Heap fragmentation, embedded systems

2023-08-02 Thread Vastris31
Hello! Nim's approach to garbage collection and memory management indeed makes it suitable for embedded systems. While the main GC is deterministic and time-bound with no stop world, heap fragmentation can still be a concern for long-running systems. However, Nim provides tools like manual memor

Top-level generic variable

2023-08-02 Thread sls1005
> what new abilities does this grant you? Not needing to write: when Mode == 0: var someVeryLongName = 0 elif Mode == 1: var someVeryLongName = "" elif Mode == 2: var someVeryLongName = @[0] else: var someVeryLongName = @[""] Ru

Nim version 2.0.0 is here

2023-08-02 Thread moigagoo
FYI Docker images got updated:

A template inside a template

2023-08-02 Thread walkr
Thank you, I've just read the explanation: > ... system.currentSourcePath which returns the path of the source file > containing that template call. but that doesn't clarify why I ought to get different results. The call to my template `mySourcePath()` on the line `let path2 = mySourcePath()`,

Nim version 2.0.0 is here

2023-08-02 Thread NecroticOoze
Awesome stuff! Maybe you should also share the news on Twitter too :)

A template inside a template

2023-08-02 Thread elcritch
See

A template inside a template

2023-08-02 Thread walkr
I'm either missing something or this is inconsistent. I'm calling `currentSourcePath()` in combination with `parentDir()` and it appears it yields different results whether I call the code directly or inside a template. # source_path/src/source_path.nim template mySourcePa

Top-level generic variable

2023-08-02 Thread xigoi
This is not dynamic typing at all. The type is known at compile time.

Top-level generic variable

2023-08-02 Thread awr1
Reminds me of the [type union operator from Pike.](https://pike.lysator.liu.se/docs/man/chapter_3.html#3.3.3)

Top-level generic variable

2023-08-02 Thread demotomohiro
You can write same code without type class: const Mode = 0 var x = when Mode == 0: 0 elif Mode == 1: "" elif Mode == 2: @[0] else: @[""] echo x Run Unlike if expression, when expression doesn't require

Nim version 2.0.0 is here

2023-08-02 Thread xTrayambak
Congrats to you and everyone who helped get the language to this milestone! I can't wait for the future of this amazing language!

Top-level generic variable

2023-08-02 Thread Isofruit
I may be missing something, what new abilities does this grant you? To me this looks like you determine the type at compile-time and assign a default value, after that you face the same limitation as if you had written var x = 0. Figuring out which code gets written there is just a tad harder th

Top-level generic variable

2023-08-02 Thread sls1005
I've recently found this working: const Mode = 0 var x: int | string | seq[int | string] = ( when Mode == 0: 0 elif Mode == 1: "" elif Mode == 2: @[0] else: @[""] ) echo(x, " ", typeof(x), " ", sizeof(x))

Karkas: Karax library to build layouts and work with styles

2023-08-02 Thread moigagoo
Hi! I'm happy to announce the release of **Karkas** , a library for Karax that makes it easier to do layouting for the frontendly impaired like myself. It offers a bunch of basic building blocks based on flexbox which, when combined, allow to create surprisingly complex structures surprisingly

Nim version 2.0.0 is here

2023-08-02 Thread Akito
Wow, great job! I'm super excited! :)

Nim version 2.0.0 is here

2023-08-02 Thread giaco
Thanks to all the contributors!

Nim version 2.0.0 is here

2023-08-02 Thread alexeypetrushin
Nice, thanks! Have good vacation :)