fsprojects / FSharp.Compiler.PortaCode

The PortaCode F# code format and corresponding interpreter. Used by Fabulous and others.
Other
42 stars 11 forks source link

Purpose of the interpreter #4

Closed 7sharp9 closed 5 years ago

7sharp9 commented 5 years ago

Im curious on the purpose of the interpreter?

dsyme commented 5 years ago

It's used in fabulous

7sharp9 commented 5 years ago

Thanks for the detailed information.

dsyme commented 5 years ago

More specifically: it's used for the "LiveUpdate" feature of Fabulous, to interpret the Elmish model/view/update application code on-device.

It's not actually necessary on Android since full mono JIT is available. On iOS it appears necessary.

The interpreter may also be useful for other live checking tools, because you get escape the whole complication of actual IL generation, Reflection emit and reflection invoke, and no actual classes et.c are generated. We can also adapt the interpreter over time to do things like report extra information back to the host.

The input code format (PortaCode) is derived from FSharp.Compiler.Service expressions, the code is in this repo. The semantics of interpretation can differ from the semantics of .NET F# code. Perf is not good but in many live check scenarios you're sitting on a base set of DLLs which are regular .NET code and are efficiently invoked.

dsyme commented 5 years ago

Added comment to README.md