r/ProgrammingLanguages • • Jun 27 '26

Discussion Artifact-centric programming

As I develop my programming language, Claude says that I have an "artifact-centric" programming language. I'd never heard the term. I've researched it and asked Claude about it, but I'd be very interested to read what you as language developers understand the term to mean. If someone told you that a language is good for ACP, what would you expect it to be like?

You can read about Caspian here but I'm hoping you'll post your thoughts before reading about it. Caspian is very much a work in progress. I've hardly even developed any code for implementation. Right now it's just a design in progress. To the extent it exists, however, it is already released under the MIT license.

I look forward to your insights.

(EDIT: Claude told me that it made the term up. Notwithstanding, I'm interested in your thoughts.)

0 Upvotes

15 comments sorted by

View all comments

Show parent comment

1

u/mikosullivan Jun 30 '26

I look forward to reading your docs. I expect I'll find some good ideas in there.

Puck actually does have a way to have mutable, stored objects. Puck has two kinds of objects: dynamic and stored. A dynamic object is what I've described. Clones of that object are sent to servers.

Stored objects live on the server. They are mutable or not depending on the developer's design. Generally they live in a database. So let's look at your Account object. Here's how it would work.

The client side object would look something like this:

{
    "account_id": 345902,
    "auth": "some-auth-data"
}

Very simple and minimal. Sending a small object like that over the wire won't clog up your network. You'd probably get that information from a query to the server. Remember that in Puck a query can return another Puck object.

The class for the object would look something like as follows. (I'm still working out the syntax, but this is a good approximation.) Remember that these are remote methods, so the request is sent to the server. Nothing much happens on the client side.

{
    "get_balance": {
        "returns": "float"
    }

    "set_balance": {
        "params": {
            "new_balance": "float"
        },

        "returns": "boolean"
    }
}

So you have a dynamic object on the client side. The actual account information is one the server. To get the balance, you would do something like this (example in Ruby).

puts account.get_balance()

To set the balance you would do this:

account.set_balance(349.21)

So the answer to your mutability question is that the stored object can be mutable, and the dynamic object isn't.

1

u/Inconstant_Moo 🧿 Pipefish Jul 01 '26 edited Jul 01 '26

So how does a server say how the object is represented?

1

u/mikosullivan Jul 05 '26

I'm still working on the syntax. The basic idea is that your program retrieves the class definition from the URL of the class. It will be in JSON and will define things like method names, method URIs, params, and what they return. So a class definition might look like this. Note that Puck has no concept of ordered params; they're all named params.

    {
        "methods": {
            "foo": {
                "params": {
                    "bar": {
                        "class": "string",
                        "required": true
                    }
                },

                "returns": "https://puck.uno/color"
            }
        }
    }