6 ms·
> 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 lik
by 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 agoSwift is not a competitor for Rust. It may be a competitor for Scala/Kotlin native or Go, but definitely not in the same performance league as Rust or C++. > Hopefully FP (functional programming) becomes more mainstream and take away all this burden of imperative languages like Rust. Pure FP is overrated. It is a nice academic model of computation, but it doesn't reflect the way how hardware works. Hardware is mutable and memory is limited. > It’s as difficult to learn as Haskell with complex syntax and semantics, but less powerful than C. This is a subjective opinion, not a fact. > as clean as Python :D :D :D
- hopia 7y agoWhy would we need to limit our programming language abstractions to how the machines work underneath? Are there some stateful objects running around in the hardware? Just because the abstractions are detached from the hardware doesn't make these design patterns useless.
- yxhuvud 7y agoIt is nice to have a connection between abstractions and hardware, because it makes it easier to reason about performance, which in turn makes it easier to achieve great performance. Now, not everybody actually need great performance, so some distance between hardware and abstraction is ok, but the amount depends on the use case.
- hopia 7y agoWell, I agree, that's why we have both low and high level languages. High level languages, setting you free from the actual constraints of the underlying machine, allow you to define abstractions that can increase productivity greatly - that's their whole point of existence. I mean I don't see people complaining how you don't need to manually manage memory in SQL expressions.
- pkolaczk 7y ago> I mean I don't see people complaining how you don't need to manually manage memory in SQL expressions. Well, they don't complain about not having to manually control the low-level bits of query execution, but later they frequently complain about performance problems. And then they add hints, setup buffer sizes, indexes, etc. Also, Rust (and to some degree C++) shows that you can have both very high-level, productive abstractions and low-level control. They call that zero-cost abstractions. The price to pay is a steeper learning curve, but not actual productivity or final performance. This is the most exciting part about Rust actually. I know how to write Kotlin, Scala, Java or C# code that's close in performance to C or C++. But this will be ugly, unsafe and hard to maintain, non-idiomatic code. Rust gives ability to write code that has almost Python-like expressivity but is still fast as if it were hand-optimised loops and pointers.
- Sean1708 7y ago> 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. It does have registries[1] and vendoring[2]. [1]: https://doc.rust-lang.org/cargo/reference/registries.html https://doc.rust-lang.org/cargo/reference/registries.html [2]: https://doc.rust-lang.org/cargo/commands/cargo-vendor.html https://doc.rust-lang.org/cargo/commands/cargo-vendor.html