Live data from Hacker News

Why I chose Lua for this blog

andregarzia.com

21–30 of 159 posts

Re: Why I chose Lua for this blog

#22
post #7

I 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

There are languages that compile to Lua. Have you investigated those? For example, you can use a TypeScript syntax and pick up free typechecking along the way: https://typescripttolua.github.io/ There's also the venerable MoonScript: https://moonscript.org/ And YueScript, a personal fave: https://yuescript.org/doc/ A whole list: https://github.com/hengestone/lua-languages

Don't forget Fennel, if you are a Lisp lover!

Re: Why I chose Lua for this blog

#23
post #2

Author of the blog here in case anyone has questions.

Why not choose Hugo (https://gohugo.io) or Zola (https://www.getzola.org ?. Both are pretty well-supported by communities and have tonnes of blog themes. (Hugo has a truckload and is the top-3 widely deployed SSG's)

Re: Why I chose Lua for this blog

#25

LuaJIT is awesome. I've been converting my Bash scripts/functions to it, with much success thus far.

You may want to benchmark lua versus luajit if you are writing scripts or other short-lived programs.

JIT-compiled languages aren't generally faster in starting up, they generally are used to speed up long-lived programs that have hot sections.

Re: Why I chose Lua for this blog

#26

I spend a lot of time blogging but all I use is a ~50 line Python file that converts my markdown pages to HTML, adds my template, and generates the ToC page. Then I push to GitHub Pages. I can't imagine needing more than that. Why are these blog stacks so complex?

Speaking for myself at least, after you've been blogging for a quarter century or more there are some nice features you might want like pagination of your table-of-contents, RSS feeds (do it, everyone should do it), support for redirects so that ancient links mostly work across those decades (I've kept redirects from like three or four blogging systems now), tags pages for finding lost treasures and silly things. I been on both sides of "needing" comments tools over the decades, similar with things like WebMentions. With so much of blogging on social media WebMentions don't seem that big a deal this decade as it was in the one where every other person (in college) had at least one Blogger.com Blog or LiveJournal and a lot of discussions were cross-links between blogs.

Admittedly most of my blogging history has been something of a path towards simplification from hand-rolled PHP+MySQL, with custom "forum code" markup language, stuff before "blogging" was even an agreed upon term for it (and before Markdown was anywhere near as pervasive), to complex third-party beasts like Drupal, to homegrown Python (and reStructuredText), to very simple SSG tools (these days still Jekyll, but I don't like working in Ruby much, so I keep debating a switch to Lume but I don't think its Redirects plugin is yet compatible enough with GitHub Pages for my liking and I haven't tested its RSS support yet, both of which are personal hard requirements).

Re: Why I chose Lua for this blog

#28
post #7

I 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

Agree, I find it a PITA. I think the good reviews are in contrast to C++ and vimscript. Fine for a small embedded script, but I hope WASM or some better language ecosystem starts to fill this niche.

Re: Why I chose Lua for this blog

#29

LuaJIT is awesome. I've been converting my Bash scripts/functions to it, with much success thus far.

You may want to benchmark lua versus luajit if you are writing scripts or other short-lived programs. JIT-compiled languages aren't generally faster in starting up, they generally are used to speed up long-lived programs that have hot sections.

LuaJIT bucks the trend of slow-warmup JITs. It is extremely quick to compile and load, and its interpreter is very fast -- faster than the JIT-compiled code from LuaJIT v1 IIRC, and certainly faster than the interpreter of Lua.

It wasn't until LuaJIT that I realized that JIT didn't inherently have to be these slow lumbering beasts that take hundreds of milliseconds just to wake from their slumber.

Re: Why I chose Lua for this blog

#30
I liked this post, and I can totally understand where you’re coming from…

But couldn’t anything you say about Lua also be said about JS? You mentioned how Lua wasn’t batteries included, so you try to limit your libraries. Couldn’t you say the same for JS? JS itself doesn’t change much, it’s the ecosystem. Couldn’t you just pick out some small and stable libraries the same way you could with Lua?

Post reply on HN