Live data from Hacker News

Ask HN: What's with all the new languages?

news.ycombinator.com

51–60 of 68 posts

Re: Ask HN: What's with all the new languages?

#51

Part of the reason for the recent explosion of new languages is the emergence of technologies that make implementing new languages much easier, LLVM being one of the most obvious ones. Swift, Rust, Julia, and various new implementations of older languages all use LLVM. Implementing new languages on managed runtimes like the JVM and CLR is also much easier than building a full toolchain from scratch. It's also easier…

> Consider Lisp as a potential pinnacle of perfection. Paul Graham quipped that Lisp was "discovered" by John McCarthy, rather than invented or designed – Lisp already existed in the way that mathematical truths exist. That's a cute idea, but clearly not literally true. There were still a lot of design choices – parentheses for example. Why not square or curly brackets? Why not indentation? There were also choices that are now almost universally recognized as mistakes. Dynamic scoping, for example, which was later replaced by lexical scoping in Scheme.

Well, have you seen lambda calculus, which predates lisp ? That's basically lisp (it has lambda, it has bound and unbound variables, it has let, it has steps, it has recursion, ...). All John McCarthy did was implement it. That's where the parentheses come from, of course. Why not curly brackets or indentation ? Because in maths, parantheses specify sequence of calculation, curly brackets denote collections, and indentation doesn't mean anything. Since the concept being expressed is the sequence, they used parentheses. In fact the first reference I can find to parentheses dates from the ancient Greeks (and they were probably merely the first one to write it down).

Lambda calculus is a generalization of mathematical formulas by Alonzo Church to describe computation (as opposed to "just" values or functions, what normal mathematical formulae do. Functions in math are very, very different from functions in lambda calculus. This cannot be said to be very original either, as is was mostly a way to introduce some sanity into Hilbert's "Entscheidungsproblem" ("can you give a mathematical formula that solves mathematical formulae"), and more generally, into constructivism. This was made possible by finding a consistent way to express the combination operators in logic. Constructivism was a branch of logic that ...

You can keep going back for quite a while, but the point is that the form of lisp was effectively decided by someone who's name we don't even know, who lived in one of the ancient Greek city states. He (or she ? not impossible in that period) also had absolutely no idea what they were doing either.

Re: Ask HN: What's with all the new languages?

#52
post #51

Part of the reason for the recent explosion of new languages is the emergence of technologies that make implementing new languages much easier, LLVM being one of the most obvious ones. Swift, Rust, Julia, and various new implementations of older languages all use LLVM. Implementing new languages on managed runtimes like the JVM and CLR is also much easier than building a full toolchain from scratch. It's also easier…

> Consider Lisp as a potential pinnacle of perfection. Paul Graham quipped that Lisp was "discovered" by John McCarthy, rather than invented or designed – Lisp already existed in the way that mathematical truths exist. That's a cute idea, but clearly not literally true. There were still a lot of design choices – parentheses for example. Why not square or curly brackets? Why not indentation? There were also choices th…

There's a lot more to an actual Lisp than lambda calculus. No Lisp ships with just lambda – that would be absurd and unusable. So there are design choices: choices of standard functions like "car", "cdr", "set" – and what kind of scoping "set" implements. The Common Lisp and Scheme specs are literally lists of design choices.

Re: Ask HN: What's with all the new languages?

#53
post #33

My take on a few languages you mentioned. I'll try to stay as neutral as possible, but some things are bound to be controversial. - C#: Microsoft's answer to Java, supposedly does some things better (Java seems to be catching up some), but cross-platform support is so-so. - Go: I don't understand Go. It seems to be conceived as an improvement over C, and it gets many things right (and a few things wrong, like error h…

> Erlang: genuinely useful for its use case, distributed systems. This is a language where the intended use was really woven in the language design, to great effect. For the rest, it's a bit like ML without types. Personally, I see no good reason for leaving out types, so that tends to annoy me a bit.

I believe there's an interview with Joe Armstrong (creator of Erlang) where he mentions that the one thing he'd wished he'd added to Erlang was a type system at the jump. I'm not a 100% sure on that, though.

In Learn You Some Erlang for Great Good they talk about the lack of types in erlang [1]. Apparently some Haskell folks wanted to make a type system for Erlang, so they called up Joe Armstrong and asked what he thought. (this is all a really cursory outline; check the sources for better info)

Joe Armstrong recounts the story and says that Philip Wadler told him "he had a one year’s sabbatical and was going to write a type system for Erlang and “were we interested?” Answer —'Yes.'"

Philip went on to write a paper [2] about the type system they wrote, but obviously it never really got traction. More info in The History of Erlang [3]

I don't really have a particular point to this, other than it's interesting and maybe of some historical interest to folks looking into PL's and how they end up getting made.

[1] http://learnyousomeerlang.com/types-or-lack-thereof [2] http://homepages.inf.ed.ac.uk/wadler/papers/erlang/erlang.pd... [3] http://webcache.googleusercontent.com/search?q=cache:ZHq_V41... (google cached version; couldn't find another version right off hand)

Re: Ask HN: What's with all the new languages?

#54
post #51

Earlier quoted context omitted.

> Consider Lisp as a potential pinnacle of perfection. Paul Graham quipped that Lisp was "discovered" by John McCarthy, rather than invented or designed – Lisp already existed in the way that mathematical truths exist. That's a cute idea, but clearly not literally true. There were still a lot of design choices – parentheses for example. Why not square or curly brackets? Why not indentation? There were also choices th…

There's a lot more to an actual Lisp than lambda calculus. No Lisp ships with just lambda – that would be absurd and unusable. So there are design choices: choices of standard functions like "car", "cdr", "set" – and what kind of scoping "set" implements. The Common Lisp and Scheme specs are literally lists of design choices.

If you don't already know, there is a Church encoding for singly-linked lists that is in the lambda calculus. We can already implement some of the operations you have listed with just lambdas:

(defun cons (x y) (lambda (z) (z x y))) (defun car (l) (l (lambda (x y) x))) (defun cdr (l) (l (lambda (x y) y)))

It's not like a lisp with 'just lambda' would be 'absurd and unusable'. I just showed you, we can implement cons, car, and cdr with just lambdas(hooray, closure! not clojure, closure...). Although there are some design decisions that had to be made, e.g. set, list.

Re: Ask HN: What's with all the new languages?

#55

Earlier quoted context omitted.

There's a lot more to an actual Lisp than lambda calculus. No Lisp ships with just lambda – that would be absurd and unusable. So there are design choices: choices of standard functions like "car", "cdr", "set" – and what kind of scoping "set" implements. The Common Lisp and Scheme specs are literally lists of design choices.

If you don't already know, there is a Church encoding for singly-linked lists that is in the lambda calculus. We can already implement some of the operations you have listed with just lambdas: (defun cons (x y) (lambda (z) (z x y))) (defun car (l) (l (lambda (x y) x))) (defun cdr (l) (l (lambda (x y) y))) It's not like a lisp with 'just lambda' would be 'absurd and unusable'. I just showed you, we can implement cons,…

Why does everyone think they're the only person who knows about lambda calculus? No kidding, lambda is turing complete, so yes, you can implement car and cdr with it. But just because you can do everything with lambda doesn't mean that it's actually done that way.

Re: Ask HN: What's with all the new languages?

#56

Earlier quoted context omitted.

If you don't already know, there is a Church encoding for singly-linked lists that is in the lambda calculus. We can already implement some of the operations you have listed with just lambdas: (defun cons (x y) (lambda (z) (z x y))) (defun car (l) (l (lambda (x y) x))) (defun cdr (l) (l (lambda (x y) y))) It's not like a lisp with 'just lambda' would be 'absurd and unusable'. I just showed you, we can implement cons,…

Why does everyone think they're the only person who knows about lambda calculus? No kidding, lambda is turing complete, so yes, you can implement car and cdr with it. But just because you can do everything with lambda doesn't mean that it's actually done that way.

At university we learned a turing machine implementation in lambda calculus. Now while I will fully agree that it's a disastrously difficult programming language, but "big" (non-trivial) programs in lambda calculus both exist and predate the oldest LISP programs.

Likewise "big" Church thesis programs exist and predate the oldest lambda calculus programs. They're even more unreadable (although everyone doing cs has at least looked at 2 of them).

Before that you will find more implicitly written programs that are definitely programs, in the sense that they are explicitly checked to be finite computation steps.

Even these informal algebraic programs not only predate LISP, Lambda and Church but a lot of them are rewrites of algorithms out of pure algebra that are definitely programs, just less formally written down.

You can trace the history of those back to the renaissance European city states (I refuse to accept al-Khawazarmi as having done anything but compile external sources).

And frankly, is there anyone here that has read Euclid's algorithm and doesn't think even the ancient Greek version is, when it comes right down to it, a valid computer program ? He didn't have the notion of generalized calculation (technically nobody did that correctly before Turing of course), but he had the notion of calculating various things by counting in specific ways. It's not that different, really. And it's only one of quite a set of programs written by Euclid of Alexandria.

Obviously Euclid's programs were never meant to be programs, but they are programs. They have a trivial mapping in pretty much any programming language that exists.

Oh, and Euclid uses recursion. Didn't define it, just uses it. Even Euclid very likely just compiled knowledge, didn't invent/discover it. Likely these algorithms were taught in Alexandria for at least a few decades before Euclid, so you could reasonably accurately say that there definitely were computer programmers in the 4th century BC, maybe even fifth.

And with the comment relating to "car" and "cdr", well, Euclid uses those functions. He doesn't define them beyond describing their effects, but he uses them. In that way, of course, he's acting like any other programmer. The only people defining car and cdr are developing the language, not any real programs.

Re: Ask HN: What's with all the new languages?

#57
post #48

Earlier quoted context omitted.

angersock, > I imagine that a more inheritance-driven language would be more amenable to strong type checking, for example. AFAIK the conventional wisdom among formal methods people is actually the opposite. If you don't mind my asking, why do you imagine this? > does anyone know of any studies/inquiries into the interaction of type systems with languages that favor composition over inheritance? I'm not sure what you…

So, this may simply be a massive gap in my understanding of theory and PL stuff. :) My reasoning is that an inheritance-based language has some notion of "A extends B extends C", and so if I need to check compatibility of types I can just walk the class hierarchy and get an answer. I'm clearly missing something--maybe I'm just using the wrong mental model for types?

> so if I need to check compatibility of types I can just walk the class hierarchy and get an answer.

For languages with parametric polymorphism, note that inheritance is kind of like subtyping. Getting subtyping correct in the presence of parametric polymorphism is famously subtle; see http://en.wikipedia.org/wiki/Covariance_and_contravariance_(...

For languages without parametric polymorphism, it's easy to see why inheritance makes things more complicated. In the case of nominal typing, this walking you describe isn't necessary without inheritance -- a value either is or is not in the exact named type it's supposed to be. In the case of structural typing, it suffices to say that inheritance complicates type inference.

Inheritance is actually even more subtle than subtyping even; e.g. consider http://en.wikipedia.org/wiki/Fragile_base_class

Re: Ask HN: What's with all the new languages?

#58
post #48

Earlier quoted context omitted.

angersock, > I imagine that a more inheritance-driven language would be more amenable to strong type checking, for example. AFAIK the conventional wisdom among formal methods people is actually the opposite. If you don't mind my asking, why do you imagine this? > does anyone know of any studies/inquiries into the interaction of type systems with languages that favor composition over inheritance? I'm not sure what you…

So, this may simply be a massive gap in my understanding of theory and PL stuff. :) My reasoning is that an inheritance-based language has some notion of "A extends B extends C", and so if I need to check compatibility of types I can just walk the class hierarchy and get an answer. I'm clearly missing something--maybe I'm just using the wrong mental model for types?

[deleted]

Re: Ask HN: What's with all the new languages?

#59

Earlier quoted context omitted.

> How do languages get popular? Inclusive community would be my stab at an answer.

Money, usually. Consider Java, C#, Javascript.

I wouldn't include JavaScript on the list of PL that are popular because of a huge corporation behind it but more on "this is what we've got, suck it or die".

Re: Ask HN: What's with all the new languages?

#60
post #29

> How do languages get popular? Money, syntax, portability? One particularly good way is to be attached to an OS or platform. - C came with Unix (although was so good that it migrated off it to Windows and basically every other platform). - JavaScript came with the browser - C# comes from an OS vendor; Microsoft. They built APIs for their platform in C#. - Likewise, Objective C was for NeXT, and Swift is for iOS. The…

In the case of JavaScript, at the beggining it didn't just "came" with all browsers since it was first implemented by Netscape. Why MS included it in IE is far from my knowledge/interest into the history of JavaScript/MSIE. I guess that once your language is in 90% (Netscape + MSIE) of all platforms, then yes, all (Chrome, Safari, etc) had to follow along.
Post reply on HN