Hi, so I'm here to present valence.
It's a programming language that borrows from natural language to expand the expressive
power of code.
Specifically, it addresses two glaring emissions in the existing language landscape.
A structural ambiguity and homonomy, which together are very, very powerful.
And these are things that we take for granted in spoken language.
So, basically what I mean by structural ambiguity is sentences like
Billy saw the group with a telescope.
So, the ambiguity lies in the grammatical construction.
When we say this, is Billy peering at the group through a telescope or did he happen to walk
by, as the group was doing some stargazing.
We can leave this ambiguous in spoken code, is spoken language.
But in code, you know, there's some order of operations that will select one interpretation.
That's supposedly more correct than the other.
But what if we want it to be both ways?
And then homonyms, the ability of a single word to have multiple meanings,
which is used very powerfully in poetry.
I like the example of Yoko Ono's fly piece, where fly has a accumulation of meanings
over time between the physical, the metaphorical, an actual fly, and her film.
And this is basically a short program for human beings to carry out.
Which tells us to fly, it means a whole bunch of different things.
So, what if we want to make poetic use of these double meanings and code?
This is what I aim to solve with the valence programming language.
So, naturally, to build a Vaxicon for this,
I decided to use ancient Greek measuring signs.
So, this is the alphabet that we're working with.
It's eight symbols, and each one has a whole bunch of different meanings.
So, I'll get to the moment.
These are the only signs that it recognizes apart from square brackets,
which you can use to disambiguate when needed.
And so, each one of these can be used in different ways, either with no parameters, one parameter, or two parameters.
If it has one, then it's a prefix, so the next thing.
Or if it has two parameters, then it's in-fix.
So, it's what comes before, and what comes after.
So, you can see here's one line of code over there to the right,
and two different interpretations broken out with the brackets.
Except that I lied, there's actually not two, there's four,
because each of these symbols is both a variable,
and it's also a literal value.
And of course, it's in octobes since there's eight signs.
This isn't highly accidental.
If it had turned out that it would have been,
I could have fit all the functionality that I wanted in seven signs,
this would have been all in base seven instead.
So, I'll show you how this breaks down.
So, in this example here, basically, if what it's a prefix,
the first one is the commands, the first symbol, and that's an if statement,
it's converting it to an integer, the next, that's what the middle sign is doing,
and then it's taken as either the variable reading or the integer reading,
which the integer reading is just the octol digit.
And for the other reading, the middle symbol is the commands,
and so it's assignments, and it will sign either the octol digit,
or the, you know, deraff of saying that is from the variable.
So, this is all the different signs, and their values right now,
commands are in green.
There's one command per line, expressions are in blue.
The color before the sign is how it's read,
and after the parameter sent it requires.
Orange is variable, yellow is an octol in white for type.
One of the nice things about this is that you can sort of calculate all of these things,
so that if it's expecting a type, you can actually have that as an expression
that resolves to a number.
That number is then converted, it's forced into an integer,
and then we go mod 8, and it resolves about these signs,
and then that is the type that it gets assigned.
So, in terms of what this looks like in the interpreter,
it looks like this.
I realize that not everybody has ancient Greek measuring signs on their keyboard.
So, you can actually type with these taken from the Quarty keyboard.
It's all with the left hand, or if you want to do it in your phone,
you have buttons to the upper right, and this is what it actually looks like
to type in what I just shown.
As you type, it's sort of generating in different readings,
and it will run the ones that are resolvable.
They turn red like that, if it opens a block that never closes,
and you can hide the non-runable ones if you don't want to see those,
the ones that are not complete.
Now, not everyone might like the idea that you need a single,
that this line of code with a single symbol,
only has one resolution.
So, you can sort of get around that by using
a job and go to instead.
And, you know, there's some people who just don't like structured programming,
and I'm not here to judge.
So, you can sort of just jump a certain number of lines away,
or you can go to a label.
And, of course, that also can take an expression
so that you can de-reference a variable,
and go to the number that is the integer equivalent of whatever
the expression results to mod 8.
So, let's see what this looks like in sort of a go-to situation.
Now, we have two different versions of the program
that end up with different results
because they go to different labels.
So, this is how we sort of create these alternate flows.
And, I have this QR code, which is a little cutoff maybe,
for the repo, but it's also on the site.
So, you might not always want a reading as both a literal
and a variable, luckily, we have a sign for the referencing
and one for forcing the literal reading.
It's seen kind of see both here.
And, we use this all the time in valence, those two signs.
So, one of the inspirations for this, of course,
is the classic polyglot program,
the program that runs in multiple languages.
This is sort of like writing a polyglot for one language,
where you get different results.
Another inspiration is the Conlang Uo.
It was created by Sonio Lang, that are known for her work
creating the Toki Pono language.
But I really believe that Uo is her masterpiece.
It's a language written with all vowels,
where every word is a hominin.
So, you can have a whole conversation with someone else
and not realize that the two of you are talking about completely different things.
So, I love you as said the same way as I flatten myself.
So, like Uo, it's valence as a language of chance associations.
And it's also often a language of accidental algorithms.
Here's how the type system works.
If you divide two by four, as we'll see, you get one.
This is because every operation resolves to the type of it's not parameter.
In this case, it's the integer two.
Now, dividing two by four and getting one, that's pretty good.
But if you want to be, if you're really like a stickler for detail,
we can force to enter a ratio and then you get one half.
So, I know that went a little bit fast, but we ended up with one half down here.
Not sure how well people can see this.
But basically, sort of at the bottom of this,
at the bottom of this here, it gives you what the status of all the variables.
There's always eight variables.
They start off numbered zero to eight, zero to seven,
rather, and then at first one came one at the end.
So, this whole thing about forcing values.
So, here's an example of sort of a more complex line of code.
And you can see how some of the interpretations look a little strange.
What does it mean to say, for example, like a six minus zero equals one minus seven?
This is actually an assignment, the left side of this resolved to six,
and then that translates to the six variable.
And this is how we de-reference things, how this works.
But for you this, we're assigning over and over again to this number,
which we write with a D.
But then we do the D reference thing, and now what D holds,
which is six, is the one that we type with a Z,
and it gets assigned to that instead.
This is the way we can sort of use these things in concert
to create kind of a delightful ambiguity.
Now, one of the great choice of valence is that you don't need to start a program
with a particular purpose of minds.
You can just sort of key match with your left hands and see what comes out.
And then maybe a lock it down with brackets if you want.
Here, I'm creating something that creates like 400 interpretations,
and then we can run them all, and they will all run depending on how fast your browser is.
You'll notice that there's a few programs that are doing similar things.
Oh, there's a few that have some undefineds, I saw there.
This project still has some things I'm still developing in the interpreter,
mostly support for Qs, which is not 100%.
So, basically, if you're going to use this language to write your production code for banking software,
or whatever, you probably need to wait like a couple of months,
and then we should be there.
This is what, this is my major sort of to do this.
The interpreter is 80%.
And I'm thinking of adding sort of a trade operation,
where two signs can trade a subset of their interpretations within that program,
so that you can kind of create like more meaningful ambiguity where you want.
This has gone through many iterations.
This project already, the first version of this, had a grammar that led to a single line of code
that would, you know, have like 10,000 interpretations.
So, I had to sort of really lock it down and be much more precise with the way that I created this.
At this point, the grammar is complete, and it's mostly sort of interpretive things that I'm working on.
And we saw a few minutes left.
I should mention, well, I never would be upset if I did not mention that.
I do have a book coming out in the fall, which has this language,
and 43 other programming languages of mine, to be called 44 SLA,
the Art of S. Tart Code.
The QR code to the left is my mailing list,
and the one to the right is for the book itself.
And that's all I have. Thank you very much.
Are you planning to write a web framework with this?
Oh, yeah, absolutely. Well, if, you know, if no one else does it before me, then, you know,
I mean, the thing is that when you create a programming language,
you never know how other people are going to use it.
Someone's already written a web server and brain fuck, right?
So, you know, that's totally, that's totally possible.
A popular view in language research is that ambiguity exists,
but is solved in interaction, in clarification, et cetera.
Is it, do you have like a type of, because you have multiple interpretation?
But is it, do you have some form of clarification to be understood,
and to really understand what the language is saying?
Yes. Well, so, like, you know, any, like any programming language,
it'll have formal rules around how these things combine.
So, for instance, you can't do things like open two blocks,
and then close it once and have a version where each one of them opens,
like an F statement and a while statement with and one closing block.
It's not going to work. So, the grammar, you know, kind of defines that that's not really valid.
But in terms of the other combinations, you know, I sort of expect that for most people,
the easiest way to do this is to sort of mess with it until they sort of get
different results and sort of discover all the sort of hidden things about the language.
But of course, it will be, like, fully defines.
So, if people want to see this, this rules, they are all spelled out.
And basically what I'm showing here in the browser, this version of the interpreter,
this is all in the GitHub repo right now.
If people do want to try it.
Is this on?
Are you thinking of implementing to come from statement as well?
Well, I am a big fan of come from, it is very tempting.
So, come from, you know, it's one of the features of Intercal,
but not the original 1970s Intercal.
I think it was the 1991 by ESR.
When he were five to Intercal.
So, so for people who don't know come from, is the opposite of go to.
So, you put it where you want to end up and it says,
what line you should jump to from there.
Do you have any more questions?
Let's speak.
Do you have anything else to talk about?
Oh, no.
That's being mentioned.
Thanks everybody.
Okay.
Thank you.