Why, why, why with the significant whitespace? That makes it a non-starter for me.
Ante: A low-level functional language
71–80 of 226 posts
Re: Ante: A low-level functional language
#72Earlier quoted context omitted.
> f x -- too mathematical! :) yet we are very happy to use the same syntax in shell scripts or the shell itself.
I guess the difference is that nesting calls (commands) is much less common in the shell, and (closely related) commands don’t really have a return value.
grep "hello ($(cat patterns.txt| tr '\n' '|'|grep ')$^)" (grep 'a' >As.txt) >(grep 'b' > Bs.txt)
[yes, gratuitous use of cat, sue me]Re: Ante: A low-level functional language
#73That said, I'm a bit skeptical of the utility of refinement types (and dependent types in general). They greatly increase a language's complexity (by obscuring the type/value distinction and making type inference and checking more complicated). I'm not sure the benefits are worth it, particularly because of the so-called "specification problem."
Re: Ante: A low-level functional language
#74Looks interesting. How are closures implemented? Is it possible to use Ante without heap? Are function arguments passed by value?
Function arguments are passed by value currently, though I may explore pass by move and other options in the future.
I hope for ante to be usable without a heap, though the `ref` type automatically handling lifetimes makes this more difficult. These refs compile to an equivalent of destination-passing in C, but can require dynamic allocation if a function creates a ref and another function calls the first in a loop. I also plan on having an Allocate effect for whenever a function can allocate, so that it is trivial to handle this with your own handle that can do anything. This would be an easier alternative to zig's approach of "pass the allocator everywhere manually," but there are still things I need to iron out, like how it interacts with the lifetime inference issues above, so its still in the design phase.
Re: Ante: A low-level functional language
#75RE lifetime inference: how does it infer lifetimes for mutually recursive functions that return refs to what would be local data? Does it automatically infer a dynamic stack?
You don't touch on it, but there are some more difficult cases with lifetime inference as well. Namely branching the compiler must decide whether or not to extend a refs lifetime. This and a lack of granularity in container types are known problems with region inference (they lead to more memory than necessary being used by assuming the longest lifetimes), and are things I hope to tackle.
Re: Ante: A low-level functional language
#76????????
Re: Ante: A low-level functional language
#77Why, why, why with the significant whitespace? That makes it a non-starter for me.
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.
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
#78Note to the website authors: the carousel with examples is not usable on mobile - trying to scroll the code swipes away to the next item. Would be better as just a series of example blocks.
Also, black text on white background is easier to read.
And don't make your web design to complex for Firefox reader mode to work: if you do, that's a sign you're doing it wrong.
Re: Ante: A low-level functional language
#79Why, why, why with the significant whitespace? That makes it a non-starter for me.
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
#80Note to the website authors: the carousel with examples is not usable on mobile - trying to scroll the code swipes away to the next item. Would be better as just a series of example blocks.