6 ms·
30 years ago Haskell was the winner. Conciseness was a major feature. Has anyone put this to the test on larger projects? 10,000 lines of Haskell have the sam
by melling 4y ago
30 years ago Haskell was the winner. Conciseness was a major feature.
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++?
- Ingaz 4y agoHasura (https://github.com/hasura/graphql-engine https://github.com/hasura/graphql-engine) is quite big project. Although it should be less than 100K LOC. It was only once when I saw problem that could be considered a bug.
- nine_k 4y agoHaskell was mere 4 years old in 1994.
- simne 4y agoHaskell is too special, to be used in typical large project. 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.
- amelius 4y agoSounds great except it takes 10x as much time to read/write the Haskell code versus C++.
- MaxBarraclough 4y agoPage 9 shows Haskell scoring very well for development time when compared against Ada. C++ development time was unfortunately not reported.
- synack 4y agoAda projects tend to start slow, but readability and flexible namespacing make refactoring and maintenance much easier.
- simne 4y agoOh, yes. Have touched Ada in VHDL (using Ada declarations syntax), declarations in Ada are very long, but extremely powerful. Have not seen any comparable in popular languages (except Modula 3, which is for same domain), nearest as for me, guard expressions of Erlang.
- melling 4y agoThe chart did indicate that 85 lines of code did take a while to write but the 1100 lines of C++ likely took longer. Many developers claim that Haskell code has fewer bugs. Program correctness counts for something. 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.
- ddejohn 4y agoFun fact: Python was 3 years old at this point.
- eddsh1994 4y agoI worked on https://github.com/input-output-hk/cardano-node https://github.com/input-output-hk/cardano-node if you want to see a large haskell code base
- gavinray 4y agoI work at one of the largest Haskell-in-production companies in the world 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.
- jackmott42 4y agoYeah an important lesson for programmers is that for big projects the ecosystem around a language is usually more important, for any given metric (productivity, quality, performance), than the language itself. Python being used to do high performance math all the time is a good example of this. Python the language isn't at all good at that, but the ecosystem has nice libraries with high performance C code underneath them. 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!
- commandersaki 4y agoThe most successful haskell project I've seen in the wild is shellcheck [0]. 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. [0]: https://github.com/koalaman/shellcheck https://github.com/koalaman/shellcheck
- nine_k 4y agoI bet pandoc [1] is even more successful, in the sense of pretty wide use. [1]: https://github.com/jgm/pandoc https://github.com/jgm/pandoc
- sitkack 4y agoThat is amazing! "Every good regulator of a system must be a model of that system" [1] So not only does the Haskell code encode a shell, but also a type inferencer and type checker, all in 18kloc. 3-5kloc more and you would have a shell compiler! [1] https://libgen.is/scimag/10.1080%2F00207727008920220 https://libgen.is/scimag/10.1080%2F00207727008920220