Liquid

From Esolang
Jump to: navigation, search

This esoteric programming language was designed by Jonathan Todd Skinner. He is known as user User:Jonskinner.

Liquid is as of yet an unimplemented esoteric programming language, that attempts to create an esolang based entirely on the concept of liquids. From now on when the word liquid is used it will refer to the esoteric programming language not the property of matter.

The principle of Liquid is fairly simply. Picture, a series of 30,000 containers on a conveyor belt, as they pass along a "tap" maybe instructed to turn on and drop a fixed amount of water into the container. Tubes hooked into the container allow fluid to flow from them, depending on the logical operator or arithmetic operation, or depending on various other factors. A printer or device will output the results into human readable form. Think of it has a hydro-turing machine or Brainfuck meets water. It is interesting to note that a MIT student has actually built a fluid computer, fluid computers are not a new idea either as you would assume.

Instructions, commands, syntax, etc.

\ - Turn "tap" on
lets water flow, it is the beginning 
statement like C's curly braces, before any statement other 
then the logical operation, halt instruction, output instruction or jump instruction gets executed the tap must be 
turned on.
/ - Turn "tap" off -- the opposite effect of "tap" on
-> - Value of accumulator "flows" into next container
<- - Value of accumulator "flows" into the previous container
: - Is the logic operator
:' - If value of previous container, and the present container 
are both the same then allow value to flow into the next container
:. - If value of previous container, and the present container are 
not both the same then allow value to flow into the next container
:~ - If value of the present container is less than the previous container 
then carrying out the next command, if it is not less than the previous 
container then skip the next instruction
{ - Jump past the matching } if the container behind/under the pointer is 0
} - Jump past the matching {
? - Read one character/integer from input and place it into the current container
" - Output the value of the current container
; - Is the arithmetic operator
;+ - Increment the value of the current container by one
;- - Decrement the value of the current container by one
% - Is the value manipulator
%y - Move value of y into accumulator
%% - Current value of the accumulator is now an integer
%$ - Current value of the accumulator is now a character(ascii-based)
! - Halt, turn off all taps and stop the conveyor belt! 
This instruction ends the program.
#x - Jump back/forward to the xth container

Liquid machine language

In theory it is possible that an entire architecture of a microprocessor or CPU could be based on the ideas presented.

External resources

An article about how a MIT student constructed "programmable water", a fairly simple but working hydrocomputer