Show HN: ArchLang – floor plans as code, compiled to SVG/DXF/PDF

(playground.archlang.uk)

135 points | by chanmeng 2 days ago

29 comments

  • Multicomp 0 minutes ago
    very cool! i would love to see this as a battlemaps as code tool, then an extension where one can have world state like treasure chests, but thats just me wanting to build out a ttrpg metaverse for my own personal gaming group. image diffusion and procedual drawing works-ish but determinism via something like code seems necessary.
  • cauterize 4 minutes ago
    Possible to add Doom map as a compile output?
  • CyLith 3 hours ago
    This is great if you are designing a house, but less useful for reconstructing an as-built. The main frustration I have is that it's not easy to translate physical measurements into the quantities needed. It's odd to me that rooms are measured from the centerline of the wall, rather than edge to edge, which is what you'd measure with a tape measure or a laser ruler.

    I have been trying to vibe code a proof of concept house-to-cad system where you feed it measurements and it uses a SLAM-like process to reconcile your measurements into a coherent house model. If anyone knows of something, let me know. Or please make it!

    • roel_v 3 hours ago
      What is the problem you're having? I walked around my house with my phone, videoing everything, took a few reference measurements, Codex then derived a 3d model of my house in Blender, and wrote Blender plugins to export per room pdfs with floor layouts. It has layers for my furniture and decorations, detects light switches and lights, etc. It also made hvac and electricity schematics, I had to feed it a bit more info of course, can't derive that only from video.
      • bloopernova 1 hour ago
        This is such a good idea, did you follow an existing workflow and if so may I have a link?
        • roel_v 1 hour ago
          No I just made it up as I went along. I didn't think this would be anything special that anyone else would be interested in. Quite frankly I just speak a half-assed idea into Codex and it filters through my braindump. It corrects the things where I skipped over certain details, and then it comes up with better ways to do it.

          If you want you can email me and I'll send you the Blender file and you can have a look. It did things like program parts of the Blender user interface so that I could have predefined views, and checkboxes or dropdowns (so that I can turn off the front wall or the side wall, so that I could have cutaways through my house, that sort of stuff).

          I wish I could say that I thought of it myself to have it program this sort of stuff into Blender but it actually came up with that itself so I can't even take credit for that.

          One thing that I did do is tell it, "Hey, some of the furniture that you found in these videos is from IKEA. If you recognize those, look on the IKEA website and you can use the dimensions for reference for measurements of the other things." It actually worked quite well even. Amazing.

          • veverkap 46 minutes ago
            Did you have Codex process the video or did you take stills?
            • roel_v 32 minutes ago
              Codex took stills. I told it 'analyse the video', it will bisect it with ffmpeg to find cutovers between 'scenes' (in my case, rooms, and specific angles of rooms) so that it has representative stills of everything. Unless I tell it 'go back to this and this door' or whatever, and then it will find specifically that part.

              In fact what I did was even more low-effort. I just took a video with my phone. I have Dropbox on my phone. It automatically uploads and synchronizes with my desktop so I just told Codex, "Look on my camera uploads on my local Dropbox and analyze the latest video I took 10 minutes ago." I use that workflow often nowadays, with photis and videos.

              • bloopernova 13 minutes ago
                That's not low effort, it's great!
    • taylorfinley 3 hours ago
      I've been working on adding a feature like that to my carpentry simulator sawdust.diy (woodworker-native SketchUp, use actual carpentry tools and a global material library instead of extruding rectangles). I've got a feature now where you upload a picture of your scrap wood pile and it solves for the closest match in your materials region and adds all the wood to your scene. I'm trying to extend that to already-built geometry so you can plan a build in your existing space or create a digital twin of your house. I set a constraint on myself of trying to do it without a fancy lidar phone, but the SFM/metric depth models I've tried so far really struggle at the task.
      • loveiswork 1 hour ago
        Sawdust rules, thank you for building it!
        • taylorfinley 36 minutes ago
          Aw man, you made me smile! Thanks for using it.
  • origini 3 hours ago
    Very nice.

    I will check it out for my current project:

    Personal digital twin.

    Designing and building a virtual twin of my flat and my future house i want to be able to plan my dream farm before i can afford it and it will allow me to priotize things like a greenhouse over a forge etc.

    And depending if i will ever have the money or have to rebuild something: it should be possible to autogenerate random layouts of a perfect house. Like if your test case is waking up, dressing then going outside and coming in dirty for lunch, all of them have pathes and costs etc. and depending on how often you do, you might be able to plan and get a bauhaus style idea out of it.

  • sheepscreek 2 hours ago
    Coolest thing that I've seen in a few days. Great for testing different ideas around the house and visualizing the end result. A sort of whiteboard for reorganizing furniture or interior decoration.

    I might hack away at it - add drag drop items on the 2D chart (such as from Nvidia's vast 3D items collection on Hugging Face[1]), or just have LLM write it in code, then adding a 3D walkthrough becomes trivial. You've already done 95% of the work for it!

    [1]: https://huggingface.co/datasets/nvidia/simready-assets

  • brudgers 1 day ago
    Landing page for archlang, https://archlang.uk/
  • sondr3 4 hours ago
    Huh, this seems very cool indeed. I've used Sweet Home 3D to model the house we bought last year but that was an exercise in frustration trying to make things line up properly. This looks like something that'd be fun to try to use to replicate the full layout of the house in.
    • zdc1 3 hours ago
      I went through a few 3D options when planning my kitchen rennovation before realising I'd need bite the bullet and learn QCAD. (This was more for planning placements and cabinets to the millimetre rather than mockups/aesthetics though.)
  • Hasz 4 hours ago
    This is cool.

    A couple thoughts:

    - 3d render seems borked, windows/doors show as flat void floating in space.

    - I am personally much more interested in the mechanicals and structural design than things like rugs. US standards are going to be quite different than the UK, eg cavity walls frammed 24-16" OC vs whatever the UK uses.

    - units :)

    - it would be cool to have your integrated ide highlight the render, eg if I click on

    ``` furniture sofa in r_live anchor bottom-left flush inset 250 size 900x2000 label "Sofa" ```

    I see that object highlighted.

    - electrical, plumbing, hvac penetrations planning is imo quite important, along with a DRC system to check you comply with xyz code.

    - multiple floors would be cool

    Anyways, 2c driveby comments, cool project.

  • pwarner 3 hours ago
    I presume an LLM can write this code? I've got similar ideas for adjacent domains.I think you is the path to LLMs helping in more domains. Message me if you are also thinking of this.
    • darccio 3 hours ago
      It looks like it (and it's fine). I'd dare to say it looks generated with Codex/OpenAI models. It's very close to my own attempt to build the same using the same stack.

      I think it's a really cool execution.

  • wm44821 4 hours ago
    would be nice if cursor placement in the source highlighted the respective part of the rendering.
  • tomaytotomato 2 hours ago
    If you could apply this to Blender and remove the need for BPY (Blender Python scripting) this would be awesome
  • hk1337 3 hours ago
    This would be nice in collaboration with an app that can create floor plans from images. Looks like there’s an mcp ability so that is likely.
  • anentropic 2 hours ago
    I have used SketchUp MCP/Claude connector before

    and the other week here there was a vibecoded open clone of SketchUp

    this looks worth a try

  • jstanley 4 hours ago
    FYI chanmeng I think the reason your comment is dead is because it is LLM-generated.
  • hard_times 4 hours ago
    Can it do something like an auditorium with concentric seat arrangement, I wonder?
  • asibahi 3 hours ago
    I expected this to be a bit more substantial than it is.

    I expected some sort of solver where you list the rooms and their sizes and their requirements (window/no window) and it would give you a floor plan.

    This is just good old drawing by text.

  • js8 3 hours ago
    Funny, like half of my coworkers vibecoded their own home planning application; must be the most popular use case.
  • gwt4life 3 hours ago
    Cool. I just wish Claude wouldnt make all websites default to looking like he Anthropic website.
  • arendtio 4 hours ago
    Pretty cool! Is it possible to have multiple floors on top of each other?
  • exabrial 1 hour ago
    I love it, one nit:

    Can we please not do infinite scroll in all dimensions anymore? Apple can't even make it not suck. It was terrible then, and it was even worse when we all endured Figma.

    Normal books have pages. If you print, you'll have pages. Pages are great!

  • bttf 4 hours ago
    Why isn't IKEA using this? For instance, I could convert my empty house into code and then have IKEA send me suggestions.
  • jiggunjer 4 hours ago
    Interesting applications for game design too perhaps. I was looking for a way to design terrain maps using a 2d plan language.
  • larodi 4 hours ago
    Love it, hope it gets good adoption!
  • dolmen 4 hours ago
    Stairs?
  • DrNosferatu 3 hours ago
    So now LLMs will be able design floor plans!
  • Code__Block 3 hours ago
    huh, very cool indeed !
  • Agataproximadev 1 hour ago
    [dead]
  • KimiCat 3 hours ago
    [dead]
  • chanmeng 2 days ago
    Hi HN. I'm the solo maintainer of ArchLang, an open-source DSL and compiler for floor plans.

    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:

      {
        "code": "E_ATTACH_POS_RANGE",
        "severity": "error",
        "message": "Door \"d1\" attachment position 30000 mm is outside the wall run (0…18000)",
        "fixes": [{
          "title": "clamp the attachment position to 18000",
          "applicability": "machine-applicable",
          "edits": [{ "span": { "start": 170, "end": 184 }, "newText": "on w1 at 18000" }]
        }]
      }
    
    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.

    • speps 2 hours ago
      In the "Riverside House" showcase, when you switch between L1 and L2, the floor plan doesn't match between the two. How hard would it be make it match? There's a slight offset which makes it hard to visual match when switching.
    • bklyn11201 2 hours ago
      Very cool!

      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?