Hacker News new | ask | show | jobs
by adamgordonbell 512 days ago
Or use code instead of HCL.

I joined Pulumi because I believe that using the abstraction and tooling that a proper language allows is the way to go, but anything that's not config: CDK, Bicep, TF CDK, etc – is to me a step in the right direction.

It's not that HCL is bad, and I get that it's dominant. It's just the same complaint I have with yaml and yaml templating: You will want something more than a config file at some point. Start today.

4 comments

I’ve come to appreciate power-limited DSLs. The problem is, they are very tricky to design: too simple and users will start templating, or even worse: programming in them (e.g. Yaml+Sh); too powerful and you’ve got yourself another full programming language (e.g. Dhall). I found HCL, although frequently complaining its type system is clearly designed by Go people, to be pretty close to the sweet spot. For each if-loop and other horrid workarounds I’ve had to write, someone else did not write a tower of abstractions that when interpreted, yielded the right result. Maintenance is usually an architectural task, rather than computer science. There are no frameworks to learn, there is no flashy new package manager attached, there is no need to deal with Python pacakge management and such. And, since it’s usually good enough, the effort to add this is disproportionately large, so that nobody does it.

Coming from my Haskell background, I’ll say it like Gabriella Gonzalez once put it [1]: _worst practices should be hard_, and this is where and why I think Terraform/Tofu shine and succeeded.

[1]: https://www.haskellforall.com/2016/04/worst-practices-should...

Had a guy invent a DSL for his Greenfield project as an abstraction layer on top of Python. Within a few months he was asking people to write scripts to programmatically generate the DSL.

So now you have DSL-generating script & DSL to version control.

The use case of "people who are computer literate enough to operate within an DSL but not literate enough to program code" is always smaller than people think. And probably not who you want to hire.

What is HCL?

Comparing to yalm and such, I'm assuming it is using a templating tool that presents a "not programming" front? If so, I think I'm 100% in agreement.

It is complicated, I think, because declarative is nice. But the idea that you have to forego all execution to get declarative code is frustrating, in the extreme.

HCL is Hashicorp Configuration Language: https://github.com/hashicorp/hcl.

It's basically a DSL used by a bunch of Hashicorp products.

It's sort of a programming language. Someone I worked with implemented 1 or 2 advent of code exercises with it a couple of years ago, but it's far from a general purpose language.

> What is HCL?

It's that weird declarative language used in terraform configuration files

Pulumi is not free. You can still use Code with Terraform/OpenTofu using CDKTF [0]!

[0]: https://developer.hashicorp.com/terraform/cdktf

Pulumi is free: "Pulumi is true open source, uses the Apache 2.0 license, and does not and never will depend on BSL-licensed software in any way, HashiCorp owned or otherwise." (https://www.pulumi.com/blog/pulumi-hearts-opensource/)

Pulumi Cloud (the SaaS offering) is (mostly) not free. There is a free tier for individuals/companies with minimal needs.

You may happily use Pulumi and manage your own state files, for free, and open source.

I yet have to read/hear about somebody self-hosting Pulumi. It lacks the huge Terraform ecosystem and without the paid cloud offering, it's pretty rudimentary.
I found https://sst.dev/ to be a developer friendly experience. It is built on top of Pulumi.

I just pay the AWS costs under my own account and nothing else.

This is great. Sorry, I've almost forgotten about it. Thanks!
It is possible to self-host it on GCS, S3, etc. We used to pay for their cloud offering, but using GCS as a backend was much more performant than using their backend and extremely cheap (a few cents to dollars per month).
I've had a disastrous experience with Pulumi several months ago trying to set up some basic Azure setup - it wasn't anything like Terraform, so, I switched to CDKTF for that, and it was nice except that I first attempted using Go, but, ideally, it went with TypeScript as it was significantly more ergonomic.
Yeah this was one of the things about terraform that I never liked. After spending all day writing my imperative code, I’m going to write some declarative JSON to deploy it? Why?

There’s a good discussion here: https://news.ycombinator.com/item?id=42663231