Hacker News new | ask | show | jobs
by thelazydogsback 2071 days ago
NIM and Red (also on HN today) seem both seem to have an interesting and intersecting feature set. Anybody here used or heavily evaluated both that can comment?
2 comments

Nim and Red are quite different languages, both in terms of semantics and in terms of project's goals and scope. Perhaps you should elaborate on an intersection that you see between the two.

I can speak only for Red: it takes its heritage in Lisp, Forth and Logo, has an embeded cross-platform GUI engine with a dedicated DSL for UI building, C-like sub-language for system level programming, OMeta-like PEG parser, and unique type system with literal forms for things like currencies, URLs, e-mail and dates with hashtags; all of that fitting in one-megabyte binary and valuing human-centered design above all.

Rebol/Red is more like Python/Cython - able to be fast but falling back to an interpreter for dynamic things. As such there are probably more "performance footguns" (though any such thing is ultimately subjective based on programmer awareness). Nim feels more like what C++ (or Python) should always have been. Not sure if this helps. It's kind of a "big" question.
No, it's actually the other way around: Red and Rebol are interpreted by default, and Red has a bootstrapping AOT compiler capable of bridging it with Red/System (a C-like sub-language), which it turn targets machine code. However, since Red is highly dynamic, compiler cannot preserve semantics across the whole language, so it keeps some parts for the interpreter to process at run-time. And sometimes that's the only option, since code can be generated on-the-fly or pulled over the network: Red is homoiconic and has quite powerful meta-programming facilities on top of that.