14 ms·
Why I chose Lua for this blog
- soapdog 1y agoAuthor of the blog here in case anyone has questions.
- Imustaskforhelp 1y agoWhat are your thoughts on something like arturo which I know is quite recent but it has a lot of features for scripting and an argument might in fact be made that it is in fact it might have too many batteries but it was an absolute pleasure to learn and I had a lot of aha moments in their discord server and the community was really pleasant to follow through actually. I know its definitely smaller but I just want your opinions on it and what you might think of the language and I may be a bit sorry if this comes across as a little off topic but your blog really reminded me of arturo and my attempts on creating something like hugo in arturo but the project was abandoned mid way but if I remember correctly it was just some 50 lines of code to convert from markdown to complete website or even less since arturo's battery include markdown syntax as well as well as a web server and its written in nim which I cherish too. I am genuinely interested in your opinions about it! https://arturo-lang.io/ https://arturo-lang.io/
- NuclearPM 1y agoTook a while to find examples: https://arturo-lang.io/documentation/in-a-nutshell/ https://arturo-lang.io/documentation/in-a-nutshell/ It looks interesting.
- soapdog 1y agoNever heard of Arturo before. Went to their page after reading your comments. Omg, it looks so cute and good. Defo up my alley. I love functional and minimalist languages. Thanks for sharing that. I might play with it for some project in the future.
- Imustaskforhelp 1y agoGlad I could help ya! I love arturo as well :) The creator is an extremely nice person and I am proud that he follows me on github. This might be the highlight of my github right now lol. Came to learn from awesome-nim about the language and loved it from day one. There are a lot of ways of doing the same thing but maybe that's the point since its rebol inspired.
- sneak 1y agoWhy 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.
- indigodaddy 1y agoPeople like to tinker. It's fine. If it blows up one time, then decide what to do from there.
- miladyincontrol 1y agoBy large I agree, its just common best practices these days. Or at least have some components statically generated like the rss feed. I know some will go 'oh well I want a web interface to create or edit posts in', nothing says you cant just implement that part dynamic and have it update static components on modification of posts.
- soapdog 1y agoit used to work like that. At the moment, the dynamic pages take miliseconds to rende and ship. Even though static files would be a an order of magnitude faster, we're talking about it already being fast enough for 99% of the time it is needed and that is good enough. Reducing my time and friction maintaining and using my own blog is more important and having five sigma of uptime.
- soapdog 1y agoMy blog is yet to fail and I don't believe in premature optimization. I had 50k in a day once in the past and it was ok. If more than that happens in seconds and the blog fails, so be it. It doesn't affect my life at all, I fail too sometimes. I considered monitoring popular posts and prerendering those. Feels like code bloat for something that might not happen. Don't get me wrong, this blog used to prerender everything. It kinda sucked to compute which pages were affected by a change in any given page as it might need to patch indexes, cross linked references, and so on. It can be done of course, or you can simply re-render everything anyway. The added friction for development and maintenance was not worth it for me. It is my personal blog, it is not a personal branding site to show people my cool web skills or anything. If it goes down, let it go down.
- roxolotl 1y agoI currently run a blog generator I wrote in fennel and have been considering switching to pollen haha. Slightly surprised you didn’t pick fennel over lua since you used racket before. Is there a reason you didn’t?
- soapdog 1y agoI absolutely love Pollen. Do it! I switched away from Racket because I wanted less moving parts. With Lua (a language I know better than Racket) I feel I have a better grasp of all the parts. The main reason to switch away was to make the codebase smaller and easier to tinker with, but the pollen version was great. Fennel is absolutelly amazing, I love it. I just didn't had the need. I like Lua the way it is. I was a student at PUC Rio for a while, I fell in love with it there and am very familiar with it.
- QuantumNoodle 1y agoI don't have a background in web development and have a genuine question. > Your blog is your place to experiment and program how you want it I 100% agree with your statement and people don't need to justify their hobbies. I've done really pointless things simply for lolz and because I wanted. My question arises because I was surprised in how ... architected and (dare I say) complex the tech stack in your blog is. In my blogging days I wrote my own HTML/CSS and published it on a Internet facing server. Later, I've used CSS templates and Markdown-to-HTML to generate the static content. What is the purpose of Lua and having a database and all the other complexity for what seems like a static blog? Again, "because I wanted to experiment" or "sharpen my skills" is a totally valid answer but seeing I don't have a background in web development I am inquiring to see if there is a technical reason for doing this. Would be curious to learn what, if any, technical problem warrants such a set up :)
- soapdog 1y agoThanks for the questions, let me see if I can address them: The stack doesn't feel as complex to me because I know it well. Familiarity doesn't make it less complex but make it comfortable. The reason for the database is that it allows me to run queries. It makes it easier for creating "recent posts" and "posts with this tag" pages. Lua is the glue that ties it all together. Yes, HTML/CSS can be used to create a full site but writing posts in HTML gets tiresome fast when typing on a phone for example. The way it is it has an admin interface that allows me to write markdown on my phone or edit a post. It is handy. For my own personal projects it is less about technical reasons and more about what will make me happy. What brings the joy on and less about what is the optimal solution. Does that makes sense?
- QuantumNoodle 1y agoAbsolutely! Thank you for taking time and replying.
- lenkite 1y agoWhy not choose Hugo (https://gohugo.io https://gohugo.io) or Zola (https://www.getzola.org 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)
- soapdog 1y agoI have used Hugo in the past. I decided against SSG (the previous Racket version was a SSG) because I wanted dynamic features such as having an admin interface that allowed me to post and edit from my phone.
- curiousss 1y agoKinda curious why you did not go with OpenResty?
- nmz 1y agoWhy not go with redbean?
- indigodaddy 1y agoCan the redbean webserver dynamically parse markdown?
- soapdog 1y agoon the very early releases, I couldn't get it work well. I know it works well now and may take it for a spin again.
- deleted 1y ago[deleted]
- rweichler 1y agoI guess it provides less freedom/flexibility on the dev side. You're forced to use LuaJIT, and you're forced to buy into OpenResty's coroutine paradigm where global variables act weird, and stuff like that. Also I bet it doesn't play super nice with LuaRocks. Totally valid choice to make, but in my opinion OP is missing out. OpenResty is state of the art and has a ton of great libraries embedded in it. It's "batteries included" so to speak, and the batteries are well designed. Yichun Zhang is one of the GOATs, along with Mike Pall. And Roberto, obviously.
- soapdog 1y agoWhile everything you said there is true, it is a matter of taste for me. I prefer working with PUC Lua over LuaJIT. The speed improvement of LuaJIT doesn't matter for me, the only thing I miss from it is the FFI. I wish PUC Lua had the same FFI interface tbh.
- simonw 1y agoI miss the days when "implement your own blogging engine" was one of the most popular learning projects for engineers. We should bring that back! Its such a great way to play around with client- and server-side development options in an almost zero-risk environment.
- zelphirkalt 1y agoStill a good project when one learns a new programming language.
- chii 1y agoyep. What makes it good is that it's an easy concept to imagine the use cases, but contains subtle details that covers the breadth and depth to gain the experience you need/want. Getting it wrong is not a death sentence (as long as you quarantine the project to it's own, rather than make it part of your home setup...).
- ganamadaduun 1y agoEverything 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.
- piker 1y agoWhat? Are you serious? If you roll your own little cgi-bin perl script behind Apache you're far from vulnerable compared to, say, a WordPress website.
- ganamadaduuun 1y agoIn any web application all data that comes from the outside world is potentially hostile. A decent web framework takes care of basic security measures, does input sanitation, provides referer checking and csrf for forms, etc. When you roll your own, your _are_ on your own to do that all properly yourself, if you even know all the potential pitfalls. And if you write your own cgi library like the op even more so. I'm not advocating for using WordPress either. I'm advocating for either having a static blog or using a decent, tested web framework or the the very least cgi module that provides tested implementations of common security features that in my experience are typically missed in self-made cgi scripts.
- behnamoh 1y agoI 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
- vardump 1y agoPerhaps 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.)
- fullstop 1y agoFor me it is a much easier language than, say, Erlang.
- dev_l1x_be 1y agoErlang has multiple higher level barrier of entries than other languages. For starting, its syntax.
- behnamoh 1y agobut Erlang isn't a scripting language, it's a full-blown language with a rich ecosystem and framework (BEAM).
- fullstop 1y agoLua is also a full blown language, with an ecosystem as well. Perhaps the road block that you've run into is because you've been treating it as just a scripting language.
- SoftTalker 1y agoAgain, tastes. I found Erlang to be one of the easiest languages I ever used. I just immediately "got" it. Unfortunately I've had very few professional opportunities to use it.
- azhenley 1y agoI 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?
- shanedrgn 1y agoSometimes people just want to have fun
- WorldMaker 1y agoSpeaking 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).
- theshrike79 1y agoTBH RSS feed on a blog should be table stakes. Preferably with full content unless you're doing some Substack personal branding "subscribe to my paid newsletter" -crap.
- 1y ago
- rwky 1y agoI use perl for the same reasons. The few dynamic scripts that I need I want to write and forget them for years. Odds are with perl they'll still work 20 years from now.
- bilekas 1y agoThis. I'm still sitting on some almost core code that's written on an over enthusiastic teenagers idea of a plan.
- indigodaddy 1y agoYou could also do something like this, have Caddy webserver parse your md files through a template https://github.com/dbohdan/caddy-markdown-site/blob/master/Caddyfile https://github.com/dbohdan/caddy-markdown-site/blob/master/C... ^^ the above combined with caddy git fs to have your md files cloned in memory and refresh every X interval is kind of magical. Git push a new md file and wait X minutes and your website updates. https://github.com/mohammed90/caddy-git-fs https://github.com/mohammed90/caddy-git-fs ==== Or a one-file FastHTML (python web framework) solution: https://gist.github.com/simonMoisselin/f63c52f087704c99b6a62bf3d7e14805 https://gist.github.com/simonMoisselin/f63c52f087704c99b6a62...
- pmarreck 1y agoLuaJIT is awesome. I've been converting my Bash scripts/functions to it, with much success thus far.
- gorjusborg 1y agoYou 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.
- haberman 1y agoLuaJIT 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.
- gorjusborg 1y agoYet I've witnessed Lua 5.1 launching faster than luajit for some of my use cases. My point still stands though. Don't just use LuaJIT thinking it will magically make things faster in all cases. If you are embedding, LuaJIT is a no-brainer. If you are using a stand-alone interpreter, measure if you care about reality.
- NuclearPM 1y ago> If you are embedding, LuaJIT is a no-brainer. If you are using a stand-alone interpreter, measure if you care about reality. This seems backwards. Lua is easier to embed and luajit is just as easy to install standalone and has zero downsides.
- gorjusborg 1y ago
- PicassoCTs 1y ago[dead]
- mochja 1y agohttps://redbean.dev/ https://redbean.dev/ could be just perfect fit for you
- soapdog 1y agoI tried it in the early days but couldn't get it to work on my mac. Also, I'm very familiar with Lua source code and LuaRocks so I chose comfort. Redbean is amazing though and I really want to take it for a spin some day.
- mcdow 1y agoI 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?
- mrbonner 1y agoFor me, it isn't 100% language warts. It is the customer experience that matters the most for me. Can I compile and ship my products to my customers without having them to install a VMs, container runtime or a language runtime? That the question that is critical for me.
- Imustaskforhelp 1y agoI agree, I think that you must really like golang and how easy it can make cross compilation and how fast it is to build. Golang has one of the best developer experiences and there are only very very few minor nitpicks I might have of the language but the whole ecosystem on packaging software and what not is just so easy and I love golang.
- mcdow 1y agoThis is the primary reason Lua is interesting to me. As high level as JS/Python but embeddable. Only problem is I have language ADHD. I use way too many to pick up another like Lua.
- soapdog 1y agoI love JS, don't get me wrong, I absolutelly love Javascript. But I love the JS that the browser runs and understands. I hate the current ecosystem of bundlers, transpilers, typescript, npm modules and so on. Yes, I could have picked a js runtime and done the same thing. The same thing could also have been done with literally any other language. It is less of a "Only Lua Can Do This" situation and more of a "I Like Working with Lua" situation.
- akkartik 1y agoI use Lua for almost all my custom tools these days. https://akkartik.name/freewheeling-apps https://akkartik.name/freewheeling-apps https://git.sr.ht/~akkartik/gen_site https://git.sr.ht/~akkartik/gen_site
- veqq 1y agoWhy not Fennel?
- akkartik 1y agoFennel 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 < Lua + Fennel. I'm more extreme than OP in that I don't even use LuaRocks. When I need a library I copy it in, and I pick a library that won't change often so that is a reasonable approach. I try to avoid native libraries. * 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 with syntax and are much more about these operational meta characteristics of the language. If I cared more about syntax I'd be on Fennel in a heartbeat.
- jack1243star 1y agoI use Lua the same way, without LuaRocks. I use a Makefile to run my programs on Lua 5.1~5.4 and LuaJIT and compare the output files, to ensure portability across versions.
- vogu66 1y agoI've been thinking of how to make a blog simple recently, and I came across xslt. It looks really cool and seems pretty set in stone, so I thought I'd ask, what are the advantages/drawbacks of making your own tech stack versus xslt? At first glance, it seems perfectly able to handle rss and other simple linking patterns, and pretty much anything can easily be turned into an xml then xslt could be used to generate an html (server-side, or rather writer-side, not like the blog is gonna change) that you serve?
- ksymph 1y agoXSLT might be removed from the HTML spec soon, see discussion here: https://news.ycombinator.com/item?id=44952185 https://news.ycombinator.com/item?id=44952185
- vogu66 1y agothat would be client side if it happens, though, I'm talking about server side generation xsltproc was preinstalled on my machine actually, the fact I could just run it without installing anything is pretty cool
- spc476 1y agoXSL is neat, and it is a functional language, but between XSL and XPath, it is quite verbose. Here's a small section of XSL I use to generate my website (not my blog): <xsl:choose> <!-- ... other code --> <xsl:when test="name(.) = 'subsection'"> <xsl:choose> <xsl:when test="not(boolean(ancestor-or-self::*/@next)) or ancestor-or-self::*/@next != 'rev'"> <xsl:if test="boolean(following-sibling::subsection[@listindex != 'no']/attribute::directory)"> <link rel="next" href="../{following-sibling::subsection[@listindex != 'no']/attribute::directory}" title="{following-sibling::subsection[@listindex != 'no']/child::title}"/> </xsl:if> <xsl:if test="boolean(preceding-sibling::subsection[@listindex != 'no'][position()=1]/attribute::directory)"> <link rel="prev" href="../{preceding-sibling::subsection[@listindex != 'no'][position()=1]/attribute::directory}" title="{preceding-sibling::subsection[@listindex != 'no'][position()=1]/child::title}"/> </xsl:if> <link rel="first" href="../{../subsection[@listindex != 'no'][position()=1]/@directory}" title="{../subsection[@listindex != 'no'][position()=1]/title}"/> <link rel="last" href="../{../subsection[@listindex != 'no'][position()=last()]/@directory}" title="{../subsection[@listindex != 'no'][position()=last()]/title}"/> </xsl:when> <xsl:otherwise> <xsl:if test="boolean(preceding-sibling::subsection[@listindex != 'no'][position()=1]/attribute::directory)"> <link rel="next" href="../{preceding-sibling::subsection[@listindex != 'no'][position()=1]/attribute::directory}" title="{preceding-sibling::subsection[@listindex != 'no'][position()=1]/child::title}"/> </xsl:if> <xsl:if test="boolean(following-sibling::subsection[@listindex != 'no']/attribute::directory)"> <link rel="prev" href="../{following-sibling::subsection[@listindex != 'no']/attribute::directory}" title="{following-sibling::subsection[@listindex != 'no']/child::title}"/> </xsl:if> <link rel="first" href="../{../subsection[@listindex != 'no'][position()=last()]/@directory}" title="{../subsection[@listindex != 'no'][position()=last()]/title}"/> <link rel="last" href="../{../subsection[@listindex != 'no'][position()=1]/@directory}" title="{../subsection[@listindex != 'no'][position()=1]/title}"/> </xsl:otherwise> </xsl:choose> </xsl:when> <!-- ... other code ... --> </xsl:choose> And yes, there is other code I've omitted for brevity. This is used to generate the navigation links for the site. I initially write this ... prior to 2009 (that's when I moved it into git). There have been some minor fixes to the XSL over the years, but it's largely unchanged (for a reason that I hope is obvious). Yes, I still use it, because it still works, and it's for a static website.
- Levitating 1y agoglad to see cgi being loved again
- amrutha_ 1y agowaldium can be good for blogs if you dont want to do a custom build. its geo-specific though
- librasteve 1y agoha - I'm well behind you trying to get my blog from Mullenweg hell to pure Raku
- asdfman123 1y agotl;dr: because no one uses Lua
- NuclearPM 1y agoThat’s obviously not true.
- TheCycoONE 1y agoLua 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 5.5 as well though they are relatively minor.[1] All to say I think if long term compatibility is the primary goal there are probably better languages. Have you already discounted php or perl? [1] https://www.lua.org/work/doc/manual.html#8 https://www.lua.org/work/doc/manual.html#8
- 0cf8612b2e1e 1y agoWhy stay on the upgrade treadmill? For such a minimal language, are the updates really that compelling? NeoVim is committing to 5.1 and leaving it at that.
- TheCycoONE 1y agoSure that's an option, most distros continue to include every lua version back to at least 5.1; and since luaJIT stayed there a lot of the rest of the community did too. I guess I'm not sure what advantage lua has in that regard: you could stick to an old version of any language, including node, which was called out as being hard to keep up with.
- 0cf8612b2e1e 1y agoThe simple interpreter seems worth a lot. The official one is under 20k lines. There are reimplementations in many other host language (Go,Rust,JS, etc). Meaning it should be possible run Lua code forever without maintaining a full legacy virtual machine OS. I am not sure I can compile Node today, let alone N years from now as compilers and platforms shift.
- shmerl 1y agoWhy couldn't LuaJIT support both? Feels like a needless limitation imposed on all its users. I noticed this problem when making plugins for neovim.
- user3113 1y agoI manage to embed lua into my project. https://rapidforge.io https://rapidforge.io its incredible language I don't understand why would you need dsl if you have something like lua to use
- JSR_FDED 1y agoI love the Lua language, has all the nice to have data structures, no need to think about memory management, is straightforward (keep the whole thing in your head easily) and will go forever without changes. Just stick with v5.1. It’s so cool to take the interpreter source, type make and be using it in one minute.
- lisbbb 1y agoI worked with Lua for awhile but never got over the 1-based indexing.
- soapdog 1y agoYou very seldon need to deal with it, most of your iterators are `pairs()` or `ipairs()` anyway. I like 1-based indexing and can deal with 0-based ones without any wart. I don't really get it why people make so much fuss, but then again if you feel it is a big problem, then there are plenty of other options that will suit you better.
- cmrdporcupine 1y agoYou'd get used to it eventually. Many of us had to go the other way. I grew up with BASIC and Wirth languages (Pascal, Modula-2, etc) that were 1-indexed and to this day even after 25, 30 years of working professionally in 0-based indexed languages I still catch myself here and there having to adjust (and whiteboard coding can sometimes throw me off under pressure), but clearly operate just fine. I worked briefly professionally in Julia a couple years ago, which is 1-indexed, and I found it an easy transition, really. Many scientific computing things are 1-indexed, as Fortran was, too, among other reasons. My own project is a rewrite / defibrilation of the 1990s LambdaMOO server (https://codeberg.org/timbran/moor/ https://codeberg.org/timbran/moor/), which had its own OO programming language that was 1-indexed. It's just not as "weird" as people think, I think it's just a generation of people grew up with C-derived languages and have grown to expect 0 as "normal" when it's really just "accident of history/popularity". I don't think it's objectionable that Lua chose 1-indexing, it is actually more "friendly" to newcomers to programming.
- pklausler 1y agoAs Fortran is, not was.
- cmrdporcupine 1y agoYeah fair enough. I was speaking more about historic influence. Fortran is still extensively used, but it was more influential 40 years ago than it is now.
- auggierose 1y ago> Your blog is your place to experiment and program how you want it. I guess this is his why ;-)
- rewgs 1y agoLove the author's mentality. While I would almost definitely not pick Lua (I'd probably pick Go), I like how they arrived at their decision. Nicely done.
- soapdog 1y agothank you! Go is such a nice language (but then again, I love Pascal so Go feels quite familiar).
- prmoustache 1y agoI am not sure why one would have to use an engine for this. A blog consist of mostly repetitive list of posts made from a single identical template. Any 10y old kid could just master it enough to write them in html directly. And pandoc is just installed in seconds from any package manager if one wants to use an even easier different markup language. Heck in age of microblogging and social medias most blogs aren't even seeing a new post every week, barely anyone is on dialup anymore[1] and those who do probably won't load images automatically, one could have all their posts in a year on a single html page and just anchor tags. This is certainly the case from the blog linked here. A shell function is enough to call pandoc, update any kind of index (date or tag based) and an rss page really. I would hardly call that an engine, it is just an helper to not forget to update indexes and feeds. [1] loading speed was the main reason blog engines used to split posts in single pages
- rcarmo 1y agoIf you want to do inter-page linking and some forms of templating, pandoc can be a complete pain, though.
- soapdog 1y agoThe reason it has an engine is because it also has an interface for me to post and admin stuff. The previous version was generated by scripts (using Racket and not Pandoc) and that made it harder for me to post from devices that were not my own main computer where the source lived. For example, I like posting from my phone. PS: I'm the author.
- prmoustache 1y agoTermux and gitnex have been my friends for posting from my smartphone.
- nodeschool 1y agoAs a a javascript dev I kinda feel you and agree that the tools are moving faster than most codebases. The thing is though, you don't really have to use that many tools unless you really want to. You can spin up a node server yourself and use web components and it will run fine probably just as long as the lua code will. It's also way easier today to just use web components and not any framework since LLMs can help you speed up the development.
- soapdog 1y agoI am extremelly biased against LLMs so take my opinion with a grain of salt. I opted to run a CGI script instead of spinning my own webserver cause webservers are tricky. I'd rather run something like nginx or caddy. I like nodejs (my preferred JS engine will always be Mozilla's and for the terminal I been favouring Bun) but part of using Lua on my own blog is cause of JS fatigue. I'm exhausted with the JS workflow these days.
- rcarmo 1y agoMine’s in Python. I took that route when it was a relatively obscure thing and PHP was gaining ground over CGI in Apache (at the time having a Python web server was downright weird) and stuck with it for a long time. These days it’s a purely static site generator and a bit too funky to release (there’s a variant over on https://github.com/rcarmo/sushy https://github.com/rcarmo/sushy) but I really enjoyed maintaining it while it was a small, batteries included environment. I considered switching to Lua (actually Fennel) but luarocks can be fiddly to use across platforms (I now run everything on ARM servers) and that pretty much was the end of that. So I’m curious as to how maintainable a Lua back-end is over time.
- jazzprogramming 1y agoSpeaking of unconventional languages for web development, there's also Wt, for people who are used to building things using C++. I found it surprisingly good and considering how little I know on how to use HTML/CSS/JS/PHP, the usual web stack, it would have taken me months or more to learn how to build an equivalent site using the standard stack (and then have to maintain it). Of course, if you're already familiar with web development, that's the best way I guess, but for those who aren't and don't have the necessary time to learn, there are probably alternatives using languages they're familiar with.
- MomsAVoxell 1y agoI do the same, but I use turboLua to host, because it has great signals support and I have my private web server wired up to all kinds of devices in my environment. TurboLua is one of those under-acknowledged tools that can do so much. Pretty good mustache support too.
- WesolyKubeczek 1y agoI'd argue that you could make the same argument for (almost) every other language instead of Lua and still have the same advantages. For example, take Javascript. With a runtime like Bun, you would have the primitives to serve some HTTP and talk to SQLite right there in the core. And here's the good news, if you carefully implement only the things that you need for your project, you probably don't need NPM. You can write it all on your own, you can peek at how NPM authors solved the problems you run into, but you still can make it all your own. This would leave you with this amazing retrocompatible language with lots of mindshare to boot. Really, you don't need that whole ecosystem if you're solving your own problems and are not required to interface with someone else's library. And no one is forcing you to use it. Or you could take Python, and it has a few single-file web frameworks. You can go with one of them and the standard library a very long way. No one tells you you must use any of FastAPI, Jinja, Flask, Django (anyone remembering Pyramid?), SQLAlchemy... Or you could write it in Go, SQLite module being your only external dependency. You can even pin your go.mod to a particular version of the compiler so you're not bothered with incompatible changes, or changes at all. Or, you could whip up Perl... but yeah. CGI.pm and DBD::SQLite are not in the core. And anything else has a litany of CPAN dependencies with their quirks. No, don't whip up Perl. All I'm saying there's nothing that makes Lua somehow inherently more suited to your philosophy than any other mainstream language. Except maybe to be different. And you're still pulling in 29 luarocks, aren't you?
- andai 1y ago>I often see wisdom in websites such as Hacker News and Lobsters around the idea of "choosing boring" because it is proven, safe, easier to maintain. I think that boring is not necessarily applicable to my case. I don't find Lua boring at all, but all that those blog posts talk about that kind of mindset are all applicable to my own choices here. I think what is really meant by choosing boring technology is that it be simple, proven, reliable. That's the key part. Minimize cognitive load, maximize peace of mind. Some ecosystems are "boring" in the sense that developers are not excited about them, but they also maximize your blood pressure and chance of shipping defects. That's the wrong kind of boring!
- KingOfCoders 1y agoJust write the blog. (For years now I publish with Hugo/Bunny CDN ($1/month)) I from time to time wonder if I should write my own engine. Then I laugh and write a blog post.
- alias_neo 1y agoI'm curious what the rationale is for so many blogs and even some websites these days limiting their content width to this tall-skinny column of text; the OP takes about 1/5 to 1/6 of the screen width on my (4k) display. A large proportion of users may very well be on mobile, but do we just not do flexible layouts in 2025?
- timetraveller26 1y agoAlways glad to read histories of Lua in the wild, it certainly is kind of an odd language but its simplicity and embedability makes it for a great choice for a lot of use cases. I used to like moonscript coffescript-like syntax, but nowadays I mostly like plain lua, though Fennel looks appealing.