Earlier quoted context omitted.
Everything web-facing, if it's not a static website delivered by a well-tested web server, happens in a high-risk environment. And doubly so, if, like in this case, stuff like custom cgi libraries are involved. One has to be either very confident in their skills to do that or very, very brave.
My point here is that if someone breaks your blog, they've broken your blog. The blast radius of that should be strictly limited. Obviously don't go rolling your custom CGI scripts on a server that also hosts your personal email - but these days we are spoiled for choice in terms of isolated hosting strategies for a blog. Heroku, Vercel, Cloudflare Workers, Fly.io, GitHub Pages, a $5/month VPS...
Why I chose Lua for this blog
81–90 of 159 posts
Re: Why I chose Lua for this blog
#82I guess this is his why ;-)
Re: Why I chose Lua for this blog
#83Earlier quoted context omitted.
The 1 indexes are only a difference from what you're used to. Lua was made by mathematicians, who of course wanted to address the first element as 1, the second element as 2, etc. 0-indexing makes sense in the context of C where the index operator is syntactic sugar for pointer arithmetic. In higher-level languages like C# and Python and others, it's pretty much just a leftover habit from C devs that we all got used…
And a lot of the time it makes the syntax more compact than it would be with 0-indexing. for i=1,#arr do foo(arr[i]) end I don't feel that strongly for or against either way of indexing though, they both have their pros and cons.
for (0..$#arr) {
foo(arr[$_])
}
Whatever you're feeling is not in starting at one.Re: Why I chose Lua for this blog
#84Earlier quoted context omitted.
Why not Fennel?
Fennel looks quite great! And I love Lisp so there is definitely some allure there. I don't use it for mostly the reasons mentioned in OP: * to minimize dependencies. Lua * for even greater stability. Fennel is pretty stable, but I use Lua 5.1 for the most part which hasn't changed since 2008 or so. I'm more extreme than OP in even avoiding later versions of Lua. Bottomline: the reasons I like Lua have nothing to do…
Re: Why I chose Lua for this blog
#85Lua 5.1 to 5.2 was a fairly significant breaking change; one that has forked the community to this day with luaJIT never coming on board. 5.2 to 5.3 also broke things with the introduction of integers but mostly at the level of bindings. There is also very little included in terms of standard library and while luarocks exists many significant packages go abandoned. There are breaking language changes in the upcoming…
Re: Why I chose Lua for this blog
#86Earlier quoted context omitted.
Perhaps people's tastes vary? I find Lua an easy to use language. Easy to embed into C/C++ projects for scripting purposes. Also great when you can only spare 100 kB or so for an interpreter. (Arguably that was more important in the past.)
For me it is a much easier language than, say, Erlang.
Re: Why I chose Lua for this blog
#87Lua 5.1 to 5.2 was a fairly significant breaking change; one that has forked the community to this day with luaJIT never coming on board. 5.2 to 5.3 also broke things with the introduction of integers but mostly at the level of bindings. There is also very little included in terms of standard library and while luarocks exists many significant packages go abandoned. There are breaking language changes in the upcoming…
Why couldn't LuaJIT support both? Feels like a needless limitation imposed on all its users. I noticed this problem when making plugins for neovim.
Re: Why I chose Lua for this blog
#88Earlier quoted context omitted.
it's easy, but the 1 indexes and global by default suck
The 1 indexes are only a difference from what you're used to. Lua was made by mathematicians, who of course wanted to address the first element as 1, the second element as 2, etc. 0-indexing makes sense in the context of C where the index operator is syntactic sugar for pointer arithmetic. In higher-level languages like C# and Python and others, it's pretty much just a leftover habit from C devs that we all got used…
Re: Why I chose Lua for this blog
#89Author of the blog here in case anyone has questions.
Why would you build your blog to fail if some article on it ever gets popular? The fact that the most hits you ever received was 50k in a week isn't relevant; a single important post could receive that in seconds. It basically costs nothing to pre-render a static site, which then serves several orders of magnitude faster. I'm confused why anyone would do it this way in this day and age.
Re: Why I chose Lua for this blog
#90I don't know man, every time I tried to learn Lua (to write nvim plugins and HammerSpoon spoons) I disliked the ergonomics of the language. I don't understand why people say it's an easy language— easy ≠ simple