-
Notifications
You must be signed in to change notification settings - Fork 86
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
Parsing Schemas #136
Comments
I suspect the problem is that the functions in What are you using these schema buffers for? Eventually I'd like to add support for runtime reflection, like I recently did for capnproto-rust: https://dwrensha.github.io/capnproto-rust/2023/05/08/run-time-reflection.html |
I think runtime reflection would work, but it may be technically more powerful than I think we need. Right now, we're considering doing our own Java-based code-generation step to produce java that can use the capnproto-java generated java, and ideally would like to use the known schema to accomplish that. I might call this "compile-time reflection" since we don't need the schema structures during runtime, but I think that's just nit-picking on semantics and it's probably same tooling, just whether you depend on it during runtime or not. (BTW, I do like the lean-and-mean approach you've taken w/ Of course, it could be argued that we should just hook into |
|
I was able to successfully read a binary schema in java; I did need to make a small modification to My notes https://gist.github.com/devinrsmith/74e0a9b230f6bb3975beebed3ec8c253. It seems like "runtime reflection for capnproto-java" would essentially entail publishing the code-generation from schema.capnp as a new jar (or, part of For reference, the schema.capnp java file is ~360kB, the compiled class file is ~9kB, and zipped up class file is ~2.7kB. |
I'm trying to use tooling to parse the code-generated Schemas in java (the
org.capnproto.SegmentReader
fields w/ hex names under the nestedSchemas
class).I assumed the struct would be Node from https://github.com/capnproto/capnproto/blob/v1.0.1/c%2B%2B/src/capnp/schema.capnp, but that structure doesn't seem to parse correctly (tried both
org.capnproto.Serialize
andorg.capnproto.SerializePacked
).Is there a different schema that is necessary to parse these fields? Or a different way to decode these bytes in java?
Thanks!
The text was updated successfully, but these errors were encountered: