logoalt Hacker News

Rhapso12/09/20241 replyview on HN

Starklark isn't exactly "functional" but by design it is hermetic. You can't call any code that would have a side-effect (other than burning compute resources) or get data that wasn't part of your initial input.

It could make a of sense as a "contract language", or as intended: part of a build system.


Replies

kccqzy12/09/2024

I believe Starlark allows side effects the first time it evaluates a file but not subsequent times. Otherwise something as simple as calling .append on a list won't work because that returns None but has an input-mutating side effect. I think it's a good choice.