r/AskComputerScience • • 6d ago

Domain languages /native speed

I know well the trade off between domain languages / efficiency compared with c / assembler

CPU / memory are fast enough for good enough performance but with memory supply issues I wondered if direction were going to be able develop better domain languages to break trade off.

modern compilation - reflection - macros - templates

languages like c should only be written by experts and or machines imo way too risky for domain users.

Eg in audio domain I want to write code fast enough for realtime have it expanded to low level code - using linked list/stack/heap/hash/midi etc

Instrument a as piano :
a.octave = + 2
a.root = g
a.feel = shuffle
a.scale = enigma
a.play(100)

I don’t want to manage memory / lifetime or use library
Ie I want the compiler to do the translation?

Is this reasonable or am I dreaming ? Do you think we need stronger reflection ie I probably need to work with ast at the moment.

0 Upvotes

11 comments sorted by

View all comments

1

u/hayztrading 6d ago

C#

1

u/Robot_Graffiti 6d ago

Yep. JITed languages like C# etc can give you a great feature set without running painfully slow. For typical business code it's something like maybe 80% the speed of C++. That's pocket change compared to the 10,000× difference you can see between the best algorithm you can think of and the O(n³) nonsense the worst guy in your team will write.