7 ms·
Spreadsheet-like programming in Haskell
- gcv 12y agoI wrote something similar for Clojure: https://github.com/gcv/dgraph https://github.com/gcv/dgraph
- dkersten 12y agoI don't know enough Haskell to really know what the article is talking about, but to my very untrained eye, the idea also seems a little like this Clojure library: https://github.com/tailrecursion/javelin https://github.com/tailrecursion/javelin
- mtford 12y agoI know a few of the investment banks have this kind of thing internally, implemented as a DAG: http://en.wikipedia.org/wiki/Directed_acyclic_graph http://en.wikipedia.org/wiki/Directed_acyclic_graph. Cool stuff.
- agumonkey 12y agoMany reactive dataflow programs are DAG based (at least most major 3D/CGI packages are). Simple and powerful.
- seanmcdirmid 12y agoMy reactive programming language can handle cyclic dependencies; DAGs are too inexpressive for general use (e.g. iterative computations). Getting that to work correctly is kind of scary though (especially when non-monotonic change is also supported).
- a-saleh 12y agoWhat language would that be? I have skimmed through your papers, and they seem interesting, but can't find any downloads to play with :-)
- seanmcdirmid 12y agoYinyang still. I want to release something soon, but need to find a purpose for it; right now it's just fly by night language design. I was also thinking about porting the editor to mono.cairo so more than just win users could play with it (going to javascript is a no go given no multithreading with shared memory).
- ntoshev 12y agoI guess "working correctly" for cyclic dependencies means you need to introduce the concept of time and be careful to update everything in the proper moment? What is this useful for?
- seanmcdirmid 12y agoSee http://research.microsoft.com/apps/pubs/default.aspx?id=211297 http://research.microsoft.com/apps/pubs/default.aspx?id=2112... if you haven't already. I have both time and phases; time is used for versions and discrete updated via event handling; phases are used to ensure state doesn't get "stuck" in a cycle on a non-monotonic change. Rollback is used instead of carefully updating anything in the right order, phases however suppress when updates can be seen during processing. It's generally useful for writing reactive, incremental, iterative programs.
- judk 12y agoWhenever I have tried spinning up a GUI on Haskell, I have always met with disaster. I think only a native (not Virtual Machine) Linux installation is the only hope, and that still is tricky. Frustrating.
- creichert 12y agoHave you tried HsQML? http://hackage.haskell.org/package/hsqml http://hackage.haskell.org/package/hsqml
- davorak 12y agoI have not had a problem on nixos on my VMware fusion box, or the same set up on my desktop. Nixos has nearly atomic package management so it is easy to set and deconstruct environment or try multiple solutions out in parallel in different profiles.
- transfire 12y agoA really great example of why Haskell will be forever relegated to academic circles.
- ef4 12y agoYour prediction is already false. It's extra-silly coming in the same week that Facebook open-sourced a piece of their own infrastructure written in Haskell. And I'm sure the high frequency traders using it would chuckle to hear that they are "academics".
- ColinWright 12y agoWhy do you say that? Your comment seems to be entirely negative, and you seem to have seen something that I haven't. Please can you expand on it? In particular, the cynical part of my mind wonders if it's simply because you can't read the code, and because of that haven't really bothered to follow the argument. I'm sure you must have deeper reasons that that, and I, for one, would appreciate an explanation of your reasoning.
- msie 12y agoAs a newcomer to Haskell may I offer an explanation: the article is full of jargon and thus hard to follow.
- lomnakkus 12y agoThat's definitely a valid criticism of the article, but not really an explanation for the OP's post AFAICT.
- ColinWright 12y agoYes, it assumes some knowledge of the language. But imagine if every article about, say, Ruby, had to explain things in a way that someone who'd only ever seen C would understand? Authors would be hamstrung, unable to talk about things at any level other than the most elementary. If you're going to talk about the power of a language you have to allow the use of language that talks about that power. To talk about what you can do in Haskell beyond toy problems you need to allow people to use more than just toy language. If readers aren't willing to do any work, its tough to help them learn anything new.
- tremols 12y agoI am experimenting with something similar for a java web framework https://github.com/constructo/chemflow https://github.com/constructo/chemflow . Its kind of sketchy right now but achieves the spreadsheet-like programming nicely.
- tremols 12y agoTo ellaborate a bit further, I don't know haskell but I can agree that the authors code doesn't look like spreadsheet programming. My approach is inspired by join calculus which is centered on the concept of waiting on a set of signals/cells to trigger a reaction (I ignore the concurrency capabilities of join calculus which make it a bit more complex). It seems to me that FRP takes the long route to achieve this since its focused on event handling. Anyhow, this can be easily achieved with a simplified cactus stack where each stack "frame" holds a reference to its parent so that it notifies its parent when its value is set, then when all of the stack frames are ready the procedure associated to it is triggered. This type of stack has some interesting capabilities including memory friendly infinite recursion and compound-key data structures. I believe that it has potential for artificial intelligence and the development of modern dataflow languages.
- lifeisstillgood 12y agoI have two takeaways from this - first is that spreadsheets are an accessible metaphor, and grok'able by many for whom coding as we know it is too long and hard to learn. So on the surface I think the superficial thrust of this is rather blunted. But, and it's a really big but, software is the new literacy. And it is long and hard to learn to read and write, but we force our children to do it as a society because of the orders of magnitude benefits. And so the same will become true of software - but not at the paltry expressive level of say, pg's Blub language - but at something Haskell is trying for. I say there are three kinds of stages of sophistication for a person or a company - not coding, automating and compiler. We want our children to be operating at the compiler level - so we want them to be using the languages Haskell will evolve into. Now where did I put my copy of SICP? Edit: Blub language not Blah...
- cwyers 12y agoLooking at the example video provided I feel like I must be missing something; it doesn't really resemble a spreadsheet to me.
- mpweiher 12y agoYep. That's something I see a lot when looking at stuff from the FP community: map a commonly used term onto something that is easy to do with FP, losing almost all relevant properties. Then claim how the ease of doing <commonly used term> in FP shows the superiority of the FP approach.
- davorak 12y agoDo you have any examples I can look at?
- davorak 12y agoIs it the limited number of cells that makes it not resemble a spreadsheet or another feature?
- cwyers 12y agoThe limited number of cells, the use of up/down increments to change values instead of typing, the lack of row/column coordinate system, the lack of any kind of an apparent way to operate on multiple cells at once, the fact that the cells don't actually look like cells... it's a lot easier to come up with ways it doesn't resemble a spreadsheet than ways that it does.
- davorak 12y agoSure it is a proof of concept and is about the spreadsheet computational model not making a full fledged spreadsheet application like Microsoft excel. I thought you meant you saw some significant barriers to a full implementation or something fundamentally different in the underlying model that was not spreadsheet like.
- thinkpad20 12y agoThe article claims to be about the power of Applicative (and/or spreadsheets?), but I've been writing Haskell for about a year and am comfortable with all of the canonical Haskell abstractions including `Applicative`, and this made basically zero sense to me. Beyond familiarity with Applicative, the author also assumes the reader has facility with Controller, Fold, Managed, View, the Pipes library, Lens, and a host of functions I had never seen, such as last (not the Prelude version), stdinLines, tick, and runMVC. Assuming this, he throws out the definition of Updatable on top of that like it makes perfect sense ("just a Fold sitting in front of a Managed Controller". Oh, well then.). Basically, two or three paragraphs in and I am already completely lost. I don't even know what problem it is we're trying to solve, and I have no idea what it has to do at all with spreadsheets. This is one of the downsides of Haskell; with so much emphasis on abstraction, code often ends up being just that: so damn abstract that it's practically inscrutable except to the very few who are familiar with what's going on. I guess this article was written for an audience with very broad and detailed knowledge of some complicated Haskell libraries -- meaning it's not so important that anyone else be able to make head or tails out of what he's talking about. Which is ok, but it does add to the impression that Haskell is an exclusive club. Also, this part sticks out as confusing: The type signature of `example` does not include IO (unless Updatable has IO on under the hood), and yet the language above suggests that it will change, i.e. that it is mutable: > example will update every time lastLine or seconds updates, caching and reusing portions that do not update. For example, if lastLine updates then only the first field of Example will change. Similarly, if seconds updates then only the second field of Example will change. Can someone clear this up for me?
- gcv 12y agoI confess that I also do not understand the code in the article. (But I am still only a student of Haskell.) I can only guess, based on my own work with this idea of Cells-type programming, that the author means the following: Suppose you have three data nodes, or cells: A, B, C, and D. A holds the value 5, B holds 3, C is defined as A+B, and D is defined as B*C. In a spreadsheet, changing cell A will automatically update C, because C directly depends on A. It will also update D because it transitively depends on B through C, and C has changed. This library (and the Clojure one I mentioned in my other post) lets you define data structures which behave the same way. In a pure environment, you can emulate this using only functions. In a non-pure environment, automatically updating values can be quite nice. You use this to implicitly trigger linked behaviors. In a UI, this could mean changing the state of several elements in response to some input without having to explicitly say updateElementA(), updateElementB(), and so on.
- Haskellwhen 12y agoI am eager to learn a new paradigm, haskell look interesting but reading the post make me thing that a great language needs someone great at explaining the core concepts, ideas and problems. Haskell for all seems to be a contradictions because to be understood by all is expensive in time and effort. Hope to learn more about haskell.
- klrr 12y agoLearning Haskell is a deep rabbit hole. Make sure you decide when it is enough, there's tons to learn and you can't be an expert on everything and you don't have to programming in Haskell.
- eddyparkinson 12y agoWeb App builder: Turning the idea upside down, this helps smart non programmers create software with a spreadsheet. www.cellmaster.com.au (I only have a few early adopters).