-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Distribute Pomsky as a native library #62
Comments
My idea was to add a CLI flag to print compilation results as JSON, which could be used by IDEs. However, that is not implemented yet. But to make your IDE extension work, I think all you need is jni-rs. You can follow this tutorial (maybe there are better ones, this is just the first one I found) and make a crate that exports a By the way, I was planning to look at your lexer and BNF grammar but didn't have time until now. I'll try to give you some feedback tomorrow. |
@Aloso JSON is a good idea. However, are we sure it's ok performance wise? I would like to call it every time there is an edit, like in the playground, and it has to report errors as fast as possible. If I make a crate, do I have to recompile each time a new version comes out? I believe the answer is yes, which means it becomes a bit cumbersome. |
This is how an IDE would handle this situation.
|
Creating a process takes less than a millisecond on recent hardware, I think, so it's not that expensive to call pomsky's CLI. But to get the best performance, using something like JNI would be better. Yes, that requires recompiling the dynamic library every time a new version comes out, but maybe that can be automated somewhat. |
@Aloso just keep in mind extensions should just inherit from the tool. If extensions have to carry their own compiled versions of Pomsky, it becomes a binary hell. |
Distributing Pomsky not only in the CLI format, but also as a native library (
.so
,.dll
), allows tools to compile and receive an output in a standardized format which can be interpreted through interfaces like JNI or JNA.Example usage: compilation and error reporting inside of an IDE.
I think a project like this https://github.com/Dushistov/flapigen-rs might come handy.
The text was updated successfully, but these errors were encountered: