-
-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trying to understand expr lang more, is there anything that expression can do that goja / otto cant and vice versa? #669
Comments
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. |
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. |
I don't have enough context to give meaningful advice here. ¯\_(ツ)_/¯ |
What aspects or use-cases (in a FaaS context) do you mean to refer to ? Or do you mean to ask whether expr (alone by itself) could serve as a full-blown FaaS runtime? |
Never gave a thought to this until I read your comment. I think, expr is Turing complete. We have [practically] arbitrary memory addressing, some form or iteration/looping, and conditional code-flow, which should be enough to claim Turing completeness. If that is not enough, what definitely nails Turing completeness is the support for custom functions (i.e execution of arbitrary golang code). |
There is no doubt what you can turn expert into turning complete language with custom functions. But only using builtin functions, not possible. Here is an example: using only built-in functions produce Fibonacci sequence. |
as titled
The text was updated successfully, but these errors were encountered: