News for hackers. Stuff that matters.
Re:Wing: A cloud-oriented programming language by verdverm on Monday December 19, 2022 @10:21AM (#34053079)
The main disadvantage of having a custom language, for a user is, having to learn a bespoke language for a single tool. Very few are willing to do this. As a company, it is generally a distraction from delivering value. Engineers like it because it is interesting work to write a language.

Most should not use HCL as an argument for forcing bespoke languages on users. (1) HCL is not a programming language, more of a config language. (2) It was the right time and place, but has shown rough edges as it has aged, it feels more hacky now.

Just write libraries

Re:Wing: A cloud-oriented programming language by OkayPhysicist on Monday December 19, 2022 @08:18PM (#34060289)
The good arguments for "This should be a new language" are either:

1. You need to enforce a relatively unique set of invariants, which in turn come with new constructs to interact with them. For example, if you want a system for managing a distributed system, enforcing the lack of global state can be a lot more natural by using a language that cannot express it.

2. You want to provide some sort of novel language construct that cannot be expressed well in existing languages (function argument pattern matching, for example, cannot be retrofitted onto an existing language by a library, maybe by pre-proccessor or sufficiently advanced macro system).

Re:Wing: A cloud-oriented programming language by verdverm on Monday December 19, 2022 @08:58PM (#34060599)
1. Could a distributed language language really know what I'm using data for, i.e. if I put an object in an object store, is it global or not? Seems like a really complicated analysis. What if this happens across services? (Separate code bases)
Re:Wing: A cloud-oriented programming language by vineyardmike on Monday December 19, 2022 @09:59PM (#34060999)
Well there exists a language today meant for distributed systems (erlang, elixir).

It doesn’t support global state. Instead you’d write a “process” that’d respond to requests with the state at time of request. Another request could mutate the state, but each request is processed one at a time. So a “bucket” type data store (object store etc) would likely be implemented as “server” that returns the state. If the objects were large you could pass a URL/handle to the file which you’d retrieve later.

These processes/servers/whatever are running inside the language VM and are SUPER lightweight. Multiple language VMs can be tied together so the actual processes can be distributed across a fleet of physical hosts in a data center - this would be transparent to how you write the code.

If you wanted to implement that in native AWS primitives you’d probably run a lambda function to transform an http request into a S3 bucket address, then you’d go and make an s3 request to download/modify the file. Or the lambda would make some modifications to the file.

So, that’s the prior art on a hypothetical distributed language handling global state, which fwiw is basically how “cloud” systems work today.

Re:Wing: A cloud-oriented programming language by verdverm on Tuesday December 20, 2022 @12:53AM (#34062082)
I am aware of prior art in distributed systems. My point was that being able to enforce certain guarantees is likely impossible, i.e. your use case of global state prevention. Working with global state and making it easier is a different goal with different tradeoffs
Re:Wing: A cloud-oriented programming language by OkayPhysicist on Tuesday December 20, 2022 @02:18PM (#34070953)
Erlang and Elixir both do not have any way to express a global variable, or even a variable that can be accessed by two different processes (green threads, lighter than OS processes). All inter-process communication happens through messages. It's not checked by the language, there is simply no way to express the concept in the language itself.
Re:Wing: A cloud-oriented programming language by eladbenisrael on Tuesday December 20, 2022 @04:40AM (#34063713)
(I am from the Wing team)

This is how we think about this too. Applications that use the cloud use a new kind of "computer" which have different characteristics than the model of a computer exposed by existing programming languages. There are some unique invariants and language constructs that cannot be implemented libraries.

The first of these unique primitives is what we call "inflight functions". You can think of `inflight` as "remote `async`". They are async functions that can be executed on a remote system (such as inside a container fleet or on a FaaS). Inflight functions can interact naturally with cloud resources around them (by simply calling `inflight` methods on the resources such as `bucket.put()`).

Interaction of inflight functions with the outside world poses a unique set of invariants. Currently inflight code can reference immutable serializable data and call `inflight` methods of resources defined outside that closure.

The compiler then analyses these interactions and inverts the control over to the resources to take care of the mechanics like wiring deployment information, synthesizing security policies and anything else that can be deduced from this high level intent.

Defining the cloud architecture of the app and being able to naturally crossing these distributed boundaries is the essence of what we call "cloud-oriented programming", and where we think a lot of the friction and pain of the cloud comes from today: every time I need to interact with "The Cloud", I leave the safety and comfort of my compiler, and I am out in the wild having to understand all the mechanics and layers involved.

Almost all existing languages/compilers take a fundamental assumption that the entire program runs inside a single machine. This is, in our view, the impedance mismatch of cloud development today. This is where we believe language innovation can dramatically reduce the cognitive load and barrier to entry for building and delivering cloud applications that fully take advantage of the cloud. Inflight functions and resources are only the first step. Think first-class support for things like defining and consuming API endpoints, writing distributed workflows, emitting metrics, raising alarms and other things you would expect from your friendly neighborhood cloud programming language.