Show HN: A virtual machine made with Google Sheets formulas (no script)
620 pointsIn a popular post today[1] the title claims "VM in Google Sheets", but it's actually in Google Script, which is basically Javascript and not an interesting technical accomplishment (definitely a useful educational tool, though).
Disappointed, I set out to fix it. Voila!
https://docs.google.com/spreadsheets/d/1g3-FZBnkDuLqFYOmk457...
A Brainfk interpreter in pure Google Sheets formulas. The hard part was parentheses matching, so I think other VMs would be even easier.
[1] https://news.ycombinator.com/item?id=14701460
Comments (37) 9 threads
Show all comments
Showing thread 2 of 9
A comment about how you have presented this - not everything has to be an interesting technical accomplishment.
Creating beginners is a much harder skill and topic than most realize.
Making topics easy to approach and learn is often much harder than learning the technical topic.
Impressive how quickly you whipped this up
It's just that I clicked hoping for one thing and found another, so I felt a need to show that the second one is also doable :-)
Also, it took me more than I expected. I had to go through a couple of wrong approaches and some confusion until I figured out bracket matching, and also had a bug or two that took a while to debug in the interpreter table. These things aren't hard to make! Try it sometime :-)
It started with a programming course I founded for data analysts in my army unit that taught them enough Python and sql and requests and win32com to be able to automate significant parts of their own jobs, creating a lot of value, and I wanted to figure out how to teach the same course outside.
The answer was "nobody outside the army knows how to deal with losing an employee for 3 weeks", so we cut the material again and again and even at the minimum we could reach - 80 hours - we couldn't make a single sell.
So my cofounder quit and I started playing with different models of teaching, and found out that there are huge benefits to teaching with a computer game (more fun, more engaging, more self-driven, but mostly - you get so much data and can optimize your lessons so fast... I really don't understand why e.g. Codecademy don't do a lot more data-based micro-optimization).
I partnered with some people that sold after-class activities to middle schools and we sold a lot more courses than we planned, so I had a frantic year of supervising the teaching of 14 courses while trying to amend my weekend prototype to teach the whole material. On the way I developed a bunch of other nice teaching activities.
But working alone sucked, so I put it on hold and went looking for the best team I could find for my "real" startup (this one was started with the explicit intention of failing but learning as much as I can, as I was pretty clueless in business at the time).
I strongly believe in educational technology as an efficient way to improve the world (though a bit less than I use to as a way to get rich). I fully intend to return to working in the field when I'm no longer needed at FeezBack (sorry, again we're Israel-only at the moment, so no links).
בהצלחה!
Would love to learn and chat a bit more about your previous startup (I see you have posted below and will reply there).
I would say that the original submission illustrates much better how simple a CPU is. And it actually exposes the user to syntax (ASM) and concepts (program counter, registers, memory usage, stack, etc) that directly transfer to basic CPU design. Your version, while technically more impressive, buries this under formulas and the particulars of parsing a language nobody uses.
FWIW, I agree with j45 that you presented this poorly. From being "disappointed" and "fixing" another user's submission, to your token parenthetical (in which you actually did not "make sure" to say it was "very impressive"). It all seems a bit condescending and arrogant for someone who would be an educator. Compare the tone and demeanor of his comments on your submission (positive, supportive) to yours on his (negative, critical).
I've used Brainfuck in some educational contexts (like the talk on virtual machines that I gave in PyCon IL a few weeks ago and in a local python meetup before that), although not yet with complete beginners.
It's useful in some contexts and not others. It's especially useful when some of your audience has heard of it before.
It's especially useful because it lets me mention other "war stories", like this one (students love war stories): https://news.ycombinator.com/item?id=7943514
Before I teach asm, I always take 1.5 hours to teach an exercise I once developed called the "shirts exercise", which is about optimizing code for a simple and very intuitive vm that looks a lot less like real asm than Brainfuck does (for example, it has conservation of material). Real asm has so much incidental complexity and I prefer to show the beauty and motivation for learning it before we start learning about number encoding etc'.
The reason to use this spreadsheet is that it's written in a format that my students would be able to follow and understand. So if I tell them "this is exactly how a computer is built", I hope to demistify a bit the idea of a computer. A good programmer is a programmer that is not afraid to dig into abstractions.
Continue this thread — 3 replies