Skip to content

3. Implement utils classes.

For Java and C, source code for default utils classes is generated with every export, regardless of contents. These utils classes contain generalised functions used for every export, so basically ESCET boilerplate. We'll need to generate the Javascript equivalent of this, adding it to the search/replace templates we created for the previous ticket.

  • Create a Java/C export to see the generated functions (and/or check the Java/C code).
  • Implement the same functions in Javascript, add them to the search/replace templates created for the previous ticket.

Discussed with Dennis/ESCET:

  • Should also add unit/integration tests that verify the generated Javascript matches a hardcoded example (same is done for Java/C).
  • Should add options to export either as package with source files, or as a simulator target (optimised for sharing/sending, all code in 1 html file, minified).

Additionally:

  • Ideally, we'd find a way to test the outputs of Javascript functions vs Java/C, not needed for v1 though (should simply do manually for v1).

  • Can use a converter/transpiler to generate Javascript from exported Java code, then simply clean up and re-use that. No need to re-invent the wheel.

Edited by Rik Lubking