News for hackers. Stuff that matters.
Re:The evolution of Lua, continued [pdf] by jrop on Tuesday October 07, 2025 @11:28AM (#45504352)
I always wrote Lua off, scoffing at the 1-based indexing, until I was "forced" to learn it thanks to Neovim. What a delightful little language it is. I do wish I could do certain things less verbosely (lambdas would be nice) -- but then again, I defeat myself by suggesting it, because not having all the features makes Lua so approachable.
Re:The evolution of Lua, continued [pdf] by groovy2shoes on Tuesday October 07, 2025 @12:01PM (#45504856)
Lua has lambdas. They too suffer from verbosity, of course, but they're there.

    function(x) return x; end
Re:The evolution of Lua, continued [pdf] by jrop on Tuesday October 07, 2025 @02:34PM (#45506944)
That's what I meant and didn't communicate well. I'm wishing for short-form syntax of lambdas, to be clear.
Re:The evolution of Lua, continued [pdf] by strenholme on Tuesday October 07, 2025 @10:26PM (#45511380)
There are patches for this so the above can be expressed with something like this:

  [ (x) | x ]
http://lua-users.org/files/wiki_insecure/power_patches/5.4/l...

And for Lua 5.1:

http://lua-users.org/files/wiki_insecure/power_patches/5.1/l...

(I personally don’t use patches like this because “Lua 5.1” is something pretty standardized with a bunch of different implementations; e.g. I wrote my Lua book with a C# developer who was using the moonsharp Lua implementation)

Re:The evolution of Lua, continued [pdf] by azemetre on Tuesday October 07, 2025 @11:31AM (#45504401)
Same here, in fact something I wish the neovim team would do is create a book where popular plugin authors create tutorials that recreate basic functionality of their plugins.

Seems like a no brainer that would help bring in more revenue too, it'd also be an "evergreen" book as new others can contribute over time.

I can't be the only one that would immediately buy a copy. :D

Re:The evolution of Lua, continued [pdf] by jrop on Tuesday October 07, 2025 @11:51AM (#45504684)
I'm actually trying to work on a video-series to do just this. I've made my own rudimentary plugins reproducing several popular ones, and would like to walk through how I made: a) file-tree b) picker/fzf replacment c) hop/leap replacement d) surround plugin e) code-formatter f) hydra (sub-modes) g) many "UI" (interactive) buffers, etc.

None of these are published because the popular ones are better and provide more functionality, but I want to share what I believe is more valuable: what I learned while writing them.

Re:The evolution of Lua, continued [pdf] by azemetre on Tuesday October 07, 2025 @12:00PM (#45504839)
That sounds great! Do you have a youtube channel or something to follow when you release it?
Re:The evolution of Lua, continued [pdf] by jrop on Tuesday October 07, 2025 @12:03PM (#45504886)
Yep, though I'm still trying to hit my stride recording videos. I don't release regularly because of lots of amazing $life things.

https://www.youtube.com/@nocturing

If you want a sneak peak of what I want to walk through, check this repo (see the examples/ folder): https://github.com/jrop/u.nvim

Re:The evolution of Lua, continued [pdf] by ardit33 on Tuesday October 07, 2025 @11:38AM (#45504516)
I used Lua professionally. I prefer the 1 indexing... it just feels more natural. For some reason the C apologists here will scream how 0 based is the only way to go. (which is not, it is just a historical artifact). Languages like ADA allowed you to use either 0 or 1, (or any arbitrary) starting index.