5 ms·
"Relatively easy to understand even if you don't know the language" <- We have empirically verified this by showing code samples of quicksort side-by-side in Ja
by rahulmutt 10y ago
"Relatively easy to understand even if you don't know the language" <- We have empirically verified this by showing code samples of quicksort side-by-side in Java, Scala, Clojure, and Eta to ~100 programmers who had no experience with functional programming at an exhibition. Eta won, followed closely by Scala (people just love their curly braces!). One person liked Clojure because of "it looked like English" and no one liked Java. For this reason, we have posted it on the landing page. We have made no claims that it's the most performant nor that it's the fully correct quicksort (accounting for uniques) - the whole point was to highlight the expressiveness.
- taeric 10y agoI'm curious, though, if this is really applicable. There are two problems, to me. First, this is not a good implementation of quicksort. Second, it is not often that people will be implementing quicksort.
- rahulmutt 10y agoI agree that it's not a good implementation, as I said it's for illustrative purposes. You also don't implement the "Hello World!" program ever in real life, yet every programming language intro starts with that. Relative to that, a sorting algorithm is a lot more instructive. I think if I changed the name of 'quicksort' to 'sortUniqueList' that would clear things up.
- taeric 10y agoHmm... fair. I am criticizing something without a suggestion. I don't have one and I confess that worries me. In trying to teach my children, I have actually grown away from the "this is what the code looks like" to examples. And I commend the site for doing that. 2048 seems like an odd example, but conciseness is the goal, I'm guessing. Still a fun one. (Snake would be more fun for kids, I'm guessing. But that is just a guess.)
- rahulmutt 10y ago2048 was just convenient. It just so happens that there was an existing Haskell project that used the native GLTK library. I just swapped that out with JavaFX and it worked. If I were to write a book on Eta, I would certainly use a simpler game! I personally learned to code as a child by playing with examples and developing a game, so I can bet your kids are going to grasp programming fast. The human brain learns naturally from examples as opposed to theory.
- js8 10y agoIf I understand you correctly, you basically verified this for Haskell (which you call Eta), since there are no visible differences with Haskell yet. Why make another language anyway, if your experiment shows that Haskell is readable? You're saying that the problem with Haskell adoption are lack of tooling and documentation, which can surely be resolved without having to design another language. In fact, I don't think bad language design hindered adoption of any language ever (examples: COBOL, APL, MUMPS, BASIC, PHP, Javascript). I wish you wouldn't break compatibility with Haskell, ever. I think it would make both languages stronger (if they were just one), since everybody could just reuse code. I don't see a reason for having another language just to fix minor syntactic problems. Edit: I think what I am not clear about is where exactly do you intend to break the compatibility with Haskell and how do you think that action will help adoption of your language.
- rahulmutt 10y agoCheck out the FAQ: http://eta-lang.org/docs/html/faq.html http://eta-lang.org/docs/html/faq.html. For the record, I love Haskell as a language and even after solving the tooling and documentation problems, it doesn't solve the integration problem. The JVM is widely used and being on top of it makes it easy to integrate into existing systems. You can certainly reuse code between Eta and Haskell given the number of extensions that are in common.
- js8 10y agoWell, I didn't find the answer to my question in the FAQ. I see where you want to differ from GHC, but I don't see where you want to differ from Haskell standard. It seems to me that the Eta language is basically Haskell 2010 compliant compiler/runtime (correct me if I am wrong) for JVM. Which actually is great and useful and I really like that about the project. I just think the project shouldn't be called "another language", but rather "Haskell 2010 compiler with some GHC extensions for the JVM". I actually don't even care if you avoid Haskell in the name, as long as you keep the compatibility.
- rahulmutt 10y ago
- didibus 10y agoI'm not sure familiarity means anything useful, but I guess it helps being being a popular language.
- rahulmutt 10y agoIt was actually not familiarity. We specifically asked people "Which code sample looks readable to you?" People just love concise code. Less cognitive burden.
- hota_mazi 10y agoThe fact these people were picked at a conference is already very strong confirmation bias. Pick 100 random (really random) programmers and I'm betting a lot more of them will feel more comfortable with the imperative version over all the others.
- nine_k 10y agoPick 100 random programmers in 1970 and most of them would be more comfortable with GOTO-based programming, for variety of reasons, including performance. "Whenever you find yourself on the side of the majority, it is time to pause and reflect. (Mark Twain, ~150 years ago)"
- kaeluka 10y ago> "Whenever you find yourself on the side of the majority, it is time to pause and reflect. (Mark Twain, ~150 years ago)" That seems to be exactly what hota_mazi is saying.
- hota_mazi 10y agoIndeed. Mark Twain's quote is also often misunderstood. It doesn't mean you should never be in the majority, it's about always questioning your choices. Personally, I go one step further and I always pause and reflect, whether I'm in the majority or not.
- nine_k 10y agoNot that I'm objecting! I'm commenting. Sometimes stating the obvious helps trigger that "pause and reflect" thing.
- jimbokun 10y ago1. So it's a language optimized for the kind of programmers who go to conferences, nothing wrong with that. 2. This goes far above and beyond what most other language designers do, which seems to be "write the kind of language I want to use." Nothing wrong with that, either, but no sense in criticizing the language designers doing more research than most for not doing enough research.