3 ms·
Exactly. There are few fundamental principles which have been neglected in order to provide way too many features (a kitchen sinc syndrome). For example, "do n
by dschiptsov 10y ago
Exactly. There are few fundamental principles which have been neglected in order to provide way too many features (a kitchen sinc syndrome).
For example, "do not create unecessary entities" maxim, which, it seems, is central for good language design (ML, Scheme, Haskell, Smalltalk, Erlang, Golang are small languages, the first three are even standardized). As long as we violate this genetal rule we end up in a mess like CL, C++, and of course Java as a peak of absurdity).
The meme that "implementation languages must be feature rich" does not hold beyond certain limits, and even Rust designers have realized that there must be certain restrictions. In fact, C - the oldest and most common implementation language is still alive and well (despite all the mess other people made of it since it left Bell Labs).
The best illustration I know is refusal of the Golang designers to complicate (to ruin the balance of simplicity and elegance with expressiveness, which is the most difficult to attain - every poet or artist will tell you that - to create an unbalanced pile of features is way easier) the language by adding generics in the language and runtime. For them interfaces (duck-typing) is good-enough).
"Explicit is better than implicit" is also a naively wrong maxim. Verbosity is bad. Period. Every good writer I know is non-verbose. Meaning behind words is what makes a good literature, not long words or elaborate passages half page long (ironically, common men think exactly opposite is true). Convention over configuration (evolved defaults instead of explicitly spelling every single rule over and over again) is the same notion from a different perspective.
Here comes Scheme - the greatest mostly-functional small language with balanced defaults, cohetent semantics (almost like in math), and unmatched expressiveness with almost no syntax at all (expressive power comes from coherent defaults that everything is an expression, everything (including lambdas) is a first-class value referenced by symbol, lexical scooping, very few standard special forms and the ability to create new ones.) as an good example. Smalltalk and Erlang are another ones for the emphasis on message passing and, in case of Erlang - pure functionality and isolation - the way vastly complex biological systems has been implemented by evolution.
So, those who have seen highly refined languages like Haskell or Scheme or Smalltalk would never be fooled by "features". The meme that "each project must first agree on which subset of C++ it would restrict itself to" is another good illustration. Rust, like Java, is already suffering from this kitchen sink syndrome, so the comment above is legitimate.
BTW, it seems that many of features should go from the language to sanitizers and checkers, like it is with clang tooling.
- pcwalton 10y agoDo you have specific examples of Rust features you claim are unnecessary? Rust would not work at all with the borrow check as a separate tool, by the way. It would be comically easy to write broken code.
- kibwen 10y agoRust is emphatically not a kitchen sink language. If you believe otherwise, please explain what features you would remove without compromising safety or the notion of zero-cost abstractions.
- dschiptsov 10y agoI don't believe in safety and zero costs. These are mere catchy memes. I could only repeat my question: How Common Lisp or even more pragmatic Golang are less safe? I am not asking about Haskell or Erlang.) Compile time error for trying to use an old binding/reference? Is this memory safety?
- pcwalton 10y agoGo is less safe due to the "Off to the Races" problem, but there's a legitimate debate as to whether that safety loss matters in practice. Common Lisp and Golang use GC, which exacts a performance cost in some scenarios. Go also has highly dynamic semantics (e.g. with defer) which have unavoidable performance overhead, especially in an AOT compilation setting.
- nercury 10y agoThe engineering decisions are not based on beliefs. They are usually trade-offs. Safety in Rust has a very specific meaning clearly outlined in the official book. There are users who prefer it for certain tasks. The answer to your last question is also in the book.
- dschiptsov 10y agoWhy not state it here in a few simple sentences, like for a 5 year old? Clarity is usually an evidence for deep understanding. I hope I will be able to get it.