Live data from Hacker News

Ante: A low-level functional language

antelang.org

41–50 of 226 posts

Re: Ante: A low-level functional language

#41
post #40
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.

> Is there a reason why you would make fn(1) and fn 1 equivalent? 1 and (1) are isomorphic. A single term tuple can be converted to the single term, and vice versa. Having an implicit conversion doesn't seem too crazy. The biggest issue I suspect would be confusion about the most idiomatic way, or a mix of styles in real-world code bases, that causes confusion or inconsistencies (increases cognitive load for the read…

I'm not sure I like a single item tuple being equivalent to just the item. Can you ask for the length of a tuple? The length of a tuple with two 100 element lists would be 2, and if you looked at the tail the length would be 100.

Re: Ante: A low-level functional language

#42

Note 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.

On mobile, I just go to ⋮ then "Desktop site", much wider display.

Re: Ante: A low-level functional language

#43

Very interesting stuff! I didn't even thought is possible to implement a low level functional languages, I always thought a functional language requires a ton of abstractions.

Not at all, there only needs to exist enough low level primitives (aka compiler intrisics) to build the whole stack.

That is how Lisp Machines and Xerox PARC workstation OSes used to be built, or Mirage OS for a more recent example.

And I do consider Lisp functional, since when I reached university, the options were Lisp dialects, Mirada was fresh, Standard ML and Caml Light were rather new.

There was yet to appear the mentality that OCaml / Haskell === FP.

Re: Ante: A low-level functional language

#45
post #41
post #40

Earlier quoted context omitted.

> Is there a reason why you would make fn(1) and fn 1 equivalent? 1 and (1) are isomorphic. A single term tuple can be converted to the single term, and vice versa. Having an implicit conversion doesn't seem too crazy. The biggest issue I suspect would be confusion about the most idiomatic way, or a mix of styles in real-world code bases, that causes confusion or inconsistencies (increases cognitive load for the read…

I'm not sure I like a single item tuple being equivalent to just the item. Can you ask for the length of a tuple? The length of a tuple with two 100 element lists would be 2, and if you looked at the tail the length would be 100.

I agree. It's better to have single-item tuples still require a comma.

(1) - the number 1

1 - the number 1

(1,) - a tuple with one item, which is the number 1

1, - a tuple with one item, which is the number 1

Re: Ante: A low-level functional language

#46

Note 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.

It's broken on desktop as well. I was trying to select some example code to copy and paste it in a comment here, but that just click on it drags the carousel rather than allowing me to select text.

Re: Ante: A low-level functional language

#47
post #41
post #40

Earlier quoted context omitted.

> Is there a reason why you would make fn(1) and fn 1 equivalent? 1 and (1) are isomorphic. A single term tuple can be converted to the single term, and vice versa. Having an implicit conversion doesn't seem too crazy. The biggest issue I suspect would be confusion about the most idiomatic way, or a mix of styles in real-world code bases, that causes confusion or inconsistencies (increases cognitive load for the read…

I'm not sure I like a single item tuple being equivalent to just the item. Can you ask for the length of a tuple? The length of a tuple with two 100 element lists would be 2, and if you looked at the tail the length would be 100.

[deleted]

Re: Ante: A low-level functional language

#48
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!

> 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.

Re: Ante: A low-level functional language

#49

Earlier quoted context omitted.

> (f x) and f(x) have the same number of parenthesis. That's the joke

I have heard that if you count { and ( as parens, a Java program for example has just as many parens as. lisp one. A lisp paren can do both jobs: expression and scopes.

> 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.

Re: Ante: A low-level functional language

#50
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!

> f x -- too mathematical! :) yet we are very happy to use the same syntax in shell scripts or the shell itself.

We’re not, but your point is still valid.
Post reply on HN