Show HN: ArchLang – floor plans as code, compiled to SVG/DXF/PDF (opens external site)
View full thread · View on Hacker News
To get push notifications on iPhone or iPad, add Hack and Chat to your Home Screen: tap Share → Add to Home Screen, then open the installed app and enable push in Settings.
View full thread · View on Hacker News
You write plain-text `.arch` source describing walls, rooms, doors, windows and furniture, and it compiles — deterministically — to SVG, DXF and PDF. Same source in, byte-identical bytes out. It isn't a renderer that draws a nice picture: it's a compiler with a linter and a geometric validator, and `compile()` never throws. Errors come back as data, each with a byte span and, where the fix is mechanical, the edit that fixes it. This is what the library's `compile()` returns:
That's what `arch fix` applies, and it's why a model can correct its own source without a human in the loop.The other half is that you can interrogate a plan without looking at it. `arch describe --json` gives rooms, exact areas, adjacency and an access graph; `arch lint --json` gives soundness warnings like `W_ROOM_DISCONNECTED` — "Room "Kitchen" has no door or opening — it can't be entered." A text-only model can check its own work.
The same source also gives a 3D preview. A separate package, archlang-3d, extrudes the compiled plan (walls, openings, floors, stairs, furniture, outdoor surfaces and fences in flat colours), checks it against the plan, and you can download it as a GLB from the playground or the CLI (the CLI validates it). It's a preview of the plan, not a renderer: stairs are built from the plan's own geometry, there are no pitched roofs or balcony railings yet, and no sections, elevations or BIM. It's in the playground, and there's a page with a few plans beside their 3D previews: https://archlang.uk/3d
Why a DSL, and why I think it matters right now. The thing that pushed me to build this is the way image-generating AI "design" tools output a picture you have to take on faith. When Adam launched its text-to-CAD tool here (https://news.ycombinator.com/item?id=48572553), the sharpest criticism was that the demo models looked like the thing but weren't manufacturable, and that natural language is a poor way to specify tolerances and constraints. A DSL is my answer to that. When a model writes ArchLang, its output isn't a hallucinated picture — it's source you can read, diff, version-control, and correct, and the compiler mechanically checks it. (I want to be honest: whether that auditability is worth paying for is a hypothesis I'm testing, not a settled fact.)
If the comparison helps: it's the Typst-and-LaTeX bargain applied to a drawing. The source is the thing you keep; the drawing is what the compiler makes of it.
Honest limitations, up front:
- The language draws a plan, and only a plan. Heights, sills and heads exist in the language, but they draw nothing — a floor plan is a horizontal cut. No sections, no elevations: a plan-level `section` mark draws only the cut line and the look direction, not a section drawing. The 3D preview is a separate package that extrudes the compiled plan: flat colours, stairs from the plan's own geometry, no pitched roofs or balcony railings yet, and you do not edit it.
- No BIM, no IFC, no round-trip. DXF export is one-way, for a draftsperson to open. Importing a building model back isn't something it does today.
- No structural, no MEP, no code compliance — and that last one is a deliberate refusal, not a gap. Asserting standards compliance is a liability claim I won't make.
- Three things are measured; the rest is advisory, and the code says so. Reachability (a real modeled access graph), areas (shoelace arithmetic), and byte-identical determinism are facts. Clear widths and walk distances are computed on a coarse grid and are explicitly advisory — the ADR calls them that. I'd rather tell you which numbers to trust than let you assume all of them.
- This is a concept/schematic tool, not a permit set. The output is dimensioned, internally consistent and exports to real CAD, but it is not stamped construction documents and you can't pull a permit from it. Anyone claiming their AI tool produces permit-ready drawings is overselling.
- Solo maintainer, MIT-licensed, 97 GitHub stars. Bus factor of one, and I'd rather say so than have you find out. The license is chosen precisely so the format outlives me if it's worth keeping.
Touch it here (no signup, no waitlist):
- Playground (compiles in your browser, nothing sent to a server): https://playground.archlang.uk
- Docs: https://archlang.uk
- Source (MIT): https://github.com/ChanMeng666/archlang
- `npx @chanmeng666/archlang compile plan.arch` — no required runtime dependencies (PNG and PDF use optional ones). There's also a VS Code extension and an MCP server (`npx -y @chanmeng666/archlang-mcp`, or hosted at `https://mcp.archlang.uk/mcp` with no sign-in; the hosted one returns SVG, text and Plan JSON, while DXF and PDF come from the CLI) so an agent can compile and lint against it directly.
I also built a commercial product on top of this (an AI tool that writes ArchLang for people planning a build) — happy to talk about it if asked, but ArchLang itself is the thing I'm showing today, and it stands alone. Ask me anything, especially the hard questions about what it can't do.
Replies (4)
What needs to be done to make this USA friendly (e.g., measurements and code compliance)? Are you looking for PRs or issues?
What is your take on other recent projects in the space like MutinyBIM or OpenTakeoff?