Reviewed https://winglang.io this week. I did NOT get a chance to play with it, but did read the docs.
There is a lot to say, but here’s the gist. It’s like the AWS CDK, but a whole other language designed specifically for building cloud applications in multiple clouds. You write in Wing, like you would with TypeScript in the AWS CDK, and it compiles to a cloud target; like “S3 buckets in CloudFormation” or “Lambda functions in Terraform”. It also includes code that can run _on_ the cloud called inflight code (preflight code is what builds your infra), and most importantly, tests that can run locally AND _in_ + _on_ the cloud.
First, it comes from the creator of the AWS CDK. If you’re familiar with that, then you’ll see a lot of the same philosophy here: Using a typed language, defining infra using classes, and lots of Object Oriented Programming thinking around “grouping these infra things as Classes with configurations inside”.
The compilation is one of the main value add’s to developers here. Instead of writing Terraform or CloudFormation, you write Wing, and Wing compiles to to Terraform, CloudFormation, … or both. If you’re one of those developers whose taken on more Ops work as opposed to an IT/SysAdmin who’s traditionally done Ops, you probably would prefer to write code vs. YAML. THIS is the target demographic: coders. Those who think in types. Those who want tests for their “Infrastructure as Code” because… it’s code. We test code.
Still, while it may seem like super ambitious, the compilation targets _actually_ do a lot of the work. Specifically, compiling Terraform… it already is cloud agnostic by design as opposed to CloudFormation which is specifically for AWS.
The type system is very similiar to any non-sound TypeScript/C#/Java one, so if you know any of those, you’ll get up to speed immediately. The JSON handling, however, has been abstracted really simply to provide built in Schema parsing to your types without having to write a Zod Novels® or Avro Epics™. They even have built in tryCatch methods.
What I’m disappointed about is they still support null values and exceptions. I get why; anyone who’s from a Java/C#/TypeScript background will understand what those are, think they’re normal, and expect those to happen. Despite being solved problems with better solutions such as Clojure’s Spec or ML languages Maybe, and errors as values like Go’s tuple returns or any ML language’s Result type, they stuck with what most are familiar with. Disappointing in 2023 we’re building new languages with these 1960’s problems.
Still, things like JSON’s tryFromJson method will hopefully influence developers to realize the world doesn’t have to revolve around copious try/catch.
The tests and simulations are amazing. You can do a dry run locally, like running your infra build code, but ensuring it doesn’t actually build anything, you’re just ensuring it all looks like its building things correctly and the RIGHT things.
Secondly, your unit tests can both test your code, AND test it in the cloud. So many of us doing Acceptance Tests in Serverless are doing a lot of that just to ensure the code works as expected “in the cloud”. However, a lot of that motivation isn’t really about the code; it’s to ensure the infra itself works. Just because I have a Lambda function setup doesn’t mean it’s allowed to send to SQS, or the that the SNS triggers are firing the Lambda functions correctly. Basic infra setup tests are usually baked into our Acceptance Tests, which is fine. However, having these infra tests as part of your infra as code… wow, amazing. Will help focus the tests more, for sure, AND add more resilience to CICD pipelines.
Finally, they have a UI that works with their simulator to both view your infra, and even play with it to ensure it’s working locally. That’s… crazy cool.
All in all, Wing has done a herculean amount of effort. When people asked “Why are Ops tools _so bad_?” they answered, “because people like us haven’t built Wing yet”.
One thing I don’t see, and wish I did on their road map is something that Gregor Hohpe brought up recently, specifically about using Domain Driven Design concepts, what we Functional Programmers call Types; using those to design your Domain, and the infrastructure and code is just details. Wing, I’d say more so than the AWS CDK, is perfect for that. I think that’s one of the later values from these Infrastructure as Code cloud agnostic platforms.