NattLua icon indicating copy to clipboard operation
NattLua copied to clipboard

Project status and syntax extensions

Open Jipok opened this issue 2 months ago • 1 comments

I must say I'm truly impressed by the depth of the implementation, especially the flow analysis, mutation tracking, and other advertised features. I tried to study the code, but it's too dense to quickly assess.

I'm contacting you because I'm currently developing a GUI framework for Lua (based on LuaJIT). It's about 90% complete, but I'm seriously considering refactoring it to use NattLua to take advantage of static typing and improved tooling.

Before I commit to this migration, I have a few questions about the project's future:

  1. What is the current state of NattLua? The advertised features are interesting, but are they all actually implemented? I saw comments in the code that were clearly written by LLM. Not that I'm against llm, but didn't the readme also written by llm?

  2. Can this project be used to implement something? Or are there scenarios where the parser or another component fails, and I'm stuck. I'm not afraid of future syntax changes and the requirement to rewrite code for new versions; I'm afraid of the possibility of being stuck with basically unworkable code written by llm.

  3. Since NattLua is already transpiled to Lua, what's your position on adding "syntactic sugar" that isn't in standard Lua? In particular, I'm interested in a shortened lambda expression syntax (e.g., fn(a, b) return a + b end or similar), which would significantly simplify declarative GUI code. Is the parser extensible enough for this, or are you striving for strict syntax compatibility with Lua standards?

  4. What do you think about https://github.com/thenumbernine/langfix-lua?

Jipok avatar Dec 04 '25 09:12 Jipok

Overall, I would say it's not ready for any reliable use. There are likely going to be bugs, and at a high level there is no clear design IMO (high level meaning cli, setup project, project config, etc). Individually, the lexer, parser and emitter should be very stable, but the analyzer still has a lot of polishing left. I personally use the LSP for syntax highlighting and formatting on save in vscode, but the extension often crashes for some reason and I haven't bothered to look into it.

The features mentioned are implemented, but likely have bugs and edge cases. I don't advertise anything I don't implement (if I do it's not intentional)

I've experimented with and used LLM's to refactor and generate some code, but mostly for refactoring code I don't even fully understand myself. I'm interested in using LLM's more than I'm doing, but with the goal of getting a better understanding, refactoring and organizing tests.

I'm interested in lambda expressions for example, but the hardest part to me is figuring out what syntax to use that doesn't cause other issues.

thenumbernine's project is aimed at syntactic sugar extension only and not analyzing

CapsAdmin avatar Dec 04 '25 12:12 CapsAdmin