Hey guys, I've been working on this Clojure project for a while now, honestly I'm not even entirely sure what it is, a game? a game engine? a 3d editor? a visual programming language? Anyway, it's a system to create mechanical contraptions and interact with them. I built a few test machines and you can see them in the first video I posted on my channel [1]. For instance you can create a fully functional piano in 5 minutes and play it, the keys move, it plays the sounds as you would expect. And this system turned out surprisingly powerful, to build these machines it often does not require any coding which was kind of surprising. I created this tetris game in half an hour [2]. It's not perfect but it is functional and again it required only a tiny snippet of code to coordinate the different submachines and even that might be unnecessary. The "programs" i.e. the machines created also interact in a way that you usually only see with command line programs. You can create a machine then someone else can use that machine as a part for a more powerful machine, for instance that lever that turns the tetris game on and off doesn't "come standard" with the system, I build it separately then imported it. Using the program is a lot like programming, thinking logically, coming up with solutions to problems, fixing bugs, but it's entirely visual so you can use your physical intuition to figure things out, maybe that's why it's possible to do things so fast. Anyway I was hoping some of you would give it a try and give me some feedback. I need people to see what they can build with it, I don't even know what's possible at this point. And if you want to give it a go and get stuck, feel free to contact me with any questions.
That's pretty cool! It seems like a weird mixture of physical contraptions (lego/meccano etc) or minecraft redstone circuits, and something you'd see in Media Molecules' Dreams (especially the graph-motion).
Thanks and that pong game is a great idea for my next machine, unless someone beats me to it! If I recall correctly the very first thought that led to this project was thinking about how to formalize mechanical devices, they have a language of sorts to describe chess games, same with choreographed dance I think. I was thinking how can I do that for machines without all the extra stuff like heat and friction, but I pivoted a lot since then and ended up with this.
Could you elaborate a bit more on “formalize mechanical devices”? That has really piqued my interest especially since you mentioned dance choreography as an example.
Do you have any examples/prior art you found interesting?
One of the topics I occasionally like to think about is how to formally describe manufacturing steps in some structured/programming language.
Maybe your program could be it. Would love to hear other folks’ thoughts on this too!
Well, I was really into formalizing stuff when I was in college, you know proving that a cryptographic algorithm was correct by formalizing them as black boxes talking to each other, that sort of thing. Then I just started thinking about how to formalize mechanical things. One of the very things I remember is coming to the conclusion that all motions of a machine can be implemented as a combination of linear and rotational motions (and that's where the two things that move on mockmechanics, the track and the wagon, come from), but I don't know if that is true. But I don't really have any prior art, I had a 2d version that didn't work years ago but I think I lost it.
You should check out Shannon’s work on the differential analyser if you haven’t already. Before computers came along they used mechanical machines to solve differential equations etc. There are more papers with beautiful drawings of mechanical machines from that era.
I think the prior art you're looking for kinematics and robotics... and I distinctly remember that e.g. for multi-joints robotic arms you can actually use methods from the algebraic geometry instead of calculus (so you solve polynomial equations instead of differential equations).
Also, no one in this thread mentioned Opus Magnum from Zachtronics which has some quite neat mechanical movement in it.
> Could you elaborate a bit more on “formalize mechanical devices”?
It made me remember yesterday's post about SparkFun's new Al La Carte thing ( https://news.ycombinator.com/item?id=24920043 ) - and now I want a service that lets me design a machine in this using it's "standard parts", and then order a physical version of it :-)
I wonder if some combination of lego/mechano style components, 3D printing, and magnetic electrical connections for batteries/switches/leds/motors could work? (Somewhat like this: https://www.pinterest.com.au/pin/178314466469771331/ which I had as a kid way back...)
You know I had actually considered this exact thing you want a while back as a way to move forward once I had the program working. You could design all the graphs, logical connections on the computer then load them and just snap all the parts together. The main drawback I encountered then was how to implement the wagon since it can move in an arbitrary track path circuit. I'm not sure how that could be done. Another idea that's a little out there is that if someone could implement the basic building blocks using molecular parts, then maybe that's how we build molecular machines!
It looks more like a lean version of gary's mod. Although that game lets you build very complicated things a lot of people end up just playing premade games instead of building their own stuff, so there is still a lot of room for a more focused "maker" experience.
It's interesting you'd mention that, because most of the program is "mechanical", you manipulate things in 3d, but for some things you have to go into a window and connect a few 2d nodes like the gates in motherboard mode. I was thinking maybe I should use 3d manipulation for everything, maybe the video you posted could serve as inspiration for 3d gates.
Yeah, as an introduction to programming, it could even be used with very, very young kids, apparently people are born with an intuitive physics module (babies are surprised by things that don't make physical sense), so who knows? Maybe someone may claim one day that she has been programming since age 2!
My son have been programming since he just got 2 years.
Started with code.org, then codeSpark and now scratchJr on iPad. Everything have to be visual, and small doses every week.
Love your work from the little I have tested now.
Anyway I can contribute for translating into other languages?
Thanks, if your son (or you!) builds anything with it I would love to see it and put it on the gallery on the website :)
Thanks for the offer, I'm dealing with so many moving parts here (pun intended) I hadn't even considered it. I think the most helpful would be translating the documentation, if you'd like to do that. Or posting a video explaining how to build something in the other language you speak would be great too.
>... honestly I'm not even entirely sure what it is, a game? a game engine? a 3d editor? a visual programming language? Anyway...
It's refreshing to see this kind of exploratory project.
Every now and then, I need to be reminded there's room for play and exploring in life, not just productivity and producing. Thank you for reminding me!
You're welcome :) I remember someone saying somewhere that most of the great computer programs probably haven't been written yet, if we remember that maybe we'll be the ones to write them!
Surely I can't be the only one who saw the title "Show HN: What would mechanical programming look like?" and thought ... sure mate, just go back to the 70's and you've got mechanical programming galore in the form of punch cards. ;-)
Haha... I remember talking to a teacher in college that used punch cards when he was young and I thought it was awesome, people were closer to the hardware you know? Hopefully my version of mechanical programming is a little more convenient :)
You know, punched cards and/or pianola rolls was the first thing I thought of watching you piano video when you mentioned wanting to record it. (my second thought was one of those cylindrical hand wound chimey music box things - https://en.wikipedia.org/wiki/Music_box#/media/File:Music_bo... )
That's a good idea. When I recorded the piano I hadn't built the tetris machine yet so I didn't have the proximity-test library part. Now it would be so easy to test if there is a hole or not (or a bump) in a block working as a sheet as it moves down. And now that scripts have editing powers, I can see how I could add a block to where the "cursor" is when I'm recording the song.
That looks like Working Model, from Knowledge Revolution, from the early 1990s. That was a great little program for Macs that let you build 2D machines. It was too slow and the physics engine was primitive, but I used it to figure out how to do robotic legged running up hills.
The CEO went on to found Roblox, which is much more successful.
One of the best things I've seen in a long time on here. It reminds me of a few different games; "Little Big Planet", "The Incredible Machine" and of course "Factorio" but this synthesises the best part... Inventing machines!
Thanks, one of the great things about creating a program where other people can create things is seeing them inventing things you wouldn't even think of, it's so open ended. Alan Turing and those other guys had no clue what we would do with his idea. I'm looking forward to see what people will make with this. (Not that I'm comparing myself to Alan Turing!)
org.clojure/clojure obviously, org.clojars.nakkaya/vecmath, org.clojars.nakkaya/jbullet, batik and lwjgl. All the other stuff, the opengl shapes and whatnot I wrote myself over the years, mostly to learn how to do it. In fact I probably can speed up this program a lot by not using my own code for those parts where libraries are available.
Thanks, it's a little hard to be sure, my first commit according to git is March 30th, 2018. On one hand, I did take months long breaks while I worked on other things since then, but I also have tried to build something like this once before, years and years ago, but it went nowhere back then.
This looks amazing. Several times in the last couple of decades, as graphics and physics engines have evolved, I've built little prototypes whose main goal was "this should work using real physics and mechanics", and then built things like marble machines. Games like Crayon Physics always felt so limiting; they were only about things bouncing off each other. I'd like gears that turn and mesh, light that diffracts, motors that naturally work in reverse as generators, and the ability to build machines that use more than one of those effects without any special-casing.
I look forward to playing with this, and extending it!
Thanks, once you are familiar with it you can start extending it right away, a couple of motherboards running custom short scripts could implement all those things you mentioned and then you could make that machine (for example the motor/generator) available for others to use on their own machines!
Most importantly, the amount of things in your shed increases exponentially with respect to time.
In the blink of an eye, you'll have old lawnmower blades (for when I start forging), a full shelf of two stroke engines (shame to throw them away, when they almost run), at least 3 power tools that have been used a total of once (but they were on sale), a "random fasteners" drawer, and an entire woodworking area. *
* Woodworking area may only exist in your mind if you're younger than 50.
I believe that comment was to be written as "If you are younger than 50, woodworking area could be still in plans. If you are older, you definitaly already have woodworking area".
My tip for anyone in that position is to start buying stuff, I bought the biggest portable table saw (in retrospect, not the best approach) I could find and progressed from there. At the time I lived in a flat and worked on a balcony.
My first woodworking project was to make a wooden work bench on which I could do subsequent woodworking. The bench is still firm, solid and in use 15 years later.
This looks amazing! Please consider making your website more accessible... the menu cannot be focused with the tab key, the images in your gallery do not have alt attributes. Those are some low hanging fruit you can correct. The overall strategy of toggling the main content with CSS might need some aria announcing so folks at least know different stuff is on screen as you move from one thing to another.
Again, AMAZINGLY COOL project, not wanting to take anything away from that. Just want everybody to be able to learn about it, even if they are not mouse users, not sighted, etc.
In order to make it fully accessible you might want to start from scratch and make a more traditional site that's not doing so much with JS to manage what content is on screen. Which might be more than you have time to deal with. But generally, when showing/hiding/navigating with JS, you are short-circuiting a lot of stuff you get for free with the browser (focus reset, announcing of changes etc.) and you have to reimplement a bunch of stuff in JS to get the same effect.
Sometimes it's worth it if what you are doing with JS is highly interactive & there's a payoff. But in this case, each thing of content could be its own page, and that plus a little more semantic HTML would do wonders.
You're probably right, it's just that I'm more of a programmer than a web designer (this is my first site) so I just built everything with Clojure/Clojurescript. But I'll definitely do that once I have some time.
I mentioned somewhere else here the libraries I used, search for jbullet with your browser and you'll find it. The rest I built myself. Clojurescript is just for the website. I don't have a background in mechanics, so no, not really. If anything I was trying to avoid the complications that real mechanical engineers have to deal with.
Feed it a directory structure with a couple of template files/markdown and it will spit out a website. It should be pretty simple to hack on. I've got a demo site [0], the source code for which is [1].
Feel free to shoot me an email if you've got questions, or if you want to tell me this is stupid, or if this looks like spam, or for whatever.
I'm available if you want to chat or work through anything in this space. Would be great if you can find a way to create your site that works for you and makes it accessible for everyone.
That's really cool feedback - and now I'm wondering if more projects shouldn't put their websites on GitHub (or similar) so people who want to contribute but who's skills are web/frontend focussed have an easy way to make updates and send pull requests?
I actually have started do this when I see an OSS project site that just needs some quick tweaks. It's easy to open the web editor and add missing labels or attributes or something.
This is one of the first things I’ve seen in a looong time that got me genuinely excited. I can see so many possibilities for the future. Kudos and great work, I think you have beginnings of something great on your hands.
Thanks, we do :). From now on what the program can do depends on what people build, the library machines they create so that other people can use them as parts and so on.
Very nice. I use some very expensive cad packages and for training and certain applications i think this is better. In my opinion you hit a home run. Nice job
I was working on an mini-game just like this using Unity but with lasers, some sort of kids game to learn the basics of programming concepts by completing simple puzzles, I lost motivation so its idle, so far it looks like this: https://i.imgur.com/MN4xm4j.mp4 (the T-shaped object represents an if-else, if blue go left else...), I was thinking of making orbs to represent lists/arrays and so forth, anyway I'm glad you stuck with it and I think it has a lot of potential.
149 comments
[ 2.6 ms ] story [ 205 ms ] thread[1] MockMechanics Introduction Video - https://www.youtube.com/watch?v=HrwxbQj5mj0&t=193s
[2] Tetris Machine Video - https://www.youtube.com/watch?v=cSPm1xxQ-qY
[3] https://mockmechanics.com/
I just watched the Tetris video and it reminded me of this mechanical pong game: https://www.youtube.com/watch?v=iBoe3yM9IKs
What inspired you to create this?
One of the topics I occasionally like to think about is how to formally describe manufacturing steps in some structured/programming language. Maybe your program could be it. Would love to hear other folks’ thoughts on this too!
Also, no one in this thread mentioned Opus Magnum from Zachtronics which has some quite neat mechanical movement in it.
It made me remember yesterday's post about SparkFun's new Al La Carte thing ( https://news.ycombinator.com/item?id=24920043 ) - and now I want a service that lets me design a machine in this using it's "standard parts", and then order a physical version of it :-)
I wonder if some combination of lego/mechano style components, 3D printing, and magnetic electrical connections for batteries/switches/leds/motors could work? (Somewhat like this: https://www.pinterest.com.au/pin/178314466469771331/ which I had as a kid way back...)
https://www.youtube.com/watch?v=CNbScb8v-MI
(someone posted this here on HN a few weeks ago)
Love your work from the little I have tested now.
Anyway I can contribute for translating into other languages?
Thanks for the offer, I'm dealing with so many moving parts here (pun intended) I hadn't even considered it. I think the most helpful would be translating the documentation, if you'd like to do that. Or posting a video explaining how to build something in the other language you speak would be great too.
It's refreshing to see this kind of exploratory project. Every now and then, I need to be reminded there's room for play and exploring in life, not just productivity and producing. Thank you for reminding me!
Mechanical analog computing FTW!
[1] https://en.wikipedia.org/wiki/ThingLab
The CEO went on to found Roblox, which is much more successful.
Very impressive!
[0] https://en.m.wikipedia.org/wiki/The_Incredible_Machine_(seri...
I look forward to playing with this, and extending it!
All jokes aside, this sandbox looks awesome and I want to play with it more. :)
In the blink of an eye, you'll have old lawnmower blades (for when I start forging), a full shelf of two stroke engines (shame to throw them away, when they almost run), at least 3 power tools that have been used a total of once (but they were on sale), a "random fasteners" drawer, and an entire woodworking area. *
* Woodworking area may only exist in your mind if you're younger than 50.
Why is that?
That sounds interesting; do you have a download link?
Again, AMAZINGLY COOL project, not wanting to take anything away from that. Just want everybody to be able to learn about it, even if they are not mouse users, not sighted, etc.
Sometimes it's worth it if what you are doing with JS is highly interactive & there's a payoff. But in this case, each thing of content could be its own page, and that plus a little more semantic HTML would do wonders.
Do I need any background in mechanics to build something like this?
https://git.sr.ht/~evan-hoose/SSSSS
Feed it a directory structure with a couple of template files/markdown and it will spit out a website. It should be pretty simple to hack on. I've got a demo site [0], the source code for which is [1].
Feel free to shoot me an email if you've got questions, or if you want to tell me this is stupid, or if this looks like spam, or for whatever.
[0] a-shared-404.com
[1] https://git.sr.ht/~evan-hoose/a-shared-404
https://youtu.be/gwf5mAlI7Ug?t=521
Mechanical algebraic computers for aiming systems
[0] https://logicworld.net/