frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Lua can be a cool HTML templating engine

https://riki.house/lua-html
4•birdculture•1h ago

Comments

MrVandemar•1h ago
Very interesting. I've never had occasion to learn Lua, but it seems like it can do some neat things. I really like the JSON-esque template language there.
zhouzhao•51m ago
Lua can also be a cool scripting language to configure/write stuff for your editor (looking at you neovim)
krapp•11m ago
I absolutely do think more people need to use Lua, especially for config. The language does have some rough edges (what language doesn't) but I always suggest Lua tables whenever a thread about JSON and its discontents comes around. It's minimalistic, it allows for comments, you don't have to quote strings. You do have to avoid the temptation to add logic. But at this point most of 'yall are using some bespoke language to generate YAML to probably generate more YAML so the horses of complexity creep have already fled the barn.

That said I'm probably too old school but I really still prefer the "old" method of templating. It's a lot easier for me to reason about the structure of the HTML site-wide when I can actually see the HTML. Of course a lot of modern programmers can't read HTML and it would just seem like noise to them, which is fine. I think a lot of the rationale behind something like this is readability and that's often a matter of what you're comfortable with. I personally worry that this would become difficult to follow once you're dealing with a large and complex site with nested and fragmentary templates.

Then again, this is basically how most modern websites work using front end templates with javascript - all of the HTML is generated, so I'm probably just being an old man yelling at clouds here.

The point about the old design parsing HTML is fair, but if you want a templating language at some point something has to do that and you don't want it to be the browser. You don't want to do what most untemplated PHP does and just toss interpolated strings into the response and just make it the end user's problem. The Lua version here inevitably winds up doing a lot of the same work. Treating a templating language like an actual language and having an actual parser may seem like overkill but it also makes features like context-aware escaping, caching and plugins easier.

I don't think that attribute order is a problem in HTML - the spec doesn't care, the browser doesn't care, you shouldn't care. But if you do care, I don't think arranging attributes in alphabetical order is the best solution. There is apparently an informal HTML attribute ordering standard for this: (https://dev.to/bawa_geek/a-standardised-approach-to-html-att...). Which again, doesn't really matter with HTML but does match what developers would expect to see.

If I had to suggest improvements in terms of architecture it would be to either use something like Teal (a compile-to-lua language that lets you add types,) and LuaJIT, which has plugins that improve the performance of strings and tables. And rather than dynamically generating everything, statically cache as much of the HTML as possible.

Show HN: Building a SQL analyst agent from scratch

https://raminmousavi.dev/blog/building-a-sql-analyst-agent
1•ramin2nt2•4m ago•0 comments

Ubuntu 26.10 could drop btrfs, ZFS and LUKS support from GRUB

https://www.omgubuntu.co.uk/2026/03/ubuntu-grub-secure-boot-luks-changes
1•mariuz•6m ago•0 comments

BSI (Germany) defines when a cloud is sovereign

https://www.heise.de/en/news/BSI-defines-when-a-cloud-is-truly-sovereign-11272828.html
1•pros•6m ago•0 comments

Queen

https://medium.com/the-hitmagist/queen-2a8c2d9da9f5
2•bryanrasmussen•7m ago•0 comments

An attempt at explaining bipolar disorder and psychosis

https://osf.io/preprints/psyarxiv/w28g9_v1
2•anon1253•11m ago•0 comments

Quarkdown – Markdown with Superpowers

https://quarkdown.com/
1•amai•16m ago•0 comments

Show HN: Defeating AI by making knowledge accessible to Humans

https://github.com/tnelsond/peakslab
1•tnelsond4•16m ago•0 comments

China Blocks Meta's $2B Acquisition of AI Firm Manus

https://www.bloomberg.com/news/articles/2026-04-27/china-blocks-meta-s-2-billion-acquisition-of-a...
3•limoce•17m ago•0 comments

China blocks Meta's $2B purchase of AI startup Manus

https://finance.yahoo.com/sectors/technology/articles/china-blocks-foreign-acquisition-ai-0825482...
2•jmsflknr•17m ago•0 comments

Notes on Serial Experiments Lain

https://jordanmatthiass.net/essays/serial_experiments_lain
1•lilytweed•17m ago•0 comments

Open Source Mintlify Alternative

https://doccupine.com
1•luangjokaj•17m ago•1 comments

Open CoDesign: Open-source, local-first alternative to Claude Design and v0

https://firethering.com/open-codesign-ai-design-tool-open-source/
1•steveharing1•21m ago•0 comments

Tell HN: Ebay.com Is Down

2•NKosmatos•22m ago•1 comments

Enhancing Server Availability and Security Through Failure-Oblivious Computing [pdf]

https://people.csail.mit.edu/rinard/paper/osdi04.pdf
1•pabs3•32m ago•0 comments

The "Connectivome Theory": A New Model to Understand Autism Spectrum Disorders

https://pmc.ncbi.nlm.nih.gov/articles/PMC8892379/
1•AndrewDucker•33m ago•0 comments

Recursive Acronym

https://en.wikipedia.org/wiki/Recursive_acronym
1•Quizzical4230•35m ago•0 comments

Soulful Sites

https://app.paradigmai.com/sheets/76210606-6ce4-4ccc-a005-fb1cf6984a45
1•sauravmaheshkar•36m ago•0 comments

LLMs are not a higher level of abstraction

https://www.lelanthran.com/chap15/content.html
2•lelanthran•37m ago•3 comments

Ask HN: RedHat for Personal Use

2•bozdemir•39m ago•2 comments

The Truth About China's Green Energy Industry [video]

https://www.youtube.com/watch?v=Ff0AYRWrnGY
1•mpweiher•39m ago•0 comments

"Grandma, get on": Ukrainian robot carried 77-year-old from grey zone near Lyman

https://euromaidanpress.com/2026/04/25/grandma-get-on-ukrainian-robot-carried-77-year-old-from-gr...
1•eternalreturn•40m ago•0 comments

Claude Code Opus-4-7 VS Codex GPT-5-5

1•rashidae•40m ago•0 comments

MobED: Mobile Eccentric Droid – A robotic platform from Hyundai (2022) [video]

https://www.youtube.com/watch?v=uQqXbXpmkc0
1•num42•40m ago•1 comments

Ask HN: Paid ambient/background noise for focus?

2•deaux•44m ago•1 comments

A Website, Hosted on an ESP32

https://helloesp.com/
1•agilek•44m ago•1 comments

Show HN: AI voice screens for hiring managers to save time

https://worksignal.com/demo
1•cdnsteve•47m ago•0 comments

Show HN: AI agents that learn from their own failures each week

https://www.deployinfra.ai/
1•dkarigi•47m ago•0 comments

French teen who licked vending machine straw faces years in jail in Singapore

https://www.bbc.com/news/articles/cjw8w849g6go
5•jb1991•50m ago•1 comments

Was sind und was sollen die unendlichdimensionalen Supermannigfaltigkeiten

https://mathoverflow.net/questions/510716/was-sind-und-was-sollen-die-unendlichdimensionalen-supe...
1•jjgreen•51m ago•0 comments

Mapping the dreamworld: inside Le Guin's unseen cartographies of myth and mind

https://www.designboom.com/art/mapping-the-dreamworld-inside-ursula-k-le-guins-unseen-cartographi...
1•bryanrasmussen•53m ago•0 comments