OpenFn / kit

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

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

Open josephjclark opened 5 months ago

josephjclark commented 5 months 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...

josephjclark commented 3 months ago

Petition to use .ofn files instead of .ojs files :thinking: