Project ideas from Hacker News discussions.

Type-safe HTML templating in Zig

📝 Discussion Summary (Click to expand)

1. Enthusiasm for type‑safe, DSL‑based templating that works with language tooling
- “one thing i love about rust's macros is that you can accomplish this without needing a separate file type or inventing syntax” – slopinthebag
- “you get rust's lsp support too, autoformatting, etc.” – slopinthebag
- “if you can indeed get LSP support in a custom syntax like this, that's really awesome.” – lukaslalinsky
- “This is just Twig templates, crazy. It's cool that Rust can do this out of a box” – asimovDev

2. Desire for native HTML templating mechanisms (includes, SSI, iframes, web standards)
- “Why can't we just have <includes src=\"./header.html\"> and be done with it?” – fergie
- “SSIs are not widely supported any more, and were never a part of the HTML standard” – fergie
- “Can I introduce you to iframes? Clunky but they do exactly what you are asking for.” – geoffmunn
- “XInclude… https://www.w3.org/TR/xinclude/” – pwdisswordfishq
- “SGML … had that, as well as many other things, such as type‑checked templating.” – tannhaeuser

3. Skepticism about inventing new DSLs/templating languages (learning overhead, limited usefulness)
- “That's not HTML though, you have to learn a whole new dsl that must conform to rust parser rules. So, not the same thing at all.” – dnautics
- “but you have invented syntax” – skavi
- “There was a brief period where everyone and their dog implemented mustache… but it died quickly because cross-language templating is not that useful in the end.” – riffraff
- “I've never quite got the deal with 'template engines'. I have always just done normal programming … interspersed outputting raw string literals to create the html.” – jaxxzi


🚀 Project Ideas

Generating project ideas…

Polyglot JSX‑like Macro Framework

Summary

  • Enables developers to write JSX‑style HTML inside Rust, Kotlin, Swift, etc., using language‑specific procedural macros or annotations that produce type‑safe DOM builders with full LSP support.
  • Core value: write familiar, readable markup while getting compile‑time checking, autocompletion, and formatting without learning a new DSL per language.

Details

Key Value
Target Audience Front‑end engineers using Rust (Yew/Leptos), Kotlin/JS, Swift/WebAssembly, or any language that supports compile‑time metaprogramming
Core Feature Macro‑based HTML‑like syntax that expands to typed element constructors, with integrated LSP diagnostics and auto‑formatting
Tech Stack Rust syn/quote for procedural macros, tree‑sitter grammars for LSP, language‑specific macro crates (e.g., kotlinx‑meta‑annotations), WASM bindings for browser testing
Difficulty Medium
Monetization Hobby

Notes

  • HN users praised Rust macros for LSP support (slopinthebag, lukaslalinsky) and wanted similar facilities in other languages (Humphrey imagined reuse across Django and JS React).
  • Provides the type‑safety and ergonomics of TSX/JSX while letting teams keep their preferred backend language, addressing the pain of inventing ad‑hoc DSLs (skavi, dnautics).

HTML Include & Conditional Polyfill (HICP)

Summary

  • A lightweight (~2 KB) vanilla‑JS library that interprets custom tags like <include src="header.html"> and attribute‑based conditionals (data-if="user.logged"), enabling native templating without a build step.
  • Core value: brings simple, declarative includes and conditionals to plain HTML, eliminating the need for separate template engines or heavy frameworks.

Details

Key Value
Target Audience Web developers who want straight‑HTML workflows (e.g., static sites, CMS themes, internal tools) and dislike complex build pipelines
Core Feature Runtime processing of <include> tags and data-if/data-show attributes to fetch fragments and conditionally render content
Tech Stack ES‑module JavaScript, Fetch API, optional Service Worker cache for offline fragments, minimal CSS scoping via Shadow DOM
Difficulty Low
Monetization Hobby

Notes

  • Directly answers fergie's lament: “Why is there no direct support for templating in HTML itself?” by providing a standards‑based polyfill.
  • Commenters appreciated server‑side includes but noted their decline (fergie, messe); HICP offers a client‑side equivalent that works everywhere without server configuration.

Template Definition Language (TDL) & Codegen Suite

Summary

  • Define UI components once in a language‑neutral TDL (similar to IDL/Protobuf) with typed props, slots, and expressions; the suite generates type‑safe templating code for Rust (macros), Kotlin (type‑safe builders), TypeScript (TSX), Go (templates), etc.
  • Core value: guarantees template consistency across full‑stack projects, eliminates duplicated template logic, and gives each language native compile‑time safety and tooling.

Details

Key Value
Target Audience Full‑stack teams using multiple languages (e.g., Rust backend + TypeScript frontend, Kotlin Android + Go micro‑services)
Core Feature Write a component once in TDL → generate language‑specific, type‑checked templating implementations with LSP‑ready output
Tech Stack TDL schema defined via JSON Schema, code‑gen templates using Handlebars/Jinja, CLI written in Rust (with clap and serde), language‑specific generator plugins
Difficulty High
Monetization Revenue‑ready: {Subscription per developer seat, tiered by number of generated languages}

Notes

  • Echoes Humphrey's desire for a template reusable in Django and a JS React frontend with TSX‑style type safety.
  • Addresses the fragmentation noted by riffraff (Mustache hype) and lukaslalinsky (Google Soy fork) by providing a single source of truth that can target any language.

Read Later