I’ve been working on a Haskell powered CAD playground.
It run’s entirely in the browser, in Web Assembly; this is made possible thanks to the GHC WASM backend, by Cheng Shao et al.
I’ve been working on a Haskell powered CAD playground.
It run’s entirely in the browser, in Web Assembly; this is made possible thanks to the GHC WASM backend, by Cheng Shao et al.
Very nice!
Does the WASM blob itself include some subset of GHC compiled to WASM in order to compile these examples in the web? Or is it a custom smaller compiler?
Out of curiosity, have you put much effort into optimising the WASM blob size yet? Curious if this 100MB is already stripped down, or if there might be some breathing room there.
I’ve been growing more and more curious about functional languages as a foundation for CAD lately, seems like a rich space to explore with lots of potential. Thanks for sharing!
Does the WASM blob itself include some subset of GHC compiled to WASM in order to compile these examples in the web? Or is it a custom smaller compiler?
It’s using a subset of GHC; the setup I’m using is heavily based on the example in this post by @TerrorJack
Out of curiosity, have you put much effort into optimising the WASM blob size yet? Curious if this 100MB is already stripped down, or if there might be some breathing room there.
I’ve not put a huge amount of effort into this yet. My suspicion is that “A compiler” and “A Geometry Kernel” are both sufficiently complicated things that most of the blob is going to be necessary, but I say that with limited confidence.
I’ve been growing more and more curious about functional languages as a foundation for CAD lately, seems like a rich space to explore with lots of potential. Thanks for sharing!
You should checkout Waterfall-CAD, my library which is the core of this playground, I use it extensively for design for 3D-Printing, we’ve got a Discord server with a number of people interested in FP for Programmable CAD
It might be worth pointing out that you can use the “loadURL” button to open files from Github (or Github Gists, just paste in the “raw” link), and even permalink to them, like so:
The high bandwidth warning is very clear and considerate, nice job.
Do you have a link to a repo?