camunda / feel-scala

FEEL parser and interpreter written in Scala
https://camunda.github.io/feel-scala/
Apache License 2.0
120 stars 50 forks source link

Cross-compile to Javascript #220

Closed nightscape closed 1 year ago

nightscape commented 3 years ago

We have a use case where we would like to execute the FEEL engine in a browser. Scala can be cross-compiled to Javascript using Scala-JS, but unfortunately there is no readily-available way to setup Scala-JS with Maven. I saw that you had an SBT build previously, but removed it in https://github.com/camunda/feel-scala/pull/135. Was there a reason why you preferred Maven over SBT? I would love to contribute a PR to compile to JS, but I don't know if my time-budget is sufficient to figure out how to do it in Maven...

saig0 commented 3 years ago

Hi @nightscape, I like the idea :+1:

I built a Scala.js cross-compiled version years ago. Back then I had some troubles with the scala-parser-combinators dependency. I had to modify the parser a bit to make it work. Maybe, this is fixed now. Eventually, I want to migrate to FastParse2.

Maven is currently set by our build and release infrastructure. To reduce the effort of maintaining Maven and SBT, I dropped SBT.

However, your contribution is very welcome :rocket: I see it as an experimental topic. Your pull request can show how a solution can look like. You can start with SBT. If it is promising then we can work on a solution with Maven.

saig0 commented 1 year ago

We will not follow this path anymore. In general, I like the idea to compile the Scala engine into JS but as we saw that it is not straightforward (#221).

For Camunda, we decided to build a new FEEL engine natively in JS. The JS version integrates nicely with the existing Camunda modeler stack. So, Scala is used for execution and JS for the modeling stack. :rocket: