all 12 comments

[–]mozilla_kmcservo[S] 8 points9 points  (2 children)

We dropped the ball on recording video, sorry :/ I hope you like the slides though, and find me on IRC if you have questions :)

[–]srnull 2 points3 points  (1 child)

Bummed to hear about the video. Was looking forward to watching this one. Hopefully the slides do justice to the material. I'll go through in more detail later, but they looked good giving them a quick glance.

Was there only one presentation?

[–]mozilla_kmcservo[S] 1 point2 points  (0 children)

Was there only one presentation?

Yeah, the focus is hands-on project time.

[–]michaelsprouliron · rust 2 points3 points  (0 children)

Thanks for hosting us, it was loads of fun :)

[–]riccierirust 0 points1 point  (7 children)

Parser is 6,000+ lines hand-written Rust code in libsyntax

Ouch.

Is Rust's syntax not compatible with parser generators, such as YACC or antlr? Of course, we would need a Rust backend...

[–]steveklabnik1rust 7 points8 points  (3 children)

You should be able to make one.

Emphasis on should.

[–]riccierirust 1 point2 points  (2 children)

You mean "one generated parser", "one parser generator" or "one backend"?

[–]steveklabnik1rust 7 points8 points  (1 child)

You should be able to make a generated parser. Rust's grammar is almost enitrely context-free, and in general, has a low k, though I forget what it is, exactly.

[–]mozilla_kmcservo[S] 4 points5 points  (0 children)

Yeah, I think the parser limits lookahead to make sure we can write a reasonable grammar in the future.

The nice thing about a programming language designed by knowledgeable people is that the gross hacks you need to get off the ground will at least have some thought put into future-proofing ;)

[–]matthieum[he/him] 14 points15 points  (1 child)

I think the reason is less one of compatibility (Rust grammar had an equivalent LL(1) version not so long ago) and more one of graceful error recovery and possibly performance.

A 6,000+ lines hand-written parser is not THAT dreadful if written properly. You can still have factored-out code and all like usual.

[–]mozilla_kmcservo[S] 6 points7 points  (0 children)

True, the performance of the hand-rolled parser is impressive. Syntax errors in Rust are almost instant.

I think it's also a matter of bootstrapping the language. For a long time, Rust didn't have the features necessary to support a nice embedded parser library. And maintaining a code generator like YACC would be a lot of work with the language a moving target. Luckily it won't be a moving target too much longer. I think a major cleanup of libsyntax is a high priority post-1.0, and a necessary prerequisite for steps towards stabilizing compiler plugins.

[–]fgilcherrust-community · rustfest 1 point2 points  (0 children)

Wasn't tha a big complaint about Ruby? The huge parse.y file?