3 ms·
Andrew Hejlsberg: Maybe I'll just add, with language design, you know one of the things that's interesting, you look at all of us old geezers sitting up here,
by DonHopkins 8y ago
Andrew Hejlsberg:
Maybe I'll just add, with language design, you know one of the things that's interesting, you look at all of us old geezers sitting up here, and we're proof positive that languages move slowly.
A lot of people make the mistake of thinking that languages move at the same speed as hardware or all of the other technologies that we live with.
But languages are much more like math and much more like the human brain, and they all have evolved slowly. And we're still programming in languages that were invented 50 years ago. All the the principles of functional programming were though of more than 50 years ago.
I do think one of the things that is luckily happening is that, like as Larry says, everyone's borrowing from everyone, languages are becoming more multi-paradigm.
I think it's wrong to talk about "Oh, I only like object oriented programming languages, or I only like imperative programming, or functional programming".
It's important to look at where is the research, and where is the new thinking, and where are new paradigms that are interesting, and then try to incorporate them, but do so tastefully in a sense, and work them into whatever is there already.
And I think we're all learning a lot from functional programming languages these days. I certainly feel like I am. Because a lot of interesting research has happened there. But functional programming is imperfect. And no one writes pure functional programs. I mean, because they don't exist.
It's all about how can you tastefully sneak in mutation in ways that you can better reason about. As opposed to mutation and free threading for everyone. And that's like just a recipe for disaster.
- chubot 8y agoYes this is a good point, and I like the way PG described it: Languages evolve slowly because they're not really technologies. Languages are notation. The Hundred Year Language http://paulgraham.com/hundred.html http://paulgraham.com/hundred.html That is, "notation" evolves a lot more slowly than "technology". One reason I can think of is that notation is communication -- it requires 2 sides to agree. So just like we're using ancient network protocols and OS interfaces (e.g. the Unix syscall interface), we're also using ancient programming languages. ---- Trivia: Awhile back I watched a talk by Larry Wall about Perl 6, and he actually said that this 2003 essay was one of the inspirations for Perl 6! I was reminded of that during the thread about Redis a week or so ago.
- jcora 8y ago> And no one writes pure functional programs. I mean, because they don't exist. This is, both mathematically and practically speaking, incorrect. People write pure programs all the time. For example, `f x = putStrLn x` is a pure program. The reason for this is because, despite the name, nothing actually "happens" when this function is evaluated. I suggest you try it: just bind `f "hello world"` to a variable! Nothing happens. Because it's just an immutable value, computed by a pure function with no side effects. There are situations where IO values get executed, but the crucial point is that computation and execution are logically separated. You can have a structure of IO-producing functions, get a list of IOs from them, filter and modify and reorder them, bind them, process them: they're just data. Pure.
- rujuladanh 8y agoYes, we all know how functional languages work; this is Y Combinator after all. However, that is a pedantic remark and missing OP's point. It is clear OP meant a program as in an entire non-trivial system, not individual functions; even if they are programs themselves. Regardless, when one talks about function purity, it is about the final evaluation, not about partial binding or lazyness.
- jcora 8y agoThis is actually not at all pedantic but a very fundamental, if subtle at first glance, point about purity. Once you start doing more advanced monadic programming it stops being subtle at all. Many people, yes "even on HN", are totally fooled by do notation and the imperative nomenclature, but there is nothing similar. You misunderstand it as well: it has nothing to do with evaluation mode. Idris is eagerly evaluated, for example, and _that function is still pure_! `f x = putStrLn x` gets "finally" evaluated and yes there is still no side effect. It is so evaluated that you can bind it to a variable and apply another function on it. Just like 2^100 is a pure expression, so is `putStrLn "hello"`. > It is clear OP meant a program as in an entire non-trivial system, not individual functions; even if they are programs themselves. It is not clear. Does he mean including the OS and hardware? Because no matter how complex, a pure program is still pure.