3 ms·
I'm guilty of putting a JSON language in production. In my case it's just an if this then that rules engine with a backend that looks kind of like lisp, [event
by eternityforest 3y ago
I'm guilty of putting a JSON language in production.
In my case it's just an if this then that rules engine with a backend that looks kind of like lisp, [eventName, [[action, param]]] is pretty much the whole language, except for a few bits of special syntax in the eventName (=variable>6 to trigger on greater than 6, @every five minutes to trigger every five minutes).
It lets people edit rules visually in a way that anyone can probably use if they can use a spreadsheet.
Sometimes the task needs some hackery to shove it into such a limited language, but I'd rather have boring hacks than elegance backed by lots of in house novelty to maintain.
- karmakaze 3y agoNice. Greenspan's tenth rule, which I would say of configs and DSLs. Not always bad but good to be aware of while you're doing it.
- febusravenga 3y agoDon't be ashamed. This is actually quite common and correct solution sometimes. Look, like mapbox styling runs on "s-expr"-like based languge encoded as JSON arrays: https://github.com/mapbox/mapbox-gl-language#mapboxlanguage https://github.com/mapbox/mapbox-gl-language#mapboxlanguage We did it in related project too and worked well enough.