Passing data between threads with ARC

2020-10-23 Thread leorize
Here's a bit of magic sauce I found in stdlib channels' implementation: It appears to me that `wasMoved` is a handy little [proc](https://github.com/nim-lang/Nim/blob/f8890a0804b6d05

What Nim projects are you working on?

2020-10-23 Thread torarinvik
I read in one of my old computer books(I have ton of them) that the most important/impressive feature in programming is the ability to work on abstraction through naming things. So in a good language assigning names/human concepts to objects should be of upmost importance. It is amazing reading

handmade hero in nim ( warning: noob)

2020-10-23 Thread nucky9
I tried doing the same thing a few years ago. For the most part, the translation is pretty smooth, but I got stuck when Casey started working on the sound stuff - I think because I couldn't find a good wrapper for direct sound back then. I'm not sure if there is one now. Can you describe what i

Passing data between threads with ARC

2020-10-23 Thread elcritch
> There are some ideas here on inter-process communication (although I didn't > use the module it's helpful as there's little info on using pipes in Nim, > they are different in Windows and Unix) > You can pass data byte by byte with > a pipe: That loo

Clarification on Macro return types

2020-10-23 Thread ElegantBeef
Yea maybe I should learn to read before speaking in certainties. :D

Clarification on Macro return types

2020-10-23 Thread Niminem
Yeah still pretty unclear lol. No worries then, I'll just stick with `untyped` for now like I do with templates.

What Nim projects are you working on?

2020-10-23 Thread Niminem
"Yep, 100% written in Nim. Both the server-side and the client-side :D" Dude that is amazing

nim plus webdriver?

2020-10-23 Thread Niminem
In your YouTube video I think I remember you saying your package only works with FireFox's webdriver, is this still the case?

handmade hero in nim ( warning: noob)

2020-10-23 Thread 19
Hello, I am a noob trying to learn low level programming from handmade hero. I really like nim and im trying to learn how to do C stuff in nim, is that wrong? I'm trying to translate this code into nim but it's not working, If anyone has any tips I'd be very happy to hear them. Maybe I'm approac

What Nim projects are you working on?

2020-10-23 Thread stisa
Haven't done much lately, but mostly maintaining a [jupyter kernel](https://github.com/stisa/jupyternim) for nim. Some other side projects include a super simple line plotter ( [graph](https://github.com/stisa/graph) , a webassembly backend for the compiler [nwasm](https://github.com/stisa/nwas

What Nim projects are you working on?

2020-10-23 Thread akavel
A Firefox Webextension: \- "tab manager minus/redux/[not decided on name yet]", kinda simplified clone of Tab Manager Plus, aimed only at helping me reduce tabs clutter in Firefox, by easily archiving multiple tabs into bookmarks folders. Super ugly and somewh

Docs: Remove gensym from arguments for procs defined in templates?

2020-10-23 Thread benjamindlee
Thanks shirleyquirk. That's what I ended up doing.

Passing data between threads with ARC

2020-10-23 Thread tmsa04
There are some ideas here on inter-process communication (although I didn't use the module it's helpful as there's little info on using pipes in Nim, they are different in Windows and Unix) You can pass data byte by byte with a pipe: import posix, sequti

Isolated [T]

2020-10-23 Thread Araq
As I said, we need a channel implementation that uses it...

The big tutorial thread

2020-10-23 Thread torarinvik
is this the page? It looks really cool, Im gonna test out the code.

Docs: Remove gensym from arguments for procs defined in templates?

2020-10-23 Thread shirleyquirk
read over for a better explanation of {.dirty.} {.gensym.} and {.inject.} {.dirty.} is probably the best solution for your case, otherwise you have to annotate everything with {.inject.} template defineStrOprs

Isolated [T]

2020-10-23 Thread juancarlospaco
Maybe it should have more examples on the documentation.

Docs: Remove gensym from arguments for procs defined in templates?

2020-10-23 Thread benjamindlee
Thanks for the link. I looked at the pragmas mentioned in response to your comment and am still a bit lost. I was able to declare the template as dirty (which I think is safe) and that worked but doesn't feel robust.

Clarification on Macro return types

2020-10-23 Thread timothee
> This should help explain the difference. it doesn't; that's for params, not return type. I've discussed this previously here: [template/macro should return `void` instead of `typed` (synonym and much clearer) - Nim forum](https://forum.nim-lang.org/t/4037) looks like the spec is still unclea

Docs: Remove gensym from arguments for procs defined in templates?

2020-10-23 Thread timothee
I'm still not convinced that gensym parameters are a good idea, see full discussion in

What Nim projects are you working on?

2020-10-23 Thread coffeepot
A top down 2D action shooter/rpg using OpenGL. The internal mechanics and lighting pipeline is basically complete, and I'm currently working on a shader for shadows. After shadows are done I'll start showing it off a bit with some videos. Everything's procgen including the models and to a varyi

Docs: Remove gensym from arguments for procs defined in templates?

2020-10-23 Thread benjamindlee
I'm working on a little library with a bunch of distinct string types. Using the advice in the manual, I made a template to define the string operations I need: template defineStrOprs(typ: typedesc) = proc `$`*(x: typ): string {.borrow.} proc `&`*(x, y: typ): typ = typ($

What Nim projects are you working on?

2020-10-23 Thread dom96
> Was Stardust built entirely with Nim? Yep, 100% written in Nim. Both the server-side and the client-side :D

Hacktoberfest is here!

2020-10-23 Thread b3liever
Can you add hacktoberfest topic to more nim-lang repos like fusion, nimble, etc?

Isolated [T]

2020-10-23 Thread Araq
Originally you could do a type converions as it was a `distinct` type. This was changed and I think we simply need an accessor.

expandMacros compilation error in nim-1.4.0

2020-10-23 Thread slonik_az
Filed bug report (regression) as per @Araq suggestion

Are (mutually) recursive generic types possible?

2020-10-23 Thread deNULL
The problem with inheritance is that my base algorithm (operating on `BaseNode`/`BaseEdge`) should be able to create instances of them without knowing about the exact descendants. For now I decided just to pass "constructors" (procs which return instances of base objects) to that algorithm. An

What Nim projects are you working on?

2020-10-23 Thread JPLRouge
I understand, but your work is fundamental, and porting GTK is a boon for Nim

Isolated [T]

2020-10-23 Thread shirleyquirk
std/isolation has made it into 1.4.0, I'm eager to experiment. I understand how to sink a value into an Isolated[T] with `isolate`, what will be the mechanism for getting that value back out of the container?

The big tutorial thread

2020-10-23 Thread Stefan_Salewski
> GUI tutorial as well I have recently added my nimbook to the wiki page, seems the entry has been renamed, but at least survived. And Google generally finds it when you type in "Nimprogramming". And when you have found the html document, you can replace the "nim" with "gtk" and get the gtk4 bo

The big tutorial thread

2020-10-23 Thread torarinvik
I see it's starting to become a bigger section now. The big tutorial on memory management seems very exciting. Hopefully one day there will be an up to date GUI tutorial as well.

What Nim projects are you working on?

2020-10-23 Thread vitreo12
I am working on [Omni](https://vitreo12.github.io/omni/), a DSL to develop audio algorithms :) [GitHub repo](https://github.com/vitreo12/omni)

What Nim projects are you working on?

2020-10-23 Thread drkameleon
Yep, exactly. Most languages _do_ have blocks, but mostly as a syntactic feature of grouping statements or declaring a local scope. In Arturo, pretty much like in Rebol, a block is a group of words/symbols/etc. They will be treated as statements, or data, or some specific DSL, or Swahili for t

Passing data between threads with ARC

2020-10-23 Thread elcritch
> I think this should help: Alas, `isolate` looks like it's still pretty early stages. It turns out `Channel`s *do* actually work on FreeRTOS (via pthread emulation)! Unfortunately they fail even when passing only strings. So `isolate` wouldn't help

The big tutorial thread

2020-10-23 Thread torarinvik
I searched the forum and could not find this. So I wondered if when people make a tutorial they maybe can post it here, so there is a library of tutorials for beginners,intermediate, advanced and experts. Would be very helpful, I know several people have made good ones, but they are usualy scatt

What Nim projects are you working on?

2020-10-23 Thread lqdev
Game-related stuff. * aglet: is a high-level OpenGL wrapper that makes low-level graphics programming easy. * rapid: is game engine built for making cool games quickly, still largely a work in progress. I'll a

The big tutorial thread

2020-10-23 Thread miran
> so there is a library of tutorials for beginners,intermediate, advanced and > experts. Would be very helpful

What Nim projects are you working on?

2020-10-23 Thread Stefan_Salewski
> ambiguous call; both glib.g_thread_new() Really a funny bug: That proc was missing for my version of gobject-introspection, so I added it manually as a user from Japan needs it for the libnice example. But your version of gobject-introspection already provides it. Should be fixable. And to m

Clarification on Macro return types

2020-10-23 Thread mratsim
For macros I always return `untyped`.

expandMacros compilation error in nim-1.4.0

2020-10-23 Thread Araq
Please report regressions on our github issue tracker. Thanks!

What Nim projects are you working on?

2020-10-23 Thread torarinvik
I absolutely will. When I first encountered Forth I wondered why so few language does not allow you to assign a block of code to a word/variable. C has these Preprocessor macros and assembly has labels, Smalltalk and Rebol has "blocks". I know Python has exec(), but it is still a very rare featu