8 ms·
A Conversation with Language Creators: Guido, James, Anders and Larry [video]
- DonHopkins 8y agoJames Gosling wants to punch the "Real Men Use VI" people. "I think IDEs make language developers lazy." -Larry Wall "IDEs let me get a lot more done a lot faster. I mean I'm not -- I -- I -- I -- I -- I'm really not into proving my manhood. I'm into getting things done." -James Gosling
- etse 8y agoI saw that part of the video too, and although Larry looked like he was having a fun moment, I think he was also quite insightful. IDEs help people write programs, but to language developers, an IDE might be the easy and less elegant way out of a problem in the design of the language.
- DonHopkins 8y agoAnders Hejlsberg also made the point that types are documentation. Programming language design is user interface design because programmers are programming language users. "East Coast" MacLisp tended to solve problems at a linguistic level that you could hack with text editors like Emacs, while "West Cost" Interlisp-D tended to solve the same problems with tooling like WYSIWYG DWIM IDEs. But if you start with a well designed linguistically sound language (Perl, PHP and C++ need not apply), then your IDE doesn't need to waste so much of its energy and complexity and coherence on papering over problems and making up for the deficiencies of the programming language design. (Like debugging mish-mashes of C++ templates and macros in header files!)
- daotoad 8y agoTypes as documentation is one of the things I like best about Perl6 types. Perl6 has the concept of a `subset` of a type. Let's say I want to write a function that takes a name which must be only one line of text, and a positive integer as arguments. In Perl6 I can document those requirements in the subroutine signature: sub foo( Str $name where *.lines == 1, Int $count where * > 0 ) { say "Name is $name with count $count"; } Or if I want to name the concepts and reuse them, I can say: subset LegalName of Str where *.lines == 1; subset PositiveInteger of Int where * > 0; sub bar( LegalName $name, PositiveInteger $count ) { foo( $name, $count) } You can use these subsets for multiple dispatch as well: # Print a single line argument. multi sub print-it( Str:D $it where *.lines == 1 ) { say $it; } # Print a multiline string as a single line multi sub print-it( Str:D $it ) { say $it.lines.join(''); } # Handle anything that we didn't expect multi sub print-it( Any $it ) { Failure.new( "it was unprintable", $it.gist ); } IME, this makes it easy to write self documenting code.
- DonHopkins 8y agoThen you'd probably love ADA! Does Perl 6 have postconditions, too? https://www.adacore.com/gems/gem-31 https://www.adacore.com/gems/gem-31 Gem #31: Preconditions/postconditions >The notion of preconditions and postconditions is an old one. A precondition is a condition that must be true before a section of code is executed, and a postcondition is a condition that must be true after the section of code is executed. http://www.ada-auth.org/standards/12rat/html/Rat12-2-3.html http://www.ada-auth.org/standards/12rat/html/Rat12-2-3.html >We will look first at the simple case when inheritance is not involved and then look at more general cases. Specific preconditions and postconditions are applied using the aspects Pre and Post respectively whereas class wide conditions are applied using the aspects Pre'Class and Post'Class. >To apply a specific precondition Before and/or a specific postcondition After to a procedure P we write procedure P(P1: in T1; P2: in out T2; P3: out T3) with Pre => Before, Post => After; >where Before and After are expressions of a Boolean type (that is of type Boolean or a type derived from it). If your language supports preconditions, postconditions and invariants, then you can pursue the "Design by Contract" approach to programming, coined by Bertrand Meyer for Eiffel. That's when you guarantee that if all the preconditions are met before calling a function, then all the postconditions will be met after it returns (but the object may go through intermediate states where the postconditions aren't met before it returns, like while inserting an item into a doubly linked list). Unfortunately that idea breaks down when you have multiple threads that might enter a function at the same time, so you have to use object level locks, which have their own problems. https://en.wikipedia.org/wiki/Design_by_contract https://en.wikipedia.org/wiki/Design_by_contract https://en.wikipedia.org/wiki/Eiffel_(programming_language) https://en.wikipedia.org/wiki/Eiffel_(programming_language) >The design of the language is closely connected with the Eiffel programming method. Both are based on a set of principles, including design by contract, command–query separation, the uniform-access principle, the single-choice principle, the open–closed principle, and option–operand separation. >Many concepts initially introduced by Eiffel later found their way into Java, C#, and other languages. New language design ideas, particularly through the Ecma/ISO standardization process, continue to be incorporated into the Eiffel language.
- lizmat 8y ago
- jules 8y agoThe prototypical example being getter and setter methods, which Java IDEs generate.
- gumby 8y agoOr you could just let the language do it, as do Commonlisp and C++.
- microtherion 8y ago> "I think IDEs make language developers lazy." -Larry Wall Larry also considers Laziness one of the three primary virtues of programmers, so maybe he meant the above as a compliment.
- daotoad 8y agoThe important thing is that Larry say language developers get lazy because of IDEs, not programmers using the language. A powerful IDE that automatically looks up documentation and guides you through writing a bunch of boilerplate lets a language designer skimp on figuring out ways to let you avoid writing the boilerplate in the first place. Code generation in the IDE is a poor substitute for a well designed interface.
- DonHopkins 8y agoWhich makes it deliciously ironic that Larry would bring that point up, since Perl's syntactic user interface is so terribly designed.
- b2gills 8y agoPerl5 has some design features that are not as good as they could have been if it broke backwards compatibility. So there were a lot of limitations on how things could get added. (Code written in 1987 will most likely still work on the latest version of Perl5 released last year, or even on the version coming out later this year.) The Perl6 project was to reimagine the design by breaking things that needed breaking. If your premise that Larry is bad at language design, then you should be able to find something in Perl6 that is “terribly designed”. I won't be holding my breath, so feel free to take your time.
- DonHopkins 8y ago"My favorite is always the billion dollar mistake of having null in the language. And since JavaScript has both null and undefined, it's the two billion dollar mistake." -Anders Hejlsberg "It is by far the most problematic part of language design. And it's a single value that -- ha ha ha ha -- that if only that wasn't there, imagine all the problems we wouldn't have, right? If type systems were designed that way. And some type systems are, and some type systems are getting there, but boy, trying to retrofit that on top of a type system that has null in the first place is quite an undertaking." -Anders Hejlsberg
- hzhou321 8y agoSo how do you express the idea of null when the language doesn't have null?
- greydius 8y agodata Maybe a = Nothing | Just a
- srgpqt 8y agoSum types. Option<T> types which can have either Some(value) or Nothing for values. Statically compiled languages can typecheck this so you don’t have null pointer errors. Some languages like TypeScript have this baked into the language syntax, so you can do: let x: Foo | null = bar; and is also properly type checked.
- DonHopkins 8y agoYou could pass a function that never returns. ;)
- tybit 8y agoThe problem isn’t actually null perse, it’s an implicit null. E.g. it’s perfectly fine to say you might have an empty value via ‘Foo | null’ or ‘Foo?’ or with something like null, ‘Maybe Foo’ but to sneak it into plain old ‘Foo’ is problematic (a billion dollars worth of problems).
- DonHopkins 8y ago"The features I wanted to add were negative features. I think all of us as language designers have borrowed things. You know, we all steal from each other's languages all the time. And often we steal good things. And for some reason, we also steal bad things. [Like what?] Like regular expression syntax. [Oh, yeah, I'll give you that one.] Like the C precedence table. [Ok, another.] Ok, these are things I could not fix in Perl 5, and we did fix in Perl 6. [Ahh, ok. Awesome!]" -Larry Wall
- whoisjuan 8y agoREGEX in Perl 6 looks pretty amazing: https://docs.perl6.org/language/regexes https://docs.perl6.org/language/regexes
- DonHopkins 8y ago"In the Java universe, pretty much everybody is really disciplined. It's kind of like mountain climbing. You don't dare get sloppy with your gear when you're mountain climbing, because it has a clear price." -James Gosling
- DonHopkins 8y ago"I have a feature that I am sort of jealous of because it's appearing in more and more other languages: pattern matching. And I cannot come up with the right keyword, because all the interesting keywords are already very popular method names for other forms of pattern matching." -Guido van Rossum
- nikofeyn 8y agois he just now becoming aware of it? it seems he had no idea something like sml existed when he first created python. i am sure he had heard of lisp/scheme but probably ignored it.
- coldtea 8y agoThank god, else we wouldn't have Python but another ML or Lisp variant that nobody (statistically speaking) uses...
- DonHopkins 8y agoAnd all this time I thought R was the programming language that statistically speaking people used.
- nikofeyn 8y agoi don't understand your snark. do you honestly think python, as a programming language, is superior to something like racket or f#? these languages are newer than python of course, but the point is that they are representative of what we could be using.
- coldtea 8y ago>i don't understand your snark It's simple, it was added to counter-balance the smug ascertainment of Guido's ignorance, and the taken-for-granted assumption that we'd be so much better if he modeled Python more after ML/Lisp/etc. >do you honestly think python, as a programming language, is superior to something like racket or f#? No, I think the subject is moot. Python has been adopted and is widely successful for being Python. We had MLs and Schemes/Lisps available before and after Python and they didn't manage to get traction. Why do you think having the original Python be more like these would help its case? Even if the result was a "better language" in the sense you think Racket or F# are, those are still niche, and there's all the reasons to believe Python would be too if it followed their model. So, it's not "if only Python was ML/Lisp like we would now have an equally successful but better Python!". It's more likely "if Python was ML/Lisp it would still be niche today, and we wouldn't have a language with the characteristics that people love in Python and adopted it for, but yet another ML or Lisp version".
- DonHopkins 8y agoAndrew 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
- tda 8y agoUnfortunately the terrible production quality of the video makes the conversations quite hard to follow. Going to try nonetheless
- DonHopkins 8y agoNote: the talk actually starts at 50:00. It starts out with bad audio, which gets better eventually, and it has a long gap in the middle when they go for a break (since it’s a recording of a live stream). But the discussion and back-and-forth is riveting! I like to transcribe and write up articles about videos like this, and this is a worthwhile candidate, if I can find the time. It would be a lot more accessible as annotated text with links and illustrations, than a long hard to hear video. (It’s also good to check with the people talking to make sure the transcription was right and captured their meaning.)
- bpyne 8y agoAnders made a great point in the discussion about optimization: his hunches are often enough at odds with the profiler. I was heartened by it due to the high-skilled developer that he is.
- DonHopkins 8y agoI saw Alvy Ray Smith give a talk in which he mentioned how when he was writing code, he had to just keep flipping the signs and coordinates around in the equations until the math worked out right. That made me feel a lot better about having to do the same thing all the time too! Nothing ever works right (or runs fast) the first time, and you have to just keep fiddling with it until it does. https://en.wikipedia.org/wiki/Alvy_Ray_Smith https://en.wikipedia.org/wiki/Alvy_Ray_Smith