This Month with Nim: Feburary and March 2022

2022-04-05 Thread pietroppeter
ah sorry, I did check but it slipped that there was indeed a post about it...

This Month with Nim: Feburary and March 2022

2022-04-05 Thread pietroppeter
some of you might have missed this (I ran into it by accident):

System.sink & System.lent

2022-04-05 Thread Araq
Yes, the "new runtime" is ARC/ORC and the document is up to date. You're right though that it could avoid the term "new runtime". Sorry for the confusions.

System.sink & System.lent

2022-04-05 Thread didlybom
That document says that it “describes the upcoming Nim runtime which does not use classical GC algorithms anymore but is based on destructors and move semantics”. Is that referring to arc/orc? It is a bit unclear to me because at some point there was something called the “new runtime” which I b

{.nodecl} VS {.importc, nodecl} and return VS result

2022-04-05 Thread Yardanico
As I said in the issue, at least one thing that's immediately obvious is the fact that you haven't used backticks so that Nim can actually name the variable the same way - Nim mangles variable names when compiling to C, so you need to do that: proc getint*():cint =

System.sink & System.lent

2022-04-05 Thread Yardanico
You might want to give a read, it explains those in some detail.

System.sink & System.lent

2022-04-05 Thread archnim
Thanks for the quick reply.

System.sink & System.lent

2022-04-05 Thread archnim
Hello world ! Please what are really `system.sink` and `system.lent` ?

{.nodecl} VS {.importc, nodecl} and return VS result

2022-04-05 Thread veksha
Hi. What is the best way to get variable value in nim that was previously declared in c/cpp code (or inside "emit")? are there a lot of bugs or i'm just use it wrongly? look here for different variants tried by me one examp

why multithreading execition take time almost equal to single thread execution?

2022-04-05 Thread Zoom
It's all rather funny. First of all, if you're insisting on using `std/threadpool` and it so happens that you use `--gc:orc` (or, like me, have it set in your config asthea default) you get `SIGSEGV: Illegal storage access. (Attempt to read from nil?)`. Arc is of course much **much** slower tha

My history on Nim forum

2022-04-05 Thread archnim
Very sad ! Thanks for the reply.

My history on Nim forum

2022-04-05 Thread Clonk
At the moment, you cannot.

why multithreading execition take time almost equal to single thread execution?

2022-04-05 Thread Araq
Because you read from `^rs` (which is blocking) too early. You use `spawn` and `^` \-- now you also need to figure out what they mean. ;-)

why multithreading execition take time almost equal to single thread execution?

2022-04-05 Thread SergeyPython
nim import sequtils, threadpool, times, strutils template time(statement: untyped): float = let t0 = cpuTime() statement cpuTime() - t0 proc splitToTerms(n:int, k:int): seq[seq[int]] = var kk = k if kk == 0: kk = n if n =

Threading SIGSEGV in HttpClient with SSL

2022-04-05 Thread Jocker
yea, that works on my machine too. Thank you

Threading SIGSEGV in HttpClient with SSL

2022-04-05 Thread DavideGalilei
It works fine this way: import httpclient import threadpool proc check() = discard newHttpClient() parallel: spawn check() Run

Threading SIGSEGV in HttpClient with SSL

2022-04-05 Thread DavideGalilei
It indeed segfaults for me as well. Traceback (most recent call last) /home/davide/.choosenim/toolchains/nim-1.6.4/lib/pure/concurrency/threadpool.nim(368) slave /tmp/a.nim(7)checkWrapper /home/davide/.choosenim/toolchains/nim-1.6.4/lib/pure/httpclient.nim(56

Threading SIGSEGV in HttpClient with SSL

2022-04-05 Thread Jocker
Debian 11 and latest Nim 1.6

Threading SIGSEGV in HttpClient with SSL

2022-04-05 Thread ynfle
This compiles and runs for me. Which OS are you and what is your nim version?

Threading SIGSEGV in HttpClient with SSL

2022-04-05 Thread Jocker
Hi, I'm currently trying getting the following code to work: import httpclient import threadpool proc check() = discard newHttpClient() spawn check() Run it compiles successfully but crashes as soon as it reaches the newHttpClient() line. I alre

Managing binary data

2022-04-05 Thread planetis
Pretty sure there quite a few nimble packages for that.

Managing binary data

2022-04-05 Thread archnim
Thank you very much.

My history on Nim forum

2022-04-05 Thread archnim
Hello world. Please how can I access the list of all my threads and posts on this forum (not only the last ten), without having to search for each one ?

Managing binary data

2022-04-05 Thread PMunch
I don't think anyone have implemented `xor` or `and` on them, but you can simply store the buffers as `seq[byte]`. But it's simple enough: proc `xor`(a, b: seq[byte]): seq[byte] = assert a.len == b.len result.setLen a.len for i in 0..a.high: result[i] = a[i]

Managing binary data

2022-04-05 Thread archnim
Hello world. Is there in Nim an equivalent of nodejs's buffers ? A structured type that allows doing all kinds of binary operations on groups of bytes ? I'm thinking of something like this: var ba1 = initByteArr(234, 69, 43, 20) ba2 = initByteArr(0x1A, 0x4F, 0xF5, 0xBD)

Changing order of templates causes compilation error. Why in this case?

2022-04-05 Thread Hlaaftana
`potato` meaning `potato()` is not a full feature, the first overload of `potato` having parameters somehow [makes the compiler treat it as a template variable](https://github.com/nim-lang/Nim/blob/83dabb69ae0f6c0bb269594a5b73af964b809bc7/compiler/semexprs.nim#L1229-L1237) which isn't a real mec

[Karax] "include" statement doesn't work correctly inside karax DSL

2022-04-05 Thread bpr
> The DSL would need to be able to deal with expanded ASTs, yes. That's quite > feasible, if only we had a specification of typed ASTs and a compiler that > would implement it. Oh come on, after that "if only we had" set up, the follow up should be something like "And here is the spec, which is

Changing order of templates causes compilation error. Why in this case?

2022-04-05 Thread ErikWDev
For smallest example I've found, scroll down to bottom. I was working on some templates akin to the code down below. With this order everything compiles and works as I expect it to: var vals = [0, 1, 2, 3, 4] template potato(): int = # 1 vals[item] template p

Impure libraries ???

2022-04-05 Thread Araq
An "impure" library is one that requires a DLL or lib.so. This is important to know for deploying / distribution of your application. Impure libraries just like other libraries might be moved out of Nim's core repository to somewhere else for version 2's stdlib cleanup, but this has nothing to d

Fidgets: widgets using Fidget

2022-04-05 Thread Zoom
That's cool, but IMO display-type elements shouldn't have the same type of embossment as buttons, as this visually conveys clickableness. Specifically, I wouldn't shade the coloured part of the progress bar.

Impure libraries ???

2022-04-05 Thread JPLRouge
hello, does this mean that the Impure libraries will be deleted or obsolete and that wrappers must be used, example: sqlite. thank you

Impure libraries ???

2022-04-05 Thread PMunch
The name impure just means that the code isn't only Nim. Sqlite and the other impure modules depend on dynamic libraries, or C code, so they aren't "pure" Nim libraries. It doesn't mean anything regarding support or obsolete status.

Fidgets: widgets using Fidget

2022-04-05 Thread kobi
generally it depends. if it's an immediate mode gui, then you pass those state variables every time you draw, and the internal system checks if drawing is needed. otherwise, the traditional mode is triggering an event, that has user code to change the instance variables, and then calls for a red