Live data from Hacker News

The perfect programming language

cygni.se

21–30 of 108 posts

Re: The perfect programming language

#21

> 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…

I get the feeling that people would benefit from learning relational algebra before learning SQL. It would give them a basic mental model that would reduce problems with operations like join and provide a nice base to build the more complex SQL mental model.

Re: The perfect programming language

#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 both?". The first three ways to implement factorial demonstrated in the article amount to minor differences similar to those between "if/then/else" and "switch", and the last three rely on various standard library functions, which technically doesn't say much about the language itself.

Re: The perfect programming language

#23
post #19

One language that seldom gets mentioned is Postscript. People tend to think of it as just a page descriptor language, but really that is just the built-in graphic functions. So we have a post fix (RPN, similar to HP calculators) expression style, which is really a mirror image of Lisp. You have genuine first class functions, introspection, and something I don't see that often is first class environments. That is you…

I remember being surprised when I read an interview with Robert Sedgewick where he listed the PostScript Language Reference Manual on his list of top ten programming books. I've never read it though.

Re: The perfect programming language

#24
post #19

One language that seldom gets mentioned is Postscript. People tend to think of it as just a page descriptor language, but really that is just the built-in graphic functions. So we have a post fix (RPN, similar to HP calculators) expression style, which is really a mirror image of Lisp. You have genuine first class functions, introspection, and something I don't see that often is first class environments. That is you…

I have often wanted a Postscript without the drawing functions to be my quick and dirty language. It really is the nicest stack language I have ever programmed in.

Re: The perfect programming language

#25
post #19

One language that seldom gets mentioned is Postscript. People tend to think of it as just a page descriptor language, but really that is just the built-in graphic functions. So we have a post fix (RPN, similar to HP calculators) expression style, which is really a mirror image of Lisp. You have genuine first class functions, introspection, and something I don't see that often is first class environments. That is you…

It’s mentioned in the article.

Re: The perfect programming language

#26
post #10

> The foremost is simplicity, that a language should be simple enough that the programmer should be able to know everything about it. Well, no. Translated - "a language should serve the lowest possible denominator". Apart from the obvious fact that it is impossible, it's also definitely not the way to go if you want quality software.

There is no purpose of having a so complicated language - like c++ or java - that the majority of the programmers don't even know 100% of the language. I think Elm (and somehow Go) fits this category, everyone can learn in less than a week every aspect of it. Another benefit of having a very simple language is the compile time, c++ has a awful compile time, 100kloc can take half an hour, in Elm it takes less than 5 s…

I agree. Languages like Elm and Go seem much more sane and we'd have to include other very good examples of this like Julia and AWK. They are designed to serve a specific purpose and (try to) make the right trade-offs to achieve that.

Because that is what every language has to do. There is always something about a language that is crappy/boring/verbose/difficult/complected. And even with highly extensible languages (Lisp) you are at least forced to be disciplined, which also 'sucks' in a way.

Having the right trade-offs/constraints around a purpose/domain opens up many opportunities for optimization of performance, readability, accessibility and so on.

Re: The perfect programming language

#27
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.

Yeah, at that one I started trying to decide if the whole thing was meta trolling:

”XSLT is my favourite language of all time and it made all sorts of lights go on in my head. This is what sparked my analysis of programming languages, I wanted to program generally in an XSLT-like style, whatever that really means, and more. Of course, all data should really be in XML at all times, but that got killed with the whole XMLSchema nonsense...”

Re: The perfect programming language

#28
post #23
post #19

One language that seldom gets mentioned is Postscript. People tend to think of it as just a page descriptor language, but really that is just the built-in graphic functions. So we have a post fix (RPN, similar to HP calculators) expression style, which is really a mirror image of Lisp. You have genuine first class functions, introspection, and something I don't see that often is first class environments. That is you…

I remember being surprised when I read an interview with Robert Sedgewick where he listed the PostScript Language Reference Manual on his list of top ten programming books. I've never read it though.

They are also available free online -- "PostScript Language Tutorial & Cookbook", also known as the PostScript Blue Book, is at https://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF. There is also the Red Book (useful to fully understand the language, to the point of writing a PostScript interpreter), and Green Book (more of a reference book than a cookbook).

Re: The perfect programming language

#30
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 the diagram that says "simplified": http://hackage.haskell.org/package/lens

So I agree with the article that Haskell can be dauntingly abstract. (Though you can write code that's perfectly straightforward if you want.)

Post reply on HN