Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Oh, man. This is a VM in JS ("Google Script") with a UI in Google Sheets.

If I had more time I'd post a VM in Google Sheets formulas only.

Anyone want to take it up?

Edit: hold my beer (see my reply below)



OK, Gimme back my beer, it's done!

A Brainfk interpreter in pure Google Sheets formulas. I chose BF because of how cool and simple and powerful and turing complete it is and because I have a lot of practice implementing it (Just gave a talk at PyCon IL where I live coded one, https://www.slideshare.net/AurSaraf/virtual-machines-and-bra...).

Of course it would be at least as easy to implement any other virtual machine, you might not need the parentheses matcher which was the biggest challenge and I had to go through a few designs until it worked.


> "OK, Gimme back my beer, it's done!"

2 hours later. In BF none-the-less. You're my hero, you put me to shame.


These things are so much easier than they seem. I just did a PyCon IL talk where I livecoded a BF interpreter just so the audience gets a feel for how easy it is. Try sometime :-)


I created a VM in excel in my master's thesis. Table 1-4

https://dspace.mit.edu/handle/1721.1/45983


Wow, this is extremely cool.

You created a VM in Excel and a VM that runs Excel in an FPGA, proving equivalence of Excel and an FPGA :-P


Try implementing a simple FPGA in Excel. 4-input look-up-table: MID(lutcell,bin2dec(concat(inputcells),1) and hten the input cells can be done with OFFSET to support programmable routing. You can set the values by hand at first, but then connect it to your VM to load in bitstreams :)



I have met an accountant with no knowledge in programming that wrote an entire accounting suite in an excel spreadsheet, which he would copy for each client.


You would be surprised how many accountants still do that. Accountants are a finicky bunch and they don't trust what a cloud accounting platform such as Xero/QB spit out, so they end up writing their own "custom software" in excel.


"Still"? I met him like three years ago. And the Israeli Xero/QB hasn't changed in like 20 years.


People have done some absolutely crazy things with Excel as well. To some people its like an OS.


Wasn't there a flight simulator or a Doom a decade ago?


Excel had a flight simulator as an easter egg, but it wasn't written in Excel formulas or VBA :)


Excel 97 had a sort of flight simulator. Excel 2000 had a car game. Earlier versions had other little easter eggs, but I think that Microsoft cracked down on them after Excel 2000.


Turns out the federal government to which Microsoft sells wondered, “if they’re sneaking in flight simulators and dungeons, what else are they sneaking in?” That’s the version I was told, anyway.

That, and Easter eggs are another attack vector. How much of a security audit do you think those get?


Indeed - some people have implemented games in it: http://mashable.com/2014/08/27/microsoft-excel-games/


My favorite is the Puerto Rico Evolver ( http://www.tropiceuro.com/puerto-rico-evolver/ ), which both allows you to play (vanilla) Puerto Rico (the board game), AND evolves to your playstyle as you play. Pretty amazing.


I am 99% sure you cannot do that. Cross-referencing cell loops are detected and prohibited, so you cannot even make a tape reader. Also, I'm not sure if you can set cell formulas with formulas either.


Well, I already have parentheses parsing working, which is the biggest challenge. The rest should be really easy.

Of course I'm working on Brainfk, both because of how cool it is and how simple for a Turing Complete VM. Also, because I have a lot of practice implementing it (https://www.slideshare.net/AurSaraf/virtual-machines-and-bra...)

https://docs.google.com/spreadsheets/d/1g3-FZBnkDuLqFYOmk457...

Stay tuned.


Awesome! I originally wanted to use only cell formulas to do this but couldn't figure out how to modify cell contents from other cells. Can't wait to see what you put together.


I'd love to hear your thoughts. It's done! https://news.ycombinator.com/item?id=14703098


Not really, circular references and iterative calculations are supported in Google Sheets, as in Excel.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: