1. I know what lambda calculus is, and I didn't even make the connection between \ and lambda. It's pretty tenuous.
2. Most programmers do not know what lambda calculus is. This is supposed to be a friendly language, not an obscure academic one.
3. It's not even the same lambda as in lambda calculus, e.g. it takes multiple arguments.
4. Lambda was a reasonable choice in lambda calculus since it's a very "mathsy" language, and it's pretty much the only symbol in the language. It's a pretty awful choice for a practical programming language though - there's a reason 99% of languages use something like `fn` or `fun` or `function` or `def` instead of lambda to define top-level functions.
I'm not a huge fan of `|foo|` either to be honest - I don't see why you can't simply use the same syntax for anonymous and named functions - but it is at least a little better.
Same syntax; just allow omitting the name and inferring the types. I can't recall any languages that do that though so maybe there's some tricky reason it can't work?
Right now I’m in between liking Gleam or Roc for a hobby functional language. The syntax you wrote is Gleam[1], well aside from it being List(). It’s very approachable, very consistent and that’s a core goal.
Roc was appealing because it was slightly more distinct and more unique. Plus it was more focused on speed. I appreciate them wanting to become more approachable. The new syntax seems less approachable to me because it’s now a half step between approachable Haskell and what feels like a combination of Ruby and Python.
I think because a closure is not a function as a closure can capture its environment, in a way that functions can't, so using the same syntax for closures and functions can be misleading (even though languages like JS do it)
> Most programmers do not know what lambda calculus is
I would frankly be shocked if a 4 year syllabus in CS these days just skipped any mention of Alonzo Church, especially considering that it's fundamental to functional programming and theoretical computer science...
Maybe it's not taught in "CS" programs that are actually just "practical software engineering" bootcamps with extra steps. The real nerds know about lambdas. They're even literally called that in Ruby (and possibly other languages).
FYI: I have a computer science degree. I never learned any functional programming, nor lambda calculus during university. I learned about both topics in my late 30s as a professional.
I find this insane, considering how important I find it now.
Honestly, I didn't take enough CS to get into functional langs, but I did learn what a lambda was. The importance of it all came later, after years of struggling with bugs in million-line codebases that wouldn't have even existed in an immutable, functional language without inheritance.
Your school should lose its accreditation. Your programme is an absolute failure and sounds like they called their software engineering programme computer science
Sure, but that also means this kind of syntax does not alienate people just because they don't know what lambda calculus is. And they will appreciate it even more when one day they get curious and look up why it is called a lambda
1. I know what lambda calculus is, and I didn't even make the connection between \ and lambda. It's pretty tenuous.
2. Most programmers do not know what lambda calculus is. This is supposed to be a friendly language, not an obscure academic one.
3. It's not even the same lambda as in lambda calculus, e.g. it takes multiple arguments.
4. Lambda was a reasonable choice in lambda calculus since it's a very "mathsy" language, and it's pretty much the only symbol in the language. It's a pretty awful choice for a practical programming language though - there's a reason 99% of languages use something like `fn` or `fun` or `function` or `def` instead of lambda to define top-level functions.
I'm not a huge fan of `|foo|` either to be honest - I don't see why you can't simply use the same syntax for anonymous and named functions - but it is at least a little better.
If it were up to me I'd go with something like
Same syntax; just allow omitting the name and inferring the types. I can't recall any languages that do that though so maybe there's some tricky reason it can't work?