top | item 45504352

(no title)

jrop | 4 months ago

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.

discuss

order

ardit33|4 months ago

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.

azemetre|4 months ago

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

jrop|4 months ago

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.

groovy2shoes|4 months ago

Lua has lambdas. They too suffer from verbosity, of course, but they're there.

    function(x) return x; end

jrop|4 months ago

That's what I meant and didn't communicate well. I'm wishing for short-form syntax of lambdas, to be clear.