Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lexer design for performance #4

Open
jojo05 opened this issue Apr 21, 2017 · 3 comments
Open

lexer design for performance #4

jojo05 opened this issue Apr 21, 2017 · 3 comments

Comments

@jojo05
Copy link

jojo05 commented Apr 21, 2017

Hi,
I am really looking forward to using your library.

I suggest using a a traditional lexer (w/o goroutines) now that the library is young so that is eventually production ready (i.e. able to get best performance).

See references:

That talk was about a lexer, but the deeper purpose was to demonstrate how concurrency can make programs nice even without obvious parallelism in the problem. And like many such uses of concurrency, the code is pretty but not necessarily fast.

I think it's a fine approach to a lexer if you don't care about performance. It is significantly slower than some other approaches but is very easy to adapt. I used it in ivy, for example, but just so you know, I'm probably going to replace the one in ivy with a more traditional model to avoid some issues with the lexer accessing global state. You don't care about that for your application, I'm sure.

So: It's pretty and nice to work on, but you'd probably not choose that approach for a production compiler.

-rob

@jojo05
Copy link
Author

jojo05 commented Apr 21, 2017

Apologize for the bad formatting. I will figure out markdown syntax next time

@chewxy
Copy link
Owner

chewxy commented Apr 21, 2017

Fixed the syntax for you.

I'm not entirely sure what point you're trying to make btw

I see your point. My plate's pretty full right now, and I'd appreciate a PR.

Some important key points:

  • Each component needs to be able to work on itself
  • Each component needs to be able to be put into a pipeline (as per the example)

@chewxy
Copy link
Owner

chewxy commented Apr 21, 2017

(updated comments)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants