7 ms·
Rust copied tooling from Go and Python. Also its tooling cannot work without internet and need to download MB's of data for simple development, and on the other
by dragonsh 7y ago
Rust copied tooling from Go and Python. Also its tooling cannot work without internet and need to download MB's of data for simple development, and on the other hand proclaims itself to be systems programming language to replace C and C++ which doesn't require active internet to work.
Also C++17 is much better version taking away the deficiencies of earlier versions and if not better at least provide similar run-time guarantee and safety as Rust (which also needs to rely on unsafe code to do anything meaningful with systems programming).
So if you use either modern incarnation of C++ or Rust, you will get same safety guarantees. Just with C++ you will not have to climb the mountain of learning just to do simple things.
I think Rust gets a lot of hype because it's syntax is complex and learning curve is much higher than C or C++ and programmers see new shiny language which got some traction as Panacea for all the programming problems.
- heavenlyblue 7y agoDid you forget how much apt-get build-essentials is going to take in terms of space?
- shiftless 7y agoDid you miss the "cannot work without internet" part? That is only one of several dealbreakers for me, for all of these Web 2.0 shitware tools. Only a fool connects his dev machine to the internet, knowing what we do now about the state of computer insecurity. The other dealbreaker in this case being that Rust is developed by Mozilla, an evil organization that is joined to the hip with another evil organization (Google.)
- ben-schaaf 7y ago> So if you use either modern incarnation of C++ or Rust, you will get same safety guarantees. As a C++ Dev who's done some rust on the side this is utter horseshit. Regardless of which C++ version you use it is utterly trivial to write code with undefined behaviour. Even if you're extremely diligent you will eventually be hunting down a bug caused by undefined behaviour.
- pjmlp 7y agoKind of, if one belongs to the developer category that doesn't use static analyzers as part of the compile/build cycle.
- nindalf 7y ago> which also needs to rely on unsafe code to do anything meaningful with systems programming Rust allows you isolate such instances of unsafe-ness to specific parts of your code base. When you're auditing for safety, you only need to audit those specific parts because everything else is safe by default. For example, the implementation of std::vec::Vec uses unsafe, but it exposes a safe interface. So once you've audited the few hundred lines of std::vec as being safe, you're sure that the millions of lines of code relying on it are transitively safe. > which doesn't require active internet to work cargo build, cargo clippy, rustfmt, rust-analyzer, rustc all work without internet. If you want to fetch dependencies from the internet, you need an active connection. If you're in a situation where internet isn't available, you can work around this by writing all the libraries you need. Same with rustup - it needs the internet to download new versions of rustc and cargo. > you will not have to climb the mountain of learning just to do simple things. I'm sorry you felt this way. Learning materials are improving all the time and the language is improving too. For example, future combinators were a pain but with the advent of async-await it's easier to write and read code that deals with Futures. Give it another try :)
- dragonsh 7y ago> If you're in a situation where internet isn't available, you can work around this by writing all the libraries you need. Why can’t cargo be simple enough like pypi where all the dependencies are in intranet and private or another way is all the dependencies are in my own simple folder and can update it separately whenever I need rather than relying on an internet connection. Rust cannot match C and it will always need to interface with C code, so in the end it will only be as safe as the C code it is interfacing. I do not understand why to create complex syntax and semantics and difficult to learn language in spite of so much development in compiler world. Like Swift which is similar to Python style syntax. Also Swift is performant and secure enough to provide replacement for objective-c. Hopefully FP (functional programming) becomes more mainstream and take away all this burden of imperative languages like Rust. But being pragmatic understand for hardware C will be there at least for the foreseeable future and Rust and any FP language can only do so much. On a personal level Python made code beautiful by white-spaces, pep-8 and cultivated a habit of trying to write beautiful code. It did not succeed completely in writing every library beautifully because in the end it needs to interface with C libraries where practicality beats purity. Rust copied gofmt and introduced rustfmt. Still Rust has miles to go until it is just able to be as clean as Python for beautiful code and cultivate it as very important habit like Python. It will take Rust may be another 30 years or more to come close to it, given its syntax and reliance on C interface. Any other language I see at present with safety guarantee and as clean as Python is Swift. I like lisp, Haskell and other FP which can achieve a lot with very little code, easier to refactor and maintain in the long run. Rust is just opposite of it. It’s as difficult to learn as Haskell with complex syntax and semantics, but less powerful than C.
- pkolaczk 7y ago> I think Rust gets a lot of hype because it's syntax is complex Rust syntax is simpler than C++. Rust is a much smaller language. To me it appears much more like a mixture of C and Haskell, rather than C++.
- yxhuvud 7y agoWhat on earth did Rust copy from Python, toolingwise?
- dragonsh 7y agoJust based on what I see rustfmt is copied from gofmt which borrowed it from Python. Cargo is just another pypi with certain improvements. Rust RFC's process is also from there. Hopefully rust can have something like PEP-8 in Python to inculcate habit in programmers to write beautiful readable code.
- yxhuvud 7y agoEh, what part of gofmt is borrowed from python? Python hasn't even bothered to have all parts of its standard library formatted to follow PEP-8.. As for pypi, it is Perl that (as far as I know) invented language specific packaging. Then Bundler, a Ruby project took and improved the situation and let people easily create repeatable and predictable installs. Some of the people behind Bundler then went on and built Cargo. Packaging for Python is and has always been a mess, which people shy away from rather than copy. There are some signs of improvement in later years, but it is not from pypi. As for RFCs, I would assume the RFC process should reasonably be attributed to IETF. They were a bunch of decades ahead of Python there..
- tsimionescu 7y ago> So if you use either modern incarnation of C++ or Rust, you will get same safety guarantees. Just with C++ you will not have to climb the mountain of learning just to do simple things. This is absolutely, completely wrong. If you want to write safe C++, you must follow a very strict discipline, essentially equivalent to appeasing the Rust borrow-checker. The main difference is that straying from this discipline in Rust leads to a compile-time error, while straying from this discipline in C++ leads to unsafe, but probably working, code, that you will only discover is unsafe after much work. And in both languages, you sometimes need to drop from the safe subset to do some things. In Rust, that is signaled explicitly with `unsafe`, in C++ it just means using more C-like constructs. It would also be very interesting to see what subset of modern C++ vs Rust could be used for safety-critical code. Given that several C++ idioms like RAII depend to some extent on exceptions, and those are not permitted in safety-critical code (per Bjarne's own standard), I would not be surprised that Rust will become very attractive in this sector once it matures.
- pjmlp 7y agoYou can get the compile-time error when using tooling like Visual C++, or Eclipse CDT with static analyzers turned on.
- pkolaczk 7y agoNot for all the things that Rust catches. And not for the most important things. Static analyzers typically catch trivial stuff like returning a pointer to a stack from a function. Which is easy to spot during code reviews. But they don't catch more sophisticated UB that can result from bad interaction of code in different units. And this it the kind of UB we're the most interested in being protected from.
- pjmlp 7y agoIf you mean lifetimes, yes you can, with the latest Visual Studio 2019, although it is WIP. And compiling in debug does enable bounds checking for arrays, vectors and iterators invalidation. Rust still needs to define what actually is UB in unsafe blocks, how multiple implementations might affect the language and a memory model. Not saying that it is perfect, rather that it can be made safer than how many make use of it, which is important, because there are plenty of codebases out there that will never get rewritten into something else.