expr-lang / expr

Expression language and expression evaluation for Go
https://expr-lang.org
MIT License
5.85k stars 378 forks source link

trying to understand expr lang more, is there anything that expression can do that goja / otto cant and vice versa? #669

Open sprappcom opened 4 weeks ago

sprappcom commented 4 weeks ago

as titled

antonmedv commented 3 weeks ago

Hello,

Let me explain the difference.

It may seem what expr and goja solves a similar problem, but they do it in a little bit different way. Also use cases can be different, goja targets more environments where JS may be needed, Expr on the other hand targets rule engines, filtering, and policy of different kinds.

A few differences between goja and expr:

Both Expr and goja a very cool and powerful languages. And you need to choose what suits you best for the task you are working on.

sprappcom commented 3 weeks ago

thx so much for the comprehensive explanation.

just curious, i was looking at making my own cloudflare workers (which would prefer js than wasm), so was wondering if i can use expr as replacement?

i know expr is not using js but i was wondering will it be a good fit for FaaS kind of scenario,

also i'm hoping able to do "hot reload" like detecting file changes and reload expr lang script. <- any caveats? for example i wont use "golang plugin" reload as memory is not reclaimed for the old unused golang plugins.

will expr be a good fit for FaaS? what caveats do i have to look out for?

@antonmedv appreciate this last question. thx. will use expr in filtering too.