Nim 1.6.10 released

2022-11-24 Thread ringabout
Hello, could try `nim -v` to show whether it is `i686` if you are using `choosenim`, which can probably get you wrong binary?

How to create a mutable object prefrably without ref

2022-11-24 Thread amadan
You can make the parameter in the function be bar type MyObj = object prop: string proc doitWithObj(myObj: var MyObj) = myObj.prop = "hallo" var x: MyObj x = MyObj() x.prop = "bon jour" echo x.prop doitWithObj((x) e

How to create a mutable object prefrably without ref

2022-11-24 Thread halloleo
I need some objects where the properties can be changed in multiple procedures. So I chose the implementation with `ref`: type MyObj = ref object prop: string proc doitWithObj(myObj: MyObj) = myObj.prop = "hallo" var x: MyObj x = MyObj

How to create a mutable object prefrably without ref

2022-11-24 Thread Stefan_Salewski
Use var parameters for your procs. And maybe read a tutorial or a book :-)

Atomic ARC option?

2022-11-24 Thread ringabout
See also

Atomic ARC option?

2022-11-24 Thread Araq
I'm quite familiar with "Biased reference counting". I don't really believe in it but experiments like these are very welcome. But don't push for yet another production `mm:X` switch we have to maintain for good.

Atomic ARC option?

2022-11-24 Thread ringabout
Python has a fork using "biased atomic RC" to diminish the overhead of atomic operation of a ref for its owner thread => . But perhaps it requires some kind of manual management and is not fit for language compiling to native code.

Nim 1.6.10 released

2022-11-24 Thread moigagoo
JFYI Docker images were updated.

Atomic ARC option?

2022-11-24 Thread Araq
> Only giving each thread a full copy of the application state would be > possible, but that's bad for both memory and memory bandwidth usage. Agreed but there is `SharedPtr` for that. Roughly it is like this: Nim version 1: Use the `--gc:x` that suits your program best. (And hope all your dep

Electron in nim like Tarui and Wails v2

2022-11-24 Thread matt
>From nimview, "Currently, the project is not in active development anymore. >There is tauri (written in rust) that has similar goals and is much more >advanced than nimview." Rust has Tarui and Golang has Wails v2. Could we have something like that?

Open XML Spreadsheet (Excel) Library for Nim

2022-11-24 Thread giaco
Thanks! Those kind packages are very important for the Nim community

Pigeon 0.2

2022-11-24 Thread dizzyliam
You can access it via the `pgApp` identifier after using the `autoRoute` macro. I'll put a note in the readme.

Type macro returning a transformed type def + other definitions

2022-11-24 Thread samdze
I'm writing a macro "testmacro" that should take this type definition: type Test {.testmacro.} = object normalProc: proc(add: int): int Run and generate this code: type Test = object normalProc: proc(add: int): int proc normalProcG

Open XML Spreadsheet (Excel) Library for Nim

2022-11-24 Thread leeooox
Wow, another nice library! Thanks. BTW, wNim helps me a lot.

Open XML Spreadsheet (Excel) Library for Nim

2022-11-24 Thread Ward
There is already a readonly iterator. It should be fast enough for most usage. I update the **performance** part of readme on the github. You can check and test it. The drawback is it may skip the empty cells. Check `cell.rc` carefully during iteration to avoid it. This may be changed in the fu

Nim 1.6.10 released

2022-11-24 Thread matkuki
NimEdit doesn't build anymore: * Specs: Windows 10 x64, Nim installed with `choosenim` (both versions) * Problem: Builds with `1.6.8`, does not with `1.6.10` * Errors: In file included from C:\Users\matic\nimcache\nimedit_d\@mC@c@sUsers@smat

Atomic ARC option?

2022-11-24 Thread Yepoleb
What do you mean by shared mutable state - writable memory that is actively written to by multiple threads or any writable memory, even if it is not modified in the threaded task? I would agree that the first case is much better handled by doing all the writes in a dedicated thread, but I don't

How can nimqml being used with docker?

2022-11-24 Thread grd
I am sorry. The question was: Does someone has a working example of a nimqml app with Docker?

Does modifying cstring affect its string?

2022-11-24 Thread Araq
Yes. It's bad style but it is guaranteed to work.

Does modifying cstring affect its string?

2022-11-24 Thread sls1005
Is it guaranteed that the modification to a `cstring` also applys to the `string` from which it's taken? (Given that the `string` is not empty and is still on the heap.) var s = newStringOfCap(10) s.add "12345" var p = cstring(s) p[0] = '0' assert s == "02345" #corre

Atomic ARC option?

2022-11-24 Thread elcritch
Also the `threading` package has atomic shared pointers that play nice with ARC.

Atomic ARC option?

2022-11-24 Thread Araq
> The atomic reference counts are indeed more expensive, however with compile > time optimizations and and lent/sink can help removing unnecessary inc/dec. Most of these optimizations are unsound in a multi-threaded setting. But even if it all worked out, there is nothing "convenient" about shar

Looking for a pair programming partner / coach

2022-11-24 Thread moigagoo
Sent you an email :-)

Atomic ARC option?

2022-11-24 Thread RodSteward
> I am in strong support of your idea to add an option for this. Even if some > consider atomic refcounts > too slow to use for performance critical > application, it's a great tool for prototyping without having > to worry > about manual memory management. The atomic reference counts are indee

Atomic ARC option?

2022-11-24 Thread Araq
It's an important experiment we should do after v2.0 has been released. > The programmer can then easily fix the leak by setting the reference causing > the cycle to nil, like clearing the enemy field when a unit dies, or by > writing x.r = nil in the above simplified example. No, actually that

Open XML Spreadsheet (Excel) Library for Nim

2022-11-24 Thread ducdetronquito
Looks like a very useful package with a nice API :) Do you think they would be possible performance improvements for read-only use cases ? I have seen many times at work people only willing to read Excel files in order to convert it to CSV.

Atomic ARC option?

2022-11-24 Thread Yepoleb
I had the same idea three days ago and @ringabout pointed me towards [this patch](https://github.com/nim-works/nimskull/commit/419675a47ff322ecde59905aac427ffd8a298e99) which I ported to an unmodified Nim 1.6 and published it [here](https://github.com/Yepoleb/Nim/commit/c7a8f914f7e531a8aedd4ba00

Looking for a pair programming partner / coach

2022-11-24 Thread bjorn_madsen
I would like to try an accelerated approach to learning nim with a little help from a coach / pair-programming partner. As I'm the author of the python project "[Graph-theory](https://pypi.org/project/graph-theory/)" I know the python code well. The objective of working with a coach is to rebu

Atomic ARC option?

2022-11-24 Thread RodSteward
Right now is ARC and ORC memory management thread sensitive and you have to move references to the thread in order to use them. Since Nim is all about options, it would be nice to have an atomic reference counted option. The reason is that the thread ownership of garbage collected memory isn't a

Open XML Spreadsheet (Excel) Library for Nim

2022-11-24 Thread moigagoo
Thank you for the great package! It's packages like this that makes a difference between a mature ecosystem and an immature one.

Nim 1.6.10 released

2022-11-24 Thread Hlaaftana
No repors of issues on the forum in 24 hours is a good sign

Open XML Spreadsheet (Excel) Library for Nim

2022-11-24 Thread Ward
Xl is pure nim library to create, read, and modify open XML spreadsheet (Excel) files. Features * Pure nim, only dependency is [zippy](https://github.com/guzba/zippy) (pure nim too). * Support .xlsx and .xltx. format. * Read and write string, number, date,