Live data from Hacker News

The perfect programming language

cygni.se

31–40 of 108 posts

Re: The perfect programming language

#31
post #22

Their discussion of Haskell starts with the statement that it is "very abstract" and continues with "Do you really need six different ways to implement factorial?". Well, you have six (in fact, many more that six) ways to implement factorial in any (reasonably expressive) programming language. That's like looking at language that has both if/then/else statements and switch statements, and asking "do we really need bo…

The factorial section he should have, yes, just left out because it makes no sense as an argument.

The first two bullet points may have some truth to them, the rest seem like a result of using google search to find the "cons".

Re: The perfect programming language

#32
post #22

Their discussion of Haskell starts with the statement that it is "very abstract" and continues with "Do you really need six different ways to implement factorial?". Well, you have six (in fact, many more that six) ways to implement factorial in any (reasonably expressive) programming language. That's like looking at language that has both if/then/else statements and switch statements, and asking "do we really need bo…

Here's another list of factorial implementations in Haskell, which I think does say something about the language and its mindset. Be sure to scroll to the end: https://www.willamette.edu/~fruehr/haskell/evolution.html Here's another illustration. Since values in Haskell are immutable, implementing something like foo.bar.baz+=1 becomes a bit clunky, so they wrote a library to make it easier. Check it out, especially t…

Both field name overloading and deep updates have been problems and are worked on as we speak: https://github.com/ghc-proposals/ghc-proposals/pull/282. And yes, that is what the lens library has been solving till now.

Re: The perfect programming language

#34
post #22

Their discussion of Haskell starts with the statement that it is "very abstract" and continues with "Do you really need six different ways to implement factorial?". Well, you have six (in fact, many more that six) ways to implement factorial in any (reasonably expressive) programming language. That's like looking at language that has both if/then/else statements and switch statements, and asking "do we really need bo…

Here's another list of factorial implementations in Haskell, which I think does say something about the language and its mindset. Be sure to scroll to the end: https://www.willamette.edu/~fruehr/haskell/evolution.html Here's another illustration. Since values in Haskell are immutable, implementing something like foo.bar.baz+=1 becomes a bit clunky, so they wrote a library to make it easier. Check it out, especially t…

I would like to see a concerted effort from the Haskell community to set aside the self-gratifying maps and factorials, and show us real work.

The OP article, too, focusing on reducing errors, went into the factorial weeds here. How about presenting the air traffic control example in Haskell to contrast with the Ada? Real concurrency, real I/O, and real error cases.

Re: The perfect programming language

#35
There seems to be a happy point in languages where it's easy enough to get up and running, but complex enough to come back through and tighten things up. Like how Python allows a secondary file for parameter types in the function signatures. Also how tools like Flow for javascript has the bolt on type checking. To me, the perfect language seems to be one that does the annoying things like that for you and lets the programmer focus on the actual logic.

Languages like Rust seem to be a reaction against the problems caused by dynamic typing, but I'm not sure that forcing all that burden onto the programmer is the right answer yet. The languages that ease newcomers into the language tend to do well. Rust is like a brick to the face.

Does that mean Rust won't take over the world? Who knows. I do know that what they're doing with it does seem to be the future, but the language is difficult, even for experienced programmers to learn.

Re: The perfect programming language

#36

> I used to have a copy of "SQL for Dummies" at hand whenever I, with dread in my heart, needed to write some SQL, especially if there was any funky stuff like joins and such going on. SQL isn't so much a programming language as a query language. It never claims to be an efficient way to write a factorial function. And why do people freak out when they see a JOIN? It's one of the simplest concepts in databases: inter…

> And why do people freak out when they see a JOIN? It's one of the simplest concepts in databases: intersecting two sets. Everything in column A that matches everything in column B.

Actually no, that's not what a join is. A join is a cartesian product (not an intersection), followed by a WHERE clause (which doesn't have to be an exact match of a value between columns). This is further complicated by outer joins where empty rows are added to one or both of the sets involved in the cartesian product.

Re: The perfect programming language

#37
post #7

Interesting perspectives on a variety of languages, at first. Then when he says that XSLT is the best language I was thinking that we are very differently minded. So I suppose it makes sense that the Tailspin language is completely incomprehensible to me.

XSLT syntax (x < 10) would be its worst problem, except for its other problems.

But seriously, XSLT's recursive templates are a nice idea for transformation, and the homoiconicism enables transformation of XSLT stylesheets theselves.

Re: The perfect programming language

#39

There seems to be a happy point in languages where it's easy enough to get up and running, but complex enough to come back through and tighten things up. Like how Python allows a secondary file for parameter types in the function signatures. Also how tools like Flow for javascript has the bolt on type checking. To me, the perfect language seems to be one that does the annoying things like that for you and lets the pr…

Rust eases newcomers into the language a lot more than C++ does. As there are plenty of novices learning C++ as their first(!) programming language, I'm not sure why newcomers would be expected to have more of an issue with Rust
Post reply on HN