5 ms·
You should take a look at D, if all you want is C/C++ like code, then you can focus on -betterC and use the libc or your own batteries (like i do) It is the pe
by Shadonototra 5y ago
You should take a look at D, if all you want is C/C++ like code, then you can focus on -betterC and use the libc or your own batteries (like i do)
It is the perfect language, don't sleep on it!
- throw_m239339 5y agoD had its chance. It made the mistake of trying to be a paid language (like Rebol) and failed at it, because clearly unless you're target a niche but lucrative industry, languages with a paid compiler are mostly a failure in the era of GCC and co. It's too late to develop a significant community around D. Rust clearly got the community aspect right.
- Shadonototra 5y agoRust is a failure because it takes an eternity to build projects, and is now infected by NPM-hell dependency management Imagine you have to wait for hours for your tests to compile and then to run, and then your micro services to compile to deploy a security update for a major CVS Rust is poorly designed with poor syntax with a poor foundation that can't scale in today day and age
- the__alchemist 5y agoI've been doing a lot of translating C to Rust lately, and the Rust variants are much cleaner and more explicit. Especially regarding namespaces (ie no need to name_space_name_every_data_structure), explicitly declaring array types and references of instead of using pointers, and state management.
- Shadonototra 5y agoEverything 'RE'written in X, Y or Z will look better because the problem was already solved, you only have to rewrite the text
- tialaramex 5y agoThere's perhaps some tiny kernel of truth in this, but as a generalisation it's obviously horribly wrong. Imagine trying to rewrite GCC in Bourne shell, or trying to rewrite the Linux kernel as Java. The results are not going to "look better" they're going to be awful, these languages are a terrible fit for the problem. What people keep finding with Rust is that it's a really nice language to write software you might otherwise write in C or C++. The defaults are correct, the tooling is great, the errors are superb, it's just a very nice experience.
- glouwbug 5y agoLow level systems programming in bash can be done: https://sdomi.pl/weblog/15-witchcraft-minecraft-server-in-bash/ https://sdomi.pl/weblog/15-witchcraft-minecraft-server-in-ba...
- pjmlp 5y agoI wouldn't call a very nice experience using Rust in anything related to GUI, graphics programming, HPC or distributed computing. Maybe in a couple of years.
- tialaramex 5y agoSome years ago I used to write some Gtk software (in C of course), and it seems to me that gtk4-rs is rather nicer than what I remember.
- pjmlp 5y agoThat is like discussing about sports car, and someone telling that they managed to do the same route in a bycicle. No designer, no localization workflows, no integration with UI/UX tooling, assistive tech stuck in the days Sun sponsored the project, no component ecosystem.
- tialaramex 5y ago
- dataangel 5y agoRust in the worst case only requires recompiling a crate at a time, and in the best case you can enable incremental compilation. I don't find compiling any slower than C or C++. If you're endlessly recompiling the same thing because you build from scratch every single time you'll have that issue with any compiled language. Also what dependency hell? Rust allows multiple versions of the same crate in the same binary so not everybody has to upgrade at the same time. Eliminates 99% of the hell for me. Cargo is awesome.
- audunw 5y agoZig and D comes at it from different ends. With D, it feels like the C replacement aspect of it is an afterthought, an add-on (I don't remember it being a big focus at all when I used it). Zig aims to be a C replacement from the start, including being a much better toolchain for cross-compiling C code than any other C compiler. For embedded development, which is what is relevant to me, I never found D a good option. If that has changed they need to work on the marketing. As an object-oriented garbage collected language with various nice features, I don't see what sets it significantly apart from C# anymore. Well, you can compile proper binaries. But dotnet core interpreters seems to be spreading on our Linux boxes, so then being able to run the same .exe in Linux and Windows is actually a nice thing. Then again I'm not in the market for such a language, so I probably shouldn't comment.
- Shadonototra 5y agoZig aims to be a total C replacement D is a natural evolution of C, fixes its issues (bounds checking and use after free for example), and adds some niceties that makes it pragmatic and polyvalent on top of a solid alternative to MACROs and metaprogramming capabilities You can do native system development, embedded development, high-level tasks thanks to the optional GC and it can also becomes a scripting language Something you can't have with Zig, but that's not its goal anyways Also D is one of the rare languages that maintains its own backend, its own compiler (with optimizations available!) and a community that grows organically without needing major corporations support, it is a true labor of love, and it still gets new features today (ImportC) Why i stick with D? because of all of the above! it's an unmatched language, that compiles code SUPER FAST! .. and the syntax remains similar to C/C++; no need to learn new syntax gymnastic
- Tozen 5y agoI get the impression that D has languished because it never placed itself as a language good for application development. In contrast, look where Pascal/Object Pascal (Delphi) went. When Pascal/Object Pascal got nudged out by C/C++ in system and embedded development, despite being and still is a strong alternative, it made itself useful in application development. IDE (Delphi & Lazarus), GUI framework (VCL and LCL), multi-OS apps, etc... It found a place to flourish, and is still being championed by various companies and taught in various school systems. Where with D, it seems to just be sitting in a corner, waiting to be noticed as a C++ replacement. But, people are not checking for D and hearing little about it. There is a long list of interesting languages, but if people don't see an almost immediate ROI for learning them, they will just sit and collect dust. Even if a language gets a bit of publicity, it still takes luck, timing, or corporate interest to move up the ranks.