Programming languages, operating systems, despair and anger
xent.com
xent.com
"If I have to write one more polyglot bash / awk / python script to gather data from log files on a bunch of different machines, demux that into a time-ordered event stream, pipe it through something to munge it into some slightly different format, ship that off via post to some web address and get some JSON back, parse that into some other shit, do some computation over it like aggregation or date math over time stamps with unlike representations, wrap the results up in an HTML table and send that table in a MIME-enabled e-mail to myself I think I am going to explode."
(Since everything seems to go to Moose (a backport of most of the Perl 6 OO model) in the Perl world, there might be an impedance mismatch in a few years with old style libraries and new?)
Python/Ruby is probably the closest I've seen to a language that provides enough batteries to be productive but gets out of my way syntactically as much as possible, but both of them could use some further evolution.
The reason I love Python is that in general when I want to write something a certain way, or what seems to be the most natural way to do something is how it is actually done. As a programmer it gets out of my way and lets me do what I need to get done.
The author to a certain degree is calling for exactly that, a language that makes tasks that every programmer does over and over extremely simple, make the stuff that is not done nearly as often harder to do, or take up more lines.
I love Python too, but it's not without its quirks. Eg:
','.join(mylist)
Which nearly everyone I know at first assumed would be: list.join(',')
Nobody thinks of what's being done here 'take a dot, and use it to join this list'. They think of 'take this list, and join it into a string using dot'.Even fewer people think of how to do that in the face of heterogeneous and polymorphic lists.
Intuition is not God, it's just an informant. Sometimes it's wrong, no matter the language.
$("<div>Foo</div>").appendTo(bar)
The way to do this would be to have an IterableMixin that implements join() (and a load of other stuff) so long as the subclass implements a small number of basic methods.
string methods are things you do to strings.
list methods are things you do to list.
Most people think of taking a list, and gluing it with a string, not taking a string, and using it as glue for a list.
just of note, the architect in me would go for 'why not have both?'
AKA the New Jersey design approach lives (http://www.jwz.org/doc/worse-is-better.html).
Java is interestingly an at least somewhat successful attempt using the MIT approach (as is Clojure on top of its JVM).
That said, it was a lovely rant ;-)
Also, language designers have to maintain a balance between improving the language and maintaining stability so that programmers can actually get work done. I think Guido is doing a good job of this (even though I might disagree with some of his design decisions).
It sounds like what he wants is a DSL, because the language he describes would be useless to most people who aren't in his exact position.
main = do
putStrLn "What's your name?"
name <- getLine
putStrLn ("Hello " ++ name)
Was that really so hard?(And a few bits of category do help when you are toying around with other typeclasses. Have a look at the typeclassopedia for an introduction.)
Why not focus on the solution rather than hoping someone is going to listen to you complain and make it all better?
I'm sure they could use the help.
Perl tried to be pretty much the language he suggests, but it was put together with a poor sense of language design. Ruby tried to correct Perl's mistakes, but also succumbed to the "kitchen sink" mentality. Python tried to correct many earlier mistakes, but while it was more closely integrated with the underlying OS and still managed to be a relatively simple language, it got too tied up in the underlying OS.
Most of what he's talking about could be implemented with Lisp machine or a Smalltalk VM as OS Kernel. The features he wants "built in" could simply be added to the default class library. Perhaps something based on the Erlang VM could satisfy the multi-core part.
The premise as I understand it is that modern languages are broken and have failed to evolve. An interesting point. A good start for an argument.
However, his rant devolves into:
"REAL WORLD, modern datatypes, built-in, literal, batteries-included PLEASE!!! If the following aren't first-class types with first-class literal constructors / representations supported at the language level then your new programming language ISN'T EVEN ON THE PLAYING FIELD"
No evidence. Not even a mention as to how he's reasoned that these statements are true. Nothing.
Why does my compiler/interpreter need to have an "email" data-type? Why is my language not even "on the playing field" without it? Why are there so many successful programming languages then that survive without it?
I can empathise with his frustrations. There are plenty of times on the job when I feel more like a glorified digital plumber. Deserializing/reserializing data and pushing it through various pipes isn't glorious work. But lets take the argument from there rather than flapping our arms and making frantic claims that everything the way it is is inherently broken because it's not the way we'd like it to be.
(And maybe he does just need a good dose of Lisp ;)
Although I do think he's a little too obsessed with one-liners but that could have been hyperbole on his part.
P.S. good rant on major pain points - I'd toss in the breakage in the hierarchical filesystem model.
I think that designing a language that can solve all possible problems is beside the point. A language is a tool and used for different tasks. Not only is the purpose different but people have also different preferences. So making everybody happy is impossible.
Languages have to go the way of the dodo. Every new one is an arguable attempt to do things better than the one which came before. That doesn't mean they really are better.
Actually PG puts it really nicely [1]:
"The right way to solve that problem, I think, is to separate the meaning of a program from the implementation details."
"What program would one like to write? Whatever is least work. Except not quite: whatever would be least work if your ideas about programming weren't already influenced by the languages you're currently used to. Such influence can be so pervasive that it takes a great effort to overcome it. You'd think it would be obvious to creatures as lazy as us how to express a program with the least effort. In fact, our ideas about what's possible tend to be so limited by whatever language we think in that easier formulations of programs seem very surprising. They're something you have to discover, not something you naturally sink into."
http://www.paulgraham.com/hundred.html http://www.paulgraham.com/avg.html http://stackoverflow.com/questions/1003940/learn-a-new-langu...
Like when you have a database, a server application and an AJAX web page, you may have four to five different representations of the same data (DB table, server language object, JSON, Javascript object and finally HTML) and need a whole bunch of code just to move data from A to B and convert between representations.
It's not just a language problem. It's just as much a problem of impedance mismatch between different systems, protocols and data formats. Various frameworks attempt to reduce the tediousness, but tend to come with issues of their own.
PG has something on this too:
"Of course the ultimate in brevity is to have the program already written for you, and merely to call it. And this brings us to what I think will be an increasingly important feature of programming languages: library functions."
"I think a lot of the advances that happen in programming languages in the next fifty years will have to do with library functions. I think future programming languages will have libraries that are as carefully designed as the core language."
http://www.paulgraham.com/popular.html
Whether the common case is made simple by the language, libraries, frameworks or standardization (we may need all of them) ultimately does not matter much to the developer, only that you can handle conceptually trivial everyday tasks with the minimum of fuss.
We have a long way to go before this becomes a reality.
When we have settled for one language, though, no matter what we do, it greatly influences our thinking. For instance, I know and love Ocaml and Haskell, yet when I do C++, I have to think in C++ to a great extent. If I think more abstractly (declarative description of my problem, proper separation of concerns, algebraic properties…), I can guarantee the C++ translation will be utterly unreadable, because the mismatch is too great.
That said, even if I am wrong, "languages are just tools" is still harmful. This phrase is often followed by statements like "the choice of languages don't matter that much", or "don't whine about your language". These are valid to the extent you have to take into account existing code (read: past mistakes), and team expertise (read: ignorance). However, they tend to overstate these issues. For any big enough project, the technical merits of a language trumps anything else.
Create football stadium and football players. Start the game when user presses spacebar. Make players have red shirts and white socks.
http://thedailywtf.com/Comments/Could-You-Explain-Programmin...
Um, what, exactly, is stopping the ranter from doing something about it himself? Is there a law that only people born into a special caste are allowed to create programming languages?
Or is he just too lazy to do more than bitch about the world being sub-optimal?
Go is just a C 2.0 developed by its fathers and it's based on early works on Plan 9 project (if I understands correctly).
So, it is language for OS-level programming and, perhaps, google's own native client, and community will code and release lots of high-level libraries, as it happened for C or, say, perl.