Re: How to instantiate `ptr object`

2020-05-19 Thread Stefan_Salewski
y: 1.2E3 Run Thanks for that hint. Of course the book is in an very early state still, I wrote most of the two first chapters in April. But I hope and think that it can be already useful for beginners with nearly no CS knowledge. I have just yesterday applied a lot fixes

Re: How mature is async/threading in Nim?

2020-05-19 Thread treeform
I use async/await in production, but only server side on Linux. It's pretty mature for a simple web application. My app runs on multiple servers instead of threds. Async does not mesh well with threds. Multiprocessing is more scalable anyways.

Issues with nimble paths

2020-05-19 Thread mp035
Hi All, I'm having a problem compiling nim sources with nimble, but I do not have the same problem when running "nim c -r src/firmware_update_compiler.nim" from the command line. Please see this transcript: me@host:~/repositories/gecko-logger/firmware_update_compiler$ nimble

Re: How mature is async/threading in Nim?

2020-05-19 Thread federico3
Parallelism/concurrency and async are some of the few pain points of the language. ARC/ORC together with [https://github.com/mratsim/weave](https://github.com/mratsim/weave) might be very promising.

Re: Issues with nimble paths

2020-05-19 Thread SolitudeSF
you need to add requires "crc32" to nimble file

Re: How mature is async/threading in Nim?

2020-05-19 Thread Araq
> At this point I'm unclear on how much of this stuff is solid and > enabled-by-default (in particular, what's the difference between "arc" and > "orc"?) ARC is in version 1.2 with significant stability improvements around the corner in 1.2.2. Many Nimble packages already work with `--gc:arc`.

Re: How mature is async/threading in Nim?

2020-05-19 Thread andrea
> for new projects I wouldn't use anything else because the tooling is so much > better That would be great, but it requires an introduction that explains to users what ARC is, how to make use of it, how it impacts multithreading, the new sync and lent parameters, how to design collections and

Re: How mature is async/threading in Nim?

2020-05-19 Thread snej
> Async does not mesh well with threds. Could you explain why not? My understanding is that it’s thread-agnostic; an unfinished async call is just a sort of lightweight continuation that can be restarted in any context. > Multiprocessing is more scalable anyways. This project is a library for

Re: How mature is async/threading in Nim?

2020-05-19 Thread snej
> it requires an introduction that explains to users what ARC is, how to make > use of it +1  The existing documentation is **great** (I’ve read the tutorial, manual, and “Nim In Action” cover to cover), but in some areas seems to lag behind. Which is understandable since the language is

Re: How mature is async/threading in Nim?

2020-05-19 Thread jasonfi
Are you using Jester or another web framework?

Re: How mature is async/threading in Nim?

2020-05-19 Thread treeform
> Could you explain why not? Current current gc:refc does not allow refs object to be passed between threads willy nilly. Async creates a reactor ref object per thread. So you can't really share the async corutines between threads. Threads are just kind of hard to use with gc:refc, that is why

Re: How to instantiate `ptr object`

2020-05-19 Thread snej
> You can use closures or pass the data parameter as an input to the function. In some sense closures and objects are isomorphic, as are functional and OOP. There’s a famous old _koan_ about this: > The venerable master Qc Na was walking with his student, Anton. Hoping to > prompt the master

Archived Nimble package

2020-05-19 Thread Clonk
Hello, I wish to make modification on a Nimble package that is archived on Github ([https://github.com/ziotom78/nimfftw3)](https://github.com/ziotom78/nimfftw3\)). I wanted to know how should be handled the case of a package being effectively "dead" (i.e. not maintained anymore) ? Should I

Re: Archived Nimble package

2020-05-19 Thread juancarlospaco
Create your own repo with fixes and updates and make a pull request on nim-lang/packages

Re: How mature is async/threading in Nim?

2020-05-19 Thread snej
> Threads are just kind of hard to use with gc:refc, that is why gc:arc is > getting worked on. I'm still confused as to which GC is the default. I thought it was ARC, but what I'm reading recently makes it sound like ARC isn't quite stable enough yet. > Just regular threads are probably

Re: Experimenting with a FreeRTOS OS Port

2020-05-19 Thread elcritch
> For stdlib's async you need --gc:orc and Nim devel, otherwise it leaks > memory. Sorry, I hope we can get 1.2.2 out soon! The good news is that we're > also planning an async more suited for embedded. Ah, that makes sense. I look forward to 1.2.2! A better async for embedded would be great.

Traceback missing line number

2020-05-19 Thread HashBackupJim
In this traceback, the line number of the main module causing the fault is not displayed: ms:nim jim$ nim c -r x4 Hint: used config file '/Users/jim/nim-1.2.1/config/nim.cfg' [Conf] Hint: system [Processing] Hint: widestrs [Processing] Hint: io [Processing]

Re: Traceback missing line number

2020-05-19 Thread HashBackupJim
I guess posting the code would be a good idea: var i: string i[10] = 'j' echo i Run

Re: How mature is async/threading in Nim?

2020-05-19 Thread elcritch
> Again, I'm considering porting a large existing project, not writing > something from scratch. I already know the requirements and the architecture. > Nim is different from C++ but that doesn't mean I'm going to change the > design to single-threaded. I definitely need multiple threads

Re: How mature is async/threading in Nim?

2020-05-19 Thread treeform
> which GC is the default The _\--gc:refc_ (deferred reference counting/heap per thread) is the default right now. The _\--gc:arc_ (immediate reference counting/shared heap) or _\--gc:orc_ (immediate reference counting/shared heap + cycle detector) is set to replace it. The _async_ stuff

Re: Traceback missing line number

2020-05-19 Thread Yardanico
Workaround - if you do var i = "" Run instead, it shows the line number :)

Re: How mature is async/threading in Nim?

2020-05-19 Thread snej
> how does your C++ architecture share data between threads? Carefully ;-) The Actor library doesn't restrict what parameters you can pass, but by convention we're careful to limit it to primitives, pass-by-copy objects (like std::string), immutable ref-counted objects, and Actor references. Or

Re: Issues with nimble paths

2020-05-19 Thread mp035
THANK YOU SO MUCH!!! I feel a little silly that the problem was so simple to solve, but I honestly had not worked out that the nimble tool has different dependencies to a plain compiler run. Your solution has helped me a lot.