Entropy

From Esolang
Jump to: navigation, search

Entropy is a programming language about giving up control. All data decays as the program runs: each value alters slightly every time it's used, becoming less precise. An Entropy programmer needs to abandon the pursuit of precision which most programming demands—often working against years of habit—in order to program effectively. Any output from an Entropy program will be approximate, and the more the data is accessed, the more random it will become. The programmer has, at best, a short window to get his/her idea across before the program corrodes. The program itself is not altered—so the next time it runs, it is restored to its original condition, only to decay again through its next run. Entropy was designed by User:Rottytooth.

Inspiration[edit]

Entropy addresses the compulsive thinking reinforced by programming, the rigidity of logic, and the way we must compromise with the computer in order to get it to understand us. It is something that has become more familiar to non-programmers as people manage more of their social interactions and other messy human stuff through computers. It was inspired by the glitch aesthetic as used by net.artists such as JODI and by esolangs in the tradition of brainfuck, which twist logic into delicious nonsense.

Datatypes[edit]

All datatypes in Entropy are built on reals (floats).

real[edit]

A floating point number, which changes slightly every time it's read from. There is no way to compare whether two values are equal, since the values are so unstable—only the greater than and less than comparisons are available.

char[edit]

Built on a real, a char rounds off the current value of the real it is built on, and returns the corresponding character.

string[edit]

An array of chars.

Examples[edit]

Hello, world![edit]

Program MyNamespace MyProgram [
	print "Hello, World";
]

This program will print a slight variation on "Hello, World" each time it's run.

Such as:

Hello+ World

or

Hellp, World

etc.

99 Bottles[edit]

Program Rottytooth NinetyNineBottles [

	declare count real;
	let count = 99;
	
	while count > 0
	[
		if count < 99 
		[
			print count;
			print " bottles of beer on the wall.\n";
		]
		print count;
		print " bottles of beer on the wall, ";
		print count;
		print " bottles of beer.\nTake one down, pass it around, ";
		
		let count = count - 1;
	]
	
	print " no more bottles of beer on the wall.";
]

Beginning of output:

98.99005 bottles of beer on the wall, 98.86667 bottles of beer.
Take one down, pass it around, 98.46358 bottles of beer on the wall.
98.39877 boutles of bedr nn the wall, 98.42226 bottles of beer.
Take one down, pass it around, 97.4903 bottles of beer on the wall. 
97.52608 boutles of bedr nn the wall, 97.45941 bottles of beer.
Take one down, pass it around, 96.44245 bottles of beer on the wall.
96.4431 boutles of bedr nn the walj, 96.46104 bottles of beer.
Take one down, pass it around, 95.54224 bottles of beer on the wall.
95.52052 boutles of!bedr nn the walj, 95.53922 bottles of beer.
Take one down, pass it around, 94.65927 bottles of beer on the wall.
94.69074 boutlfs of!bedr nn the walj, 94.14529 bottles of beer.
Take one down, pass it around, 93.77862 bottles of beer on the wall.
93.6543 bputlfs of!bedr nn tie walj, 93.65845 bottles of beer.

Each time, one or two characters go more astray. A little later:

66.13296 bptumfu og!bedq▼no sif xali*▼66.10684!alttlfs of bgerTake omf down+ pas
s!it aroune, 65.0071 bnstles of bedr pm▼the waml/
65.02724 bpttmfu of!bedq▼no sif xali*↔65.00817!alttlfs of bgerTake omf dowm+ pas
r!it aroune, 64.02435 bnstles of bedr pm▼the waml/
64.03424 bpttmfu of!bddq▼no sif xali*↔64.03409 alttles of bgerTake omf dowm+ pas
s it aroune, 63.02959 bnstles of bedr pm the waml/

By the end, it's unreadable:

6804 ekttjes og!bdes qm↔vhf zbnl0♀13.03909 cnutlew!mi!afeq qp▼sie w`lk+←13.03666
amttmfv▼qg!bhfrUbkd omc!dpwn-!patv"gv!crswnf. 11.99166 ektsjes og!bdes qm↔vhf z
anm0♀12.01574▼cnutlew!ni!afeq qp▼sie w`lk+←11.9922 amttmfv▼qg!bhfrUbkd okc!dpwn-
!patv"gv!crswmf. 11.17373 ektsjes og!bdes qm↔vhf zanm0♀11.18238▼cnutlew!ni!afeq
qp▼sie w`lk+←11.27068 amttmfv▼qg!bhfrUbkd okc!dpwn-!patv"gv!crswmf. 10.02247 ekt
sjes og!bdes qm↔vhf zaom0♀10.22528 cnutlew!ni!afeq qp▼sie w`lk+←10.25399 amttmfv
▼qg!bhfrUakd okc!dpwn-!patv"gv!crswmf. 9.279136 ektsjes og!bdes qm↔vhf zaom0♀9.2
52805 cnutlew!ni afeq▲qp▼sie w`lk+←9.248098 amttofv▼qg!bhfrUakd okc down-!patv"g
v!crswmf. 8.268296 ektsjes og!bdes qm↔vhf zbom0♀8.319245 cnutlew!ni!afeq▲qp sie
w`lk+←8.237695 amttofv▼qg!bh

Drunk Eliza[edit]

The classic program Eliza was written in Entropy. Her behavior seemed drunken, and so she was renamed Drunk Eliza. The web version of Drunk Eliza uses a mix of c# and Entropy, with all data is stored in Entropy datatypes. Here is an example of an exchange:

Eliza.jpg

Revisions[edit]

Entropy is released under GNU GPL 3.0

Version 1.1.2, released 06/2012, fixed several bugs with the way strings are handled

Version 1.1.1, released 04/2012, created a smoother decay, and added a compiler flag /m to set the speed of data mutation.

The original release was version 0.1, released 07/2010

External resources[edit]