11 ms·
Excel-Virtual-Machine: C Compiler which targets Excel
- max_ 5y agoThe "blog post"[0] is an actual demo. Click "Run as spreadsheet". This is amazing for learning. [0]: https://mrthefakeperson.github.io/Excel-Virtual-Machine/ https://mrthefakeperson.github.io/Excel-Virtual-Machine/
- msarrel 5y agoIt never ceases to amaze me how Wall Street thinks every pipeline needs to flow through Excel. I couldn't believe it 20 years ago and it's even harder to believe today.
- behnamoh 5y agoIronically, 97% of the code is written in F#.
- boberoni 5y agoInteresting. I wonder the reason for this This is totally contrived, but I want to believe that this project is a learning project that the creator started to use F# to write a compiler. Perhaps the creator is experienced with imperative programming using C and wanted to do more programming in F# The reason to do such a thing is that implementing a compiler in a functional programming language results in very elegant functional code. There's an "Aha!" moment when you drop the imperative way of thinking and see how functional thinking can be expressive and concise, yet so very different I could see myself doing the same thing. It's a seductive intellectual challenge, difficult but achievable, to learn functional programming and write a compiler from scratch
- emodendroket 5y agoWell, functional languages are often considered a great choice for a compiler, but C is simpler to implement to F#, I'd imagine. The README says it has unfinished F# support too.
- deleted 5y ago[deleted]
- nazgulsenpai 5y ago> A2 acting as standard input, and cell B2 acting as standard output. This made me literally laugh out loud for way too long. This is the dumbest and most awesome thing I've seen in a while. I love it. Also doesn't seem to have been modified for 5 years.
- Infernal 5y ago“To ensure accuracy, do not disturb the spreadsheet before it is finished recalculating.” Sage advice indeed.
- hulitu 5y agoI learned it the hard way. Had an excel template which analised results from a test. It runs for 30-60 minutes depending on the amount of data. If you have another file open in excel and hope to work on it, forget it. Tried it, all data in the other spreadsheet was corrupted (results written in the wrong sheets due to other window being active). The only wise thing was to wait. This was helped by the fact that excel was using one core fully and the other 3 were thermal throtled so the laptop was unusable.
- rodikana 5y agoWhy? Because we can that's why!
- IncRnd 5y agoI think we need a compiler written in excel!
- im_down_w_otp 5y agoSheets for modules. A column for each function. A row for each line of code. I weirdly would love to see this.
- mikaraento 5y agoThat is pretty much how macros worked in Excel 4.
- kitd 5y agoI once wrote an x86 assembler in Lotus 123.
- exikyut 5y ago[Need for citation intensifies]
- kitd 5y agoApologies, this was over 30 years ago! IIRC it made extensive use of lookup tables, both building them and being driven by them. It wasn't a complete implementation, but it proved the theory and scratched an itch.
- exikyut 5y agoThat's really cool :) and makes perfect sense. I can see what you mean about it scratching an itch. Definitely piqued my interest! (Varying "citation needed" didn't quite convey genuine curiosity the way I thought it would.)
- tambourine_man 5y ago> The compiled Excel file can be executed by triggering iterative calculation (pressing F9 repeatedly) I know very little Excel, but can’t you create a loop with it?
- Jtsummers 5y agoNot without dropping into VBA, at least last I looked. The cell dependency graph should form a DAG. If there is a cycle, it will break (Excel will detect this). A common way to produce a "loop" is to create a row for each iteration depending on the one above (which can actually be handy to see convergence and intermediate values). This means there's no way to do something like: // initial A1 = 0 A2 = 100 (the limit) A3 = =A3+A1 (self referential, 0 initial) // somehow A1 = 1 A2 = 100 A3 = =A3+A1 == 1 If you could refer to previous values it might be possible, but would also force some synchronization into the process that might be problematic. Like you'd need A1 to only update after A3 has had a chance to read it, then the next, then the next.
- RuggedPineapple 5y agoThis sounds like we're going to learn about macro and VB viruses all over again.
- gizmo686 5y agoExcel supports iterative calculations, which allows you to use circular references. If you enable it, you need to specify a maximum number of iterations excel will run on each update. I believe you can also specify a minimum delta which will cause Excel to terminate early if subsequent iterations differ by less than the delta. I suspect the reason you need to press f9 repeatedly is this project uses circular references, but running your program takes longer than the maximum number of iterations, so pushing f9 allows it to run for another set of iterations.
- Jtsummers 5y agoThat makes sense, I've never made use of that. Apparently that was available as early as Excel 2007, I've just never come across it and haven't used Excel for much more than a scratchpad in years now.
- cube00 5y ago"Your scientists were so preoccupied with whether they could, they didn't stop to think if they should."
- punnerud 5y agoThat is how a lot of innovation start. That can benefit the company many times the combined time of these kinds of “procrastination”. It is also a way to give employees motivation. How else do do figure of “what you don’t know that you know”?
- janjones 5y agoMotto of many technical posts on Hacker News front page.
- BurnGpuBurn 5y agoThe reference to Jurassic Park* is actually quite on point, given the dinosaur vba is. *) I remember Jeff Goldblum saying something along those lines, though I imagine the quote could've come from someone else.
- kwhitefoot 5y agoI think the knee jerk hatred of VBA is really odd. No other language has given more people an opportunity to create the tools they need.
- chrishere 5y agoThere was a time when we used Excel Services in SharePoint to meet some of our business user needs. I wouldn’t use Excel again, but back then it seemed to be a good trade-off between time-to-market and usability (meaning performance for most of the time). Anyhow, we use https://github.com/handsontable/hyperformula https://github.com/handsontable/hyperformula to run calculations in our other components these days.
- youaredaniel 5y agocool
- cbsmith 5y agoThe always required: "Your scientists were so preoccupied with whether they could, they didn’t stop to think if they should."
- Extigy 5y agoThis is disgusting. I love it.
- cloudhan 5y agoThen we need a powerpoint virtual machine[1]. [1] https://www.andrew.cmu.edu/user/twildenh/PowerPointTM/Paper.pdf https://www.andrew.cmu.edu/user/twildenh/PowerPointTM/Paper....
- nickdothutton 5y agoThe Dwarves dug too greedily and too deep. You know what they awoke in the darkness of Khazad-dûm.
- deleted 5y ago[deleted]
- SonOfLilit 5y agoSee also: brainf*k in Google Spreadsheet https://news.ycombinator.com/item?id=14703098 https://news.ycombinator.com/item?id=14703098
- keithalewis 5y agoThis is quite clever, and probably a joke that I'm not getting, but the Excel C SDK lets you call C/C++ from Excel and vice versa. This is one of my bread and butter tools, and I like nice tools, so I wrote a C++ wrapper around the SDK. It also lets you embed C++ objects in Excel: https://github.com/xlladdins/xll https://github.com/xlladdins/xll