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…
Ante: A low-level functional language
41–50 of 226 posts
Re: Ante: A low-level functional language
#42Note 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.
Re: Ante: A low-level functional language
#43Very 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.
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
#44Note 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.
Re: Ante: A low-level functional language
#45Earlier 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.
(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
#46Note 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.
Re: Ante: A low-level functional language
#47Earlier 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.
Re: Ante: A low-level functional language
#48Earlier 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.
Re: Ante: A low-level functional language
#49Earlier 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.
Using different symbols for different purposes makes sense, it helps humans to parse correctly faster.
Re: Ante: A low-level functional language
#50Earlier 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.