3 ms·
Ease/ability to embed in other language safely. Predictability of memory, execution. Known constraints like guaranteed to terminate is useful. no Doom running
by aleksiy123 8mo ago
Ease/ability to embed in other language safely. Predictability of memory, execution. Known constraints like guaranteed to terminate is useful.
no Doom running on cel.
I recently wanted to expose some basic user auto tagging/labeling based on the json data.
I chose cel, over python, SQL because I could just import the runtime in C++, or any language that implements it (python, js etc..)
Safely running a sandboxed python execution engine is significantly more effort and lower performance.
At this cel excels.
Where it didn't was user familiarity and when the json data itself was complex.
- IshKebab 8mo ago> Known constraints like guaranteed to terminate is useful. "Guaranteed to terminate" actually means "guaranteed to terminate in finite but possibly arbitrarily large time" which is really not a useful property. There's no practical difference between a filter that might take 1 billion years to run and one that might take more than a billion years.
- aleksiy123 8mo agoYes but when you combine it with the other guarantees on performance. https://github.com/google/cel-spec/blob/master/doc/langdef.md#performance-limits https://github.com/google/cel-spec/blob/master/doc/langdef.m... And your service puts an upper bound on input size and cel expression size. (True for all practical applications.) You can actually get a guarantee tha t you can't construct a billion year expression. And even guarantee that all expressions will evaluate in let's say 60 secs. Turing completeness by itself does not guarantee this but it is a necessary prerequisite for these guarantees.
- IshKebab 8mo ago> Turing completeness by itself does not guarantee this They should update their home page then!