Haskell, Ada, C++, Awk: An Experiment in Prototyping Productivity (1994) [pdf]
cs.yale.edu
cs.yale.edu
Haskell, Ada, C++: An Experiment in Prototyping Productivity (1994) [pdf] - https://news.ycombinator.com/item?id=19570776 - April 2019 (55 comments)
Haskell vs. Ada vs. C++ an Experiment in Software Prototyping Productivity (1994) [pdf] - https://news.ycombinator.com/item?id=14267882 - May 2017 (59 comments)
Haskell vs. Ada vs. C++ vs. Awk vs (1994) [pdf] - https://news.ycombinator.com/item?id=13275288 - Dec 2016 (68 comments)
Haskell, Ada, C++, Awk: An Experiment in Prototyping Productivity (1994) [pdf] - https://news.ycombinator.com/item?id=7050892 - Jan 2014 (24 comments)
Haskell v Ada v C++ v Awk... An Experiment in Software Prototyping Productivity - https://news.ycombinator.com/item?id=7029783 - Jan 2014 (23 comments)
I wonder what kind of an impact literate programming has on maintenance. Can't imagine rewriting 40 lines of commentary to suit a 2 line code change to be particularly enjoyable.
There is an exception though: runbook automation. When I write scripts to automate work that comes up when I'm on call, I try to write them in a literate style when I can, and commit them to a runbooks repo. The extra documentation is a lot more beneficial because they tend to be things that people aren't looking at regularly, and someone might be looking at it because of a 3am page or some urgent outage, so having a lot of documentation up front can be a big benefit.
Yeah, when I was on call, I'd have an ipython notebook up and running with access to all the systems I need to extract data and information from for doing investigative analysis. I feel like my intelligence drops 10% when a P1 would come in. Being able to map IDs in one system to another system so you can access a specific log can reduce much of the chaos.
I have the expectation of a "simple" 2 lime change that took 24 hours to resolve not require more than 4 lines of commentary.
However I fully admit it's not rational and try to work to change it.
It helps me to remember the end goal isn't just fixing the problem, but also preserving the biggest gotchas, limitations, and most important lessons learned.
Reflecting on and expressing the motivation of a task and providing the rational of how you accomplished it, the alternatives you considered, etc. will obviously bring a higher cognitive load along with it than just "winging it". My guess is that for non trivial systems the benefits generally outweigh the costs. In most environments you're likely to work in, the extra "upfront" effort is unlikely to get recognized, not by one's bosses, often not even by oneself.
I put upfront in quotes because I believe you don't just profit in the long term, explicitly thinking about the task and discussing / documenting the thought process generally leads to considering the problem more closely.
Having a well designed and documented system probably will also cut down on those "2 line bodge fixed" that are to cumbersome to document in the long run.
That said, it obviously depends on context, trivial code, throwaway code, boilerplate code exists...
But if you think you can get better data, we'd all love to see it...
I don't think it's this one but I do remember reading a very high quality study arriving at the same result as well.
Has anyone put this to the test on larger projects?
10,000 lines of Haskell have the same functionality as 100,000 lines of C++?
Have not seen any comparable in popular languages (except Modula 3, which is for same domain), nearest as for me, guard expressions of Erlang.
Anyway, a modern competition with Python, Swift, Java, Modern C++, Rust, etc would be interesting.
Java 1.0 wasn’t even available when this paper was written.
There are issues outside of the actual authorship of code you need to take into account if you want to choose Haskell. I'll leave it at that.
It's a fantastic language undoubtedly.
But if you've never experienced the maintenance and upgrade of a very large Haskell codebase over a period of years, especially if you have a big dependency-tree, and need to interface with external tools (database drivers, etc.) I'd urge you to talk to someone who has for a view into the experience. Also ask about the state of things like profiling and compiler bugs/memory leaks.
EDIT: I want to note that the state the general Haskell ecosystem/tooling has improved at a dramatic pace in the last ~3-4 years, with the advent of HLS and recent GHC releases.
If one comes to believe there is a language that really is a lot better, then you have to get to work building out the ecosystem around it to realize that, and it isn't easy!
Here is cloc run against the repo:
$ cloc .
75 text files.
75 unique files.
12 files ignored.
github.com/AlDanial/cloc v 1.90 T=0.08 s (788.1 files/s, 271069.0 lines/s)
--------------------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------------------
Haskell 29 2381 1321 15440
Markdown 5 393 0 1088
Bourne Again Shell 12 99 39 438
SVG 1 32 0 262
YAML 3 39 23 160
Dockerfile 6 35 54 104
Bourne Shell 8 3 4 99
--------------------------------------------------------------------------------
SUM: 64 2982 1441 17591
--------------------------------------------------------------------------------
I wouldn't say that this is a compressed version of a 100,000 lines of C++. I'm not adept at evaluating a Haskell source base to do a translation to C++ either.3-5kloc more and you would have a shell compiler!
It was only once when I saw problem that could be considered a bug.
But in real projects, are in wide use other pure functional langs (trying to write most popular first): - Erlang (telco, finance) - Lisp (finance, CAD) - Scala (basically universal) - Scheme (basically universal) - Elixir (frontend) - Clojure (don't know much, looks like also frontend).
But in most cases, they are sort of DSL, because functional paradigm is much better in some niches, but not so good in others.
I wish there was documentation of what the actual program and input data looked like. Something this text based.... it almost sounds like you could give it as an Advent of Code day 23 puzzle and somebody will have a Python solution done for it in 45 minutes.
If the codebases are publicly available it would be interesting to see how understandable they are.
Come to think of it, I wonder if they counted docstrings as documentation or code?
The developer(s) were probably quite experienced with it.
The larger the code base, and the stricter the correctness and performance requirements, the more you want to use something like Haskell, or F#, or Typescript, which allow you to exactly pin down and statically ensure certain things.
I've been using prolog recently and found really quite good. I've found myself thinking in terms of ontologies rather than hierarchies, which most over languages encourage.
In case it was missed, the lisp in the paper is a rational lisp.
In 1994 Borland had already gone through BIDS, Turbo Vision and OWL.
Apple was shipped AppToolbox alongside Metrowerks Powerplant.
IBM had CSet++.
Microsoft was shipping MFC since 1993.
In fact, 30 years later those frameworks still win over many missing features in the standard library, like networking and graphics.
It is really hard to write portable C++ code of small projects, because strings are different in nearly all major platforms.
But if You tied to one platform, platform specific strings, usually, are good enough for heavy usage.
Problem description and code, or it didn't happen.
Nevertheless, at Page 6 starts the chapter 3 which aptly named "Problem description".
The Haskell code for a problem solution is at Page 15. It is not complete, but it contains examples of what is called "combinators", from whose it is easy to deduce how authors approached the solution.
But, one needs to be aware of the notion of combinators and how they are usually constructed. For that, take a look at [1], a construction of parsing combinators. They start with a simple higher-order functional approach just like the solution exemplified in the paper we all discuss here.
[1] https://www.researchgate.net/publication/222837975_Combinato...
In the diagram, the Geo-Server takes input from Object Tracking and produces some output as well as a Log. It also takes input from a User Interface, and produces output back to it. Because of that extra multiplexing complexity, a front-end harness layer could be developed: something which interacts with the User Interface, Log, Object Tracking and Deployment, and loads the Geo-Server as basically a plug-in.