News for hackers. Stuff that matters.
Re:Four Years of Rust by Waterluvian on Wednesday May 15, 2019 @10:50AM (#19919936)
I love watching Rust progress. But the #1 thing I'm watching is the RLS and vscode plugin. Maybe I'm weird but I work with so many languages that having to manage multiple editors is a non-start. So any time I have a little personal project that could be done in Rust (for learning) I end up using Go or Python instead because the vscode support is still quite buggy.

Naturally others will say you don't need IDE-like support and that's fine. It's just the way I enjoy learning. Autocomplete is an amazing learning tool.

Re:Four Years of Rust by steveklabnik on Wednesday May 15, 2019 @10:57AM (#19920016)
We're embarking on a major project to re-architect the compiler and write a next-generation RLS. It's on this year's roadmap. See here for more: https://ferrous-systems.com/blog/rust-analyzer-2019/
Re:Four Years of Rust by robohamburger on Wednesday May 15, 2019 @11:50AM (#19920595)
> It has high latency: because build is costly, it is invoked at most once per x seconds, which means you either have to wait to get the results, or get stale results.

I find this is the worst part right now. Latency is everything if it is tied to actual typing in of code.

Excited to see this get fixed, or at least improved!

Re:Four Years of Rust by eatbitseveryday on Wednesday May 15, 2019 @11:24AM (#19920331)
Maybe we can expand acronyms the first time they are used? I am guessing RLS is Rust Language Server? The URL you cite also does not have this spelled out.
Re:Four Years of Rust by runevault on Wednesday May 15, 2019 @11:39AM (#19920473)
since no one else has answered you yet, RLS is Rust Language Server.
Re:Four Years of Rust by pzmarzly on Wednesday May 15, 2019 @11:03AM (#19920075)
I can recommend https://tabnine.com/ with https://github.com/rust-analyzer/rust-analyzer .

While rust-analyzer doesn't always resolve type (unlike Jetbrains Rust plugin, which always does but sometimes incorrectly), it still makes writing code faster and doesn't have RLS quirks (which come from the fact that RLS has to compile the code before offering suggestions, so code has to be correct at some point, which is not good if you are prototyping)

Re:Four Years of Rust by Lorkki on Thursday May 16, 2019 @12:15PM (#19930308)
It's a lot smoother than stable RLS, but type resolution is practically nonexistent for futures-based code due to trait support still lacking. Definitely excited to check back once that's resolved though.
Re:Four Years of Rust by batisteo on Thursday May 16, 2019 @11:31AM (#19929920)
Too bad TabNine is a Freemium :-/
Re:Four Years of Rust by maltsev on Friday May 17, 2019 @06:45AM (#19938232)
When working with Rust code you get all paid features for free: https://tabnine.com/faq#language
Re:Four Years of Rust by oselhn on Wednesday May 15, 2019 @05:47PM (#19924107)
I do not understand what people like about vscode. If I ignore insane resource consumption this is at most average IDE (the only real benefit over sublime "text editor" is integrated debugger). This is most preferred editor at work so I am forced to work with it and there are some of the most serious issues I have:

1. Only one side panel, so I can't see outline, test results and project files at the same time as I am used to see on widescreen monitors in other IDEs.

2. Language servers are still not comparable to solutions offered by java IDEs and in case of C++ they are worse than anything else I used.

3. Python extension constantly forgets and founds unit test. There is little support for unit test in other languages.

4. Official C++ extension despite being completely useless consumes several gigabytes of space for "indexed" files (I wonder if it is so bad to not hurt sales of Visual Studio). I also tried to use clangd which is better but there is still a lot of work to be done before it is useful.

I like sublime rust support for really small projects and eclipse support for larger projects (which is not ideal) but I have not coded anything serious in rust yet, so I do not know if there is some good IDE.

Re:Four Years of Rust by Matthias247 on Wednesday May 15, 2019 @10:09PM (#19925570)
For C++ try the cquery extension. It's pretty good. It mostly helped me to provide IDE support (full code completion and navigation) for a project that wasn't supported by Visual Studio or any other IDE (embedded project based on gcc and a hacky makefile).
Re:Four Years of Rust by Waterluvian on Wednesday May 15, 2019 @07:22PM (#19924740)
It works well enough for the 6 languages I use weekly. I'm honestly too busy doing all the other engineering tasks that don't happen inside Vscode to really care that it's not perfect. I don't live in vscode that much each week to really care.
Re:Four Years of Rust by Rusky on Thursday May 16, 2019 @03:54PM (#19932438)
> 4. Official C++ extension despite being completely useless consumes several gigabytes of space for "indexed" files (I wonder if it is so bad to not hurt sales of Visual Studio).

I chuckled at this, because the implementation is actually shared between the official C++ extension and Visual Studio. That extra space usage is likely the recent addition of automatic PCH generation (to VS Code, VS has done that for a long time).

Re:Four Years of Rust by lenkite on Thursday May 16, 2019 @06:39AM (#19927735)
I bought and use JetBrains CLion (C++ IDE) precisely for these reasons. I only use VSCode for HTML/JS/CSS and as a markdown editor. For plain editing I just use VIM. For medium-scale projects, VSCode tends to take enormous amounts of resources.
Re:Four Years of Rust by nullwasamistake on Thursday May 16, 2019 @12:06AM (#19926050)
Vscode has great Typescript and JS support. Arguably the best of any editor. I still use jetbrains for other languages, it's really hit or miss.
Re:Four Years of Rust by AlexanderDhoore on Wednesday May 15, 2019 @02:11PM (#19922122)
Before Vim I had to look for an editor every time I learned a new language. Now I just use Vim. For everything.
Re:Four Years of Rust by fnordsensei on Wednesday May 15, 2019 @03:12PM (#19922690)
Try :q!

On a more serious note: I have a long-term goal to learn either Vim or Emacs for various reasons, the above mentioned being one of them.

It's hard to feel so spectacularly unproductive as I do when I try them out though, so it's easy to give up.

What's there best way to go about learning Vim or Emacs?

Re:Four Years of Rust by deking on Wednesday May 15, 2019 @03:46PM (#19923020)
I don't have any reference material/tutorials, but my major breakthrough with Vim was when I understood that normal mode is the norm. Anytime you're not entering text, be in normal mode. Remap jk or jj to escape. Get in the habit of typing it whenever you're done adding text. Use hjkl for movement instead of the arrow keys. Learn the f,t, and o commands.

http://cloudhead.io/2010/04/24/staying-the-hell-out-of-inser...

Re:Four Years of Rust by leonardmh on Wednesday May 15, 2019 @10:15PM (#19925589)
“Normal mode” it’s right there in the name :)
Re:Four Years of Rust by wyatwerp on Wednesday May 15, 2019 @03:44PM (#19923002)
This is going further & further OT, but hey - I didn't start it!

What you need is a motivating factor. Vim is almost guaranteed to be there on any Linux/BSD/Mac shell environment, which motivates people in those environments to learn it even if they learn no other editor.

Beyond such environments, like on any desktop GUI, what'd motivate you to try GUI Vim? For Emacs, I can say the integration between any set of tools you can imagine could be a motivation.

The reason Emacs users don't particularly appreciate IDE's is that Emacs' integration of code editor, compiler output, debugger control makes the development cycle extremely fast. Add any 1 more use to that. File explorer? Emacs dired. Process monitor? Emacs proced. Interactive shells? Emacs integrates Unix shell, Python sessions, anything interactive actually.

You will get all your work done in Emacs, just using editor operations! Go to the source code for a compiler error? Hit "Enter" or click on the error in the compile window. Go to the source code being debugged? Stepping in the debugger automatically opens the file at the right line number. Found the bug? The code is already there ready to be fixed; switch to the compile window & compile. Find a file in a directory? Do a text search in its dired window. Rename all files beginning with foo to begin with bar instead? Do a search-replace.

Emacs also scales way better than any desktop editor or Vim, whether it is opening GB-sized log files, or binary files viewed/edited in hexadecimal. Before long, you start managing your to-do's using org-mode, and doing all your Git operations in the insanely featureful Magit interface.

The list gets longer and longer every release. And many Linux shell environments support the same basic keyboard short-cuts (Ctrl-A to go to beginning of line, Ctrl-E to go to the end, Ctrl-R to search in the shell history), and also provide light-weight Emacs clones like 'zile', 'mg' for editing-only use in the terminal.

Re:Four Years of Rust by pjmlp on Thursday May 16, 2019 @12:45AM (#19926201)
I would like to see a UI designer or UML layout written in elisp, including support for third party components.
Re:Four Years of Rust by fnord123 on Friday May 17, 2019 @03:35AM (#19937216)
Emacs is physically destructive. The chording will destroy your hands. This is why emacs enthusiasts need special keyboards or foot pedals.

https://www.emacswiki.org/emacs/FootSwitches http://ergoemacs.org/emacs/emacs_best_keyboard.html http://ergoemacs.org/emacs/emacs_pinky.html

Vim is great, but after 20 years of using it, I'm moving mostly to Jetbrains stack since flying around the code is faster and syntastic (a vim plugin) is slow as shit on large projects. Thankfully the vim bindings in Intellij are pretty darn faithful.

Re:Four Years of Rust by vram22 on Wednesday May 15, 2019 @05:00PM (#19923720)
Maybe try out my vi quickstart tutorial:

https://gumroad.com/l/vi_quick/

vi is the predecessor of, and a subset of, vim, and is probably available on even more platforms than vim is. So knowledge of that single editor (vi) enables you to work on any of those platforms. And you can always progress to (and through - it is big) vim later, at your own pace.

I wrote it at the request of two Windows system administrator friends who were given additional charge of some Unix systems. They later told me that it helped them to quickly start using vi to edit text files on Unix.

Re:Four Years of Rust by Skunkleton on Wednesday May 15, 2019 @05:14PM (#19923833)
Another nice thing about learning Vi first: no plugins. There are so many plugins that make Vim _worse_. In my experience most novice vimmers end up with a huge vimrc, which overtime is pared down to something pretty small as they learn how vim actually works.
Re:Four Years of Rust by vram22 on Wednesday May 15, 2019 @05:51PM (#19924144)
Yes, good point. That's partly why I mentioned that vim is big, above. And there is tendency of some devs (not just beginners) to load many plugins (for any tool, not just vim), before learning the base tool well. Counterproductive, IMO, plus leads to cognitive overload. And at least in the case of vi/vim, you can compose commands, so, even without using things like macros or plugins, you can achieve a lot. So master that first. It will take you a long way.
Re:Four Years of Rust by McWobbleston on Wednesday May 15, 2019 @04:20PM (#19923335)
Clojure for the Brave and True has a really nice Emacs primer
Re:Four Years of Rust by jamil7 on Wednesday May 15, 2019 @03:24PM (#19922809)
Not sure about emacs but vim basically requires a period of fighting through how horribly unproductive you will initially be, give it a week or two and you'll be ok.
Re:Four Years of Rust by vram22 on Wednesday May 15, 2019 @05:02PM (#19923740)
Doesn't have to be so. See my other comment in this thread:

https://news.ycombinator.com/item?id=19923720

Re:Four Years of Rust by jamil7 on Thursday May 16, 2019 @07:11AM (#19927867)
Nice tips, thanks!
Re:Four Years of Rust by vram22 on Thursday May 16, 2019 @09:53AM (#19929040)
Welcome :)
Re:Four Years of Rust by bgilroy26 on Wednesday May 15, 2019 @03:20PM (#19922757)
I learned by playing vim adventures, but that might be too kiddie for you.

Check out this old HN post[1]

[1] https://news.ycombinator.com/item?id=213054

Re:Four Years of Rust by dan00 on Thursday May 16, 2019 @03:30AM (#19926899)
> What's there best way to go about learning Vim or Emacs?

Sitting at a unix terminal at the university and being forced - you can't install anything - to learn either of both to get anything done. ;)

Re:Four Years of Rust by malvosenior on Wednesday May 15, 2019 @03:54PM (#19923084)
`vimtutor` It's installed everywhere vim is.
Re:Four Years of Rust by panpanna on Wednesday May 15, 2019 @03:03PM (#19922599)
Well, there are two ways to interpret that :)
Re:Four Years of Rust by pjmlp on Thursday May 16, 2019 @12:43AM (#19926189)
If the only thing you do with programming is typing text sure, my IDEs do a little more than that.
Re:Four Years of Rust by dagmx on Wednesday May 15, 2019 @12:33PM (#19921092)
If you're open to a different ide, intellij idea or CLion with the rust plugin is a really great combo.

Idea + rust is free minus debugging.