-
Notifications
You must be signed in to change notification settings - Fork 2
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
[RFC] DDlog 2.0 Syntax #3
Comments
Some suggestions. Meta
Type system
|
bigint is useful. But it could be a library - although you lose the literals. |
Yah, I totally agree with those sentiments. Purity is a tricky question, it's a tradeoff between user control and compiler freedom. However, since we have the ability to drop into writing and using Rust code within ddlog, I think that making the surface language pure can sidestep that particular drawback |
I have no problems with mutable variables in imperative code. It should be clear that you cannot mutate any value that is in a relation, though. |
There will no longer be any distinction between imperative and relational code at the language level. |
I thought you gave up on embedding the language in Rust or something else. |
You can always convert mutable variables to single static assignment form. I guess if we want to allow loops, then we want mutable variables. Loops are not very useful if you cannot modify variables in the body of the loop :) |
Variables are not as interesting as containers. Do you want mutable vectors and maps? |
That's a library design question. Assuming we have mutable arguments, you can define methods that mutate the container. You can also have immutable containers, where mutator methods return a new container. |
We're not embedding in an existing language, but are designing our own functional language. Relations are first-class objects that can be passed to functions and back. All relational operators are just methods (#2); Datalog-style rules will be implemented as syntactic sugar on top of this language. At least this is the current proposal. Not sure exactly what Upd: but I still like the idea that input and output relations are just inputs and outputs of a function. |
Opened #4 |
The syntax is described in an EBNF flavor loosely based off of W3C's EBNF
Note: As of now this grammar is not complete or final, it's just what I've implemented. A lot of the constraints are much loser than they seem like they should be, that's just because of the error recovery I've implemented in the parser, things accepted within parsing are not always valid and errors are emitted
The text was updated successfully, but these errors were encountered: