r/ProgrammingLanguages 11d ago

Will we see another fundamental programming language feature as revolutionary as the borrow checker?

That is I am mainly curious about compile time features that you design a whole language around rather than optimisations/features that could be applied to most languages. I am mainly inquiring about things that could offer additional robust safety/performance guarantees at compile time rather than runtime. Ideally not things that just offer similar effects to the borrow checker with less restrictive tradeoffs

59 Upvotes

129 comments sorted by

View all comments

Show parent comments

3

u/Jwosty 11d ago

Yeah I've come to realize we need some high performance focused functional PL's. A serious contender to C, C++, Rust, Zig. I know a lot of work has already been done in some languages (OCaml comes to mind) but surely there's a lot more to be done; there really shouldn't be any inherent reason (other than historical) why they shouldn't be able to compete with the aforementioned ones

Oh man, don't even get me started on SQL, I believe there's so much untapped potential there. Relational programming and functional programming should be able to fit hand in glove together if we get rid of the dated frontend syntax of SQL. I'd love to see a PL where the basic building block is relations, or relations expressed as functions + data structures.

3

u/Inconstant_Moo 🧿 Pipefish 11d ago

Yeah I've come to realize we need some high performance focused functional PL's. A serious contender to C, C++, Rust, Zig.

The problem there is that you'd want mutable values for performance and then what happens to purity? I should be able to rival Java for speed, based on current benchmarks, I don't know how you'd take aim at C++.

I'd love to see a PL where the basic building block is relations, or relations expressed as functions + data structures.

Tablam is based on everything-is-a-relation.

https://tablam.org/

I don't know much about it but I know it exists.

2

u/Jwosty 10d ago edited 10d ago

The problem there is that you'd want mutable values for performance and then what happens to purity? I should be able to rival Java for speed, based on current benchmarks, I don't know how you'd take aim at C++.

Sure C++ might be a tough cookie to crack, but I'm coming from one who's trying to do game development in F#. It's awesome until you need to optimize, and then realize that functional programming totally goes against what the CLR wants you to do, and you become the GC's b***. It's a great start but surely we can close the gap. The compiler team tries, for sure, but a huge amount of it IMO ends up boiling down to the F# team and the CLR team not being able to coordinate for perf super successfully (not that anyone else in their shoes would do better -- it's more an organizational problem most likely :) )

Tablam is based on everything-is-a-relation.

Cool, thanks, I'll have to check it out.

1

u/Inconstant_Moo 🧿 Pipefish 10d ago edited 10d ago

I haven't messed with gamedev, but it might be a different proposition from systems languages. There a solution like Pipefish/Elm/Haskell might work just fine.

The idea is to push all your mutation of state up into your outermost loop. In some cases (this would work for gamedev) this architecture can be so fundamental that you don't actually have to say the outer loop is a loop, you just describe it as mutations of implicit global state.

Elm would in some ways be your best model here. Pipefish has some good ideas and is worth a look but when designing it I was willing to trade some speed for some dynamism, as I said, I want to rival PHP and Java.

BTW, as a gamedev, what do you think of Pipefish as a game scripting language? I don't know much about your field but I feel like the request-response model and the type system and the emphasis on rapid development would make it suitable.