Replies: 3 comments
-
For now the way would be to do like C does. If i remember correctly @edubart want to adds something similar to Tho I am actually making a general purpose library which has Rust's For the goal in regards to compilation speed, I dont think there is any. For now if you are looking for a high level Lua-like compiled language, Nelua isn't for you. Its metaprogramming abilities are off the charts, and a lot can be done with it (just check the sumtype file of my lib to have a glimpse at it), but it's pretty young so the compiler works, but the standard library is pretty thin. It's worth noting that some jam games were made in it (https://github.com/edubart/nelua-game2048, https://github.com/edubart/nelua-tetris, https://edubart.github.io/neco/celeste.html, https://github.com/Andre-LA/baixada-game-jam-game/) so it is usable even if it is still a bit unstable. |
Beta Was this translation helpful? Give feedback.
-
It's on the roadmap to have the "optional" type builtin into the compiler to assist error handling, once that is done error handling will be similar to Lua style error handling without pcall (returning nil plus and error code). At the moment you can make your own optional type using meta programming, as mentioned by @linkpy and done here: https://github.com/Andre-LA/baixada-game-jam-game/blob/master/rotor/optional.nelua
Nelua has different goals and design than V, it's unfair to compare compilation speed of Nelua vs V, because V compiler is static compiled, while Nelua compiler is dynamic, made in Lua and interpreted. But there is a good reason for that, having a dynamic compiler permits to have unusual meta programming possibilities in the languages, allowing the user to cooperate with the compiler via the preprocessor on the fly and extend the language and do unusual things usually not possible in other static compiled languages. Nevertheless Nelua compiler tries to be efficient as it can, I often profile and try to keep compilation optimized, because nobody likes huge compilation times, so usually you can expect better compilation times than Rust, C++, etc. But Nelua prioritize runtime efficiency and metaprogramming possibilities first. You can expect small programs to be compiled in a few milliseconds, but huge code bases I would say it could take some seconds.
I don't see much benefits comparing more languages in this repository at the moment, this could be done in a third party project. Also it's unfair to compare languages with very different use cases and styles, comparing with C/Lua/LuaJIT is enough for showcasing what users can expect when coming from those languages. Terra/RaptorJIT is more unpopular and would be ignored for most users in the benchmarks. |
Beta Was this translation helpful? Give feedback.
-
Thanks for clarification - will follow this repository to see how far the support gets 😉.
Sounds good, thanks.
This seems a bit of a misunderstanding and I'm sorry for not articulating it more clearly. I didn't mean any performance comparison, but features, goals, practical tips, practical weaknesses & gaps, practical advantages, motivation for developing Nelua and who's behind ("how risky it is to use the language in practice"). Looking at the comparison should immediately more or less answer a newcomer's question "why should I choose either of the three for project X". |
Beta Was this translation helpful? Give feedback.
-
Have you already contemplated how to "clutterlessly" support error handling? For such a system programming language I always cite the first class built-in way V implements - namely Optionals (it's similar to Rust's "std::option::Option", but in Rust it still imposes more clutter than in V).
Btw. what's the goal in regards to compilation speed for Nelua? The above mentioned V language has extremely low compilation times (1 million SLOC in about 2.3 seconds on 1 vCPU of ~3GHz) which greatly improves the overall development experience and efficiency.
Would you also add comparison to other Lua-like languages with similar goals as you have (seamless use of system programming capabilities as well as dynamic garbage collected stuff with high-level APIs)? E.g. https://github.com/terralang/terra and https://github.com/raptorjit/raptorjit ?
Beta Was this translation helpful? Give feedback.
All reactions