from Hacker News

Show HN: Winglang – A new cloud-oriented programming language

by shaiber on 12/6/23, 3:56 PM with 71 comments

  • by openquery on 12/6/23, 5:41 PM

    Winglang looks really cool. I'm really curious how Winglang will evolve their language syntax and semantics to make cloud development more expressive (I assumed `bring` and `inflight` keywords are just the beginning?).

    At Shuttle[0] we've built something similar but instead of building a language from scratch we've built on Rust using metaprogramming and the type system to achieve the same effect. For now we haven't hit any limitations that would warrant a new compiler as metaprogramming allows us to express cloud development quite naturally inside the language.

    [0] https://www.shuttle.rs/

  • by thesurlydev on 12/6/23, 5:05 PM

    It's a coincidence I just went through the getting started guide yesterday. It would be nice to have a two-way sync between the simulator diagram and the generated code. I'm also curious how Winglang handles existing infrastructure and what it looks like to introduce Winglang to a project that already uses CF or TF.

    I've used CF, and TF and was an early adopter of CDK. I'm curious how this compares with Pulumi (never tried it). I liked the idea behind CDK but was shy about going all in because it was AWS-specific. Looks like this is the natural progression.

  • by liotier on 12/6/23, 5:10 PM

    Why a whole language rather than a library that could just as well abstract the cloudy infrastructure and expose its data structures as "first class citizens" ?
  • by bez00m on 12/6/23, 4:59 PM

    I've been following the Unison lang [1] for quite some. Wing seem to set similar goals? From the first glance Wing looks more polished, but there's "The Big Idea" behind Unison - is there something similar?

    [1]: https://github.com/unisonweb/unison

  • by ljm on 12/6/23, 5:33 PM

    Given that it's built as a whole language, I'm curious about the choice to make no obvious distinction between 'preflight' and 'inflight' functions.

    It's not obvious at a glance that you can only call inflight functions in an inflight scope, because the syntax for calling them is identical to calling a preflight function on the same object.

    Do you just compile it and see where it fails?

  • by haskellandchill on 12/6/23, 4:22 PM

    > infrastructure and runtime code in one language

    This is fertile ground for new languages, apparently they call this the "Construct Programming Model" but there appears to be no meat to the theory. If programming language theory was leveraged properly I think they'd really be on to something. See the success of Rust for example.

    I just did some cursory research and came across a paper on "ABS: A high-level modeling language for cloud-aware programming" which would give a much stronger foundation for such an effort than JavaScript.

  • by cmgriffing on 12/6/23, 9:57 PM

    I think it's an interesting idea, but I feel like creating a whole new language has too much overhead for adoption. You would need to create a language server and extensions for every editor you want to support.

    A language-specific DSL (Pulumi, CDK, etc) just works in any editor that already supports your language.

    This is a similar reason to why I dislike most docblock-based infra tools as well. If wing is confident in their ability to maintain editor tooling, more power to them, but it isn't maintenance I would want to manage.

  • by nathan_tarbert on 12/6/23, 4:25 PM

    I looked through the docs and I don't see any async methods, is that built into inflight like this code snippet I found?

    queue.setConsumer(inflight (body: str): str => { let next = counter.inc(); let key = "myfile-{next}.txt"; bucket.put(key, body); });

  • by RcouF1uZ4gsC on 12/6/23, 6:01 PM

    >In existing languages, where there is no way to distinguish between multiple execution phases, it is impossible to naturally represent this idea that an object has methods that can only be executed from within a specific execution phase

    My category theory is pretty rudimentary, but isn’t this a good use case for a monad?

  • by dugmartin on 12/6/23, 5:05 PM

    Look interesting but my first thought is I don't see any error case code.

    Given this language is really about abstracting network calls to external services as objects/methods wouldn't it make sense to have return values be maybes and then be able to pattern match on that given that these are not local calls and networks/services do fail?

    My guess is an actor pattern where you are sending messages to these services and waiting for responses instead of faking a local call would surface the error conditions in a much cleaner way, ala Erlang or Elixir.

    This may be helpful: https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-a...

  • by dadadad100 on 12/6/23, 6:26 PM

    This seems to be in roughly the same space as the radius project[1] out of Microsoft. They are a data structure rather than a language, but the idea of merging the application and infrastructure seems similar. Is there a place for one application/infrastructure model that includes integration details in the manner of Apache Camel[2] that we can all get behind? [1] https://radapp.io [2] https://camel.apache.org
  • by quickthrower2 on 12/6/23, 8:23 PM

    I need an elevator pitch on this (which is currently in my "yet another terraformy thing" mental bucket right now, rightly or wrongly!).

    I am interested, but when I look at the comparison with Pulumi - https://www.winglang.io/docs/faq/why-a-language, they have 4 lines of code in Wing, but the long Pulumi example sets up permissions. So how did the permissions get set up in Wing? The great thing about Pulumi is if you are trying to comply with company security policies which in turn are for SOC2 etc. then this explicit setup as code is great. I think Pulumi also has a policy system but I haven't explored it yet.

    So what I am saying is more code != bad (think of the raison d'etre of the Go programming langauge) but I am not saying Wing is bad ... I am saying I would like to know more.

    I find it hard to believe that there is a semantic deficiency in JS/Go/C# etc. that means you need a new languages. And if you use Typescript, OCaml or Haskell (most likely Typescript for popularity) you can probably make the Type system do as much static heavy lifting as possible. Of course some checks need the current state so need runtime. But happy to be persuaded we need a new language.

  • by gnarlouse on 12/6/23, 9:10 PM

    Show me a complex use case.

    Show me making it more complex and what that costs.

    Show me the performance benchmarks.

    Syntax is cool but the older I get the more I care about productivity and speed.

  • by dang on 12/6/23, 9:41 PM

    Related:

    Wing Cloud Raises a $20M Seed to Build a Programming Language for the Cloud - https://news.ycombinator.com/item?id=36864816 - July 2023 (6 comments)

    Wing: A cloud-oriented programming language – request alpha access - https://news.ycombinator.com/item?id=34051325 - Dec 2022 (148 comments)

    Wing programming language: A cloud-oriented programming language - https://news.ycombinator.com/item?id=33762969 - Nov 2022 (1 comment)

  • by srbhr on 12/6/23, 4:08 PM

    Can you explain the idea behind a cloud-oriented programming language? How does it works?
  • by whoomp12341 on 12/6/23, 5:26 PM

    I could see this useful for prototyping, but I worry about losing finer control. for instance when I make a lambda, I like to have the lambda execute a container rather than write the function in place
  • by eddd-ddde on 12/6/23, 9:42 PM

    > In existing languages, where there is no way to distinguish between multiple execution phases, it is impossible to naturally represent this idea that an object has methods that can only be executed from within a specific execution phase (or within certain scopes of the program).

    What about algebraic effect based languages like koka? Would it make sense to make "inflight" methods and effect and have appropriate effect handlers in scopes like queues or functions?

  • by shauniel on 12/6/23, 8:19 PM

    Is the goal to let this work with something like sveltekit? Like how do I use this with a full flown web app?
  • by nevodavid10 on 12/6/23, 3:59 PM

    Very cool! What's the difference between WinLang and Serverless?
  • by jahsome on 12/6/23, 5:39 PM

    This is pretty cool! I've had my eye on Wing for a while, as a avid fan of Pulumi. I was fortunate enough to have the freedom to use Pulumi in a past role, and it revolutionized the way I thought about infrastructure.

    My current org has been slow to adopt IaC, and Bicep has been all for which I've managed to drum up appetite. I was surprised somewhat to enjoy the simplicity, but eventually I think we'll outgrow it. My hope is by the time we're ready to graduate, things like Wing, or radius will be more mature and easier to weave in.

    On a side note, it feels disingenuous or at least inaccurate for a project to brand itself "new". I feel like I've seen this posted to hn a few times, how long will it be "new"? There's at least one 8-month old post.

    The word "new" scares away certain types, who happen to be in leadership or decision-making roles.

  • by bluber84 on 12/6/23, 6:40 PM

    Which clouds are supported by winglang?
  • by gigatexal on 12/6/23, 11:11 PM

    Does it work on/against GCP?