Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Ideal memory management in your dream PL.

Name: Anonymous 2014-10-21 8:06

Imagine you are designing a practical relatively low-level programming language to use instead of C++. What approach to memory management would you use?

In case someone asks, ``what is wrong with manly manual memory management in C++?'', I would briefly explain my disdain towards it. C++ strives to allow for efficient programs to be written, yet you have to jump through hoops and remember 30 different things if you want to avoid inefficiences C++ compilers inject into your application code. Where C would hit the spot with passing of pointers, C++ programmers need to know about RVO and const references and rvalues and perfect forwarding and noexcept declaration of copy constructors (why even have copy constructors anyway‽ how sane is having such thing‽) and reference collapsing rules. All just to prevent compiler from inserting procedures that needlessly copy your data multiple times here and there.

Instead of fixing a conceptually shitty design the committee adds 5 even more shitty things, each with its own semantics, each designed to work around one compiler/stdlib deficiency or another. Each has to be used manually.

So C++ programmers spend their brain cycles on recalling hundreds of shitty techniques while churning out code doing stuff which would be trivial for a saner language compiler to infer, instead of focusing on actual functionality.

Since it is lunch time where I work, I want to fantasize about a language/compiler which has most or all benefits of fast memory management (no GC), takes modern hardware into account, and doesn't fucking get in your way every time you pass a string to a function.

Name: Anonymous 2014-10-23 5:44

>>16
I'm nearing the end of a two week project using Rust. My main motivation writing with Rust is to avoid writing with any C++ nightmares in the future.

Unfortunately, I'm arriving at a similar conclusion which you mentioned. It has good ideas to be implemented on a lower level lang. However, the explicitiness, lack of higher kinds, funky fn names for simple stuff, and tiring conversions between primitives can be really annoying at times. Sometimes, it's too much because now I have a 150+ col one liner which would have been 50 col in C. Its verbose and complex syntax is difficult to read.

I really want to like it more than its currently worth. And I'll probably use it off/on and before/after it hits 1.0 because I'm sure as hell won't ever be going back to C++. But I don't enjoy it as much as its capable.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List