News for hackers. Stuff that matters.
Re:Ante: A low-level functional language by rmrfchik on Friday June 17, 2022 @08:41AM (#31777227)
Age of "var, val" is over. Now age of "significant whitespace". If seriously, seems like indent syntax is default to go nowadays. Python has way too big influence on language designers.
Re:Ante: A low-level functional language by jfecher on Friday June 17, 2022 @09:00AM (#31777462)
I'm not a fan of python (it handles significant whitespace somewhat poorly). Cases like mixed tab-space whitespace and single-line only lambdas are python-specific problems for example.

I chose it mainly because I like the style and I haven't found it to be an issue in practice yet, especially with flexible rules for line continuations. The biggest detriment to me is the lack of auto-formatters for indentation.

Edit: I'll add to this a point I haven't seen discussed before about functional languages using the `f a b` syntax specifically. Without significant whitespace you cannot really have semicolon ellision with this syntax since almost any line may be interpreted as a function application of the next line. E.g. `a = b + c` and `foo 32` as subsequent lines would be interpreted as `a = b + (c foo 32)`, hence why ocaml requires semicolons. For some people semicolons are fine, but they're just noise to me :)

There's more detail on the specific significant whitespace scheme used on the website here: https://antelang.org/docs/language/#significant-whitespace

Re:Ante: A low-level functional language by strbean on Friday June 17, 2022 @01:59PM (#31781917)
Regarding single-line only lambdas, I think that isn't an intractable issue with the grammar.

Guido van Rossum basically said parsing them is hard, and he doesn't like lambdas in the first place, so it won't happen. [0]

Similar to "tail call optimization encourages dirty FP nerds" logic. Terrible decisions IMHO.

[0]: https://www.artima.com/weblogs/viewpost.jsp?thread=147358

Re:Ante: A low-level functional language by jfecher on Friday June 17, 2022 @03:18PM (#31783003)
Agreed. Other whitespace sensitive languages like Haskell, F#, and Ante handle multiline lambdas just fine
Re:Ante: A low-level functional language by rmrfchik on Friday June 17, 2022 @10:09AM (#31778426)
You claim, significant whitespace helps mitigate "goto fail" errors. As for me, indent syntax allows more human errors during refactoring. When moving code blocks around, you can easily misplace whitespaces and compiler/editor has no ability to help you.
Re:Ante: A low-level functional language by jfecher on Friday June 17, 2022 @03:23PM (#31783056)
This is definitely an issue, but isn't one I run into often. Just like if I'm pasting code in rust I need to make sure it is inside or outside an if statement, I likewise need to ensure pasted code in ante is inside/outside the if statement by looking at its indentation relative to the previous line. The compiler can help somewhat here, just not a lot. If your indentation is not on an existing indentation level you will get an error since you cannot randomly start indent blocks in your code. I do think the biggest detractor of indentation-sensitive syntax in general is the loss of auto-formatting indentation though.
Re:Ante: A low-level functional language by PontifexMinimus on Friday June 17, 2022 @09:02AM (#31777486)
That and Haskell.
Re:Ante: A low-level functional language by pjmlp on Friday June 17, 2022 @03:39PM (#31783243)
ML languages did it first.