News for hackers. Stuff that matters.
Re:Writing Complex Macros in Rust: Reverse Polish Notation by inurigakko on Thursday February 01, 2018 @09:56AM (#16282217)
Rust is probably the most advanced programming language with the worst syntax. Prolog and Erlang are a joy after Rust.
Re:Writing Complex Macros in Rust: Reverse Polish Notation by carlmr on Thursday February 01, 2018 @10:17AM (#16282378)
What is so terrible about the syntax? My biggest problem with Rust isn't the language, but the tooling which is still not quite there yet.

I find the syntax ok, and you do get used to the snake_case.

Re:Writing Complex Macros in Rust: Reverse Polish Notation by jandrese on Thursday February 01, 2018 @02:53PM (#16285253)
My impression has always been that it probably feels right at home for people with mathematical backgrounds, and mildly line-noisy for people coming from traditional programming backgrounds.

Stuff like this:

  fn map<T, U, F>(vector: &[T], function: F) -> Vec<U>
    where F: for<'a> Fn(&'a T) -> U {
    ...
It's not too hard to read once you're in the ecosystem, but there's a lot of non-alphanumerics in there, and you know each one of them is super important to getting the thing working.
Re:Writing Complex Macros in Rust: Reverse Polish Notation by carlmr on Friday February 02, 2018 @02:20AM (#16288990)
While I like the functional style you actually did bring up one of the cases where I find the syntax a bit too much. Why can't we have the functional interface information on F directly in the signature?

Why not something more akin to ML?

    fn map<T, U, 'a>(vector: &[T], function: &'a T -> U) -> Vec<U>
Re:Writing Complex Macros in Rust: Reverse Polish Notation by fb03 on Thursday February 01, 2018 @11:44AM (#16283271)
I'm there with you. Have you found something consistent/stable to debug Rust code? I find the integration with VS:Code to be quite flimsy and friends have been saying that's like the pinnacle of Rust tooling right now, to have a fully loaded VS:Code with the Rust plugins...
Re:Writing Complex Macros in Rust: Reverse Polish Notation by steveklabnik on Thursday February 01, 2018 @11:58AM (#16283424)
We're still committed to improving tooling, so please file bugs!

I've used the "Native Debug" extension with VS: Code in the past.

I've heard that if you have a CLion license, it (with the Rust plugin) is pretty solid at debugging, but I don't own one of those.

Re:Writing Complex Macros in Rust: Reverse Polish Notation by carlmr on Thursday February 01, 2018 @01:52PM (#16284569)
I know you are. I didn't mean to take a jab at you. Rust is amazing for how young the language still is. I also don't have a CLion license, but I've also heard from multiple sources that that is right now the best IDE.

What do you mean by "Native Debug" extension for VSCode? The normal Rust plugin built on top of Racer often shows Racer as crashed, and doesn't underline errors while typing. It also doesn't really seem to know the type of a variable most of the time. I'm writing in too many languages at once. Autocompletion usually gives me enough of a hint that I remember what to type.

VSCode being my favorite editor, so I'm glad that I don't need to install another IDE right now.

EDIT: I just checked it out, and apparently you can install the Rust plugin with IntelliJ Community Edition. Which is free.

Re:Writing Complex Macros in Rust: Reverse Polish Notation by steveklabnik on Thursday February 01, 2018 @02:07PM (#16284747)
It's cool! I didn't take it as a jab :)

I meant this extension: https://marketplace.visualstudio.com/items?itemName=webfreak...

> The normal Rust plugin

Which one are you talking about? There are three of them: one is abandoned.

> you can install the Rust plugin with IntelliJ Community Edition. Which is free.

My understanding is that you can install it, but it does not include debugging support, that's what you have to pay for.

Re:Writing Complex Macros in Rust: Reverse Polish Notation by carlmr on Friday February 02, 2018 @02:24AM (#16289000)
It's just the plugin called Rust. I tried the other ones, but they were not better.

>it does not include debugging support

That's a bit sad, but I haven't had debugging support in VSCode until now. I'd pick good code completion and error hints over debugging. Both would be nice though.

How do you configure that Native Debug plugin for Rust?

Re:Writing Complex Macros in Rust: Reverse Polish Notation by steveklabnik on Friday February 02, 2018 @09:02AM (#16290522)
Gotcha, yeah it's RustyCode that's the outdated one. Rust(rls) is the one provided by the Rust team.

> How do you configure that Native Debug plugin for Rust?

exactly the same way that it says on the page; choose gdb or lldb, change target to point to the executable, and you're good to go.

Re:Writing Complex Macros in Rust: Reverse Polish Notation by fb03 on Friday February 02, 2018 @06:03AM (#16289704)
Yes sir! You can rest assured I'll find something to contribute to the Rust ecosytem, be it bug reports, translations! I haven't been as thrilled as I am right now with a new language since I was a kid actually taking my first steps into programming (MS-DOS and Turbo Pascal days). I wanna see Rust take off and take a big slice off the 'most used languages throughout' pizza chart :-)

o/

Re:Writing Complex Macros in Rust: Reverse Polish Notation by mcguire on Thursday February 01, 2018 @11:20AM (#16283018)
Prolog and Erlang are untyped. Er, dynamically typed. That changes quite a lot.
Re:Writing Complex Macros in Rust: Reverse Polish Notation by quotheth on Thursday February 01, 2018 @12:48PM (#16283921)
I personally find Rust quite a joy to read.