Live data from Hacker News

Ante: A low-level functional language

antelang.org

121–130 of 226 posts

Re: Ante: A low-level functional language

#121
post #5

Earlier quoted context omitted.

> Is there a reason why you would make fn(1) and fn 1 equivalent? If your standard function call convention is just `f x`, but you also support precedence operators, then `f (x)` automatically becomes possible. It reminds me of an old Lisp joke, though: f x -- too mathematical! (f x) -- too many parenthesis! f(x) -- just right!

As an old lisp fan, I never got this. (f x) and f(x) have the same number of parenthesis. and the nice thing about (f x) is that the parenthesis group f with x; so you have the whole call inside the (). Consistent and simple to understand. vs i.e. print(f"a string"), where it isn't even clear that the "f" is a function call.

It's a stupid joke.

The negative reactions that a lot of people have toward Lisp's parentheses are not because of the call function syntax but because parentheses are used everywhere else in Lisp's syntax.

Re: Ante: A low-level functional language

#122
post #96

Earlier quoted context omitted.

I don't understand your objection, what output would you like to see instead?

GP's point is that while yes, we know since `f` has arity 1 there's no ambiguity, in general you might not have the arity of any given function fresh in your head, and therefore can't tell (in Ruby) just from looking at `f f 1` whether it means a single invocation of an arity 2 function, or two invocations of an arity 1 function

Ah! Right. It helps to have all functions be of arity 1 to disambiguate, yes.

Re: Ante: A low-level functional language

#123
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 takes four minutes.

I'd love to start again with a new, small language. I love Haskell, but it's decades old, and one struggles to work with it without being torn apart by the gravitational tides of the black hole at the center of its galaxy. All jokes aside, Haskell really does reward a PhD in category theory, or the self-taught equivalent later.

Functional languages make parallelism easier, and Haskell has put particular effort into this: Adding a dozen lines to a program can keep the 16 performance cores of my Mac Studio running full tilt. I have yet to read any account of how someone else's favorite language makes parallelism easy, that is aware of the comparison with Haskell. If I thought there was a reasonable alternative, I'd jump at trying it.

Rust appeals because it replaces GC with modern control of allocation lifetimes. I love how Ante will also explore this. I use cyclic data structures; how one handles this functionally, and how one handles this using reference counting, is exactly the same problem.

Parallelism should be the first consideration, designing any new language in 2022. Parallelism is the reason I keep using Haskell, despite newer alternatives. Any language that runs on a single core is a toy. This is a plea!

Re: Ante: A low-level functional language

#124
post #49

Earlier quoted context omitted.

> A lisp paren can do both jobs: expression and scopes. Using different symbols for different purposes makes sense, it helps humans to parse correctly faster.

That's right, which is why the parenthesis is combined with a leading symbol like (let ...). Mainly, you don't look at the parenthesis when reading; you look at that let and your eyes rely on indentation for structure.

Okay, but now you have to look at more things.

Also, the ending paren doesn't have anything to help you see what it is on its own.

Re: Ante: A low-level functional language

#125
post #90

Earlier quoted context omitted.

Thanks for sharing! The dot product example gave me pause because map2 seems to be the same as zipWith. Does that exist in Ante? Without context I might have thought map2 was going to act as bimap. Take that for what you think it's worth :) Also I might be having a brain fart -- but isn't the dot product in your example equal to 32?

map2 is indeed another name for zipWith. I believe I got that name from Racket if memory serves. Compared to zipWith I like its symmetry with the 1 argument map. I also wasn't aware of bimap! I can't seem to find a function of that name online, though I did find the BiMap haskell package, is that what you're referring to? And yes, the dot product should be 32, thank you :)

I was wondering why the dot product wasn't 32! Good thing I checked. Also this seems like a cool new language, I need to learn a functional language, I wonder how far this language will go in development.

Re: Ante: A low-level functional language

#127

Earlier quoted context omitted.

That's right, which is why the parenthesis is combined with a leading symbol like (let ...). Mainly, you don't look at the parenthesis when reading; you look at that let and your eyes rely on indentation for structure.

Okay, but now you have to look at more things. Also, the ending paren doesn't have anything to help you see what it is on its own.

Just ignore the parentheses. Setting them to the background color may enforce that.

Re: Ante: A low-level functional language

#129
This looks really lovely, I look forward to following the maturation of Ante in the future. I've often thought that the niche of a general purpose low-level FP language was a promising space. The only other langs that fit in there are ATS[1], which is notoriously complex/difficult-to-learn, and Futhark[2], which is more GPGPU/scientific-computing specific.

We've got Rust, which is essentially a C-style lang that steals all kinds of goodies from the ML family; it's nice to see Ante as a kind of inverse to this: i.e. an ML style lang that borrows some of the nice bits from traditional imperative langs (and hopefully maintains their performance characteristics).

Looking through the language tour there already seem to be a plethora of very sensible/ergonomic design decisions here. The 'loop' and 'recur' keywords are a great feature, making a nice little functional nod towards while loops. As a long-time Haskell user the explicit currying initially turned me off, but after seeing a couple examples I can see how it's actually a very reasonable solution, and moreover the ability to curry out of order is really nice instead of having to use 'flip' or similar combinators (as a side note, the explicit currying reminds me a bit of APL's α and ω arguments in dfns, a feature I'd love to see pop up more). The paired tuples also seem like they'd be a pleasure to use; certainly a bit more flexible than tuples in other ML style langs. Making '.' the pipeline operator is also a smart bit of syntax, and I can see it being very accessible to OO programmers in that it looks (and acts) like the method chaining they're familiar with. Refinement Types seem like a good alternative to full on dependent typing (ATS has an analogous (and more general) proof system for ensuring things like array indices are valid (an essential feature in a low level FP lang), but it involves threading those proofs through your program which seems much more clunky than what's presented here).

Overall I'm really excited to see where Ante goes, it seems like a very pragmatic functional language, something the world definitely needs more of...

[1]: http://www.ats-lang.org/Home.html

[2]: https://futhark-lang.org/

EDIT: In regards to low level FP langs there's also Carp, Erik Svedäng's nifty little statically typed Lisp. It's like Scheme with a Rust-y memory model:

https://github.com/carp-lang/Carp

Re: Ante: A low-level functional language

#130
post #3

The syntax looks a little funky to me but it's still quite interesting. Is there a reason why you would make fn(1) and fn 1 equivalent? For me personally it makes readability worse and looks strange when chaining functions like in their last example on their landing page. On mobile horizontal scrolling through the code snippets will trigger switching to the next snippet on my phone.

Haskell does this. Basically languages that are following the ML style have this syntax including Haskell. You must not have experience with this family of languages at it is very common and a huge part of functional programming. A good number of "functional programmers" only have experience with JavaScript these days.

Close, I saw this when dabbling with Nim and I remember I found it confusing, since I mostly write TypeScript and that is not a thing there so my post was mostly my ignorance speaking. I guess when one is used to it it will not look confusing at all!
Post reply on HN