If the esoteric programming language (esolang) Asciidots looks like a mess, it is at least a very different-looking and even aesthetically pleasing mess. Simply, its mechanics and syntax are based on Ascii art. Before going any deeper, let’s quickly look at an example Asciidots program.
What the program above does is pretty simple. It takes a variable and increments it by 1 every time the code executes. So, if we started with a variable x with a value of 0 and then ran the program three times we’d wind up with an x that’s equal to 3.
How it does this is probably not obvious. Asciidots is a unique sort of programming language known as a dataflow language. In this sort of language, we can imagine units of data (like our variable x) following a data go-kart track that’s interrupted in different places with pit stops that change the value of the data go-kart that’s following the track around. One pit stop might add 1 to the variable, while another might chop it in half. At some points, the track might even split, with the data go-kart picking one fork depending on its current value. If, say, it’s greater than 2 it might go left; otherwise, it goes right.
Other examples of dataflow programming languages include LabVIEW, Pure Data, Max/MSP, Verilog, and Simulink. They’re often used to simulate electronic hardware systems. Pure Data and Max/MSP are generally used for music composition and performance.
In Asciidots, the aforementioned go-kart track is represented by lines (|,-,/,\). The program below just directs a unit of data from start to end without actually doing anything to it.
Most of the other non-line symbols are mathematical operators, but there are also symbols that direct the program to request input from the user, set values, print values, and change the direction of the unit of data. That unit is itself represented by a single dot. So, the dots in a program represent the entry points for new units of data. Let’s look at another program.
So, here we see two dots entering the track. Each one is set to a value using a hash symbol followed by the desired value. The two data units then meet at a minus symbol, which does its work and then spits out a result, which then travels to the dollar sign at the top. Its meaning is to print any values that it receives.
Here’s a whole game coded in Asciidots. Remember that the dollar sign means to print whatever values it receives, which, in this case, are instructions to the user.
Under the hood, Asciidots is a Python program. An Asciidots program is just fed into that underlying program and digested into normal Python code, which is then executed. A lot of languages are like that, including Python itself, which is usually translated into C code.
I kinda doubt Asciidots will transcend its “esolang” status, but esolangs often have the benefit of forcing programmers to look at their work from a new perspective. I think Asciidots at least accomplishes that. And, of course, it looks really cool.
via http://ift.tt/2hRRRzI http://ift.tt/2jCFe7A