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

Collaborate with linq4j? #1

Open
julianhyde opened this issue Aug 22, 2012 · 2 comments
Open

Collaborate with linq4j? #1

julianhyde opened this issue Aug 22, 2012 · 2 comments

Comments

@julianhyde
Copy link

My projects linq4j and optiq need to generate and execute Java, so I created some code similar to brennus. See the net.hydromatic.linq4j.expressions package:

https://github.com/julianhyde/linq4j/tree/master/src/main/java/net/hydromatic/linq4j/expressions

There are some differences; I use janino to compile, where brennus uses asm directly. I suspect that I need to generate more complex expressions (anonymous and inner classes, and soon lambdas). As far as i can tell, brennus can't "unparse" (generate java source code from a model). But of course brennus has nice builder classes.

Janino is a mixed blessing for me. It is mature and the bugs have all been worked out, for what it does. But it does not support newer features like generics, boxing/unboxing, and suspect it will not support lambdas.

What are your plans for brennus? Do you think it would be useful to pool our resources? What is your preferred communication channel?

Julian

@julienledem
Copy link
Owner

Hi Julian,
I would be happy to collaborate.
Brennus is designed to make it easy to generate domain specific data objects at runtime, as well as related operations (equals, expressions, etc). I'd like to use it in Pig for example.
The brennus model is higher level than bytecode so that it can take care of autoboxing and similar things (in bytecode instructions vary depending on the type handled). At the same time it is not a full representation of the java language syntax tree which would be huge and would make the builder too verbose. Which means you can't turn java bytecode into the brennus model.
The builder makes it easy to generate the model. Then the model can be used to generate bytecode or source or something else by implementing a visitor. Currently there is a bytecode generator that creates classes using ASM and a printer that generates something very close to java source code with some caveats (not dealing with unreachable code ...)
The current builder pattern API is now stable, which was my priority. All the operators are not yet supported but it just a matter of adding them, the general framework being defined.

For new features in Brennus, issues on Github are good. For a more informal chat I'd be happy to meet in person.

@julianhyde
Copy link
Author

Can you take a look at the net.hydromatic.linq4j.expressions package? Would you be willing to include all of that functionality? It has a model for most of the Java language syntax (and it really isn't that huge).

I can see that you wouldn't want to commit to supporting the whole model in the builder. I think it would be acceptable if the builder supported less than the full model, and was extended as needed.

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

No branches or pull requests

2 participants