SweetDSL is a plugin for Jetbrains MPS that uses JSweet, a transpiler from Java to TypeScript/JavaScript, and a modified version of MPS's builtin XML language to generate web apps. New javascript libraries can be easily added as a new language and are fetched from a maven script and then compiled to javascript.
A first attempt at a build script is already included. Help.
Yes. com.mbeddr.core, com.mbeddr.mpsutil and org.campagnelab.textoutput. They can all be found in the MPS plugin store.
Yes, Maven. Go to preferences -> Other settings -> SweetDSL generation and change the path to the executable if neccessary.
- Cross model usage of classes is not supported
- Only a subset of Java is supported(more info here)
- MPS languages that contain runtime classes are not supported (except basic support for tuples and lambdas)
Switch from the Logical view to the web view. Open the markdown model -> Java. Right click on MarkdownExample -> Recompile Web App. Try to understand the demo. Complain about things that are not working.
- Create a new solution with a model in it.
- Import base language
- Import js languages that you want to use (AngularJS,BackboneJS...)
- Use the intention "Add web app support" (light bulb). A new attribute is added to the class.
- Add dependencies for languages in 3. (AngularJSDependency,BackboneJsDependency...)
- Right click on a class with main method -> Recompile web app
In the node attribute.
Go to JSweet documentation->Globals to find more information about it.
There could be multi reasons for that:
- A MPS language with runtime classes is used (e.g. collections). That's currently not supported.
- You forget to add a dependency to the core language or to another language (e.g. jQuery, KnockoutJS..)
- The java code couldn't be compiled to js. Not all features of java are supported. Consult the JSweet Github page for more information,
This seems to be an internal error and should be reported in the issue tracker.
SweetDSL is under the MIT license.
JSweet is under the Apache 2.0 Open Source license.