User avatar
Jon Sterling @jonmsterling@mathstodon.xyz
10mo
I think that people in academic PL often speak (derisively) of mainstream languages as being "designed by amateurs". It could be useful to dial down the tone, and be more specific about what we mean when we say things like that.

One example was TypeScript's designers' total confusion concerning the variance of function spaces. But I've said enough about this one, and maybe it is not easy to create a sound type system that makes sense of unsound practices without changing those practices.

Another example that I've seen more recently is the way that the Swift typechecker blows up when you nest things too much, and asks you to replace it with some let bindings to avoid choking.

I am not sure exactly what is causing this kind of blow-up, but Swift includes a lot of implicit inference of things about which, if asked, an expert would have said: "Of all things, do not try to infer that; it might look cool in code examples, but this will definitely blow up in practice." Even if it doesn't blow up, it will lead to extremely inconsistent programmer-expectations.

There's a lot of things like that in Swift, and one thing to remember is that it is easier to add than to remove. Once you commit to supporting some PL feature that is basically algorithmically infeasible, it is not easy to remove it. If you try to remove it, users will revolt by saying "But it already works!" ignoring how it only works sometimes. Some kind of expert judgement was needed here, adults in the room.
14
0
1
0
User avatar
Andrej Bauer @andrejbauer@mathstodon.xyz
10mo
@jonmsterling You should see programming languages designed by real mathematicians.

Actually, I can describe all of them: BASIC with some objects bolted on. Also, they claim to have types.

Here's some nighttime reading:

* GAP -
docs.gap-system.org/doc/ref/chap4_mj.html#X7FE7C0C17E1ED118

* Magma -
magma.maths.usyd.edu.au/magma/handbook/part/1

* Sage = Python

* Mathematica:
www.wolfram.com - but links to Wolfram language are all broken
5
0
0
0
User avatar
Björn Gohla @6d03@mathstodon.xyz
10mo
@andrejbauer @jonmsterling I think the problem is these people are not interested in programming languages as such.
1
0
0
0
User avatar
Andrej Bauer @andrejbauer@mathstodon.xyz
10mo
@6d03 @jonmsterling But they dabble in the design of programming languages?
1
0
0
0
User avatar
Björn Gohla @6d03@mathstodon.xyz
10mo
@andrejbauer @jonmsterling who's gonna stop them?
1
0
0
0
User avatar
Andrej Bauer @andrejbauer@mathstodon.xyz
10mo
@6d03 @jonmsterling It's not about stopping them, it's about finding ways to cooperate. Step 1 is for people who invent programming languages to know whether they know anything about programming languages.

I still have regular discussions with mathematicians where they say "C++ because it's the fastest language".
1
0
0
0
User avatar
Björn Gohla @6d03@mathstodon.xyz
10mo
@andrejbauer @jonmsterling

I have on occasion lamented that
isn't used more in scientific computing.

It's puzzling, because you would think that it's more important to a mathematician to understand their programs, than for them to run fast.
4
0
0
0
User avatar
Jon Sterling @jonmsterling@mathstodon.xyz
10mo
@6d03 @andrejbauer Actually, I think most mathematicians who have computational needs want their programs to run fast most of all, and the faux-mathematics espoused by Haskell programmers is more of an impediment to mathematicians understanding what is going on than the oddities of C++ or Fortran — mathematicians are in general very comfortable with the idea that computers might prefer to organise ideas in a different way than humans (even if this idea is a little reactionary).
3
0
1
0
User avatar
Jon Sterling @jonmsterling@mathstodon.xyz
10mo
@6d03 @andrejbauer

I mean, imagine the following conversation.

Haskeller: "It's a monad, so you should already know how that works."

Average mathematician: "I fucking hate category theory, and had no idea what a monad was."

Haskeller: "Don't worry, it's pretty easy and really helps you reason about the code."

Average mathematician: "OK, I looked it up and I now know what a category is and what a monad is. So you're saying that the code is happening in a category and I have some strong monads on that category?"

Haskeller: "Yeah, exactly."

Average mathematician: "OK great. This is a bit unfamiliar for me, but I can learn a new thing. So, for example, function composition is associative and unital with identity."

Haskeller: "Well, hmm, actually I'm not sure. OK, looks like it's not associative."

Average mathematician: "Huh, so it's not a category."

Haskeller: "Well, maybe, but it doesn't matter in practice."

Average mathematician: "But you just said we had a monad. I don't know what a monad is on something that is not a category. Can you clarify that?"

Haskeller: "No, I can't clarify that. But I saw a paper once that says fast and loose reasoning is OK."

Average mathematician: "OK, I found that paper and looked at it. It took me many hours to understand what it was about, but in the end it seemed to not imply what you think it implies."

Haskeller: "Oh, well, someone told me about that paper once. I never really read it. Anyway..."
7
2
1
0
User avatar
mio @mio@shrimp.mio19.uk
10mo
@jonmsterling @andrejbauer @6d03 😺
0
0
0
0