News for hackers. Stuff that matters.
Re:Making a virtual machine in Google Sheets by SonOfLilit on Wednesday July 05, 2017 @09:00AM (#14702018)
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)

Re:Making a virtual machine in Google Sheets by SonOfLilit on Wednesday July 05, 2017 @11:16AM (#14703050)
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.

Re:Making a virtual machine in Google Sheets by taftster on Wednesday July 05, 2017 @03:43PM (#14705540)
> "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.

Re:Making a virtual machine in Google Sheets by SonOfLilit on Wednesday July 05, 2017 @04:09PM (#14705726)
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 :-)
Re:Making a virtual machine in Google Sheets by amirhirsch on Wednesday July 05, 2017 @12:28PM (#14703803)
I created a VM in excel in my master's thesis. Table 1-4

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

Re:Making a virtual machine in Google Sheets by SonOfLilit on Wednesday July 05, 2017 @02:27PM (#14704955)
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

Re:Making a virtual machine in Google Sheets by amirhirsch on Wednesday July 05, 2017 @09:29PM (#14707537)
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 :)
Re:Making a virtual machine in Google Sheets by ulucs on Wednesday July 05, 2017 @09:15AM (#14702125)
Re:Making a virtual machine in Google Sheets by SonOfLilit on Wednesday July 05, 2017 @10:42AM (#14702746)
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.
Re:Making a virtual machine in Google Sheets by tosaket on Wednesday July 05, 2017 @05:17PM (#14706187)
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.
Re:Making a virtual machine in Google Sheets by SonOfLilit on Wednesday July 05, 2017 @05:38PM (#14706337)
"Still"? I met him like three years ago. And the Israeli Xero/QB hasn't changed in like 20 years.
Re:Making a virtual machine in Google Sheets by samfisher83 on Wednesday July 05, 2017 @09:51AM (#14702359)
People have done some absolutely crazy things with Excel as well. To some people its like an OS.
Re:Making a virtual machine in Google Sheets by sogen on Wednesday July 05, 2017 @11:50AM (#14703396)
Wasn't there a flight simulator or a Doom a decade ago?
Re:Making a virtual machine in Google Sheets by euyyn on Wednesday July 05, 2017 @12:22PM (#14703740)
Excel had a flight simulator as an easter egg, but it wasn't written in Excel formulas or VBA :)
Re:Making a virtual machine in Google Sheets by khedoros1 on Wednesday July 05, 2017 @12:10PM (#14703617)
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.
Re:Making a virtual machine in Google Sheets by mikestew on Wednesday July 05, 2017 @08:08PM (#14707224)
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?

Re:Making a virtual machine in Google Sheets by wolfgke on Wednesday July 05, 2017 @05:44PM (#14706371)
Indeed - some people have implemented games in it: http://mashable.com/2014/08/27/microsoft-excel-games/
Re:Making a virtual machine in Google Sheets by lenocinor on Thursday July 06, 2017 @12:04AM (#14708058)
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.
Re:Making a virtual machine in Google Sheets by grenoire on Wednesday July 05, 2017 @10:12AM (#14702510)
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.
Re:Making a virtual machine in Google Sheets by SonOfLilit on Wednesday July 05, 2017 @10:21AM (#14702586)
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.

Re:Making a virtual machine in Google Sheets by briansteffens on Wednesday July 05, 2017 @11:20AM (#14703081)
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.
Re:Making a virtual machine in Google Sheets by SonOfLilit on Wednesday July 05, 2017 @11:46AM (#14703351)
I'd love to hear your thoughts. It's done! https://news.ycombinator.com/item?id=14703098
Re:Making a virtual machine in Google Sheets by ucaetano on Wednesday July 05, 2017 @10:22AM (#14702597)
Not really, circular references and iterative calculations are supported in Google Sheets, as in Excel.