logoalt Hacker News

Show HN: AutoLISP interpreter in Rust/WASM – a CAD workflow invented 33 yrs ago

123 pointsby holgyesterday at 3:56 PM39 commentsview on HN

Comments

holgyesterday at 3:59 PM

In the early 90s I wrote AutoLISP code for AutoCAD 9/10 that enabled a CSV → template → parametric drawing workflow. You could define components in spreadsheets, feed them through templates, and generate complete technical drawings automatically.

I've never seen anyone else use this approach. Now I've built an interpreter in Rust/WASM so it can run in the browser - partly nostalgia, partly preservation before this knowledge disappears entirely.

The lisp/ folder contains some LSP files from that era, others i recreated from memory.

Repo: https://github.com/holg/acadlisp/

What kind of drawings were you generating? Electrical schematics, mechanical parts, architecture? We also have some playground, to toy around with LISP and some function generator, to demonstrate Lisp usage for math...

show 8 replies
MontyCarloHallyesterday at 6:48 PM

   My brother's electrical company needed hundreds of Schaltpläne (circuit diagrams).
   Drawing each by hand = 5 hours per plan
   100 drawings = 500 hours = 12 weeks
   Professional CAD work? Unbezahlbar (unaffordable).

   The secret weapon: AutoLISP
   A programming language built into AutoCAD

   The Result: 99.5% time saved
   100 drawings: 12 weeks → <1 hour
This is a general pattern of how automation (including the recent wave of gen-AI) reshapes the labor landscape. Automation rarely replaces jobs wholesale (i.e. very few people get fired because their position was "outsourced" to automation). Rather, automation lets people who are proficient in Domain A who need some work done in Domain B become proficient enough in Domain B with sufficient ease that it's cheaper for them to pick up the requisite Domain B skills themselves versus hiring a Domain B specialist.
buildsjetsyesterday at 5:23 PM

I had to accomplish pretty much the same exact task circa 1999, but in Aldus Pagemaker using Postscript.

My first job out of college was a 6 month contact at a fairly small industrial control manufacturer that had been purchased by a larger conglomerate. All of their engineering documentation needed to be converted to the new company’s format.

The old company had devised a scheme whereby a wire harness could be completely described by the part number, which encoded the wire size, color, length, and termination. The new company wanted a detail drawing for each wire, with thousands in the database.

I made a library of reusable glyphs that could be stored in Pagemaker layers, and connected with postscript generated lines, and a script to iterate through the part number database and generate drawings.

show 1 reply
ofrzetayesterday at 4:57 PM

related: "In Version 2.5, AutoLISP allowed access to the DWG database. AutoLISP was based on XLISP, a public domain version of LISP written by David Betz. Betz later complained that Autodesk had failed to acknowledge the source, which the company later did." (https://www.shapr3d.com/history-of-cad/autodesk-and-autocad)

https://github.com/dbetz/xlisp

show 2 replies
kayo_20211030yesterday at 5:34 PM

Super interesting. Thanks. AutoLisp was both a pain and underrated. But, it was perfect for this sort of stuff. Much easier than generating the dxf files directly, say using postscript ;-). I love the modern recreations and UI.

show 1 reply
loufeyesterday at 8:03 PM

AutoLISP is still my most fluent language, pleasantly surprised to see anything in it on HN. There's something fun about its idiosyncrasies, but I am genuinely so glad for modern IDEs, linters, tooling in just about every other environment. AutoCAD has severely neglected it, despite some large businesses built exclusively upon it.

show 1 reply
pjmlpyesterday at 4:24 PM

AutoCad nowadays uses .NET as well, and thus any CLR enabled language, with a MSIL backend.

https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-390A...

show 1 reply
mlhpdxyesterday at 10:46 PM

AutoLISP programming is the only LISP programming I’ve ever done. Memories.

bitwizetoday at 4:55 AM

Ah, Autolisp. Based on an early, early version of XLisp, it's zombie software: not quite alive—Autodesk really wants you to use its COM and .NET integration to program AutoCAD—nor can it truly die. It was also the first Lisp I ever programmed, and back in the mid-90s there was a trend of putting a Lisp, or Tcl, into all the things (Emacs, GIMP, frickin' Abuse...) and Autolisp had prepared me for that world rather well.

zenethianyesterday at 6:21 PM

This website is a mess on mobile. Cool concept though!

show 1 reply