Re: How to set up/start a Project?

2020-07-08 Thread XxDiCaprioxX
Both dont work haha. The system / mingw compiler looks for ...gcc.exeinstead of the location of gcc.exe so it wont find the necessary file. Idk how to fix it because the Path variable is correct

Re: How to set up/start a Project?

2020-07-08 Thread federico3
I use [https://github.com/FedericoCeratto/nim_project_maker](https://github.com/FedericoCeratto/nim_project_maker) to initialize projects with some useful files

Re: How to set up/start a Project?

2020-07-07 Thread sschwarzer
Just to be sure, are you using the command `Nim` (uppercase N) or `nim` (lowercase n)? The command is `nim` (lowercase n).

Re: How to set up/start a Project?

2020-07-07 Thread XxDiCaprioxX
And there is my next problem. If i try to run anything with Nim c -r filename.nim it gives a file not found error. even if i use f6 in VS Code

Re: How to set up/start a Project?

2020-07-07 Thread XxDiCaprioxX
Thank you for the links it was hard for me to find anything

Re: How to set up/start a Project?

2020-07-07 Thread XxDiCaprioxX
Thank you, I'll look into it

Re: How to set up/start a Project?

2020-07-07 Thread treeform
This is project structure I use: [https://github.com/treeform/nimtemplate](https://github.com/treeform/nimtemplate)

Re: How to set up/start a Project?

2020-07-07 Thread sschwarzer
. :-) The example files also have imports so you see how a file references others.

Re: How to set up/start a Project?

2020-07-07 Thread Stefan_Salewski
Have you tried reading some tutorials? [https://nim-lang.org/learn.html](https://nim-lang.org/learn.html) There are also videos at youtube. Generally in Nim we do not but all objects in its own source file as it is common in Java. So generally You just create one single text file for your

How to set up/start a Project?

2020-07-06 Thread XxDiCaprioxX
like class files in java)? And if you do so how do you reference other files/classes/whatever? Is there something like packages? How is it all structured? Do I have to use CMD/BASH to set it all up? Thanks in advance :)

Re: How to do feature detection with JS backend?

2020-07-05 Thread ftsf
Thanks @Araq!

Re: How to do feature detection with JS backend?

2020-07-05 Thread Araq
Something like: proc newAudioContext*(): AudioContext {.importjs: "new (window.AudioContext || window.webkitAudioContext)()".} Run

How to do feature detection with JS backend?

2020-07-04 Thread ftsf
I'm trying to fix the webaudio package to work with Safari as it exposes `webkitAudioContext` instead of `AudioContext`. proc newAudioContext*(): AudioContext {.importjs: "new AudioContext()".} Run In Javascript you'd generally do something like: var

Re: How to use inheritance?

2020-06-27 Thread Stefan_Salewski
And finally this may look more like what you may desire: import gintro/[gtk, gobject, gio] type Header = ref object of Headerbar text: string MainWindow = ref object of gtk.ApplicationWindow header: Header pb: ProgressBar

Re: How to use inheritance?

2020-06-27 Thread Stefan_Salewski
And to give you a starting point, the basic shape of your above program would look like this: import gintro/[gtk, gobject, gio] type Header = ref object of Headerbar text: string MainWindow = ref object of gtk.ApplicationWindow header:

Re: How to use inheritance?

2020-06-27 Thread Stefan_Salewski
OK, when it is gintro related then your initial post is really not that smart. Inheritance for C libs in different from inheritance in Nim . C is not an OOP language. I would strongly suggest YOU not using gintro! I have recently listed most of the Nim GUI packages here, located directly

Re: How to use inheritance?

2020-06-27 Thread adnan
I don't think it's gintro specific. I have never used inheritance in Nim before so I just need to get started with the basics. import gintro/[gtk, gobject, gio] type Header = ref object of RootObj base: HeaderBar text: string # Header = ref

Re: How to use inheritance?

2020-06-27 Thread Stefan_Salewski
I hope it is not related to gintro?

How to use inheritance?

2020-06-27 Thread adnan
Hi, I want to create a derived type and call methods of the based type. How does one achieve this? I was trying to just call the method on the result type as follows: type Header = ref object of HeaderBar text: string proc newHeader(): Header = new

Re: How to load multiple shared libraries?

2020-06-26 Thread Javi
Just load `libmsg.so` and get the address of the symbols that you need. If `libmsg.so` depends on `libnet.so` then the OS loader (`ld`) should load automatically `libnet.so` if `libmsg.so` is implicitly linked with `libnet.so` (you can check the `.dynamic` section of `libmsg.so` with `readelf`

Re: How to load multiple shared libraries?

2020-06-26 Thread enthus1ast
As far as I understand dylib this specifies in which shared library the function is located. What happenes when you just choose the correct library?

How to load multiple shared libraries?

2020-06-26 Thread zhongdechan
libmsg.so depends on libnet.so. I want to load two libraries at the same time, but this will cause errors. dynlib only allows one library. proc create_message*(version: cint) {.cdecl, importc, dynlib: "libnet.so libmsg.so".} Run

Re: How to convert openarray[byte] to string?

2020-06-25 Thread snej
I've filed [an issue](https://github.com/nim-lang/Nim/issues/14810) to request adding toString(openarray) to the standard library.

Re: How to convert openarray[byte] to string?

2020-06-25 Thread snej
Interesting … I'm wondering where the 0 byte at the end of the cstring came from, since `cast` doesn't copy anything. You might just have gotten lucky in that particular example, and the memory after `bytes` happened to start with a zero. Here's a modification that fails, because the byte past

Re: How to convert openarray[byte] to string?

2020-06-25 Thread jyapayne
Not sure if this is helpful, but casting to cstring apparently works as expected: proc toString(bytes: openarray[byte]): cstring = let str = cast[cstring](bytes) echo "length = ", str.len echo "str[0] = ", str[0].byte assert str.len == 3 return str

Re: How to convert openarray[byte] to string?

2020-06-25 Thread mratsim
cast is equivalent to reinterpret_cast in C++, it just reinterprets the raw bit pattern (except for numerical types were it does zero-extension or truncation like C casts) Openarray are "ptr+len", I did misread your parameters and thought it was seq[byte] when I wrote that part of my answer.

Re: How to convert openarray[byte] to string?

2020-06-24 Thread snej
> @oswjk solution is correct. It would be nice to have this in the standard library, so that one doesn't have to unleash `unsafeAddr` just to do a simple conversion.  > openarray[byte] are not nul-terminated unlike strings and that would cause > issues if you are interfacing with C code that

Re: How to get & set text in clipboard ?

2020-06-24 Thread Aiesha_Nazarothi
Author is here. Yeah, you can just fetch library sources from GitHub and use them directly.

Re: How to convert openarray[byte] to string?

2020-06-23 Thread jibal
> where the bytes are UTF-8, of course. This isn't relevant -- Nim is agnostic about the content of strings and doesn't require them to contain UTF-8 or any other encoding.

Re: How to convert openarray[byte] to string?

2020-06-23 Thread mratsim
@oswjk solution is correct. `openarray[byte]` are not nul-terminated unlike strings and that would cause issues if you are interfacing with C code that expect nul-terminated cstring. I.e. you were probably victim of the same bug as

Re: How to convert openarray[byte] to string?

2020-06-23 Thread oswjk
One way would be proc toString(bytes: openarray[byte]): string = result = newString(bytes.len) copyMem(result[0].addr, bytes[0].unsafeAddr, bytes.len) Run

How to convert openarray[byte] to string?

2020-06-23 Thread snej
There's no documentation I can find about how to convert an array of bytes to a string (where the bytes are UTF-8, of course.) I've looked through the manual, tutorial and several library modules. So far I've been using `cast[string](...)`. This appears to work fine for `seq[byte]`; at least I

How to debug a library with gdb on windows?

2020-06-22 Thread Shucks
time after the main program is launched. The library itself is compiled with \--debugger:native --passL:-s --passL:-static-libgcc. I've expected that attaching gdb to the process should be enough to set breakpoints but thats not the case. So how to debug a library coded in nim? My try

Re: How to get & set text in clipboard ?

2020-06-22 Thread Trustable
You could have a look at the WinAPI clipboard implementation of NiGui: [https://github.com/trustable-code/NiGui/blob/master/src/nigui/private/windows/platform_impl.nim#L421](https://github.com/trustable-code/NiGui/blob/master/src/nigui/private/windows/platform_impl.nim#L421)

Re: How to get & set text in clipboard ?

2020-06-20 Thread Yardanico
> Report it to the antivirus people, Nimble is not a virus :)

Re: How to get & set text in clipboard ?

2020-06-20 Thread Omnomnim
Why don't you whitelist it?

Re: How to get & set text in clipboard ?

2020-06-20 Thread kcvinu
Thanks for the reply. Since, my antivirus is catching nimble, i am not able to use it. And i send a message to the author of that library that i would like to know how to use it without nimble,. :)

Re: How to get & set text in clipboard ?

2020-06-20 Thread Stefan_Salewski
https://forum.nim-lang.org/t/4820#30170

Re: How to declare container variable for proc?

2020-06-20 Thread jf1
Works perfectly! Thanks a lot!

Re: How to declare container variable for proc?

2020-06-20 Thread Tim_H
Would something like this work for you? proc a(x: int): int = x+1 proc b(x: int): int = x+2 var container: proc(x:int):int if 4 > 5: container = a else: container = b echo $container(3) Run

How to declare container variable for proc?

2020-06-20 Thread jf1
How would one declare a variable that is to contain a procedure later on? E.g.: instead of testing a condition over and over again in each run of a proc and branching depending on the condition, I'd create two functions, one for each of the possible values, check the condition once (which

How to get & set text in clipboard ?

2020-06-20 Thread kcvinu
Hi all, I am using windows machine. I would like to know how to set and get text in clipboard. I hope i don't need to use any libraries. Thanks in advance.

Re: Unclear (for Python people) import behavior. And how to deal with it

2020-06-18 Thread ZadaZorg
@juancarlospaco thanks, I read links you provide before. Maybe I'm skipped, but there were no explanations of such catch. @Yardanico oh, thanks a lot. I think that is it!

Re: Unclear (for Python people) import behavior. And how to deal with it

2020-06-18 Thread juancarlospaco
* [imports](https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers#Imports) * [Objects](https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers#Objects) * [I recommend read it completely](https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers#table-of-contents)

Re: Unclear (for Python people) import behavior. And how to deal with it

2020-06-18 Thread Yardanico
Your example can be fixed by doing export ex.uuid Run Or, if you want to export _everything_ from that module (export only exports things which are marked by `*`: import ex export ex Run See

Unclear (for Python people) import behavior. And how to deal with it

2020-06-18 Thread ZadaZorg
my smartness :) My questions are: * What is a nim way to write such code? (I'm thinking about `include`, but not sure, this is the true way.) * In other words, how should I notify users of my code, that they have to import additional modules? * How to explain this approach/behavior to Python

Re: How to load dlls created in C++?

2020-06-17 Thread akavel
I have no experience in this, but if nobody else answered yet, I have some supplemental questions for you, that I am thinking maybe can potentially at least make it easier for someone to find the proper solution eventually: * could I kindly ask you to run something like `nm libmecab.dll |

How to load dlls created in C++?

2020-06-17 Thread nnahito
I would like to use the Japanese morpheme analyzer "MeCab"( [https://github.com/taku910/mecab](https://github.com/taku910/mecab) ) in the Nim language. Since I use Windows 10, I thought about how to load the DLL in the Nim language and use the functions defined in the DLL. However

Re: How does one use locks (need a brief example)

2020-06-15 Thread akavel
Kinda pseudocode, fragments scavenged from one of my projects: import locks var lock: Lock myflag: bool lock.initLock() proc foobar() = echo "before lock" lock.withLock: if myflag: echo "...do something with

How does one use locks (need a brief example)

2020-06-13 Thread adnan
, and it refers to a UI object. Whenever the method `update()` is called, it makes some changes to the UI. How should I approach this? I was unable to find any examples of Mutexes in Nim. I don't know how and where to start. Something similar in D: class Listener

Re: How to properly construct a ref type inside Option in functions?

2020-06-04 Thread PMunch
Note that an Option[ref T] is just a thin wrapper that checks if the reference is nil: [https://nim-lang.org/docs/options.html#Option](https://nim-lang.org/docs/options.html#Option). Wrapping something that is a pointer in an Option is simply a way to get Option semantics for pointers.

Re: How to properly construct a ref type inside Option in functions?

2020-06-02 Thread Yardanico
Or with Option: proc searchTree*[T](leaf: Tree[T], searchFor: T): Option[Tree[T]] = result = if leaf.isNil(): none Tree[T] elif leaf.item == searchFor: some leaf elif searchFor < leaf.item: some searchTree(leaf.left, searchFor) else:

Re: How to properly construct a ref type inside Option in functions?

2020-06-02 Thread Yardanico
Well, first of all - you can't check `leaf.isNone()` beacause `leaf` is not an Option type. You can however check `leaf.isNil()`. And really in your example you don't need `Option` at all - you can just use `nil`, but if you still want Option type, then something like `return

Re: How to properly construct a ref type inside Option in functions?

2020-06-02 Thread Yardanico
`proc searchTree*[T](leaf: Tree[T], searchFor: T): Tree[T] = result = if leaf.isNil(): nil elif leaf.item == searchFor: leaf elif searchFor < leaf.item: # are you sure you don't want leaf.left here? searchTree(leaf, searchFor) else: searchTree(leaf.right, searchFor) ` Run

How to properly construct a ref type inside Option in functions?

2020-06-01 Thread adnan
Hello, I know in a function returning a ref type, I need to construct the result first: `new(result)` However what if the result is an Option type? I need to construct what's inside before wrapping it inside an option. How can I do this? Example code: type Tree*[T] = ref

Re: How do I revert a my fork back to nim devel?

2020-05-31 Thread slangmgh
` git checkout devel # your version of devel git reset --hard nim-lang/devel # reset to nim-lang/devel git push --force # push to github ` Run

Re: How do I revert a my fork back to nim devel?

2020-05-30 Thread jackhftang
To your specific question, the exact commands to get my repository back exactly to devel git reset --hard devel git clean -f Run but I think what you actually need is to resolve merge conflicts... which is just edit the files and then `git add ` and then `git

Re: How do I revert a my fork back to nim devel?

2020-05-30 Thread solo989
deleted and restarted my repository still curious what commands would have done that for me without starting from scratch

Re: How do I revert a my fork back to nim devel?

2020-05-30 Thread solo989
well now my repository is even more of a mess somehow I managed to merge some of araqs commits into my own branch and it's claiming I co-authored them [https://github.com/solo989/Nim](https://github.com/solo989/Nim)/ if anyone could give me the commands to get my repository back exactly to

Re: How do I revert a my fork back to nim devel?

2020-05-30 Thread solo989
This is what I get when type git remote -v origin [https://github.com/solo989/Nim.git](https://github.com/solo989/Nim.git) (fetch) origin [https://github.com/solo989/Nim.git](https://github.com/solo989/Nim.git) (push) upstream

Re: How do I revert a my fork back to nim devel?

2020-05-30 Thread solo989
Ok I managed to update my branch to be inline with devel. But now it says I'm 13 commits ahead. And whenever I try to make a pull request it includes all those commits in the pull request.

Re: How do I revert a my fork back to nim devel?

2020-05-30 Thread sschwarzer
I also recommend including the branch name in your shell prompt. For bash, I have in my `.bashrc`: PS1='\u@\h:\w$(__git_ps1 " [%s]")\$ ' Run Depending on your distribution, you may need to install a package or source some shell script to the `__git_ps1` command. For

Re: How do I revert a my fork back to nim devel?

2020-05-30 Thread sschwarzer
I assume the pull got you stuck in a merge because of a merge conflict. The output of `git status` should say something about this. If it's confirmed by `git status`, you can either try to resolve the merge conflict by editing the file, `git add` it and use `git merge --continue`, or you can

Re: How do I revert a my fork back to nim devel?

2020-05-30 Thread solo989
this is the exact error message when I try git checkout devel error: you need to resolve your current index first lib/pure/pegs.nim: needs merge this is one of my commits that has now been been overridden in devel how do I resolve/remove it?

Re: How do I revert a my fork back to nim devel?

2020-05-30 Thread solo989
so the cmds are git clone [https://github.com/nim-lang/Nim](https://github.com/nim-lang/Nim)/ git checkout devel git fetch upstream devel git pull upstream devel git push git remote -v lists sources that are connected to my local copy but how do I connect them in the first place? and how

Re: How do I revert a my fork back to nim devel?

2020-05-30 Thread mratsim
My workflow is: I keep 2 sources, visible with git remote -v origin https://github.com/mratsim/Nim (fetch) origin https://github.com/mratsim/Nim (push) upstreamhttps://github.com/nim-lang/Nim (fetch) upstreamhttps://github.com/nim-lang/Nim (push)

Re: How do I revert a my fork back to nim devel?

2020-05-30 Thread solo989
but I have no idea how to do that.

Re: How do I revert a my fork back to nim devel?

2020-05-30 Thread jackhftang
Not sure if I understand correctly. You want to put your commits on top of latest commits from nim repo? The following should work. git remote add nim https://github.com/nim-lang/Nim git pull --rebase nim master Run

How do I revert a my fork back to nim devel?

2020-05-29 Thread solo989
I would like to make some more pull requests but I can't figure out to revert my local fork back to devel. I've tried the command: git pull --rebase --autostash as well as other commands. But it always claims it is up to date. How do I get my repository to rebase based on [https://github.com

Re: How to bypass a runtime error ?

2020-05-28 Thread fredg
I have tried it, in many ways, with no luck :( Thanks for trying. ++

Re: How to bypass a runtime error ?

2020-05-28 Thread mratsim
`try` / `except` or `try`/`finally` [https://nim-lang.org/docs/tut2.html#exceptions-try-statement](https://nim-lang.org/docs/tut2.html#exceptions-try-statement) from strutils import parseInt # read the first two lines of a text file that should contain numbers # and

How to bypass a runtime error ?

2020-05-28 Thread fredg
Hello, I am trying to build a list of mirrors and append the date when the mirror has been refreshed. (For doing that I take the last-modified header of a file) The program built without errors. The program begin to parse and print but, it ends if it meet an error during the parse. Is there a

Re: How to implement observer (publish/subscribe) pattern?

2020-05-27 Thread Pixeye
How about more "reactive" observers ? [https://gist.github.com/PixeyeHQ/fbec35b25b667b847b4eac413a8539a5](https://gist.github.com/PixeyeHQ/fbec35b25b667b847b4eac413a8539a5) The idea is to subscribe for variable change. The proc you register will trigger every time this variab

Re: How to implement observer (publish/subscribe) pattern?

2020-05-27 Thread Kosteg
I can do this but it's not convenient to have all the subscribers be of the same class

Re: How to implement observer (publish/subscribe) pattern?

2020-05-23 Thread snej
I think you could also do it in OOP style by defining a Subscriber object with a ‘changed’ method, then having the real subscribers subclass that and override the method. (Requires ‘pragma multimethods’, I think? I have to admit I haven’t tried any real OOP in Nim yet! I’d try it out in a

Re: How mature is async/threading in Nim?

2020-05-23 Thread jackhftang
Speaking from my user experience with nim (~1 yr), you don't have to worry about the stability of async related things, they are quite robust. The things that is not very mature is the GC. I am not talking about the arc one, but the current default one refc. I have a single threaded project

Re: How mature is async/threading in Nim?

2020-05-22 Thread k0zmo
> Not really. What you can achieve is something similar to what I created with > httpbeast: each thread running its own Async event loop and allowing the > system to load balance the socket connections. For clients that will likely > be trickier. This _event-loop per thread_ is only required

Re: How mature is async/threading in Nim?

2020-05-22 Thread mratsim
I didn't use ARC because when I started evaluating multithreading options (July 2019) and implementing Weave (November 2019) it was not ready at all. Now at the moment, I'm ready to run my batteries of tests on arc:

Re: How mature is async/threading in Nim?

2020-05-22 Thread dom96
> Read mratsim's post from the same thread then, > [https://forum.nim-lang.org/t/6352#39200](https://forum.nim-lang.org/t/6352#39200) @mratsim shows no examples of what ARC can do, but I assume that ARC can help with the third scenario that he describes... > You need a shared state, for

Re: How mature is async/threading in Nim?

2020-05-22 Thread aredirect
Adding to that [https://github.com/nim-lang/Nim/issues/14429](https://github.com/nim-lang/Nim/issues/14429) :)

Re: How mature is async/threading in Nim?

2020-05-21 Thread Araq
> I may very well be missing something, ... Read mratsim's post from the same thread then, [https://forum.nim-lang.org/t/6352#39200](https://forum.nim-lang.org/t/6352#39200)

Re: How mature is async/threading in Nim?

2020-05-21 Thread dom96
> I have limited experience with nim mobile apps. But knowing what I know don't > think I would use async on the client. Async is great if you are doing tons > of http style requests. But really a mobile client? Just regular threads are > probably better if you are just writing and reading from

Re: How mature is async/threading in Nim?

2020-05-21 Thread dom96
gt; The asyncnet module documentation has a couple of caveats about Windows, like > "on Windows it only supports select()" and "In theory you should be able to > work with any of these layers interchangeably (as long as you only care about > non-Windows platforms).&

Re: How to implement observer (publish/subscribe) pattern?

2020-05-21 Thread Kosteg
Thank you! Works great: import tables type EventEmitter = ref object eventsMap: Table[string, seq[proc(event: string)]] proc subscribe(emitter: EventEmitter, event: string, callback: proc(event: string)) = if not emitter.eventsMap.hasKey(event):

Re: How mature is async/threading in Nim?

2020-05-21 Thread jasonfi
I've tried to summarize the state of Nim's concurrency and parallelism in this blog post: [https://onlinetechinfo.com/concurrency-and-parallelism-in-nim/](https://onlinetechinfo.com/concurrency-and-parallelism-in-nim/). Some of it was based on this discussion.

Re: How to implement observer (publish/subscribe) pattern?

2020-05-20 Thread dawkot
This should be enough, you can capture whatever type you want inside a closure. type Publisher = ref object subs: seq[proc(data: int)] Run

How to implement observer (publish/subscribe) pattern?

2020-05-20 Thread Kosteg
The publisher has to maintain the list of subscribers. It's easy to implement if all the subscribers are of the same type (or of the multiple pre-defined types). But is it possible to do not specify all possible types of subscribers?

Re: How can I pass shared memory between threads?

2020-05-20 Thread mratsim
You can implement atomic refcounting with destructors. See what I do in my [multithreading runtime](https://github.com/mratsim/weave/blob/33a446ca4ac6294e664d26693702e3eb1d9af326/weave/cross_thread_com/flow_events.nim#L176-L201): type FlowEvent* = object e: EventPtr

How can I pass shared memory between threads?

2020-05-20 Thread Keithcat1
supports shared memory, but I couldn't figure it how. If Nim doesn't have this now, are there future plans that will improve this situation? Will there be a garbage collection algorithm that allocates all ref T on a shared heep, supports passing them between threads, and frees the memory when

Re: How mature is async/threading in Nim?

2020-05-20 Thread mratsim
Regarding multithreading it really depends on your workload but here are 2 kinds of code architectures that would allow mixing async on threads: 1\. If the part of your code that you want threaded is stateless and only allows the following types to crossover threads: * plain old

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: 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 referen

Re: How mature is async/threading in Nim?

2020-05-19 Thread elcritch
ouple of years, so the "actor" model and copying messages between them makes sense to me. Out of curiosity, how does your C++ architecture share data between threads?

Re: How mature is async/threading in Nim?

2020-05-19 Thread snej
probably better if you are just writing and reading > from a single websocket connection. Async and threads are orthogonal, not opposite choices. What interests me about async/await is how it cleans up the control flow in source code, avoiding "callback hell". Again, I'm considering po

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 mature is async/threading in Nim?

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

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

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 la

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 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 colle

  1   2   3   4   5   6   7   8   9   10   >