←back to thread

218 points generichuman | 2 comments | | HN request time: 0.001s | source
Show context
0xFEE1DEAD ◴[] No.44004292[source]
Years ago, I tried lua and wasn't impressed. Then I started using Neovim, did the necessary configuration in lua, but continued writing my own scripts in vimscript. Later I started using wezterm and decided to give lua a second shot, and I began to really like it.

I realized my initial dislike for lua stemmed from my experience with javascript (back in the jwquery days), where maintaining large codebases felt like navigating a minefield. The lack of type system made it all too easy to introduce bugs.

But lua isn't like that. It's not weakly typed like javascript - it's more akin to pythons dynamic duck typing system. Its simplicity makes it remarkably easy to write clean maintainable code. Type checking with type is straightforward compared to python, mostly because there are only five basic types (technically seven but I've never used userdata or thread). And I even started to enjoy using metatables once I understood how and when to apply them.

That being said, lua's lack of popularity probably stems from its limited stdlib, which often feels incomplete, and the absence of a robust package manager. luarocks is a pain to work with.

All that being said, I don't really see the point of using this project.

While I do wish type annotations were a native feature, the ones provided by the lsp are good enough for me.

replies(4): >>44006332 #>>44006803 #>>44008645 #>>44009267 #
1. augusto-moura ◴[] No.44006332[source]
BTW, you might want to check Lux [1], it's a new approach for Lua packaging. They launched it recently, so there's a lot of work going on. But it looks and feels very promising

[1]: https://github.com/nvim-neorocks/lux

replies(1): >>44010652 #
2. 0xFEE1DEAD ◴[] No.44010652[source]
Oh wow I didn't know someone was actually working on an alternative. It really does look promising. Thank you, definitely going to try it.