5 ms·
I'll be honest: Rust is kind of losing me with these changes. I started following/tracking the language about a year ago, and I thought the syntax looked really
by moogly 13y ago
I'll be honest: Rust is kind of losing me with these changes. I started following/tracking the language about a year ago, and I thought the syntax looked really succinct and easily readable back then, but with changes like this, [T] => Vec<T>, the region/lifetime syntax, together with the propensity to abbreviate almost everything, code is quickly starting to look kind of soupy to me.
I get the arguments, and they're logically sound, but in the end it's beginnning to read like C++03.
On the one hand, the Rust community's generalising a lot of stuff, which sounds great, but then adding a bunch of macros (I know, this ain't yo daddy's C macros) to replace first-class citizens ([1, 2, 3] => vec!(1, 2, 3) for example), and I worry how IDEs will be able to handle macros from an autocomplete/intellisense standpoint, not just checking/displaying type information when using them, but also writing new ones.
I guess it's a language primarily by and for text editor users, and I'm beyond that point these days.
As I said, I started following the language daily a year ago, and a couple of months ago I was thinking of jumping in around this point in time, but right now I feel like I want to wait another year to see if the syntax has become more readily intelligible.
I still think it's a fantastic effort, and kudos for all the hard work.
- sillysaurus3 13y agoI guess it's a language primarily by and for text editor users, and I'm beyond that point these days. What do you mean? EDIT: Imagine a programming language designed around an IDE. Fun thought. Not sure whether it's a useful thought, but it's fun to think about.
- kansface 13y agoText Editor vs IDE.
- sillysaurus3 13y agoHmm... I don't understand why it has to be Text Editor vs IDE. The two concepts are orthogonal. One is for editing text; the other is for understanding and autocompleting text. If their concern is that there aren't any good tools for Rust yet, that'll be solved with time.
- deeviant 13y agoI think you are missing the point of the statement. If one was designing a language meant to be developed in an IDE, you can hold various assumptions which would influence how syntax shapes up. A trivial example which is not related to rust but I think serves as a decent example, you can assume the IDE will color/italicize/etc member variables to get rid of _var __var var__ nonsense. You can also use slightly less verbose terms even if they are less informative if you assume a tooltip with a concise and complete explanation pops up.
- eevee 13y agoI'm a little terrified by the prospect of a language designed to be incomprehensible without a stack of tools that will explain it to you.
- e12e 13y agoI'm not sure how interesting this topic really is. As an example, look at Smalltalk. Crazy easy syntax, and made to be used in an IDE that dwarf what most of us consider an IDE.
- eevee 13y agoAnd we shall call it Java.
- Pacabel 13y agoThat isn't really the case at all. Java (the language) is relatively small and simple. Java code can be written quite easily without an IDE. In fact, that's how it was done for many years by most Java developers, before Eclipse, NetBeans and other IDEs became more commonly used. The unnecessarily complex design of many Java libraries and frameworks is generally what pushed developers toward using an IDE, not the language itself.
- pjmlp 13y agoActually we call them Smalltalk, Interlisp, Delphi, Visual Basic and Eiffel.
- moogly 13y agoI actually regret that comment. I feel I was being a bit too negative in my original post, and I don't want to add fuel to the fire by continuing the argument here.
- sillysaurus3 13y agoNo, no... I'm sorry if my comment sounded strange. I wasn't being ironic or snarky, I was being genuine. What are your thoughts regarding IDEs vs editors? It's an important topic.
- AlisdairO 13y agoHonestly, as a guy who works on a lot of old code that I didn't write, IDEs are a complete godsend. Features like 'find me everywhere this method gets called', or 'find everywhere this value gets written to', and just simple navigation between functions/files. They're a backbone of my maintenance programming strategies, and I don't know what I'd do without them. I do all of my javascript coding in vim and don't miss IDEs so much, but that's because I mostly only work on my own javascript code. For large, multi-person projects I massively prefer working inside an IDE.
- charlieflowers 13y agoI think the real key here is not ide friendliness, but "compiler as a service." The compiler, by definition, is already capable of understanding our code. If that understanding can be exposed as a standard api, we can build up a set of powerful capabilities for refactoring and much deeper programmatic transformations. With very large code bases, this is no longer just nice-to-have ... it is the next tool we should rationally insist on.
- lazzlazzlazz 13y agoOdd, I've just been getting the impression that the language is become much, much readable. I agree with thestinger, here: > uses and instead of &&, or instead of ||, list instead of [] and so on. Most people find it far easier to read and search for these than the sigil alternatives. The avoidance of more than one way to do the same thing (like including both ~T and Box<T>) is another reason why people find Python easy to read.
- 4bpp 13y agoWhat is the source of that statement? Because honestly, if the future of Rust is to look like this, that would be somewhat horrifying. Python is a great language for beginners and people who get into programming through nontraditional channels without having much of a symbol-pushing background; presumably, being able to parse symbolic expressions naturally is a skill that needs to be learned, and perhaps even needs to be learned early in life to wield effectively. If you don't have the ability, classical systems languages will look like malicious ASCII soup and a language whose code you can actually read like a paragraph of text will be long-overdue respite from this misery; the same perhaps even applies to other non-verbose shorthand (as an anecdote, one of my graduate program's logic-heavy classes is currently suffering from a student who more or less constantly interrupts the lecture to get all the mathematical notation on the board read out to him in natural language). The latest startup/trendy tech boom has made a disproportionate number of people of this type gravitate towards programming, many of them coming from the wider blogosphere/"social internet"; as a result, their opinions regarding what is good or bad and legible or illegible have come to entirely dominate the airwaves. It is all to easy to forget that there is a barely visible core of often significantly more prolific "native" programmers hiding in newsgroups/IRC channels/mailing lists and more often than not having very different measures regarding what constitutes good language design. When Rust came about, its design held the promise to finally deliver something to this group that might offer a way out of the C monastery; having it reorient itself to appeal to more popular sensibilities at this point is bound to cause a lot of hard feelings. Personally, I always found the flat monotonicity of Python code to be rather unpleasant to read and write. Having what some people like to denounce as "line noise" actually enables a very useful visual contrast between "structural" (parentheses, scope boundaries, operators) components of the code and largely user-defined "names". Looking at a piece of code like "if(vals[1]==1 && vals==[1,2,3]) { ... }" allows you to break up the code visually before having read and echoed to yourself even a single word of natural language; this can't be said of a (hypothetical) example like "if vals.at(1) equals 1 and vals equals list(1,2,3):". Adding to that the general lack of code layout flexibility and the deliberate lack of alternatives to express a given pattern, the resulting picture is that the way an experienced programmer would usually gather a slew of information from diagonally skimming over a piece of code (segmenting all of it using the visually distinct "line noise", gathering when and how data is accessed, inferring the original writer's priorities from how the code was spaced out and what constructs were chosen, spotting the names of external dependencies...) is severely crippled.
- xooyoozoo 13y ago[T] => Vec<T> It's ~[T] that is now Vec<T>, which was a good change in emphasis (the former is still valid, though it will become Box<[T]> with this RFC). Besides the implementation differences, I think readability is improved when `Vec<T>` is written.
- moogly 13y agoAh yes, sorry.