Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A virtual machine in Excel (hackaday.com)
83 points by ColinWright on Dec 26, 2014 | hide | past | favorite | 8 comments


There's a well-known technique for solving certain types of equations by making use of circular references, and people have simulated digital logic too (e.g. http://mypage.uniserve.ca/~jeffsch/writing/SimPage.html and http://makeyourownchip.tripod.com/flipflop_simulator.html ), but this is something even more ambitious. I wonder if this virtual machine could be driven by using a circular reference as an "oscillator" ( http://en.wikipedia.org/wiki/Ring_oscillator ) to increment a counter, and use that to fetch and execute instructions... the amount of actual functionality needed to implement a rudimentary CPU is surprisingly small.

The actual system a spreadsheet would best simulate is known as a "systolic array": http://en.wikipedia.org/wiki/Systolic_array

I don't know if it's something to do with culture but for some reason I see far more of this "lateral thinking" and clever creative solutions coming out of Europe and in particular East Europe and Russia than North America - look at the demoscene, for example.


I also live in Hungary and there is a saying "a Hungarian can enter the turnstile after you and leave before you" which is quite true. Everyday life here involves a lot of hacking/tinkering mostly because of the repercussions of bad decisions of our (not only past) leaders.


I think the correct quote is "If a Hungarian passes through a revolving door right after you he will come out before you". Many fellow Hungarians keep bringing this up because they think that it's a positive thing expressing how clever Hungarians are while in reality this is not exactly intended to flatter anyone. :)


Thanks for the correction. I don't think that it is either positive or negative but it is true in general. In some cases it is useful but sometimes it annoys others.


It may be a result of a culture of fixers and makers. I think we are quite spoiled here in the West and many of us have never fixed something let alone made something of any real complexity or utility. Fixing and making trains the brain to look for solutions by re-purposing items for unintended uses which can apply quite well to building applications.


In a discussion on HN of sedchess, VladRussian2 post this relevant link: http://en.wikipedia.org/wiki/The_Tale_of_Cross-eyed_Lefty_fr...


It is quite fascinating that the localized Excel function names do not have some kind of internal reference/ID so a spreadsheet's language could simply be set by the user.


I think the problem with that is that Excel has a few 'almost like eval' functions. For example, SumIf takes a string like "> sin(2)". You would have to translate those strings at runtime, and may have to guess at the source language (that string might be input by the user)

Even if that isn't the case, the engine cannot know whether any macro will change formulas. There, you hit the really troublesome area. VBA has a full eval (http://msdn.microsoft.com/en-us/library/office/ff193019%28v=...). Even ignoring that, things can get hairy because Excel localizes numbers (is that comma a decimal point or a thousands separator?) and list separators (does one use commas or semicolons as argument separators?)

I expect there are some edge cases here that makes this problem unsolvable in practice. Some people will have code that checks whether the string representation of a cell's value contains a comma to check whether it is >= 1000 (or <= -1000.00, but relatively, that is a 'minor' bug)




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

Search: