HeadlinesBriefing favicon HeadlinesBriefing.com

Forge: Stack-based Language for Web Development

Hacker News •
×

A developer created Forge, a stack-based language inspired by Forth, to explore alternative approaches to building websites. The language uses postfix notation where operations follow their operands, allowing developers to define custom HTML-generating functions through simple word definitions.

Forge compiles .forge files to HTML using WebAssembly running on both server and client. The single binary tool handles server-side rendering for crawlers and service workers for client-side navigation, creating a hybrid SPA experience. Pages are organized in directories with corresponding .forge source files.

The language includes unique persistence features through log-based storage. Developers can append data to JSONL logs for features like like buttons, with forms submitting directly to other .forge pages. State management spans localStorage, server logs, and append-only storage mechanisms.

This experimental project demonstrates how stack-based languages might offer unconventional but functional approaches to web development, though practical adoption remains uncertain.