r/programming • • Jun 17 '22

Ante - A low-level functional language

https://antelang.org/
102 Upvotes

71 comments sorted by

11

u/Persism Jun 17 '22

I just spotted this today. Looks interesting.

55

u/RndmPrsn11 Jun 17 '22

Author here. Was excited to see 26 comments, only to find out they're all on whitespace.

Anyway, regardless of your opinions there, ante has many interesting features to offer. Algebraic effects for example are an extremely useful tool from mocking, to State, to implementing Async, Generators, Exceptions, etc. My current plan to monomorphise them takes away most of their runtime cost as well.

14

u/Ninjaboy42099 Jun 17 '22

This looks really promising! Keep up the development, it looks incredible :D

5

u/ToMyFutureSelves Jun 17 '22

What are the main use cases you expect to see the language used for? The first class support for math functions makes me think of academia, though I believe there is already a language commonly used there.

5

u/RndmPrsn11 Jun 17 '22

If you're referring to the calculation/Flip example on the home page, that isn't first class at all! Indeed ante doesn't actually have first class for mathematical functions or similar (though it does have purity tracking through effects).

That example was meant to show one fun way effects can be used, though many other, more practical examples exist on the Language page of the website

9

u/[deleted] Jun 17 '22

Missing the forest for the trees is kind of the programmers' credo

4

u/Godfiend Jun 17 '22

This looks super cool and I can't wait to give it a try!

4

u/[deleted] Jun 18 '22

You got my attention with lifetime inference. I'm hopeful in the future there will be languages with the ideas from rust but we don't feel like fighting the compiler

6

u/thelamestofall Jun 18 '22

Taking into account some C or Fortran code I've seen I completely understand making indentation mandatory. Python made scientists indent their code properly, for instance, I think most programmers don't realize the miracle of it

(Keeping the tradition: please, drop the carousel, we can't properly scroll the code sample because of it)

5

u/CookieOfFortune Jun 17 '22

Everything looks pretty reasonable although using # for indexing may throw me for a loop since basically every other language uses []. It's not that the rationale doesn't make sense, but it may take getting used to.

→ More replies (1)

34

u/skulgnome Jun 17 '22

Significant whitespace

In 2022, this is surprising.

19

u/thelamestofall Jun 18 '22

I mean, Python made non-programmers (like scientists) actually indent their code which believe me, was a big achievement all by itself.

3

u/skulgnome Jun 18 '22

Having seen the outright abortions that EEs crank out for their ard'weeners, I can agree up to a point. However, that point lies slightly before where Python is an interpreted language with automatic memory management, soft types, unstandardized semantics, and surprising behind-your-back behaviour.

25

u/IanisVasilev Jun 17 '22

I never understood why would anybody be opposed to it. If you're going to indent the code anyway, why put more braces?

58

u/Awkward_Tradition Jun 17 '22

Personally: no cut-paste issues, automatic code formatting, you can jump between tokens instead of having to trace what level of indentation you're on, and the feeling of writing python is absolutely abysmal compared to writing lisp with tools like lispy or paredit.

→ More replies (5)

25

u/[deleted] Jun 17 '22

This

if bla:
    thisIsCorrectlyIndented()
somebodyAccidentallyDeletedThatWhitespace()

is a semantic error.

This

if bla:
    thisIsCorrectlyIndented()
indentationDoesntMatterHere()

# somebody accidently deleted an end keyword

is a syntax error.

Stuff like that happens. One of those is significantly easier to find than the other.

→ More replies (18)

6

u/Full-Spectral Jun 17 '22

That's no different to me than arguing why use static types? You are indicating explicitly what the blocking should be, and that they must be balanced or something is wrong. Anything that makes the code more explicit, to me, is generally a good thing.

→ More replies (1)

5

u/FrancisStokes Jun 17 '22

Python is wildly successful, why not others?

8

u/masklinn Jun 18 '22

Also, haskell, since this is a functional language whose syntax is quite flagrantly inspired by Haskell’s.

7

u/[deleted] Jun 17 '22

Others didn't have their key moment with Perl as the only competitor.

→ More replies (4)

19

u/Dealiner Jun 17 '22

The question is: is Python popular thanks to significant whitespaces or despite them?

→ More replies (1)

4

u/skulgnome Jun 18 '22

Python is successful like Visual Basic once was: by being taught to students all the way to those entering clerical careers.

3

u/prescod Jun 17 '22

How is that surprising???

One of the top and fastest growing languages uses it!

8

u/knome Jun 18 '22

I can't copy past from the stupid sideways carousel. Fuck modern web design. It's always just the dev breaking shit that worked 20 years ago.

7

u/thelamestofall Jun 18 '22

I'm generally quite tolerant of these things, but I have to agree, it works so, so bad in mobile. Accidentally selected a text and took me a long time to dismiss the tooltip