5 ms·
They recently changed the syntax to add parens, commas and use `|arg|` for closures :) https://github.com/roc-lang/roc/releases/tag/0.0.0-alpha2-rolling https:
by hillcapital 2y ago
They recently changed the syntax to add parens, commas and use `|arg|` for closures :)
https://github.com/roc-lang/roc/releases/tag/0.0.0-alpha2-rolling https://github.com/roc-lang/roc/releases/tag/0.0.0-alpha2-ro...
- anacrolix 2y agoBoooo
- masijo 2y agoJesus, why? This is a bummer.
- deleted 2y ago[deleted]
- hajile 2y agoPretty much all of those changes look bad to me.
- trescenzi 2y agooh wow it went from being a very clear language to looking more like a hodgepodge of a few different languages.
- IshKebab 2y agoAh great improvements! I don't know why the sibling comments are so negative; this is clearly better.
- tasuki 2y agoWhy? I'm used to \ meaning lambda. I understand you aren't, and that's fine. But it's just your weird opinion determined by what programming languages you've learned. Ultimately, it's just syntax and not so important. Semantics are important.
- IshKebab 2y ago> Why? I'm used to \ meaning 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 fn double(a: list[int]) -> list[int] { a.map(fn(i) { i * 2 }) } 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?
- Hasnep 2y agoRoc does use the same syntax for anonymous and named functions, both before and after the recent syntax changes.
- trescenzi 2y agoRight 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. [1]: https://gleam.run/ https://gleam.run/
- pmarreck 2y ago> 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).
- 3836293648 2y agoAre the Roc people really doing everything they can to ruin everything they had going for them? Appealing to those who know nothing and won't be willing to touch anything FP at the cost of annoying those who actually want to try it is just so stupid
- darthrupert 2y agoI say this as someone who enjoys reading Rust more than Haskell or Elm -- that looks like a really bad idea for aesthetic reasons anyway. I mean if you want the syntax to look like Zig or Rust, perhaps go all the way there instead of making a kind of a mutant hybrid like this. Syntax is superficial and the semantics actually matter, but that doesn't mean the syntax can be just anything. Is there some deeper technical reason for making such changes?