TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Write your own Excel in F# (2018)

401 pointsby eDameXxXover 5 years ago

11 comments

donatjover 5 years ago
I was lead developer for a company ten years ago who developed tools for industrial companies. We had a steel rack manufacturer approach us with a panic inducing spreadsheet of the calculations they needed. It was 8 very full worksheets and included everything you could think of, including seismic data by zip code.<p>To build this proper was going to take our small team at least a couple months. The sales people didn’t like this. I had an idea however to extend a SpreadsheetML parser I’d written a few years prior with a formula evaluator. I had a prototype working within a couple days, I reimplemented a large number of Excel functions warts and all, and since Excel saved all the last computed values along side the formulas it was easy to automatically test. It was the first project that really taught me the value of unit testing.<p>It was a fun project and took around a month in the end, which was still over the amount of time sales had given us. The client actually sent us a fair number of revisions to the spreadsheet such that had we built it out any other way would have been a major project, but was as easy as swapping the spreadsheet the tool read. I left the company a few months later but I was sad to hear from coworkers they never did anything else with the tool. I thought it was a really neat hack.
评论 #20794627 未加载
评论 #20793776 未加载
评论 #20794840 未加载
slx26over 5 years ago
my typical experience with these kinds of things: I start looking at the source code, and the code is actually simple and short, the logic is easy to follow (make a grid, allow and process formulas in cells, display the grid and some additional edit-mode display if you are editing a cell)... but then I start seeing dependencies, references to other frameworks and multiple languages, libraries... and all that looks so confusing! the dependencies require at least an order of magnitude more knowledge to be understood or used effectively than what we are being shown in the post; that&#x27;s the really tricky part to me. don&#x27;t mean to criticize that, those are probably very powerful tools that in most cases you want to know about and use (if you are working in that specific environment), but it&#x27;s like... are those 100 lines of F# even that important? writing your own excel sounds nice, but I feel it&#x27;s more &quot;how to glue a bit of F# logic to a web-compatible UI&quot; (well, yeah, one could argue those are really the same things).<p>&gt; &quot;The final spreadsheet application is quite simple&quot;<p>Is it? I easily understand the logic of the F# code, but I couldn&#x27;t make another &quot;similar&quot; application so easily unless I was just copying the dependencies. I wouldn&#x27;t really know what I&#x27;m doing, maybe it&#x27;s not so simple!<p>(this isn&#x27;t meant to be a criticism to the article itself, I just wanted to share this uneasiness I get when checking some code I don&#x27;t know much about that&#x27;s presented as &quot;simple&quot;&#x2F;&quot;short&quot;&#x2F;...)
评论 #20792380 未加载
评论 #20792663 未加载
评论 #20792569 未加载
评论 #20793669 未加载
jeanmichelxover 5 years ago
Fantastic example of how to structure a real life (ish) application with functional programming. I don&#x27;t know any F#, but I can see how to apply this to imperative languages and make them easier to debug
iddanover 5 years ago
I implemented a React component with a subset of Excel features and additional customisation features: <a href="https:&#x2F;&#x2F;github.com&#x2F;iddan&#x2F;react-spreadsheet" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;iddan&#x2F;react-spreadsheet</a>
xixixaoover 5 years ago
How does F# on Fable compare to Elm and Purescript, and how is each doing these days?
评论 #20792058 未加载
评论 #20795180 未加载
Nelkinsover 5 years ago
Fable&#x2F;Elmish is a cool combo, I&#x27;m writing really simple admin tool for work with it now and really enjoying it.
enzover 5 years ago
Thanks for sharing. I&#x27;ll try to write an equivalent code using Rust for learning purposes. Since it has algebraic datatypes too, it should be fine.
aardvark291over 5 years ago
How does F# compare to OCaml or Haskell?
评论 #20792444 未加载
rishav_sharanover 5 years ago
If anyone is interested in gamedev in F#, try Xelmish. Its F# + the elm architecture + monogame
ape4over 5 years ago
Value of this cell = formula which may depend on other cells
jimbob45over 5 years ago
The coolest part is that it&#x27;s in F#. Add that to the title. How many F# samples do we get around here anymore?
评论 #20792015 未加载
评论 #20792051 未加载