4 ms·
Wouldn't a managed runtime mean it isn't suited for systems programming? The benefit of something like Rust is it provides a lot of the benefits of a managed la
by jplayer01 8y ago
Wouldn't a managed runtime mean it isn't suited for systems programming? The benefit of something like Rust is it provides a lot of the benefits of a managed language while producing native code and "zero-cost abstractions". A runtime adds a lot of overhead etc.
- pjmlp 8y agoC also has a runtime, that is what takes care of calling main(), handling VLAs, floating point emulation, constructor/destructors (GCC C extensions), ... Besides there are plenty of OSes written in type safe system languages to learn from, including surviving mainframe OSes.
- jstimpfle 8y agoI feel much of the negativity that you like to express towards C is unwarranted. Fact is, it's both very easy and efficient to interface with "C" or more specifically, platforms' standard ABIs.
- pjmlp 8y agoOn platforms written in C. As for the negativity, Morris worm is now 30 years old and the CVE database gets C derived exploits every month.
- jstimpfle 8y agoYou can interface with Object Pascal (which you frequently advertise) just fine. (That doesn't make Object Pascal a practical language, though). https://www.quora.com/Why-is-the-JVM-so-riddled-with-security-bugs https://www.quora.com/Why-is-the-JVM-so-riddled-with-securit... Another fact is, startup times alone make JVM impractical for many endeavours. For each task an appropriate tool I'll say.
- pjmlp 8y agoJVM startup times are only an issue for those that don't want to buy a commercial JDK with AOT compiler support. Good news, now OpenJDK and GraalVM offer it for free, gratis. Object Pascal/Delphi is quite pratical on Windows.
- jstimpfle 8y ago> Object Pascal/Delphi It has a sane subset which is basically C with a slightly saner syntax than C (the begin...end and lacking data initialization syntax are terrible though!), and with a proper module system and much better compile times. On the other hand, it was crippled by missing a usable preprocessor and an ecosystem that has bought into each hype since the 90's, resulting in 23 incompatible kinds of strings, 101 different dynamic arrays, and about 5 (really) incompatible object models with different kinds of memory management. Programmers with many years in the language don't really understand all the ways memory is managed in this language. Now try writing something on top of the broken RTTI for that. Even official guides basically concede the fact by writing quirky code that easily breaks. Also you have to declare typealiases for every little thing like pointer-to-types, before you can use that type in a function signature. This alone renders it almost completely unusable for my purposes. It has a culture of goto-considered-harmful where people like to indent 13 times instead of using return/continue/break, which would yield readable control flow. If you want to return something, you need to write two lines - assigning to the result and calling exit(). You can't call exit() though when the current class has a method called exit(), since that method is closer in scope (REALLY REALLY WEIRD). I know what I'm talking about. I've been paid to work in it, and refactored a subsystem written in idiomatic Delphi to be halfway maintainable, achieving real speedups of 100-1000x by following a straightforward "data-oriented" approach, just like I would write it in C, writing complicated code only where the straightforward approach was not feasible in the language. Despite completing the project successfully (there hasn't been a single problem since the rewrite), in the end I was burnt out due to having to work with the original code. Didn't work for 5 months afterwards.
- deleted 8y ago[deleted]
- earenndil 8y agoThe operative word here is managed runtime. Jvm wants to completely own your program, heart and soul. You can also write freestanding code in c (and rust, d, zig I assume although I don't know enough about it). I believe there is a dialect of c# that allows you to write freestanding code, but it's not really c# so much as c#-flavoured c with some extra features, so it's inferior to other c alternatives. As for type safe system languages, ada?