Small improvement discussion: Use `let` to lock variable previously declared as `var`

2022-05-30 Thread dwin
I made an attempt to do this with macros import strformat, macros, macrocache const varCache = CacheTable"vars" macro getVar(varId: static string): untyped = let v = varCache[varId][1] result = quote do: when not declared(`v`): {.error:

Nim v2: what would you change?

2022-05-30 Thread nimoid
Nim v.2 Release notes: Be extra careful with fp — it's too fast now. → filterIt(it == x) # Time: 10⁻²¹ sec. "Just a zeptosecond". → mapIt(it + x) # Time: 10⁻⁴⁴ sec. Nim's fp is at Planck speed. → anyIt(it == x)# Nim's fp is faster than light. Say "!iH" to your twin br

changing mingw cross compiler path?

2022-05-30 Thread ggibson
Thanks. I realize now I was assuming `-d:mingw` took care of that. Works well now!

Are user defined pragmas permitted in a let section with Nim 1.6?

2022-05-30 Thread dxb
For reference I believe this is the relevant commit

Are user defined pragmas permitted in a let section with Nim 1.6?

2022-05-30 Thread dxb
Thank you @ElegantBeef. I find that Nim 1.7 errors out with `` Error: invalid pragma: ohhi`` when using `macro ohhi(left, right, expr: untyped): untyped`, so it seems that there isn't a single macro signature that would work for both Nim 1.6 and Nim 1.7 for this particular case.

`nlvm` updated to 1.6

2022-05-30 Thread arnetheduck
There's a good overview of what's involved here:

`nlvm` updated to 1.6

2022-05-30 Thread blashyrk92
Amazing work Arne! Do you maybe know, even as an eyeball estimate, the amount of work necessary for it to work on Windows and macOS (presumably the latter would be easier as it already works on Linux)? I haven't done any compiler/LLVM work in the past, but as you yourself stated in the readme,

nim-snappy, faster and simpler

2022-05-30 Thread arnetheduck
A quick note for snappy users out there: we've recently completed a revamp of our [snappy implementation](https://github.com/status-im/nim-snappy), simplifying the API and making sure performance is decent. The implementation covers both the plain and [framing](https://github.com/google/snappy/

Are user defined pragmas permitted in a let section with Nim 1.6?

2022-05-30 Thread ElegantBeef
They've had a change in #devel which causes them to work with a single statement whereas they used to require `template ohhi(left, right, expr: untyped)` for an example

Small improvement discussion: Use `let` to lock variable previously declared as `var`

2022-05-30 Thread cmc
Woah, dude! ;)

Are user defined pragmas permitted in a let section with Nim 1.6?

2022-05-30 Thread DavideGalilei
🤔 This example fails to compile too: `/tmp/test.nim(8, 11) Error: invalid pragma: ohhi` import macros macro ohhi(letSection: untyped): untyped = echo treeRepr letSection return letSection proc test() = let t {.ohhi, nodecl.} = 1 test()

Are user defined pragmas permitted in a let section with Nim 1.6?

2022-05-30 Thread dxb
Greetings! The following code displays "Oh Hi" using the devel branch (1.7) but fails to compile using 1.6.6 (current stable). Is this expected? Thank you. macro ohhi(letSection: untyped): untyped = echo "Oh Hi" result = letSection proc test() = let

Channels documentation

2022-05-30 Thread mratsim
> Is it safe to send messages from a single producer thread to multiple > consumer threads using a single channel? Or would separate channels be > required, one for producer-consumer thread pair? Channels are for passing a message with a single owner, a producer and a consumer. There are single