Hacker News new | past | comments | ask | show | jobs | submit login

Pulumi is a great example of declarative APIs built with imperative programming languages. SwiftUI is another.

Personally I have nothing against the Nix language, and use it without issue, but it's untrue to suggest that the language itself requires uncommon support for this kind of thing.




Ooof... Pulumi et al are terrible to write and read. Why should I care about writing 'new' in front of all my declarative configuration? What happens when an if statement depends on a concrete value? How would that even work? The leakiness of the abstraction is too terrible to even consider.

Terraform et al, despite not being my favorite, have much simpler semantics than Pulumi. It's not always a good idea to write DSLs into languages with huge paradigm mismatches.


Terraform and Pulumi have basically the same semantics.

> Why should I care about writing 'new' in front of all my declarative configuration?

Because that’s how your choice of language instantiates an object. Try F# or Swift or Go if it’s that annoying to you.

> What happens when an if statement depends on a concrete value?

What do you think “count = var.concrete_value ? 1 : 0” is doing in Terraform, exactly?

> The leakiness of the abstraction is too terrible to even consider.

While you are are entitled to your opinion, I’d suggest you are very much mistaken, and would implore you to actually consider it for a minute.


Just as a point of order. You offer no case for Pulumi and your one actual discussion of the semantics is misplaced as it deals with if expressions, not statements. Stratified ifs that occur at the non-recursive areas of the language are usually not a problem for these change management systems.


I'm not offering a case for or against either, to be clear - and neither are you - indeed you went so far as to say effectively you wouldn't even bother considering the semantics since they _must_ be awful.


The semantics of the Pulumi runtime are probably fine, but the semantics of the DSL layer that preceeds that when mixed with the sensible semantics of the Pulumi runtime are a recipe for disaster. This is based on my extensive experience with declarative DSLs in imperative languages. The impedance mismatch is high. Nothing to do with Pulumi's internal state management, but it's beholden to javascript.


Personally I see it as similar to typed vs untyped languages. You can add typing to untyped languages or you can just use a typed language. The language used shapes the structure and some are easier to reason about than others (to some people).


Some people don't want to hear this, but it is 100% true.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: