Butng

From Esolang
Jump to navigation Jump to search

What is Butng?

Butng was originally created by User:Baidicoot as an extension of lambda calculus. However, it has since grown, and, with the help of User:Gollark, who did the diagrams (!), now resembles nothing like lambda calculus.

Syntax

Butng is wholly, entirely, made up of data structures called 'Fields'. Each and every field is a field of another field, or a field of the program, which in itself is modeled as a field. All fields must implement all possible subfields.

Let's break down this program:

a = 1
a

As you may have guessed, this sets the field a to equal 1, and then returns the value of a, namely 1. But hey, isn't using the operator = kind of un-field-y? Well, in Butng, , or space, is the syntax for accessing a subfield of a field. So, in this case, we are accessing the field 1 of = of a, and = is acting as the setter method for a, setting a to 1. Wait, what, I hear you ask. How can the field = of a act as the setter method for a? This is because any, and indeed every, program written in Butng has pre-defined fields that every field contains, called the 'standard fieldset', or std, and = is just one of these, as is 1.

Placeholder Law

One of the primary rules of Butng is that every field must have every possible subfield implemented. As field names can be any length of ASCII string, this is an infinite amount of subfields. How then, does Butng do this? The answer is with 'placeholder law'.

If a field is unimplemented, placeholder law dictates that the field must be inherited from it's parent. This triggers the parent's placeholder law, and this recurses up the program's genealogy, until it reaches the scope field, which implements the standard fieldset. If it isn't found there, then it is implemented in the same place it was first referenced, with a default return of the field 0.

Scopes

A special field implemented by the standard fieldset is the ( field. This field, when referenced, opens a new scope. Take the following program:

b = 3
a = ( b + 1 )

This program sets a to b + 1, or 4. More specifically, it creates a scope object, which, when referenced, evaluates to 4. The ) field returns the last referenced field to the parent scope.