11 ms·
There isn't so much in languages features themselves, but in their implementations. GC can be largely pauseless for many practical purposes and a GC language ca
by karmakaze 5y ago
There isn't so much in languages features themselves, but in their implementations. GC can be largely pauseless for many practical purposes and a GC language can be within 2x-3x the performance of C-like languages.
Also the amount/cost of memory has improved so that we can use immutable datastructures and functional style in many contexts, which definitely feels like a 'level-up'.
Concurrency has been getting easier too, with many languages supporting coroutines/async and/or threads. Reference capabilities are exciting as in Pony, Rust, or Clean.
In general there's a great convergence where ergonomics are improving (editors, compilers, build/package systems) and each language evolves to adopt features of other languages.
I just dabbled into the Sorbet type checker after not writing any C++ since the 90s, and it was surprisingly browseable/readable and could copy/paste the concepts based on recent Ruby, Java/Go knowledge.
- scythe 5y ago>GC can be largely pauseless for many practical purposes and a GC language can be within 2x-3x the performance of C-like languages. To that end, it seems like only recently we've seen automatic reference counting [Obj-C, Rust, Swift] and/or compile-time garbage collection [Mercury] in a non-toy implementation. "Breakthrough" is a difficult word because it refers to discovery and impact, with the latter coming long after the former, and it's not clear if ARC is really a game-changer for any serious applications, but it seems interesting at least.
- steveklabnik 5y ago(Rust does not do automatic reference counting)
- dcow 5y agoSure it does: `Arc::new(thing)`
- steveklabnik 5y agoThat is atomic reference counting, not automatic reference counting. With automatic reference counting, you do not need to wrap the variables, and you do not need to increment or decrement the counter. Rust requires that you actively make your values reference counted by wrapping them explicitly, and makes you bump the count explicitly. It uses RAII to decrement the count automatically though.
- deleted 5y ago[deleted]
- wizeman 5y agoAs far as I understand, the Mercury compiler doesn't do compile-time garbage collection (see the LIMITATIONS file).
- alexisread 5y agoFor me, Composita https://concurrency.ch/Content/publications/Blaeser_Component_Operating_System_PLOS_2007.pdf https://concurrency.ch/Content/publications/Blaeser_Componen... and ASAP https://www.semanticscholar.org/paper/ASAP%3A-As-Static-As-Possible-memory-management-Proust/4eb76f9a5b8874328773bf189a22b0975401f373 https://www.semanticscholar.org/paper/ASAP%3A-As-Static-As-P... Seem like a good way forward wrt memory management and concurrency, using ASAP inside a component, and delegating concurrency and component cleanup to Composita. Other languages like Maude http://maude.cs.illinois.edu/w/index.php/The_Maude_System http://maude.cs.illinois.edu/w/index.php/The_Maude_System Are pushing in new directions wrt proof checking.
- ragnese 5y agoIt's nice to read a positive comment like yours occasionally, because the vast majority of the time, I'm just disappointed in how bad our programming tools (including languages) are. It's become a meme in my office that I'm the guy constantly bitching about how stupid our languages are. This week I was back on my soap box about the fact that almost zero mainstream (statically typed) programming languages can even let you write down that you want a non-empty string. In some languages you can implement your own class/type that wraps around the built-in string type, but most of the time you are now introducing memory and CPU overhead, can't use your type with other APIs that expect strings, etc. So nobody does that. But ask yourself this: how often have you ever written a function that requested a string as input and actually wanted an empty string? How many times did you not even think about what would happen if someone DID pass an empty string? Same goes for positive and non-negative numbers. How many times did you write "int" when you actually only wanted a positive number? If I have to type "if x <= 0 throw FooException" as the first line of one more function, I'm going to scream. (A lot of languages do have unsigned ints, to be fair. But some still don't, or their unsigned ints are almost useless.) People make all kinds of Stockholm Syndrome-y excuses for it ("validate inputs at the edges is all you need"), but the truth is that (most of) our languages are so deficient for expressing really basic ideas. Thank goodness there are some languages that do try to make it possible to write "newtypes" and try to make concurrency safer. Now if we could just get everyone to adopt those in less than a decade, maybe we'd be able to get to the next generation after that, and then maybe we'll have good programming languages before I die. Sorry that turned into a rant... :/
- raspasov 5y agoCheckout Clojure spec for a very expressive way of defining data requirements. It allows you to use arbitrary functions to describe data requirements. That way you are not limited by static, compile-time only descriptions of data flowing through your program.
- ragnese 5y agoI used Clojure on a project while spec was still alpha/beta or something, so I never used it. It does sound interesting, but I'm skeptical. Even the way you described it- I'm still just writing a function to validate my data, aren't I? Is that truly any different than just calling `validateFoo()` at the top of my functions in any other language?
- amelius 5y agoAnother problem is that no language hits the sweetspot of a truly general purpose language. For example Rust doesn't allow freestyle functional programming (Haskell relies on a garbage collector for a reason), whereas at the other end of the spectrum Haskell doesn't allow precise control of CPU usage.
- pharmakom 5y agoIs such a language even possible? Seems like you have identified two desirable traits that conflict with each other.
- amelius 5y agoYou could have a language that offers both in different parts of the program. Just like Rust has an "unsafe" keyword, you could have a "garbage_collected" keyword or a "functional" keyword.