-
Notifications
You must be signed in to change notification settings - Fork 18
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
An idea for an interesting nyanga sample #33
Comments
On 2/14/14 8:09 PM, romix wrote:
I think it's an awesome idea! I have a project for it as well, and I'll need plenty of network code as Once you have streams, you can make them composable. Either by using layers:
Or by using filters and channels to connect them:
All of this will just magically schedule fibers cooperatively of course :) On a related note: I've decided to bite the bullet and use libuv for a So this is all just something for you to think about while working on [1] https://github.com/richardhundt/libray
|
Cool!
or ML-style
The syntax is just an example, of course.
I would assume that both last prints should output the same value. But this is not the case. The first one prints
More over, the second one sometimes produces segmentation faults.... |
BTW, one more question, a bit off-topic: Imagine that I want to define a grammar for C/Java-like expressions using Nyanga's grammars. Different arithmetic operations have different priorities (and sometimes different associativity). Of course, one can model this by introducing a new non-terminal per priority level, as it is usually done by means of Yacc/Bison. But may be there's a shorter way when using LPEG grammars, e.g. the priority/precedence of operations is defined in a table and parser dynamically consults it to check what to do next or something like this? I.e. for binary operations one would have only one rule This link seems to describe something that I have in mind: But I'm wondering if this can be expressed using RE/Nyanga grammar syntax instead of LPEG's low-level syntax. |
Hi Richard,
I have the following idea for a relatively complex example that would show nyanga's power. This example should implement a small workflow engine.
It means:
I think this set of features is pretty easy to implement and it covers a lot of Nyanga's features:
I think such an example would be really impressive compared to small "Hello World!" like examples and would show a real power of Nyanga.
What do you think?
The text was updated successfully, but these errors were encountered: