OpenFn / kit

The bits & pieces that make OpenFn work. (diagrammer, cli, compiler, runtime, runtime manager, logger, etc.)
8 stars 12 forks source link

Lazy State: Maybe use `@` instead of `$` #717

Open josephjclark opened 1 week ago

josephjclark commented 1 week ago

The Lazy State operator uses $ to read from state. For example:

get($.url)

Some benefits of using $ are:

Problems with $ are:

Benefits of using @ are:

But the problems with @ are:

I think the bottom line with @ is that it's better branding and basically good for us, but it moves the openfn DSL a step closer to being a distinct formal language, meaning we need to support .ojs files and create OpenFn JavasScript language definitions.

To be honest actually $ is no different - it SHOULD be treated as a different language statement, with linting rules and syntax highlighting associated with it. And $ won't run without compilation anyway.

So maybe introducing @ just forces us to be more honest about our coding language.

However, I don't want to do all that stuff if we're going to throw it away next year in favour of a v3 langauge syntax, as is being discussed in the dark corridors of power here...