What if you could import someone’s code as easily as you tag someone on twitter?

let x = @sam.foo(@joe.bar)

There’s a tweet I can’t find that said Twitter can be thought of as a collaborative, immutable, spreadsheet. That’s a beautiful thought, and it is indeed what makes Twitter such a generative environment.

It took me years to see how elegant Twitter’s model is. Tweets are proper first-class citizens: they can stand alone, can reply to other tweets, can be replied to, can be retweeted, or referenced. There’s a reason that you see Tweets on television: they are a proper primitive.

This sort of elegant, mutually-recursive data structure shows up in a couple of other products, namely Reddit and its predecessor Hacker News. Another example is Notion, with its infinitely-nest-able block structure. It seems obvious now, but the idea of first-class primitives and infinitely nested data structures is counter-intuitively powerful when applied to consumer products.

Yet these ideas of composable social primitives, which came from programming, haven’t reinfected programming itself.

A first experiment: Twitter Eval

My friend JP and I first tried building a Twitter-like coding experience directly within Twitter:

  1. Tweet JavaScript
  2. A reply to a tweet appends all the prior tweet code above
  3. Quoting a tweet splices in all that code in place
  4. Run by adding “eval” to a Tweet link, ie: https://twittereval.com/stevekrouse/status/1523448157585039371

It was fun and wacky, but not practical.

Tweet-sized backend snipets: Val Town

My current project is Val Town, which does allow you to import code as easily as you tag someone on twitter. Here’s a recent demo video:

https://www.loom.com/share/878294970d8e48919c819f35d0cd0da4

It's been a fun environment to build and play with. So far folks are using it for playing with APIs, exposing their own endpoints, running poll jobs, and little zapier-like glue code.