4 ms·
It's definitely simpler than most other systems languages in what it gives you access too. Go, D, C++, C# are all far more complicated than Rust is. I would arg
by webkike 9y ago
It's definitely simpler than most other systems languages in what it gives you access too. Go, D, C++, C# are all far more complicated than Rust is. I would argue Modula-3 is not as simple because it contains a garbage collector - thus making the connection between written and compiled code less simple. Don't know much about pre scheme
- jabits 9y agoHave only checked Rust out a bit, but you mention C#. Does Rust have functionality similar to, and as easy to use, as Linq?
- zlynx 9y agoLinq, ick. It's a performance nightmare. No one knows what it is actually doing in the background so firstly, everyone writes horrible O-cubed performance with it, and then it is a series of random poking around to try fixing it.
- xorxornop 9y agoDepends if you're using it with ORMs or not. It's equally as useful with data in memory. Definitely slower for some things though (yes, it's always slower in one sense... But its also easier to make parallel, so it can even out in the end) Still, I now prefer doing such things in Rust.
- moosingin3space 9y agoIn Rust, you'd generally use functions that return iterators or Tokio's streams for Linq-style tasks. Check out the "Complex Queries" example on http://diesel.rs http://diesel.rs for an example of what a Linq-like library looks like in Rust.
- xorxornop 9y agoYes, it does. Also a C# programmer. I really like Rust. About as easy to use to transform, filter, group etc, but considerably faster.
- placeybordeaux 9y agoHow are you defining complexity in a programming language?
- webkike 9y agoI suppose it's the difference between the computational model presented by the language verses the computational model presented by the computer. A combination of how many components require some runtime environment to exist and how many disparate language features there are. Not an intuitive definition of simple for sure, but this is in the context of a system's programming language. In terms of just plain simple, I'd say scheme or just lambda calculus even takes the cake.
- placeybordeaux 9y agoSo the fact that that is a scheduler and a garbage collector in go means that by your definition even the simplest go program has a large complexity cost?
- webkike 9y agoNot necessarily large, but it factors into the mean complexity cost.
- comex 9y agoGo, at least, is far simpler as a language than Rust, and the implementation (compiler) is less complex overall, especially if you count LLVM on Rust's side. I suppose that Go programs exhibit more complex behavior at runtime due to the GC and green threads and stuff, but it's a huge stretch to call Go more complicated overall. On the other hand, I'd argue that Rust makes up for the complexity with performance, power (ability to express more complex programs in less code), and safety (not just memory safety, which Go also mostly guarantees, but the ability to leverage the type checker to verify code correctness in general). C++, on the other hand, is more complex (due to all the legacy drift), yet equal in performance, less safe, and less powerful in most respects (there are some things C++ can do that Rust can't, but more things for which the opposite applies).
- webkike 9y agoConsider how interfaces work and how you would have to implement them. Rust may have a more complicated type system and I suppose enums are more complicated in Rust, but the things I value as simple are more simple in Rust than Go.
- comex 9y agoWhat about interfaces? The basic idea of fat pointers with vtables works the same as Rust's trait objects. If you mean the ability to dynamically cast from one interface type to another, which Rust doesn't support - that does require a global list of implemented interfaces per type, but without generics that's not too hard to implement. (In Rust, it would be drastically more complex, verging on impossible to pull off with a good UX, due to various language features including wildcard impls, type-parameterized traits, and a Turing-complete type system.)
- webkike 9y agoWhen ever you would need to box a trait object in Rust Go automatically performs a heap allocation that is garbaged collected at some point. A bit more is explained here https://research.swtch.com/interfaces https://research.swtch.com/interfaces Basically there are some property of Go interfaces that make them far more dynamic than traits and implementations in Rust.
- pjmlp 9y agoThat is what the Assembly view of the compiler is for. Also your complaint can be applied to C as well. Given how optimizing compilers work, and the amount of UB being exploited, the language stoping being simple long time ago.
- cwzwarich 9y agoHow is Rust simpler? In terms of cognitive complexity on the part of the user, Modula-3 is much simpler; it is easier for a programmer to learn to write new Modula-3 code and correctly read Modula-3 code than it is for Rust code. In terms of implementation complexity, Modula-3 is also much simpler, despite the existence of a GC. A Modula-3 spec would be a great deal smaller than an equivalently detailed Rust spec. Many people have independently implemented Modula-3, whereas an independent implementation of Rust is effectively impossible, due to all of the unspecified implementation-defined behaviors. If you told me I had 1 year to implement either language from scratch, I would much rather choose Modula-3.
- steveklabnik 9y agoThere are two alternative implementations of Rust in the works; one is _almost_ able to compile rustc at this point.
- cwzwarich 9y agoWhat are these implementations? The one I immediately found by searching (https://github.com/thepowersgang/mrustc https://github.com/thepowersgang/mrustc) is accompanied by an explicit nongoal to correctly implement the language. It also doesn't seem particularly independent from rustc, given the similarities in implementation strategy and the fact that some parts look like rustc code converted to C++.
- steveklabnik 9y agoMrustc is one; my understanding is that it isn't yet, because its purpose in life is to make bootstrapping/ddc stuff easier. Once that works, I thought it intended to add the stuff that's missing. There's another that's not public.
- kibwen 9y ago> ddc stuff Note: this refers to "Diverse Double Compilation", which is a mitigation tactic against Reflections-on-Trusting-Trust attacks.
- nickpsecurity 9y agoModula-3, like many Wirth-inspired languages, can be described in a few pages with developers understanding those pages. You can be writing useful code in a day, using most of its features in a week, and probably master it in months to a year. The GC doesn't make it any less simple as that's one component that lets you ignore the complexity of memory management. The component itself can also be simple. Rust being simpler than other programming languages you cite actually means those languages are enormously complex. That is, given how much more complex Rust was to Wirth-style languages, Smalltalk, Scheme, and so on. It has extra stuff. Hence, the extra complexity. The compiler is also harder to write to make all that work.