[HN Gopher] Nelua: AOT statically typed Lua
___________________________________________________________________
Nelua: AOT statically typed Lua
Author : gatane
Score : 56 points
Date : 2023-01-26 19:56 UTC (3 hours ago)
(HTM) web link (nelua.io)
(TXT) w3m dump (nelua.io)
| karmakaze wrote:
| "Nelua is a systems programming language for performance
| sensitive applications, like real-time applications and game
| engines. Its syntax and semantics are similar to Lua, but its
| garbage collection is optional, it provides optional type
| notations, and it is free from an interpreter. Nelua uses ahead-
| of-time compilation to generate optimized native binaries. It is
| metaprogrammable at compile-time using Lua and it is simple and
| easy to use."
|
| This seems to mean that you can't drop a Nelua script into a
| game/engine and use it. You have to compile the script and link
| with the game? Something with either an interpreted mode or
| runtime code generation seems more appropriate.
| stefanos82 wrote:
| If you are interested, the README.md [1] explains everything in
| detail.
|
| [1] https://github.com/edubart/nelua-lang#about
| Kukumber wrote:
| Many languages to choose from, that's great
|
| I wish the same could be said about tooling
|
| How is the debugging story? gdb/ldb compatible? does it support
| its types?
|
| Is there a language server available? formatter?
| Benjamin_Dobell wrote:
| I want to start adding support for Lua derivatives to my IDE -
| which adds static type checking to regular Lua. Inference,
| structural & nominal types, generics etc. (Luanalysis -
| https://github.com/Benjamin-Dobell/IntelliJ-Luanalysis/)
|
| I feel like plugin support would be best but I've no idea how
| that's supposed to work in the presence of a predefined grammar.
| There's also so many variants I don't think there's a good way to
| build out a composite grammar.
|
| Does anyone have any ideas about modular/extendable language
| parsing? For reference, I'm using
| https://github.com/JetBrains/Grammar-Kit.
| JonChesterfield wrote:
| The FAQ doesn't cover "how does this differ from lua", but
| overview contains the disclaimer:
|
| > not all Lua features are implemented yet. Most of the dynamic
| parts, such as tables and handling dynamic types at runtime
|
| It has coroutines to some extent
|
| > At the moment Nelua does not support variable arguments in
| yield and resume (unlikely Lua).
|
| It also extends lua primitives - lots of control flow things,
| arrays and records which look like tables but are passed by
| value, not by reference.
|
| So it's an ahead of time statically typed language which looks
| somewhat like lua. Compiled to C, no interpreter. It says it's
| meta-programmable using lua which I assume is really confusing
| given the two languages look similar and behave differently.
| yellowapple wrote:
| The million dollar question: has anyone written a Lua interpreter
| in Nelua yet?
| nerpderp82 wrote:
| Similar to Terra https://terralang.org/
| VWWHFSfQ wrote:
| Can I transpile this "Lua" to LuaJIT (5.1/5.2) and run it in
| nginx?
| snacktaster wrote:
| LuaJIT + nginx event loop is probably the fastest network
| runtime in existence. Is there a faster one? In terms of
| writing high-level code that executes at the speed of the
| machine.
| lerchmo wrote:
| https://www.techempower.com/benchmarks/#section=data-r21
|
| (openresty) is luajit + nginx
| turtledragonfly wrote:
| I low-key dislike when people nitpick titles, but in this case
| I'll do it (:
|
| The title makes it sound like this is a variant of Lua, or
| somehow largely compatible.
|
| The page itself is more clear, calling it a "programming language
| with a Lua flavor".
|
| Emphasis on "flavor".
|
| I feel like the list of differences from Lua is about as big as
| the similarities, and it's definitely not a drop-in replacement,
| at least in its current form (contrast with something like
| LuaJIT).
| shadowofneptune wrote:
| Of the features to selectively take from Lua, the syntax is one
| I like. Pascal-style syntax does not have the statement
| separation issues a more expression-rich language like
| JavaScript has. It not only does not have statement separators,
| it is almost completely whitespace agnostic.
|
| As a strategy to get adopters, it could also have value.
| There's a small but widely spread group of people who have been
| exposed to Lua in various games and programs.
| [deleted]
| dang wrote:
| Related:
|
| _Nelua Programming Language_ -
| https://news.ycombinator.com/item?id=28293836 - Aug 2021 (118
| comments)
___________________________________________________________________
(page generated 2023-01-26 23:00 UTC)