Hacker News new | ask | show | jobs
by mahmoudimus 536 days ago
I feel very strongly against Lua. I use it for WoW add on development all the time - I make so many mistakes with the 1-based index when porting algorithms. It is very very painful.
2 comments

Fortran has arbitrary-based indexing forever (as does Ada). The default is 1 but it can be specified as anything. I don't see why this capability is so rare.
I think it's one of those features where the original intended audience of the programming language are supposed to be non-programmers (or presumably, 1-based indexing is intuitive?) but for seasoned programmers who have been used to 0-based indexing, the change is quite stark.

It's the same concept with AutoHotKey and the original intention of Lua (super small user-defined script for the masses).

Whereas Fortran and Ada probably had some forethought that went into enabling that functionality. I will have to check but I remember my algorithm class started with 1-based indexing and the reason was it was intuitive to explain. But when experienced with C/C-inspired languages, the old adage becomes relevant: "There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors."

> the original intention of Lua (super small user-defined script for the masses).

Lua was originally intended to be a language/data format for a Brazilian oil company geology software.

https://www.lua.org/history.html

why not Fennel?
Wow I didn't know this existed. This is pretty cool. Will definitely play around with it.
What? Really? OMG, Fennel is so nice. I'd use it for anything that needs Lua these days - neovim, hammerspoon, awesomewm, mpv, wezterm, etc. It's very mature and it even has an lsp-server implementation and a dedicated conference. It's incredible how you can reduce some big, nasty, unavoidable boilerplate in Lua just into a few lines of Fennel.