logoalt Hacker News

bossyTeachertoday at 4:38 PM2 repliesview on HN

I would love if languages like Scala, Swift or F# had something like Cel but running at compile time so your program was evaluated against those restrictions. I believe a language called Idris has something like this


Replies

yegletoday at 8:41 PM

Are you suggesting to compile CEL into native code and run the compiled code at runtime (i.e. as a predicate function)? I think this is doable and I vaguely remember this was how it's implemented initially.

But most use cases are treating CEL as a user provided config, which requires runtime parsing and execution.

nivertechtoday at 8:18 PM

A better solution would be first-class metaprogramming, like in Zig or LISP. Maybe with some subset which guarantees to halt (I.e. no unbounded loops, no recursion, no FFI, known input size, hard time limits, etc.)