I avidly follow descendants of Scheme and Haskell (I figured out for example how to build Idris native on an M1 Mac), and I plan to follow Ante. I just spent $5k of lunch money on an M1 Ultra Mac Studio, to use as a math compute server. How do I keep it busy? Haskell. My "Hello world" parallel benchmark, using reverse search to enumerate the 66,960,965,307 atomic lattices on six atoms, took 14 hours in 2009. It now t…
Ante: A low-level functional language
221–226 of 226 posts
Re: Ante: A low-level functional language
#222Earlier quoted context omitted.
A functional programming language is a programming language in which functions are first class citizens. C is such a language. Of course there are many programming patterns that are in more acceptable functional programming languages than C. Whether a programming language is considered functional is not the same as which patterns are supported in the language.
Your idea of what FP means is completely nonstandard. For the record, there is not one accepted definition, but we can get close by saying that FP languages are those based on lambda calculus as their semantics core. And the primary mechanism in lambda calculus is variable capture (as done in closures). C is based on the Von-Neumann model and has absolutely nothing to do with the lambda calculus. No reasonable PL exp…
Re: Ante: A low-level functional language
#223Can someone please explain what is an "uninterpreted function", in the context of Ante's refinement types? The Wikipedia article didn't help much ( https://en.wikipedia.org/wiki/Uninterpreted_function ).
Re: Ante: A low-level functional language
#224Re: Ante: A low-level functional language
#225Functional is always at odds with low level programming because of heap allocation. You can't control it because of immutability. Just a simple map operation does a heap allocation. How does Ante avoid this problem and give the user control of the heap? The mechanism should be made clear in the introduction as browsing the documentation doesn't make it clear to me.
In the case of map operations, Ante is using Rust style iterators over collections. In Rust, iterators are just as fast as loops. The author said somewhere else in the thread they want to switch to generators implemented with effects eventually.
However for things like "sorting" this can never fully be achieved. You cannot sort a generator. Every iterator counterpart needs a list counterpart or there will be literally certain computations that are impossible.
Re: Ante: A low-level functional language
#226Earlier quoted context omitted.
The plan is to give users control through the Allocate effect which can be handled in any way desired as long as it returns some memory. It is similar, but easier to use since it is an effect, to zig's approach of "pass the allocator everywhere." I say easier to use since effects are automatically passed around where necessary and propagated via function signatures and can be inferred. The specific design is still in…
Here the `Allocate` effect is just a syntactically-lightweight way of doing dependency injection, right? Similar to a Haskell type class. I don't see why you'd need to make it an algebraic effect, as it does not need to mess with control flow AFAIK.