4 ms·
There's not many examples beyond this though... it does seem to be the case that people either choose C syntax for successful languages, or those languages are
by chrisseaton 6y ago
There's not many examples beyond this though... it does seem to be the case that people either choose C syntax for successful languages, or those languages are successful possibly because of C.
Why did Rust move from an ML syntax to a C syntax?
- dragonwriter 6y ago> There's not many examples beyond this though... Ruby, though still in the Algol-derived syntax family, is even less C-like than Python.
- skohan 6y agoThat's true, and that's probably why even though I have had to modify ruby code and write simple scripts at various points in my career, I never got to the point where I fully grep the syntax. Maybe that's why C-like syntax is so popular.
- steveklabnik 6y agoWe wanted to cater to an audience of systems programmers, so we tried to stick to a familiar syntax where possible.
- skohan 6y agoI know this opinion will not be received well, but I'm really sorry this extended to things like semicolons, snake_case, and the overloading of the term vector to refer to variable length arrays. I'm a big fan of many of the decisions made in Rust, but those are things which I wish we could have let die in the systems programming language of the last decades.
- steveklabnik 6y agoIt's cool. I strongly prefer those things. That's why no single language will ever rule them all.
- skohan 6y agoTo each his own, but out of curiosity what do you like about using the term Vec for dynamically-sized arrays? To me it just seems that it's an inaccurate usage of a term with a precise mathematical meaning (what is a vector of strings exactly?), and as somebody who works with linear algebra a lot in code, it's a frequent point of consternation to have this built into two of the most relevant languages for achieving high performance.
- chrisseaton 6y ago> what is a vector of strings exactly? You can have a vector of integers, a vector of real-numbers, why do you think a vector of strings doesn't make any sense? Strings can be given a well-defined ordering. You can think about strings as a points along a string-line, if you want to. For example - Java often names packages using co-ordinates (vectors) in an n-dimensional string space. Seems to make sense to me?
- skohan 6y agoMaybe in some technical way this is correct, but when I'm pushing a string onto a vector of strings, I'm not thinking about conceptually adding a dimension to my vector in string space. And how would you compute the cross product of <"foo", "bar", "baz"> and <"apple", "orange", "banana"> exactly?
- chrisseaton 6y ago> And how would you compute the cross product of <"foo", "bar", "baz"> and <"apple", "orange", "banana"> exactly? How would you compute the cross product of <NaN, NaN, NaN> and <NaN, NaN, NaN>? Some vectors don't have a useful result for cross product, even if they contain 'numbers' and even if you can get some kind of result out. Same with dot product of a string. Doesn't make much sense... so probably don't do it.
- skohan 6y ago
- skohan 6y agoWell it makes sense to converge towards something right? Unless a programming language is using a radically different paradigm, like Lisp or Prolog, or if it is purely a syntax experiment, why not go with a C-like syntax and have every programmer in the world be able to instantly ready your code and basically understand what's going on.