Re: Challenges implementing an

2017-10-30 Thread monster
@mratsim I've looked at Pony. While the feature-set is interesting, it fails my need in one critical point: I want C/C++ codegen, not just a C/C++ FFI. I might dig into the doc, for inspiration. @andrea Nimroy reminds me too much of Akka, which is IMHO the _wrong_ way to do an actor system.

Re: How do you get thread count in Nim

2017-10-30 Thread jzakiya
Yes, that is what I meant, the `threads` that are available per system (all cpu cores), which you can see using commands such as `lscpu` or `htop`.

Re: How do you get thread count in Nim

2017-10-30 Thread Tiberium
TS probably means "processor threads" \- Hyper Threading

Re: How do you get thread count in Nim

2017-10-30 Thread Araq
The docs are correct, there is no such thing as the "number of available threads", threads are dynamic in nature, on some OSes you can create thousands of them.

Re: How to get real time of parallel code

2017-10-30 Thread jzakiya
Thanks, will do.

Re: How do you get thread count in Nim

2017-10-30 Thread jzakiya
Yes, that returns the number of available threads, though its doc says processors/cores.

Re: How do you get thread count in Nim

2017-10-30 Thread dom96
You mean the number of available cores? [https://nim-lang.org/docs/osproc.html#countProcessors](https://nim-lang.org/docs/osproc.html#countProcessors),

Re: Challenges implementing an

2017-10-30 Thread monster
@mratsim Pony looks interesting, I'll have a look. And I haven't seen any of those links before. Lots of inspiration, thanks. @mashingan I _will_ use Channels. It's just that I remember looking at many Java queues to exchange messages, and I remember that the 1:1 queues usually were faster.

Re: Challenges implementing an

2017-10-30 Thread andrea
I confess that I did not read the whole post, but you may want to check out [Nimoy](https://github.com/evacchi/nimoy). Its author is a colleague of mine, andis currently on holidays, but I am certain he will be interested to discuss how to best implement an actor system suited for Nim

Re: Challenges implementing an

2017-10-30 Thread mashingan
@monster, I only read half of your post, do you not consider `Channel` as the mailbox like Erlang? Also, how about `coroutine`?

Re: How to get real time of parallel code

2017-10-30 Thread wizzardx
https://github.com/nim-lang/Nim/issues

How do you get thread count in Nim

2017-10-30 Thread jzakiya
How do you get the number of available system threads inside a Nim proggram?

Re: How to get real time of parallel code

2017-10-30 Thread jzakiya
OK. Could you provide the url for doing it.

Re: Challenges implementing an "actor system" in Nim (long post!)

2017-10-30 Thread mratsim
I can't help you on that but go for it, awesome project! Don't forget to check how [Pony](https://www.ponylang.org/discover/#what-is-pony) does its actor system (the whole language is based on Actors). It's probably state of the art. In particular here are the papers (bibliography might be

templates with generics question

2017-10-30 Thread jackmott
The following code works fine as a proc, but not as a template: proc BufferData*[T](target:BufferTarget, data:openarray[T], usage:BufferDataUsage) = glBufferData(target.GLenum,data.len*T.sizeof().GLsizeiptr,data.unsafeAddr,usage.GLenum) Any obvious reason

Re: Challenges implementing an "actor system" in Nim (long post!)

2017-10-30 Thread monster
@Ar I know what a game entity system is. This is _not_ what I'm trying to do here. I'm talking about actors in the "erlang" sense of the word. While I want to use the actor system for games, I want it to be generic enough to be used in other context. The only really game-specific thing