Live data from Hacker News

Ante: A low-level functional language

antelang.org

201–210 of 226 posts

Re: Ante: A low-level functional language

#201

Earlier quoted context omitted.

Fwiw C is actually a huge abstraction over modern hardware. It's a good representation of the PDP-11 and similar-era computers. It's also a good abstraction for modern microcontrollers. C's view of the world is also a really poor fit for today's larger CPUs. Your computer has to jump through a ton of hoops to make itself seem C-like. C has no concept of vectorization, speculative execution, branch prediction, multipl…

> C has no concept of vectorization OK, but vectorisation is exposed by the instruction set, as instructions[1] > speculative execution, branch prediction, ... caches, MMUs How would you expose speculative execution & branch prediction? Cache behaviour is well understood so what's wrong with it? What would you do to expose MMUs to the programmer, and what would they do with it/how would it help? [1] but aren't there…

Speculative execution and branch prediction are adaptations to compensate for C's failings as a description of desired semantics.

But they are thoroughly ingrained into the technology, and will not easily be rooted out.

Re: Ante: A low-level functional language

#202

Earlier quoted context omitted.

what makes Ante low level? Just from a cursory look over the website seems pretty high level to me.

My definition of low level is no tracing GC, values are unboxed by default, and users still have control to do low level things (raw pointers, other unsafe operations) when needed, even if it is not the default.

> My definition of low level is ...

This is a very deep and mature assessment. I have high expectations for the future of Ante. Higher than Rust, in particular, provided it supports some analog of destructors.

Re: Ante: A low-level functional language

#203
post #201

Earlier quoted context omitted.

> C has no concept of vectorization OK, but vectorisation is exposed by the instruction set, as instructions[1] > speculative execution, branch prediction, ... caches, MMUs How would you expose speculative execution & branch prediction? Cache behaviour is well understood so what's wrong with it? What would you do to expose MMUs to the programmer, and what would they do with it/how would it help? [1] but aren't there…

Speculative execution and branch prediction are adaptations to compensate for C's failings as a description of desired semantics. But they are thoroughly ingrained into the technology, and will not easily be rooted out.

Your first sentence doesn't answer any question. The second is irrelevant. Please make some concrete suggestions.

Re: Ante: A low-level functional language

#204
post #201

Earlier quoted context omitted.

Speculative execution and branch prediction are adaptations to compensate for C's failings as a description of desired semantics. But they are thoroughly ingrained into the technology, and will not easily be rooted out.

Your first sentence doesn't answer any question. The second is irrelevant. Please make some concrete suggestions.

There seems little value in "exposing" crap we would be better off not building in the first place.

The more expressive your language is, the less the runtime and hardware needs to guess about.

Re: Ante: A low-level functional language

#205

Earlier quoted context omitted.

Why compile to C when you can use LLVM?

C can sometimes be an easier target since you don't have to learn LLVM's API. C is also more portable than llvm since there is a greater variety of C compilers for a greater variety of architectures than llvm targets.

C as an API changes far more slowly than LLVM, too. Using LLVM is a real maintenance commitment.

Re: Ante: A low-level functional language

#206
post #204

Earlier quoted context omitted.

Your first sentence doesn't answer any question. The second is irrelevant. Please make some concrete suggestions.

There seems little value in "exposing" crap we would be better off not building in the first place. The more expressive your language is, the less the runtime and hardware needs to guess about.

So what are the $%^&* semantics we're supposed to build into the language to avoid the need for speculation via OOO exec and branch prediction. Because as a guy interested in languages you might have something to teach me, assuming you have any idea what you're talking about.

Re: Ante: A low-level functional language

#207

Earlier quoted context omitted.

There is a group of programming language enthusiasts that would be interested in all sorts of languages. Then there are people who will criticize just about anything for the sake of doing it. Just ignore those people and make a day more interesting for the people who share your passions.

That is the argument that has been made by my few friends who are interested in PLT as well. The other option I’ve considered if starting a blog or similar (although my son keeps suggesting a YouTube channel) and doing a longer series of posts concerning the language, type theory, and category theory inspirations present in the semantics of the language. I would love to imagine I could be the next Andrew Kelly (creat…

I get it that programming languages are quite different from most of other projects in that normal projects can have a small user base and still be considered a success in solving a given problem, but with programming languages the mere fear of not being able to reach a sizeable community is enough to not even try out a new approach.

Nevertheless I think there is space for experimental/research languages. Just don't burden yourself thinking in terms of "this is the next great thing" and it will be fun, and perhaps your work and the ideas underlying it will even leave a mark, even if that doesn't necessarily mean that the particular incarnation of that particular language will ever reach adoption.

We not only stand on the shoulder of giants. We all stand on the shoulders of billions of dwarfs.

Re: Ante: A low-level functional language

#208
post #180

Earlier quoted context omitted.

The generally accepted definition of a low level language is a language that provides little or no abstraction from a computer's instruction set architecture. In actuality, C is a lower level functional programming language than Ante, because C functions are first-class citizens. I like the lack of GC! What is the method for always incremental compilation? The benefits are obvious, but isn't it problematic to have tw…

Eh, isn't it a bit of a stretch to claim you can program functionally in C? You can mimic it, but without easy closures you can't follow _any_ functional programming patterns that are built on composing functions into new ones in expressions (e.g. binding the operation argument to a fold) C is great, and it would be cool to see something that is similarly close to the instruction set but has functions as values

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.

Re: Ante: A low-level functional language

#209

Earlier quoted context omitted.

Strangely the language "below" assembly, Verilog, is a lot more abstract and tries to pretend to look like C while generating hardware, so writing it is more like imagining how to trick it into doing what you want.

That's because a HDL is not a lower level machine language, but instead they are languages used to implement a machine that consumes a machine language. Consider what happens when you implement a x86 emulator in python: you're using a high level language to implement a machine using a particular substrate (a simulation inside another machine). This simulated x86 CPU executed machine code and you'd call that machine c…

It's not because of anything intentional, it's because Verilog is poorly designed.

https://danluu.com/why-hardware-development-is-hard/

https://danluu.com/pl-troll/

Re: Ante: A low-level functional language

#210
post #208

Earlier quoted context omitted.

Eh, isn't it a bit of a stretch to claim you can program functionally in C? You can mimic it, but without easy closures you can't follow _any_ functional programming patterns that are built on composing functions into new ones in expressions (e.g. binding the operation argument to a fold) C is great, and it would be cool to see something that is similarly close to the instruction set but has functions as values

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 expert considers it functional.

Post reply on HN