Matt Keeter, an engineer who builds CAD tools, constraint solvers, and GPU and embedded projects, writes up his work in detail.
Commenters recommend his blog and thesis as a source of varied projects, and praise his CAD work and hardware photos.
Constraint programming is extremely important, now more than ever. I don't want to fall on the tired old explanation that says, "you program by declaratively describing the answer instead of procedurally describing how to compute it," both because it's sort of not true and because there's a whole declarative-procedural continuum: FORTRAN is more declarative than assembly language, LISP or Python is more declarative than FORTRAN, arguably ML is more declarative than Lisp or Python, Prolog is more declarative than ML, and SQL is more declarative than Prolog. And it varies by application area: probably, if you're describing a circuit layout, Verilog is more declarative than SQL, and MyHDL is more declarative than Verilog.
Unfortunately I don't have a good, compelling way to explain why I think constraint programming is so important. Here are a few attempts.
Constraint programming transforms a program that determines whether a possible solution is acceptable into a program to compute an acceptable solution.
Constraint programming allows you to write the specification of your program and then separately search for ways to fulfill that specification, either manually (by specifying search strategies/proof tactics) or automatically.
Constraint programming allows you to abstract away the question of which values in a subroutine are returned and which are provided as parameters. If you have only two such candidates, like the tired old °F↔°C example, this is a minor saving. If…
This is really great, thank you for doing this.
Tangentially, while browsing through your blog I found this: https://www.mattkeeter.com/projects/machined-pen/the_plan.jpg
This illustrates beautifully an idea that's been rattling around in my head for a while: what if the process you went through to design this manufacturing plan was the user facing cad api? When I approach a "making" problem--whether it's carpentry, plumbing, metal fabrication, machining--I naturally think about it in much the same way you did here. What raw materials am I starting with? What tools do I have? What sequence of operations do I need to perform to achieve the desired end result? The "cad api" (literally an api in the case of code cad tools or the visual representation thereof in traditional mouse driven interfaces) does not work this way, and forces me to think about how to represent the finished shape not about how I'll actually make it. All I care about in the end is making a thing, the modeling is just a tool to assist in that process but it makes itself way too visible.
Naively it seems like there would be so many benefits to having a more "reality based" modeling workflow. As someone who clearly has a lot more experience in the cad space than I do, do you think this concept could go anywhere or is it a dead end?
EDIT: also, a bit of feedback on the pen: you can maintain concentricity if you do something like this:
1. grab the bar stock in a 3 jaw chuck and turn it to a dimension…
I find stack based assembly easier to understand over register based assembly.
I read this article recently: https://www.mattkeeter.com/blog/2022-10-04-ssra/
It's regarding register allocation. According to comments on the HN post for it, it uses the same algorithm that Luajit uses. It uses a technique by searching backwards through the code to work out whether it needs to spill a register from memory or to memory.
I haven't written a bytecode interpreter or a compiler but I wrote a parallel interpreter that is multithreaded. Its code is plaintext so it's not particularly fast but is built with an actor implementation and can send and receive integers between threads. If it supported objects and network requests, it could be useful.
I am yet to implement any stack based operations but I have an idea for an object oriented design similar to Java JVM specification.
Here's the assembly. Colons indicate labels. addv adds values to variables. add adds two variables. send sends messages to a thread number. receive receives a message. The send and receive commands jump to the label indicated if there is no messages.
threads 25
<start>
set running 1
set current_thread 0
set received_value 0
set current 1
set increment 1
:while1
while running :end
receive received_value :send
:send
add received_value current
addv current_thread 1
modulo current_thread 25
send current_thread increment :while1
endwhile :while1
:end
This program gets between 1.5-65 million…
I think you if you have a particular goal with using the computer it gets easier to avoid hoarding. I'm trying to get better at writing code that's easy to read and change, which is admittedly too vague but it can still help me be real with myself and close tabs that don't have anything to do with it.
For example, here's two tabs I opened recently:
A Neat XOR Trick: https://www.mattkeeter.com/blog/2022-12-10-xor/
Code Only Says What it Does: https://brooker.co.za/blog/2020/06/23/code
So that first one is about solving an advent of code problem cleverly. That second one makes some nice points about how code doesn't necessarily capture your intent or the reasons you wrote what you did. So if I had both of those open in my browser or in some queue for unread links, and I wanted to cut down, I'd delete the first one.
I also find it helpful to ask if a link has any information that isn't already covered by some other resource in more depth. So if my goal was to learn more about compilers I might be tempted to save the blog post OP links to about writing a brainfuck compiler in Go with LLVM but there's already resources like Crafting Interpreters out there, so I'd probably only give that blog post a skim and not bother saving the link. (But if it was my goal to specifically write a brainfuck compiler, or write a compiler in Go, or write a compiler that uses LLVM, or some combination, I'd be more likely to save that particular post.)
I do full stack myself, from electronics design, part design, software, and qa. I have an associates degree for drafting/3d design along side a specialty in plastics. My hunch was that thermoplastics was going to take off after the expiration of the patent in '09. Lo and behold...
No, I would love a 3d printer that would only take seconds to make a part. However, with ABS, we're effectively limited to about a 200mm/s@.35mm is about the top end of printing. Obviously we can add in more hotends and other tricks, but the flow of ABS itself is the limiting factor.
And about the supports, I've usually approached them more from a metal casting way. Making a sprue network isn't difficult; the only weirdness is to design the 'infill' in the STL, rather than let the slicer handle it. Because usually, I want a 5% rectilinear infill for the sprues and something better (say, 30% honeycomb) for the part. Ideally, I'm working on a way to delineate areas that I want different infill on slic3r. That would be pretty spiffy.
Also, have you seen Antimony on the CAD front? http://www.mattkeeter.com/projects/antimony/3/ Pretty neat idea, similar to the system in Blender.
This is a mid-point in Matt Keeter's research.
Start at:
http://mattkeeter.com/research/thesis.pdf
then see:
http://www.mattkeeter.com/projects/kokopelli/
then Antimony (see the article at: http://hackaday.com/2015/05/29/otherworldy-cad-software-hails-from-a-parallel-universe/ ), then the current effort:
https://github.com/libfive/libfive
(and also see: https://www.gitlab.com/kavalogic-inc/tovero "a binding of Libfive to Common Lisp, including a standalone REPL-based viewer"[https://github.com/Irev-Dev/curated-code-cad] can be integrated with https://www.gitlab.com/kavalogic-inc/clive
Currently I'm using OpenSCAD (w/ BlockSCAD as a front-end: https://www.blockscad3d.com because I prefer a sort of visual representation), but have been stymied by the lack of file I/O (I want to write out G-code).
Still looking for a 3D modeling tool which is:
- a node or block editor
- can write out/append text files
- has loops
Bounced on PythonOCC in Ryven (install is a awkward), and was trying to make Nodezator work, but no loops, so currently trying pyflow (but can't get it installed on my Mac).