Earlier quoted context omitted.
> You wrote code, you knew roughly which instructions it translated to, and there you went! This must have been a very very long time ago, with optimizing compilers you don't really know even if they will emit any instructions.
On x86-type machines, you still have a decent chance, because the instructions themselves are so complicated and high-level. It's not that C is close to the metal, it's that the metal has come up to nearly the level of C! I wouldn't dare guess what a compiler does to a RISC target. (But yes, this was back in the early-to-mid 2000s I think. Whether that is a long time ago I don't know.)
I stopped everything and started writing C again
121–130 of 475 posts
Re: I stopped everything and started writing C again
#122Re: I stopped everything and started writing C again
#123Earlier quoted context omitted.
Rust has three major issues: - compile times - compile times - compile times Not a problem for small utilities, but once you start pulling dependencies... pain is felt.
Long compile time isn't a new issue for language with advanced features. Before Rust, it was Haskell. And before Haskell, it was C++. And implementation wise, probably there's something to do with LLVM.
You don't need to wait for long compile times in Haskell if you don't want to, there are interpreters and REPLs available as well.
You don't need to wait for long compile times in C++ if you don't want to, most folks use binary libraries, not every project is compiled from scratch, there are incremental compilers and linkers, REPLs like ROOT, managed versions with JIT like C++/CLI, and if using modern tooling like Visual C++ or Live++, hot code reloading.
Re: I stopped everything and started writing C again
#124I fully understand that sentiment. For several years now, I have also felt the strong urge to develop something in pure C. My main language is C++, but I have noticed over and over again that I really enjoy using the old C libraries - the interfaces are just so simple and basic, there is no fluff. When I develop methods in pure C, I always enjoy that I can concentrate 100% on algorithmic aspects instead of architectu…
Re: I stopped everything and started writing C again
#125Earlier quoted context omitted.
The C standard makes provisions for compiler implementers which absolve them from responsibility of ignoring the complexity of the C language. Since most people never actually learn all the undefined behavior specified in the standard and compilers allow it, it might seem the language is simpler, but it's actually only compilers which are simpler. You can argue that Rust generics are a trivial example of increased co…
True, if C wanted to be Rust it would be just as complicated. But who cares? The fact that C chooses not to nail everything down makes it a simpler and more flexible language, which is why it's sometimes preferred.
Re: I stopped everything and started writing C again
#126Earlier quoted context omitted.
> You wrote code, you knew roughly which instructions it translated to, and there you went! This must have been a very very long time ago, with optimizing compilers you don't really know even if they will emit any instructions.
On x86-type machines, you still have a decent chance, because the instructions themselves are so complicated and high-level. It's not that C is close to the metal, it's that the metal has come up to nearly the level of C! I wouldn't dare guess what a compiler does to a RISC target. (But yes, this was back in the early-to-mid 2000s I think. Whether that is a long time ago I don't know.)
Just let your C(++) compiler generate assembly on an ARM-64 platform, like Apple Silicon or iOS. Fasten your seat belt.
Re: I stopped everything and started writing C again
#127Then I moved into backend development, where I was doing all Java, Scala, and Python. It was... dare I say... easy! Sure, these kinds of languages bring with them other problems, but I loved batteries-included standard libraries, build systems that could automatically fetch dependencies -- and oh my, such huge communities with open-source libraries for nearly anything I could imagine needing. Even if most of the build systems (maven, sbt, gradle, pip, etc.) have lots of rough edges, at least they exist.
Fast forward 12 years, and I find myself getting back in to Xfce. Ugh. C is such a pain in the ass. I keep reinventing wheels, because even if there's a third-party library, most of the time it's not packaged on many of the distros/OSes our users use. Memory leaks, NULL pointer dereferences, use-after-free, data races, terrible concurrency primitives, no tuples, no generics, primitive type system... I hate it.
I've been using Rust for other projects, and despite it being an objectively more difficult language to learn and use, I'm still much more productive in Rust than in C.
Re: I stopped everything and started writing C again
#128I started programming with C a long time ago, and even now, every few months, I dream of going back to those roots. It was so simple. You wrote code, you knew roughly which instructions it translated to, and there you went! Then I try actually going through the motions of writing a production-grade application in C and I realise why I left it behind all those years ago. There's just so much stuff one has to do on one…
Is that not the problem rust was created to solve?
Re: I stopped everything and started writing C again
#129I started programming with C a long time ago, and even now, every few months, I dream of going back to those roots. It was so simple. You wrote code, you knew roughly which instructions it translated to, and there you went! Then I try actually going through the motions of writing a production-grade application in C and I realise why I left it behind all those years ago. There's just so much stuff one has to do on one…
Related-- I'm curious what percentage of Rust newbies "fighting the borrow checker" is due to the compiler being insufficiently sophisticated vs. the newbie not realizing they're trying to get Rust to compile a memory error.
Re: I stopped everything and started writing C again
#130I started programming with C a long time ago, and even now, every few months, I dream of going back to those roots. It was so simple. You wrote code, you knew roughly which instructions it translated to, and there you went! Then I try actually going through the motions of writing a production-grade application in C and I realise why I left it behind all those years ago. There's just so much stuff one has to do on one…
> Similar to C, but with much more help from the compiler with all sorts of things. Is that not the problem rust was created to solve?