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

Synthesize diagrams from the standalone compiler #398

Closed
cmnrd opened this issue Jul 7, 2021 · 2 comments
Closed

Synthesize diagrams from the standalone compiler #398

cmnrd opened this issue Jul 7, 2021 · 2 comments
Assignees
Labels
diagrams Problems with diagram synthesis enhancement Enhancement of existing feature

Comments

@cmnrd
Copy link
Collaborator

cmnrd commented Jul 7, 2021

While our Epoch IDE is very nice, many people seem to refrain from using Eclipse. I think that the standalone compiler provides a very viable alternative. Thanks to #365 we even have support for syntax highlighting in vim, which is in a way better than the highlighting in Epoch as it includes full target language support (at least for C/C++ for now). However, the only important feature lacking without Epoch is the diagram synthesis, and I think we should make this available also from the lfc compiler.

What do you think? Would this be possible? If so, do you have any pointers on how this could be implemented?

@cmnrd cmnrd added enhancement Enhancement of existing feature diagrams Problems with diagram synthesis labels Jul 7, 2021
@cmnrd cmnrd self-assigned this Jul 27, 2021
@a-sr
Copy link
Collaborator

a-sr commented Aug 2, 2021

Yes, it is possible.
The Klighd framework can save diagrams as png or svg outside of eclipse. An example is the Kieler Compiler (kico), which has a variant that is able to save diagrams (kicodia). In the klighd-vscode project, there is also a standalone tool that allows interactive diagrams in a browser using the language server.

However, the tricky part is building the tool. For LF you could use the same tool chain as for the language server (on the vscode branch) and register a main class that provides saving images (example from kicodia). However, the problematic part is that Klighd uses SWT for rendering, which relies on platform-dependent native code. This the reason for the different jars of kicodia. Each bundles the specific code for SWT. There are also alternative strategies. The LF language server currently excludes SWT and puts the correct platform-dependent jar on the classpath when the language server is started. Hence, the extension ships with one language server jar and three SWT jars, to achieve platform independence. A colleague once produced a solution where he bundled all platform-dependent jar into the tool and wrote a special class loader to include the correct one at runtime but I am not sure if such an solution will always work.

Building with Gradle is also not possible because Klighd is not yet available as proper maven artifacts, see related Klighd issue. Hence, one has to rely on Maven with p2 and a self-written Python script to create a fat/uber jar.

@cmnrd
Copy link
Collaborator Author

cmnrd commented Jan 27, 2022

Closing this in favor of #897.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagrams Problems with diagram synthesis enhancement Enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

2 participants