HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
A Language Creators' Conversation: Guido van Rossum, James Gosling, Larry Wall & Anders Hejlsberg

PyCascades · Youtube · 106 HN points · 7 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention PyCascades's video "A Language Creators' Conversation: Guido van Rossum, James Gosling, Larry Wall & Anders Hejlsberg".
Youtube Summary
PuPPy (Puget Sound Programming Python) presents its annual benefit: A historic discussion of language creators about the past and future of language design.

Guido van Rossum, James Gosling, Larry Wall, and Anders Hejlsberg, creators of some of the most widely used programming languages in modern times will share a panel on language design, the universe, and everything with opening words by Cyrus Habib, Lieutenant Governor of the State of Washington.

Live stream sponsored by Microsoft. Be sure to try out Visual Studio Code(https://aka.ms/AA4pxr2.), Microsoft’s free and cross-platform editor with great support for Python, JavaScript, and more!
HN Theater Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this video.
Oct 10, 2022 · DonHopkins on When nil is not nil
"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

https://news.ycombinator.com/item?id=19568681

https://news.ycombinator.com/item?id=19568378

https://www.youtube.com/watch?v=csL8DLXGNlU

throwawaymaths
Honestly, nil is not so bad in Elixir. (It's an atom type, and it and false are the only falsely values, and there are some nice defaults like List.wrap(nil) == [])
cableshaft
Found out the hard way with Javascript I have to be careful about just doing "if(blah)" to represent what I thought was shorthand for "if(blah !== undefined && blah !== null)", when I had a weird bug where the logic was being skipped, and discovered that, oh, that also means "if(blah !== 0)"! The value was sometimes 0 and that was also causing it to evaluate to false, when I expected that to be true.

Now to be safe I'm always explicit when checking for undefined and null values, and also try to limit how I use them.

masklinn
> that also means "if(blah !== 0)"!

The empty string ("") is also falsy. So is `false`, obviously. And the bigint 0. And NaN. Here is the complete truth table: https://262.ecma-international.org/#sec-toboolean

FWIW undefined and null are loosely equal to one another, it's one of the few cases where loose equality is legitimate. As in

    if (blah != null)
will exclude null and undefined, and only those two[0]. That's step 2 and 3 of IsLooselyEqual: https://262.ecma-international.org/#sec-islooselyequal

[0] and Document.all but if you're dealing with that you're beyond the reach of god

DonHopkins
https://www.reddit.com/r/ProgrammerHumor/comments/225i15/pro...

"Proof that Brendan Eich never really cared about equality."

https://i.imgur.com/j7u6KbR.png

masklinn
If we're doing thunderdome, JS doesn't beat C++: https://howardhinnant.github.io/smf.jpg
Dylan16807
By the time you're declaring copy and move constructors you're much deeper than equality checks.
DonHopkins
It's family and marriage destructors like Brendan Eich who cause inequality.
masklinn
> "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

That's one thing I will heartily credit C# for, despite not being a great fan of the language. Actually retrofitting null-safety in a language never designed for that was an impressive undertaking.

DonHopkins
Anders Hejlsberg was talking about TypeScript in that $2 billion quote, which he also designed.

I love programming in C# myself, and think it's quite a nice language, carefully designed to say "Fuck You!" to Java, the same way Java was carefully designed to say "Fuck You!" to C++, which itself was insanely designed to say "Fuck You!" to C.

Whereas TypeScript, which I also enjoy and appreciate, was carefully designed to say "Fuck You!" to JavaScript, but JavaScript was less designed than just haphazardly thrown together as LiveScript, and then deceptively renamed and marketed to say "Me Too!" to Java.

What about Anders Hejlsberg?

James Gosling designed Java to fix C++, and Anders Hejlsberg designed C# to fix Java, and he also designed TypeScript to fix JavaScript.

https://news.ycombinator.com/item?id=22210073

From the HN discussion about the video of "A Conversation with Language Creators: Guido, James, Anders and Larry"

https://news.ycombinator.com/item?id=19568378

https://www.youtube.com/watch?v=csL8DLXGNlU

I posted these Anders Hejlsberg quotes, who co-designed TypeScript, C#, Delphi, Turbo Pascal, etc:

https://news.ycombinator.com/item?id=19568378

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

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

And these Larry Wall and James Gosling and Guido van Rossum quotes:

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

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

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

Also:

https://news.ycombinator.com/item?id=19568860

DonHopkins 10 months ago [-]

>Anders 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!)

https://news.ycombinator.com/item?id=22210073

From the HN discussion about the video of "A Conversation with Language Creators: Guido, James, Anders and Larry"

https://news.ycombinator.com/item?id=19568378

https://www.youtube.com/watch?v=csL8DLXGNlU

I posted these Anders Hejlsberg quotes, who co-designed TypeScript, C#, Delphi, Turbo Pascal, etc:

https://news.ycombinator.com/item?id=19568378

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

[...]

scns
I like what Anders Hejlsberg says here, but still wonder why he is not pushing for F# adoption/funding/tooling etc. I'm in no position to judge such an accomplished language designer in any way, just curious. Is it ego? NIH? Or that other thing (Whose name someone else can surely provide) about not being able to see the solution if your salary depends on the problem.
justin66
Because he's not responsible for F# in any way, and because approximately everyone hates functional programming anyway.
marcosdumay
It's almost unanimous that the general "null" from C is a very bad idea.
scns
I know. C.A.R. Hoare who invented null, called it his Billion Dollar Mistake.

https://en.wikipedia.org/wiki/Tony_Hoare?wprov=sfla1

DonHopkins
A bad bet which, as Anders Hejlsberg rightly pointed out, JavaScript doubled down on.
kungito
Is he in any way related to F#? I feel like he is completely focused on Typescript with C# slowing down with features and F# and VBasic are pretty much in maintenance mode
scns
He is not, that's why i hinted at Not Invented Here.
Ok, then if not actually designed under the influence of LSD, then certainly under the influence of religious fanaticism.

The tired old "Perl was designed by a linguist" cliché is endlessly Parroted (pardon the pun!), but doesn't actually necessitate or imply good programming language design. But look at the actual factual source of that folklore -- it would be more accurate to say "Perl was designed by a wanna-be missionary", and that certainly shows ("Exegesis", "Apocalypse", "bless", etc):

https://en.wikipedia.org/wiki/Larry_Wall

>While in graduate school at the University of California, Berkeley, Wall and his wife were studying linguistics with the intention of finding an unwritten language, perhaps in Africa, and creating a writing system for it. They would then use this new writing system to translate various texts into the language, among them the Bible. Due to health reasons these plans were cancelled, and they remained in the United States, where Wall instead joined the NASA Jet Propulsion Laboratory after he finished graduate school. Wall is an active member of the New Life, Church of the Nazarene.

Going on a missionary expedition in Africa to invent and teach illiterate people of color a written language to read the Bible in certainly sounds to me more like religious and linguistic imperialism than a sound motivation for programming language design.

https://en.wikipedia.org/wiki/Linguistic_imperialism

>Linguistic imperialism or language imperialism is occasionally defined as "the transfer of a dominant language to other people". This language "transfer" (or rather unilateral imposition) comes about because of imperialism. The transfer is considered to be a sign of power; traditionally military power but also, in the modern world, economic power. Aspects of the dominant culture are usually transferred along with the language.

Translating CS literary classics like the "Pascal Users Manual and Report" and Anders Hejlsberg's "Turbo Pascal Reference Manual", or even textbooks about sustainable farming techniques, nutrition, medicine, sex ed, and birth control, into their invented written language would do more economic and life sustaining good for those poor Africans than translating the Bible.

kqr> "people with CS degrees adding things that sound cool"

People with CS degrees add cool things that are sound, not things that sound cool.

Do you really believe that programming languages should be intentionally designed to be MORE like religions, MORE imperialistic, MORE evangelical, instead of less?

Compare Larry Wall's contributions to this otherwise deep fascinating conversation about language design, versus the contributions of less religiously motivated, more scientifically trained programming language creators with CS degrees, like Guido van Rossum, James Gosling, and Anders Hejlsberg:

A Language Creators' Conversation: Guido van Rossum, James Gosling, Larry Wall & Anders Hejlsberg

https://news.ycombinator.com/item?id=19568378

https://www.youtube.com/watch?v=csL8DLXGNlU&t=49m41s

James was literally taken aback by Larry's macho IDE shaming:

https://news.ycombinator.com/item?id=19568381

"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

useragent86
This bigoted, anti-religion, ad-hominem ranting would result in a stern chastisement, or even an outright ban by dang for "ideological flamewar" were it not posted by a user with 14k karma points. And it's far from the only such comment DonHopkins has made on HN (he even continues by quoting Wikipedia rants about "Christian colonialism": https://news.ycombinator.com/item?id=26660365).

Yet HN mods have the gall to claim that "reflexive," combative commenting is not allowed, and "reflective," truth-seeking comments are what's required: https://news.ycombinator.com/item?id=26548649

Clearly, certain users are allowed to say whatever they want on HN. If HN were honest, it would go ahead and give them orange checkmarks.

It would also not be allowed if it were against any religion other than Christianity.

gwd
> Going on a missionary expedition in Africa to invent and teach illiterate people of color a written language to read the Bible in certainly sounds to me [...] like religious and linguistic imperialism...

Honestly, this could only be said by someone who had never met anyone whose spoken language hadn't been written. I personally know people who have recently done exactly this: Developed a writing system for a tribe of people who previously had no writing system for their own language. The people themselves are amazed to see their language written down. They have generally internalized the negative attitudes of the larger culture they live in toward their own language; they'll say things like (and this is going to be offensive, but again, it's them saying it about their own language, having internalized it from the larger African language groups around them), "I thought our language was just a monkey language". Seeing it written down gives them a sense of value and pride toward their own culture they've never had before. This is exactly the opposite of "the transfer of a dominant language to other people". On the contrary, it gives people a powerful tool to fight linguistic imperialism.

khrbrt
That's very interesting. I thought it was odd that so many writing systems for indigenous languages[0] use invented alphabets instead of adapting Latin letters but this makes total sense when the written form is a source of pride and identity.

0: https://en.wikipedia.org/wiki/Canadian_Aboriginal_syllabics

cat199
So, picking a few religious-themed keywords out of a hat, and using this + non programming interests as a strawman basis to attack the whole language as designed by 'religious fanaticism' ? If I have to pick the 'superstitious' side, it would be the side of this argument.

This isn't 'Temple OS'. By this line of reasoning we should all only use strongly-typed FP since it's the only 'rational enough' language family.

emodendroket
I think this is a silly line of inquiry at best, but if one were to attempt to take it seriously, surely “there is precisely one way to do it” is an approach that would better fit the “imperialist” frame than Perl’s actual approach.
DonHopkins
Which Imperialistic Programming Language dictates that "there is precisely one way to do it"?

Not Python -- it has Zen-like practical suggestions about what matters, instead of ideological doctrine about how to do it:

https://www.python.org/dev/peps/pep-0020/

>There should be one-- and preferably only one --obvious way to do it.

>Although that way may not be obvious at first unless you're Dutch.

Does The Zen of Python really sound "imperialistic" to you?

    The Zen of Python

    Beautiful is better than ugly.
    Explicit is better than implicit.
    Simple is better than complex.
    Complex is better than complicated.
    Flat is better than nested.
    Sparse is better than dense.
    Readability counts.
    Special cases aren't special enough to break the rules.
    Although practicality beats purity.
    Errors should never pass silently.
    Unless explicitly silenced.
    In the face of ambiguity, refuse the temptation to guess.
    There should be one-- and preferably only one --obvious way to do it.
    Although that way may not be obvious at first unless you're Dutch.
    Now is better than never.
    Although never is often better than *right* now.
    If the implementation is hard to explain, it's a bad idea.
    If the implementation is easy to explain, it may be a good idea.
    Namespaces are one honking great idea -- let's do more of those!
chipotle_coyote
I don't think it's a stretch to argue that Christianity is imperialistic, and by extension Christian missionaries are de facto agents of imperialism. However, I think it's a stretch to argue that Perl is imperialistic. :)

It's fascinating to learn that Larry Wall might have become a missionary had his life gone a different direction, but I don't think one can make a compelling case that Wall's religiosity had a major effect on Perl's language design. Don Knuth is a devout Lutheran who played church organ, taught Sunday school, and wrote a book about the Bible -- but it just doesn't seem likely we should be concerned that typesetting our work with TeX subtly infuses it with Christian apologia.

DharmaPolice
> There should be one-- and preferably only one --obvious way to do it.

This always felt like an excessive over-reaction to Perl's "there's more than one way to do it" motto and never struck me as desirable or true.

In the earlier days of Python I remember reading StackOverflow questions which attracted differing solutions and Python advocates (who were a bit abrasive at the time) would reconcile this with the above by saying some answers weren't sufficiently "pythonic". It all seemed rather strange.

emodendroket
I think this is pretty common though. Most language communities converge on some standard way of doing things. I always try to go along with the philosophy of the language I’m working in, even if I wouldn’t necessarily choose that myself from a blank slate.
emodendroket
Not exactly but I think the idea that Perl (or for that matter Christianity) is imperialistic is itself absurd, so that doesn’t seem like an answer.

Anyway, the closest I’ve experienced is Go, to answer your question.

DonHopkins
Most historians and victims of its missionaries would beg to differ that Christianity isn't imperialistic.

https://en.wikipedia.org/wiki/Christianity_and_colonialism

>Christianity and colonialism

>Christianity and colonialism are often closely associated with each other because Protestantism and Catholicism participated as the state religions of the European colonial powers and in many ways they acted as the "religious arms" of those powers. According to Edward Andrews, Christian missionaries were initially portrayed as "visible saints, exemplars of ideal piety in a sea of persistent savagery". However, by the time the colonial era drew to a close in the last half of the twentieth century, missionaries became viewed as "ideological shock troops for colonial invasion whose zealotry blinded them", colonialism's "agent, scribe and moral alibi."

>In some areas, almost all of the colony's population were removed from their traditional belief systems and were turned into the Christian faith, which the colonizers used as a reason to destroy other faiths, enslave the natives, and exploit the lands and seas.

>"Colonialism is a form of imperialism based on a divine mandate and designed to bring liberation – spiritual, cultural, economic and political – by sharing the blessings of the Christ-inspired civilization of the West with a people suffering under satanic oppression, ignorance and disease, effected by a combination of political, economic and religious forces that cooperate under a regime seeking the benefit of both ruler and ruled." -Jan H. Boer of the Sudan United Mission

emodendroket
I think one could easily make similar arguments about, say, the Internet. But let’s leave it aside. Let me ask you something: even granting it’s true, what does anything here have to do with Perl, beyond guilt by association?
HeckFeck
I think it is a stretch to argue that every missionary is motivated by 'Imperialism'. Certainly some may have been in the past, but if one sincerely accepts the tenants of a religion then it isn't surprising one has enthusiasm to spread it. I've seen plenty of evangelists for every ideology under the sun. People who think they are right will go to great lengths to spread their ideas.

Also, the end of slavery was pushed by conscientious Christian evangelists like John Newton and William Wilberforce in the UK. It is easy to argue against slavery in Christianity owing to the Imago Dei doctrine. I suspect it is less easy to argue against slavery in other religions and cultures; many of which still practice forms of it today.

Spreading your religion while separating your culture is difficult. The same way it is difficult for a migrant to fully adapt the customs of any host culture. I think the relationships between these ideas are more complex than the evil catch-all of 'Imperialism!'.

emodendroket
I think it might be easier to see the point you are making if we substituted some other ideas. For instance, how many of us are ready to argue that freedom and democracy are evil or imperialist ideas? Yet they served as a rationale for the invasion of Iraq.
HeckFeck
There's more than one way to argue it.
millipedegears
Official Religion of the Roman Empire; retains some imperialist overtones. Yes. And so what.
gjm11
Let's stipulate that Larry Wall is a religious fanatic (though I think that's only true if you use the word "fanatic" in a highly nonstandard way). So what? What actual impact has that had on the design of Perl? What features of Perl's design are worse as a result of Larry Wall's religious beliefs or practices? I don't see any sign that any are.

(You mention exactly one thing about Perl's design, namely the "bless" keyword. That's a bit quirky, but it's not a terrible name for what it does and nothing obviously better occurs to me.)

> Going on a missionary expedition [...] sounds to me more like [...] than a sound motivation for programming language design.

In what way were Larry Wall's missionary ambitions a "motivation for programming language design" at all? I don't see any sign that they were.

(I do remember, from many years ago, something in Perl's licence or readme file along the lines of "I make Perl because I think it pleases the Author of my story. If you have a problem with that, your notion of Authorship needs some revision :-)", but I think that means not "I wrote Perl to help me convert the heathen" but "Everything I do is for the greater glory of God". So far as I can see, that doesn't imply any particular language-design choices.)

[EDITED to add: I looked it up. The above doesn't misquote too badly, but one place where it diverges from the original is that he actually wrote "nice things like this", not "Perl" specifically. I think this makes it even clearer that the Perl language design as such is not what LW is saying was religiously motivated. You can find the actual text at https://github.com/Perl/perl5 if you care.]

I listened to as much as I could bear to of that language design conversation. (The audio is incredibly bad for almost all of it, unfortunately.) I didn't notice Larry Wall's contributions being notably less insightful, more dogmatic, more ignorant, or whatever it is you're gesturing towards. The one example you give is that Larry Wall doesn't like IDEs and James Gosling does, which doesn't seem like good evidence of anything.

So, please, if you're going to make this sort of claim, make it explicit enough to engage with properly. What about Perl is the way it is becaues of Larry's "religious fanaticism"?

(As it happens I'm an atheist and don't like Perl very much. There's plenty I dislike a lot about both Christianity and Perl. It's the alleged connection you're trying to draw between them that I don't see at all.)

From the HN discussion about the video of "A Conversation with Language Creators: Guido, James, Anders and Larry"

https://news.ycombinator.com/item?id=19568378

https://www.youtube.com/watch?v=csL8DLXGNlU

I posted these Anders Hejlsberg quotes, who co-designed TypeScript, C#, Delphi, Turbo Pascal, etc:

https://news.ycombinator.com/item?id=19568378

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

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

And these Larry Wall and James Gosling and Guido van Rossum quotes:

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

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

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

Also:

https://news.ycombinator.com/item?id=19568860

DonHopkins 10 months ago [-]

>Anders 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!)

Oct 30, 2019 · lordgrenville on Thank You, Guido
This is pretty close! (Guido van Rossum, James Gosling, Larry Wall and Anders Hejlsberg) https://www.youtube.com/watch?v=csL8DLXGNlU
shurane
Wow,surprised to see this at a local meetup in Seattle. Thought it would be a kind of event for a much bigger venue.
4 of the most popular language creators here https://www.youtube.com/watch?v=csL8DLXGNlU agree that type systems are useful.

I would suggest definitely not using Vanilla JS. There are excellent type systems over JS, TypeScript, Scala.JS, BuckleScript to name a few each with their pros and cons (I don't know what cons BuckleScript has though, maybe relatively smaller lib-ecosystem)

Hermitian909
I use bucklescript/reasonML extensively.

The biggest con is definitely the smaller lib-ecosystem, creating bindings for functions is generally relatively painless but if you're using javascript libraries with large API surfaces that will be a large time sink. Otherwise it's been a joy to use.

tyingq
Larry Wall is endorsing strong types? I'll have to watch that now. I guess you can use Perl 6 in a way that approximates it, but it's very optional.
Shoop
Does anyone have a timestamp for Larry Wall talking about types?
mst
I believe the idea is 'gradual typing', where you add types as you firm up an interface.

Lots of the perl6 code I've seen types most stuff at least at interface boundaries.

melling
There are lots of alternatives to vanilla JavaScript. Why stop at types and encapsulation?

http://bikeshed.fm/192

Illniyar
Not that I don't agree with their opinion, but being a language creator mostly like greatly biases you towards over estimating the usefulness of certain features. As such I wouldn't hold language creator's opinions on the value of certain language features over say the opinions of CTOs or VP engineering of large companies, especially as it relates to productivity, maintenance and onboarding.
Apr 04, 2019 · 106 points, 66 comments · submitted by DonHopkins
DonHopkins
"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
So how do you express the idea of null when the language doesn't have null?
tybit
The 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).

brazzy
I'd say the real problem is having nullability as the default for all types.
dragonwriter
Depends on the other focuses of the language.

Option/Maybe monads are one option popular in static functional languages.

For set oriented languages, an empty set is an option. (This is very similar to the previous option, actually.)

Null is kind of a middle ground between these options and a ad hoc use of a specific sentinel value like using a signed integer variable when the data is logically unsigned, so you can use “-1” for missing data.

hzhou321
I see. So the idea of NULL is the idea of sentinel value. And to express the idea of sentinel value is to create a wrapper around the value and have the wrapper always check for sentinel by default. Is this interpretation correct?

So I guess the better question is how do you express the idea of skipping checking for Sentinel when the language always checks for sentinel?

matt_kantor
What do you want the runtime behavior to be if the sentinel value is produced?
greydius

    data Maybe a = Nothing | Just a
Iv
You don't. That's the point. Look at how C++ references (not pointers) work. You can't declare one without giving it a valid object to reference.

The only reason why you may need null is to check whether a reference is null. You remove this need by forbidding it in well defined programs.

DonHopkins
You could pass a function that never returns. ;)
srgpqt
Sum 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.

None
None
millstone
How do you express the idea of null when the language doesn't have null and the runtime environment can diverge from its static model over a period of years or decades?

If your program typechecked against Netscape Navigator in 1997, does that prove that it will run without type errors in AwesomeNewBrowser 2023?

IMO null/undefined/etc are reasonable fallbacks if your runtime environment can radically diverge from its static model.

specialist
I favor Null Objects. It's a minority viewpoint.

https://en.wikipedia.org/wiki/Null_object_pattern

fulafel
If we pretend Elm existed in 97, I think things would have worked out ok in this respect.
DonHopkins
Note: 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.)

DonHopkins
"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
REGEX in Perl 6 looks pretty amazing: https://docs.perl6.org/language/regexes
DonHopkins
James 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
I 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.

jules
The prototypical example being getter and setter methods, which Java IDEs generate.
gumby
Or you could just let the language do it, as do Commonlisp and C++.
DonHopkins
Anders 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
Types 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
Then you'd probably love ADA! Does Perl 6 have postconditions, too?

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

>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/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
Yes, Perl 6 has pre and post-conditions. They are available in the form of the `PRE` and `POST` phasers: https://docs.perl6.org/language/phasers#PRE , https://docs.perl6.org/language/phasers#POST
daotoad
The 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
Which makes it deliciously ironic that Larry would bring that point up, since Perl's syntactic user interface is so terribly designed.
b2gills
Perl5 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.

microtherion
> "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.

DonHopkins
"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
pmontra
I don't think it's a matter of keywords. I'm working with both Elixir and Python on different projects right now.

Pattern matching is very deeply ingrained into Elixir. Two examples to scratch the surface

This is pattern matching in function arguments

    def process_file({:ok, {file_name, file_content}}) do
      ...
      :ok
    end
    def process_file({:error, reason}) do
      ...
      :error
    end
    def process_file(_), do: error
This is pattern matching in assignment

    {:ok, content} = File.read(file_name)
Actually the = character is the pattern matching operator, which accidentally ends up assigning values in some cases: it can't assign to the :ok atom but it can assign to the content variable. If File.read returns {:error, "some error"}, the match will fail and the program will stop. Usually I get a notice from Sentry and a supervisor process will start it again, possibly running into the same problem or not. Sometimes errors are caused by external services that have occasional hiccups.

Some changes are so structural that turn languages into another one and I'm not sure it's worth it. We have so many languages to choose from.

nikofeyn
is 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
Thank god, else we wouldn't have Python but another ML or Lisp variant that nobody (statistically speaking) uses...
nikofeyn
i 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
>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
And all this time I thought R was the programming language that statistically speaking people used.
zimablue
Note that python does have pattern matching, just not to the same degree as some languages.

  (a, (b, *c, d), *e) = [1, (2, 3, 4, 5), 6, 7]
Good for nested iterables, but not supporting dict/object unpacking.
vorg
> all the interesting keywords are already very popular method names for other forms of pattern matching

When I first read that, I thought he meant run-time lookups of overloaded method names, which is a form of pattern matching on parameter lists.

DonHopkins
You can do multiple dispatching in Python, by hand or with decorators, but it can get kind of awkward, not as elegant as CLOS's and Dylan's approach with generic functions.

https://www.artima.com/weblogs/viewpost.jsp?thread=101605

Five-minute Multimethods in Python, by Guido van van Rossum.

I used to believe that multimethods were so advanced I would never need them. Well, maybe I still believe that, but here's a quick and dirty implementation of multimethods so you can see for yourself. Some assembly required; advanced functionality left as an exercise for the reader.

https://python-3-patterns-idioms-test.readthedocs.io/en/late...

https://pythonhosted.org/multidispatch/

https://adambard.com/blog/implementing-multimethods-in-pytho...

https://opendylan.org/documentation/intro-dylan/multiple-dis...

https://opendylan.org/documentation/intro-dylan/objects.html...

https://en.wikipedia.org/wiki/Multiple_dispatch

https://en.wikipedia.org/wiki/Generic_function

andreareina
Hah, I should have read further downthread to this before telling you about multiple dispatch via decorators.
b2gills
In Perl6 multiple dispatch is a fundamental feature. Even the infix numeric addition operator is handled by 27 multi subs. (They usually get inlined or even optimised out entirely.)

    say &infix:«+».candidates.elems; # 27
Here is a quick translation of that second link to Perl6

    #! /usr/bin/env perl6
    use v6.d;

    enum Roshambo < Rock Paper Scissors >;
    enum Outcome < Lose Win Draw >;

    proto compete ( Roshambo, Roshambo --> Outcome ){*}

    multi compete (    Paper,     Rock --> Win ){}
    multi compete (     Rock, Scissors --> Win ){}
    multi compete ( Scissors,    Paper --> Win ){}

    multi compete ( $a, $b where $b eqv $a --> Draw ){}

    multi compete ( $, $ --> Lose ){}

    for Roshambo.roll(20) Z Roshambo.roll(20) -> ($a,$b) {
      say "$a.fmt('%8s'), $b.fmt('%8s'): &compete($a,$b)"
    }
(Note that I didn't really write any actual code for the `compete` subroutines; it was all handled by the signatures.)
tomp
Not sure that's pattern matching... I'd call that destructuring, for me pattern matching also means the ability to fail the match (and try another).
arethuza
Presumably Prolog's unification being one of the most powerful 'pattern matching' mechanisms?

http://www.dai.ed.ac.uk/groups/ssp/bookpages/quickprolog/nod...

[Amused to see that the page I linked to there is over 20 years old!]

andreareina
I can't find a reference to what parser python uses internally, but if it does at least one token lookahead, wouldn't you be able to disambiguate special syntax from any standard expression since the former allows tokens separated by only a space and the latter doesn't? e.g. afaik `match some_call():` is a syntax error, so you don't need to worry about match being a legal identifier.

I daresay another issue is going to be the syntax -- the naïve way of implementing it nests two blocks: one for the pattern-matched block as a whole, and and another for the actual cases, which means that now you've got a double indent. IIRC this was a reason he gave against implementing case statements way back when.

There is one construct that's almost like a block but doesn't indent code, decorators. It's rich enough to implement multiple dispatch in functions, including pattern-matching on values and not just on types. Unfortunately it won't get you the sort of things you could do with actual blocks, e.g. access to other variables.

DonHopkins
"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
tda
Unfortunately the terrible production quality of the video makes the conversations quite hard to follow. Going to try nonetheless
bpyne
Anders 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
I 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

DonHopkins
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.

jcora
> 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
Yes, 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
This 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.

simonh
Ok so run up an embedded OS and application on a system with limited resources so that all the memory is being used. Now run your pure functional program. The system crashes. Using memory is a side effect. Consuming CPU time is a side effect. Heating up the environment and drawing power due to that CPU usage is a side effect[0]. These are not trivial either, actual real systems used for critical activities fall prey to this sort of thing all the time. It just depends on what you are willing to consider as a side effect.

[0]https://xkcd.com/1172/

jcora
That's not what purity refers to! We're talking about a mathematical property of the language itself.

The real issue is that people don't understand that `putStrLn "hello"` _is literally just as pure as `2*x`_. They are both like mathematical expressions in that they evaluate to a value and _nothing else_. The name "putStrLn" _suggests_ that this is similar to a print statement but it is emphatically not. You can evaluate it a billion times and nothing gets printed.

simonh
Yes we all know that, we're not stupid and the OP clearly knows that perfectly well too, but note his use of the word 'exist'. Real programs don't run on server farms located in Plato's Realm of Forms.
matt_kantor
Hang on a minute.

The only difference is that the languages you are talking about have captured "doing I/O" as something that can be statically reasoned about, but not "consuming memory" (for example). From a mathematical perspective, one is part of the axioms while another is not.

One could imagine a language where all memory allocation must be done explicitly via a monad, just like how in Haskell all I/O is performed inside an IO monad. If that were the case, you could have additional static guarantees about how memory is used. That doesn't mean that languages which don't do this are somehow inherently "impure"; they are simply "pure with respect to a certain set of axioms" (which don't talk about memory usage).

"The system crashed" example is fun too. All pure functions must return a value, right? Well, that's obviously not gong to be the case if the computer blows up halfway through executing a pure function. "Blowing up" might not be something your type system talks about—Haskell does to some degree (with _|_ inhabiting every type), but Idris for example has total functions which at runtime could most definitely be interrupted by a sudden explosion. They are "total" only with respect to a set of axioms which imply an execution model where computers do not explode mid-program.

jcora
This can be done, for example ST in Idris which lets you reason about resources (check out linear types).

However, if you are thinking more in the direction of "you have to reason about where and how exactly your values and functions are stored", you're moving back to C, because the entire point is to disentangle the formal description of computation, from it's actual execution in the real world. If you want to deal with that, you have to do it explicitly and _by reasoning about it_ (with ST, for example). Which is what purity means.

> They are "total" only with respect to a set of axioms which imply an execution model where computers do not explode mid-program

"There is a chance that the computer blows up" is one of those things that have little bearing when reasoning about programs, it's just not in the domain of discourse. It certainly has no formal bearing on the notion of totality, mathematics just doesn't deal with cases such as "what if everyone who counted to 5 suddenly died", it deals with the counting itself. When the chance is actually high, for example radiation in space flipping bits, I'm pretty sure you want to handle that elsewhere.

It's not hard to imagine a fault-tolerance system gaining a lot from dependent types, however, with their ability to prove that your code follows a defined protocol.

DonHopkins
Actually, the Moveable Feast Machine is a "Robust First" asynchronous distributed fault tolerant cellular-automata-like computer architecture that DOES reason about what might happen if computers randomly explode in mid-program!

(One of my favorite topics, that I've written about in other threads!)

https://news.ycombinator.com/item?id=15560845

Check out how the city seamlessly regrows after you nuke it:

https://www.youtube.com/watch?v=XkSXERxucPc

> Robust-first Computing: Distributed City Generation: A rough video demo of Trent R. Small's procedural city generation dynamics in the Movable Feast Machine simulator. See http://nm8.us/q for more information.

And here's a robust, self-healing membrane, that tolerates random failures (like tiny little exploding computers):

https://www.youtube.com/watch?v=oq0uvF4mm7Y

>To demonstrate the robustness of three membrane implementations in the MFM, an instance of each was placed side by side and subjected to a failure probability of 5e-5 per site per EPS. That is, each site is erased, on average, every 20,000 event cycles.

Intercellular Transport also demonstrates some robust chemical and biological programming metaphors:

https://www.youtube.com/watch?v=6YucCpYCWpY

>Two cells are interconnected by self-healing wire. The magenta substance is being passed from the cell in the west to the cell in the east. The black particles are an ectoplasm, allowing the membrane to identify sites outside of the cell. Similarly, the yellow and blue particles are an endoplasm specific to the cell in which they reside, allowing the membrane to identify sites inside of it.

Demon Horde Sort exemplifies the Robust First approach:

https://www.youtube.com/watch?v=helScS3coAE

Into functional programming? Here's a demo of programming the Movable Feast Machine with λ-Codons:

https://www.youtube.com/watch?v=DauJ51CTIq8

>λ-Codons provide a mechanism for describing arbitrary computations in the Movable Feast Machine (MFM). A collection of λ-Codon molecules describe the computation by a series of primitive functions. Evaluator particles carry along a stack of memory (which initially contains the input to the program) and visit the λ-Codons, which they interpret as functions and apply to their stacks. When the program completes, they transmute into output particles and carry the answer to the output terminals (left).

mastor
wow. I find it very sad that most people don't grok what pure means. The statement "no one writes pure functional programs. I mean, because they don't exist." is just wrong by any stretch of the imagination.

But at the same time, it's not that surprising, it's not something that comes to us humans naturally. The only way to learn it is to do it. This is something I highly recommend to everyone, you'll find the experience incredibly rewarding.

rujuladanh
Yes, yes, of course. All my C programs are pure too!

They are a simple mapping of a tuple (hardware state, queue of world events) onto itself! Truly marvelous!

Vive la pureté!

PS. I am now working on abstracting this further, and I just realized the universe itself is pure too; but somehow I got some strange behaviors when I started to look into particles too closely... will report back soon.

DonHopkins
Weren't all Java programs supposed to be "100% Pure" a while back? Whatever happened to Sun Microsystems' "100% Pure Java" [TM] Initiative?

https://www.oracle.com/technetwork/java/100percentpurejavaco...

>[...] 100% Pure Java, JavaStar, JavaPureCheck, [...] JavaSpin, HotJava, The Network Is The Computer, and JavaStation are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and certain other countries.

Registering purity as your trademark and insisting that all of your users rewrite every bit of their existing legacy code in your pure language, and never use or talk to any other languages ever again, always seemed like separatist linguistic supremacy to me.

Apparently, C#'s P/Invoke is an evil impure cross-language conspiracy to dilute our linguistic purity and sap our precious bodily fluids, breeding caravans of mongrel coders who will swarm across our open borders and steal our jobs. That's why JNI and NDK are only used by unpatriotic second class citizens with divided loyalties, so they don't deserve to be well supported or maintained.

https://www.zdnet.com/article/100-pure-java-initiative-wins-...

>"Keep Java pure" is the message behind Sun Microsystems' 100% Pure Java initiative which has already won support from 100 developers but will lock out programs such as Visual J++. The move is an attempt on behalf of the Californian firm to maintain integrity of Java code and build awareness.

https://www.cnet.com/news/100-pure-java-watered-down/

>Viewers of cable news network MSNBC may recently have seen a commercial for Sun Microsystems (SUNW) in which a man tells a priest that he's been thinking "pure" thoughts. When the beatific man exits the confessional, he passes a queue of anxious programmers--one wearing a Visual Basic shirt--ready to admit their sins.

>The commercial, which touts Sun's "100 percent pure Java" campaign, is not your usual television ad. But Sun has in many ways shown an almost religious determination to spread the gospel of Java to the far reaches of the globe, even sponsoring a worldwide educational tour for programmers with the support of Netscape Communications, IBM, and Novell.

pjmlp
It is being enjoyed every day by those of us that develop on Windows and deploy on JEE containers running somewhere, by uploading a JAR/WAR/EAR into them.
jcora
You are really not getting this distinction, I'm not sure how much clearer I can make it. You can evaluate `putStrLn "hello"` a billion times without anything "happening" at all, because it is just a function. Maybe it has to be made clear that purity is a property of languages and language constructs, and how you can reason about them, if you model a physical system mathematically of course you will have a pure formal description of it, but that's not the domain where this concept applies. Even then, it can only be said of your _model_ that it is pure, and the point of pure languages is to allow for this mode of reasoning.

When you call a C function, you cannot know whether equational reasoning holds, whereas you can be sure when you're using a pure language. Therefore, when you're working on a project that is 100% in say Idris, you are in fact making a totally pure program. You could make an Idris compiler that inserts random perturbations in various functions, or you could look at crashes etc., but that is not where the concept of purity applies, it's a category error to think it does.

sbergot
He has a point though. You can imagine that all c code lives implicitly in an io monad and define evaluation the same way Haskell does. Then c becomes pure by your own criteria.

If you say that c is impure you have to admit that any program with the io monad also is. That is, any working Haskell program, even if Haskell allows you to write part of this program out of the io monad.

AnimalMuppet
All right, but...

When I actually get output that says "hello", that isn't pure, is it? And there is some way for me to actually produce that output, isn't there? It may not be "evaluating putStrLn", but it's something.

And if that's all true, then rujuladanh is essentially correct: You're being pedantic in a way that misses the main point.

chubot
Yes 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

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.

HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.