Hacker News new | past | comments | ask | show | jobs | submit login

Python top right, Go bottom right, Brainfuck bottom left, Rust or Perl top left.

(Don't kill me fanatics)




Do you think many people would put Rust and Perl next to each other?


I was a professional perl5 developer for years and when working through https://doc.rust-lang.org/book/, kept remarking to myself how similar the languages are, in terms of expressiveness, complexity, and implied developer disciplines.

Rust feels like an industrial version of Perl to me.


In this chart, sure. Not like, the same dot, but both in that quadrant. But those are my personal opinions, as I find both difficult to read yet very expressive. YMMV.


Interesting. I haven't heard anyone complain that Rust is harder to read than the average language, just stuff about writing it.


Having never written anything in Rust but read and “translated” some code (maybe 3k LOC?) from Rust to Ada, I can tell that I found Rust rather hard to read and harder than e.g. Ruby (which I also do not know how to write but translated to Java once).

Here is what I guess makes it hard to read for me: There are many terse keywords (fn, mut) and symbols (&, [], ->) along with some things that look like Java annotations and are equally hard to understand without knowing the language. Array slices look easy enough to understand [a..b] but surprise: b is actually exclusive? The definition of arrays is the most weird one I have ever encountered [u8; n]. To me Rust looks much like C++ with a twist and people rightfully complain about C++ often :)

The documentation about language and libraries was solid for my cases and most of the time it seemed enough to ignore most of the tiny key words and symbols without losing much understanding of what the code intends to do. If I were given the choice I'd probably still prefer Rust's weird syntax with added safety over the clarity of C which offers no safety at all (not talking about obfuscated code contests here).


> To me Rust looks much like C++ with a twist and people rightfully complain about C++ often :)

But would you put C++ next to Perl in terms of difficulty reading? I wouldn't have thought they were particularly close. (In terms of normal code at least, not the implementations of ultra-generic templates.)


The difficulty of reading Perl is probably overclaimed and overrepresented. Let's not forget that we are comparing a pretty darn low-level language to a fairly high-level one.

And regarding design principles, I think the comparison is clearly on point. These are languages where the motto is basically "if you can't do it (if you can do it but it's perceived too long that also counts) then the language needs to be horizontally extended to account for this use case".

My vague impression was that Rust is still a (significant) simplification over C++. (Ada is a funny case because it seems to be deliberately designed to be hard to read and hard to write, overall a pain in the arse, in the spirit of "if you never reach flow, you will always be very focused", I guess.)


> "if you never reach flow, you will always be very focused"

That's how I stay alert in every language. :D


Some of the dewrapping constructs can get a bit gnarly looking when there is something wrapped in a wrapper in a wrapper sort of thing. But it's probably largely author-dependant and you could write the same code more readably.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: