News for hackers. Stuff that matters.
Re:Show HN: Minimal Fibers by dom96 on Saturday May 19, 2018 @04:03AM (#17107075)
Nim is small enough to be used for this purpose. You can easily use it as a nice layer on top of C.

Why do you consider it too big?

Re:Show HN: Minimal Fibers by backpropaganda on Saturday May 19, 2018 @05:33AM (#17107227)
I haven't looked at Nim in detail, but since Nim does garbage collection, it didn't read to me like a thin layer over C. For instance, is it possible to instantiate a struct on the stack? I'd also have liked the compiled C code to be readable, which if I'm not mistaken, Nim doesn't do.
Re:Show HN: Minimal Fibers by dom96 on Saturday May 19, 2018 @05:54AM (#17107251)
> For instance, is it possible to instantiate a struct on the stack?

Yeah, it is. You can easily avoid the GC as long as you don't mind managing memory yourself (unfortunately this means that you cannot use the stdlib either, or at least parts of it, if you disable the GC with the `--gc:none` flag you'll get warning messages from the compiler about procs that need the GC which is nice).

> I'd also have liked the compiled C code to be readable, which if I'm not mistaken, Nim doesn't do.

Yeah, that's one thing that Nim definitely doesn't do. I don't think there are many languages that do. It would be an interesting experiment to see how pretty you could make the generated C by either fixing things in the compiler or just running a C formatter on it.

Re:Show HN: Minimal Fibers by backpropaganda on Saturday May 19, 2018 @06:12AM (#17107282)
> unfortunately this means that you cannot use the stdlib either

This is the kind of friction I expect from a language which uses GC, for my usecase. I think it might make sense for Nim to support a GC-less stdlib for people who do not want GC in their code.

Re:Show HN: Minimal Fibers by theprotocol on Sunday May 20, 2018 @04:25AM (#17111807)
This is giving me D flashbacks.