Live data from Hacker News

Show HN: Pest – Fast parser generator written in Rust

github.com

1–10 of 28 posts

Re: Show HN: Pest – Fast parser generator written in Rust

#2
I remember playing with PEGjs back in the day, making a toy implementation of JS in JS. It had terrible Unicode support though. To build a token out of valid Unicode non-whitespace characters took pages and pages of range definitions. Is that any better here?

Re: Show HN: Pest – Fast parser generator written in Rust

#3

I remember playing with PEGjs back in the day, making a toy implementation of JS in JS. It had terrible Unicode support though. To build a token out of valid Unicode non-whitespace characters took pages and pages of range definitions. Is that any better here?

Rust by default uses Unicode for strings. I would be surprised if this had problems with them.

Re: Show HN: Pest – Fast parser generator written in Rust

#4

I remember playing with PEGjs back in the day, making a toy implementation of JS in JS. It had terrible Unicode support though. To build a token out of valid Unicode non-whitespace characters took pages and pages of range definitions. Is that any better here?

Rust by default uses Unicode for strings. I would be surprised if this had problems with them.

The difficulty wasn't in the engine. JS itself is just as good with accepting Unicode characters as Rust, both in code and strings. The problem was with the PEG implementation. Without some sort of shorthand for Unicode families, defining programming languages that are valid in multiple real-world languages becomes a serious burden.

Re: Show HN: Pest – Fast parser generator written in Rust

#6
post #5

Shouldn't the title better by "Pest - Fast, modern parser _in_ Rust"? The current title made me think that this would be a Rust AST parser, similar to syntex.

Yes this is no doubt the current implication. I was expecting something like racer.

Re: Show HN: Pest – Fast parser generator written in Rust

#7
post #5

Shouldn't the title better by "Pest - Fast, modern parser _in_ Rust"? The current title made me think that this would be a Rust AST parser, similar to syntex.

Exactly what I came into this thread expecting. Was curious why when it looks like there's already great IDE support for Rust with existing tools.

Re: Show HN: Pest – Fast parser generator written in Rust

#9
post #8

What type of parser does this produce?

"Parsing expression grammars (PEGs) are an alternative to context free grammars for formally specifying syntax" [1]

Basically, you have tools for context free grammars such as GNU Bison or Yacc. This is an alternative, but with PEG.

For more in-depth info, there's the original PEG paper. [2]

[1]: http://bford.info/packrat [2]: http://bford.info/pub/lang/peg

Post reply on HN