Writing I'm not sure, reading it's just awful, everytime someone show his project on HN I check github and I'm baffled how the code looks bad as a human reader. (){}<>''-_
Writing I'm not sure, reading it's just awful, everytime someone show his project on HN I check github and I'm baffled how the code looks bad as a human reader. (){}<>''-_
Like, to me, the human language of Vietnamese looks like a mess of accents, and I'm baffled by why they're necessary. But I'm not a fluent speaker of Vietnamese; and I can imagine that, for someone who is fluent in Vietnamese, and another sibling language like Chinese, maybe the extra accents actually compare very well and help readability compared to e.g. the reduced set of accents in Chinese pinyin.
Likewise, I would suspect that for someone fluent in both C++ and Rust (i.e. someone who knows how to write code that takes advantage of arcane language features in both), Rust might be more readable than C++ because of some of the initially-offputting syntax, whereas C++ might seem less readable because it eschews extra syntax in favor of using template constructors for everything.
So like you said - same thing with languages. You could probably substitute "Japanese text" or "Arabic text" into the original comment and see a little more clearly that fluency does matter.
Your mental model will affect how you feel about a language.
Once I finally took the plunge and committed a full project to learning TypeScript, I grokked it. I no-longer saw noise, I saw signal. I saw details about interfaces that I used to have to infer, document, or reverse engineer if I forgot.
I had (still have!) trouble reading JS, because the vast majority of things I've worked on have been in statically typed languages. JS was baffling because I always have to try to infer/reverse engineer things that I can just read off in the languages I'm most familiar with.
The only way I really could handle dynamic stuff was for things like scripts, where I could mostly remember the entire set of types.
I've gotten better with JS after using some TS, but that difficulty still exists. Correspondingly, I'm delighted by Rust - sure, it's a verbose language, but that puts everything I want to know right there for me to read.
In other words, there's beauty, and there's acquired taste and it's legitimate to point out this difference.
Most humans frankly don't understand what's needed to capture complex mathematical concepts, so that's not at all surprising. The same argument can be applied to your objection to syntax, and this merely reiterates the OP's point: until you're fluent in a particular language, you have no idea whether the syntax is necessitated by some complex but necessary semantics that you simply don't know about.
I think this is more a problem with what you're used to. You see the same criticisms of every language: Basic dialects are too wordy, Lisp dialects too bracketty, C dialects too symbolly, etc. etc. It's hardly the measure of a language.
Java was the language I learned during CS101 in school and I always hated the “don’t worry about this part right now just write static main void... or the equivalent”. Python code is cleaner too look at but Java has it’s reasons for the verbosity.
The braces allow you to be explicit with what you want. Rust's {} are a feature. They let you see exactly which scope you're in. With Rust's memory management, you then know exactly when a variable will go out of scope and be cleaned up.
You peaked my interest. Guido van Rossum on the subject:
> But the complexity of any proposed solution for this puzzle is immense, to me: it requires the parser (or more precisely, the lexer) to be able to switch back and forth between indent-sensitive and indent-insensitive modes, keeping a stack of previous modes and indentation level. Technically that can all be solved (there's already a stack of indentation levels that could be generalized). But none of that takes away my gut feeling that it is all an elaborate Rube Goldberg contraption.
https://www.artima.com/weblogs/viewpost.jsp?thread=147358
As a side note, there are more than 100x the number of jobs with Python in the description vs rust. Out of the 30 or so jobs with Rust in the description most are for automotive techs.
Rust 1.0 was released May 2015 [1]
Python 1.0 was released January 1994 [2]
That's over 21 years that Python has had a chance to work its way into the industry and into almost every field imaginable. I'd wager that many careers have revolved around the Python language at this point.
Rust is just getting started. The volume of press is the first sign that it's about to take off. It can take years for existing enterprises to approve a new language for use. Give it time.
[1] https://blog.rust-lang.org/2015/05/15/Rust-1.0.html
[2] https://en.wikipedia.org/wiki/History_of_Python#Version_1
like Haskell ?
Objective-C in particular was verbose, but the symbols made sense and their meaning could be understood from the context. In Rust you either know what the symbols mean, or you do not understand the code.
This is just part of knowing a programming language. Readability to people who don't know a programming language might be considered an interesting property in itself, perhaps especially for cognitive psychology or education, but it has little to do with programming. It's only accidentally related to a concept of 'readability' relevant to software development.
I find Rust readability a mixed picture. Being a Rust novice I sometimes find the details hard to follow precisely (as in: I often wouldn't be able to reproduce the code without error myself). But the type system, stdlib & generics make it sufficiently expressive that it's usually pretty easy to understand broadly how things work. In my journey so far I've been able to follow large library codebases more easily than in other languages I've used.
Yes, Rust is a very symbol rich language, but it also is very information dense which makes it easier to read than many other languages once you learn it.
APL-likes (and Forth-likes, and Lisps when you use the macro features) are a bit too far on the "power when fluent" axis, at the expense of learnability, and so the total area of the product is small. Might be good for one-man projects, but not for large ones.
Minimal languages like ASM or Java, where there are just a few primitives and everything else is design patterns, trade high "learnability" for low "power when fluent", and so also have a reduced optimization product.
Most languages aim somewhere in the middle, though often with a bias toward the side where they think the optimum might truly lie; for example, Go is slightly on the "learnable" side, and Rust is slightly on the "power when fluent" side, but both seem to be generally more productive per average-programmer-man-hour invested into FOSS projects than languages that more heavily favour just one axis.
(Side-note: I'd love to see some real numbers crunched on this. A comparison of rival FOSS projects to implement some shared standard in different languages would make for a pretty good "natural experiment" to look at productivity over. First thing that springs to mind for me personally are the rival Ethereum clients of Geth (= Go) and Parity (= Rust), but I'm sure you can think of your own examples.)
These are mostly orthogonal issues to how easy and/or powerful a language is.
By this standard, most programmers never achieve 100% fluency in even their favorite programming language, unless their favorite language is one of the dead-simple ones; and there are some programming languages (esolangs, certainly) that nobody is 100% fluent in; and many (the APLs, Forths, etc.) that only a few human beings on earth are 100% fluent in. (That's not to say that there aren't many people who can read and write them—just, not fluently. If you need to look at a programming-language reference more often than you need a dictionary to parse out the meaning of a sentence in your native spoken language, you're not fluent.)
A language that's less "readable", by your terming, is just one that takes longer to become fluent in. Given that the programmers working on any given project are going to be in a mixture of phases in their careers, and thus have invested different numbers of man-hours into language fluency, there's going to be a mixture of fluency levels on any project (where less-fluent readers experience the language as "less readable.") Longer time-to-fluency means that the same number of invested man-hours get you less fluency, and so on projects in languages with longer time-to-fluency, but the same distribution of programmer career-levels, you'll see lower average fluency (or a skew toward the bottom of the distribution, really) and thus more complaints of low readability. Mind you, this isn't really a fact about the language itself, but a fact about the project—if everyone on a project are 20-year veterans of the language, any language can be "readable."
I would note that we can measure time-to-fluency; it's objective. We can teach people a programming language, test them along the way, and see how many man-hours of study it takes to get 100% on the tests. We can't measure a language's "readability"; it's subjective. But it likely has a heavy correlation to time-to-fluency, so time-to-fluency is the measure you should care about if you care about A-B testing programming language syntax features for their effect on "readability."
C++ is design-patterns heavy and symbol heavy at the same time.
The heaviest design-pattern language champ would be JavaScript 1.5 with the lack of construct (assuming people work in super-huge JS project with hundreds of developers, not a simple web-app).
I think it looks awesome. Pattern matching, short keywords, types on the right... It accomplishes this beauty while also carrying lifetimes, pointer types, and traits. I personally like it much better then Java or similar static typed languages.
You can't compare it to a scripting language because it has type information.
What do you mean by this?
A statically typed language would be hard to reason about without types and it would dramatically impact compilation times.
Why would you include lifetime annotations in a GC'd scripting language? These are features for the compiler and the human to reason about. The language and compiler are intertwined.
While you could divorce the language from the compiler, it would be misguided to do so for many languages and problem domains.
You can hold up TypeScript as an example of a scripting language with types that upholds your philosophy, but its advantage is primarily for humans. I'm unaware of any performance benefits or optimizations it provides. It wasn't carefully spec'd out with a compiler in mind. It's a well thought out cross-compiled superset language. This isn't the case with languages designed for bare metal.
edit: I can't reply with a comment thread this nested. Compilers absolutely inform language design and vice-versa. Bad language design leads to horrible compilers (C++). A good language design process works in lockstep with its compiler design, with careful attention to the AST, the number of passes, analysis, etc. If we didn't think about compilers, we couldn't design languages that could be compiled.
Otherwise, you've conflated a bunch of things. Interepreted languages don't need to have a GC, or lifetime annotations, or anything else, really. Static typing doesn't require explicit type annotations, although it tends to have them, and neither is the domain of exclusively interpreted or compiled languages. And so on.
I also argue there's no meaningful distinction between "designed for bare metal" and "designed for application programming" other than a language that is designed to allow deployment on bare metal has a way for you to poke memory locations and at minimum turn off a GC. Everything above and beyond that is language features or libraries and by no means limits your ability to operate quickly and efficiently in either domain.
Python on the other hand is awesome, and I also begun looking at Go which seem to be quite okay.
The only exception is the method::<Type>() that's sometimes necessary.
When I write or read rust code the symbols just sort of disappear.
Nowadays every time I have to go back to C++ and read `method<Type>()` I need to parse whether this is `(method < Type) > ())` or something else. Luckily for me, C++ introduced the `method.template <Type>()` syntax... but over that I prefer `::<Type>`.
I also prefer ::<Type> over Scala and D's syntaxes for some reason. I find Scala syntax for this more complex, and I find D syntax too simple.