convert HSlice to varargs?

2022-01-25 Thread DavideGalilei
Unfortunately, `x.setBits(@[0, 1, 2, 3])` doesn't work for me. It is possible to use bitwise operations, though: var x = 1'u8 let range = 0 .. 3 x = x or ((1'u8 shl len(range)) - 1'u8) echo x # 15 Run Note that this only works if range looks like `0 .. n`,

convert HSlice to varargs?

2022-01-25 Thread MichalMarsalek
I don't remember if seq can be used in place of varargs. If so, toSeq should work.

Choosing a specific version of SQLite

2022-01-25 Thread jdf
Is there a way to link dynamically to a specific sqlite library so that `std/sqlite3` uses it instead of the system default? I've tried countless variations of `--passC:`, `--passL:` etc but can't get nim to use the sqlite at `/usr/local/opt/sqlite/lib/libsqlite3.dylib` (the one brew installs o

convert HSlice to varargs?

2022-01-25 Thread oyster
as we know import bitOps var x = 1'u8 x.setBits(0, 1, 2, 3) echo x Run says `15` and we can use HSlice to get the same result: var x = 1'u8 for i in 0 .. 3: x.setBits(i) echo x Run but we can't use `x.setB

What about `or=`, `and=` and `xor=`?

2022-01-25 Thread Araq
import std / bitops var v = 0b_0011'u8 v.setBits(3, 5, 7) doAssert v == 0b1010_1011'u8 Run

Sleep in Nimscript

2022-01-25 Thread archnim
Please how to make a Nimscript program sleep ?

Sleep in Nimscript

2022-01-25 Thread ElegantBeef
You could use the system's sleep through `exec` and do something like `exec "sleep 10"`

Sleep in Nimscript

2022-01-25 Thread archnim
Thank you very much. It works.

simple event system

2022-01-25 Thread demotomohiro
Here is simplified code reproduces same runtime error. This code cause SIGSEGV because it reads an address of `cb`, and stores it to `gpointer`. Using `unsafeAddr` without understanding pointer and address is as dangerous as going to grocery without wearing mask in pandemic. import

What about `or=`, `and=` and `xor=`?

2022-01-25 Thread tsojtsoj
I just wouldn't feel good doing this, because it isn't consistent with the rest of Nim's bit operation appearance. Especially `a &= b` (instead of `a and= b`) fires the neurons in my brain associated with string concatenation when using Nim.

What about `or=`, `and=` and `xor=`?

2022-01-25 Thread ynfle
You can do `|=`

What about `or=`, `and=` and `xor=`?

2022-01-25 Thread tsojtsoj
It's hard to judge from a single perspective how useful a feature would be for the whole community (especially with my limited experience). I have a project where I need to do this all the time, that's why I asked. If almost nobody else really needs this, then @ElegantBeef's suggestion (`a.bitOr

What about `or=`, `and=` and `xor=`?

2022-01-25 Thread juancarlospaco
Bigints already has that, and it is needed because the big int may be too big to copy

Nim 1.6.4 release candidate

2022-01-25 Thread treeform
Thank you very much for the release! We ran into the {.bycopy.} not working issue while working on our windowing library for mac ( ) and were stumped. Its great that its getting fixed now!

What about `or=`, `and=` and `xor=`?

2022-01-25 Thread treeform
We write a lot of bit-fiddling code and I feel the `or=`, `and=` and `xor=` are just too rare to be useful. I would prefer Nim language to stay smaller...

Trojan:Win32/Wacatac.B!ml

2022-01-25 Thread chrisheller
There is a presentation happening at DEF CON 615 at 18:30 Central Standard Time today (Jan 25) called "Exploratory Analysis of Nim Malware". Might be of interest to those following this thread. https://twitter.com/HuskyHacksMK/status/1485057985051308036

simple event system

2022-01-25 Thread geekrelief
Just following the conversation. it'd be nice if you post what you finally end up with.

Nim 1.6.4 release candidate

2022-01-25 Thread xflywind
Yeah, is incomplete as I said in the PR description. I will look into it soon.

Trojan:Win32/Wacatac.B!ml

2022-01-25 Thread mratsim
GCC also optimizes away patterns. It wouldn't be competitive with LLVM otherwise.

Nim 1.6.4 release candidate

2022-01-25 Thread mratsim
SIGBUS is probably using aligned SIMD/vector on an unaligned data.

Trojan:Win32/Wacatac.B!ml

2022-01-25 Thread Hlaaftana
C and C++ don't leave a footprint like Nim does. Nim is higher level so its low level output will have some repetitive patterns. On that note other compiled high level languages might not encounter this problem as much since they tend to use things like LLVM which either optimize away those pat

Nim 1.6.4 release candidate

2022-01-25 Thread dsrw
I'm getting `SIGBUS: Illegal storage access. (Attempt to read from nil?)` crashes using [godot-nim](https://github.com/pragmagic/godot-nim) with this version. I also saw this in 1.6.2 (but not 1.6.0 or earlier) and assumed it would be fixed by , but ei

What about `or=`, `and=` and `xor=`?

2022-01-25 Thread ynfle
There are a limited set of words that can be infix as @ElegantBeef said

Trojan:Win32/Wacatac.B!ml

2022-01-25 Thread oyster
aha, defender did the same thing on [freebasic](https://www.freebasic.net/forum/viewtopic.php?f=3&t=31408)

Trojan:Win32/Wacatac.B!ml

2022-01-25 Thread Lecale
My own experience is that I will compile some simple code, and within 1 second WindowsDefender has deleted the exe. That's how using Nim in work can be for me, nearly impossible.

What about `or=`, `and=` and `xor=`?

2022-01-25 Thread Hlaaftana
Just make a post asking if people approve. People will probably make arguments for it instead of against it.

What about `or=`, `and=` and `xor=`?

2022-01-25 Thread Clonk
Nim 2.0 is going to break stuff anyway so might as well make things better.