Entropy (2010)


Entropy is a programming langauge where data decays as the program runs. Each value will alter 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 compulsive habit, in order to progam effectively in Entropy. Any output from an Entropy program will be approximate, and the more the data is accessed, the more random it will become. The program itself is not altered -- so when a program is restarted, it is restored to its original condition, only to decay again through its next run.


For example, the classic "Hello, World" program will execute slightly differently each time it runs. It may print "Hello, Xorle" or "Hemlo, Wprld." Since decay is cummulative, putting the same print command in a loop will cause the decay to progress with each iteration, until the text becomes completely unrecognizable. You may get a string of text like this:


Hellp, World
Helmq, Xosld
Iemmq, Xpsle

etc.


How does it work?

There are no integers in Entropy, only reals (floats). Chars too are stored as floating-point numbers, and displayed as the corresponding char to whatever whole number they fall closest to. Apart from strings, no arrays are allowed, since addressing is approximate, and could lead to crashes (Entropy may produce unexpected results, but crashing is not encouraged). Values wear down over time, becoming more entropic each time they're used. So if you assign 1 to x, when you print x to the screen the first time, it may well be 1.001, the next time 0.87, then -1.5, drifting further away each time. If you assign 'f' to y, it may become 'g', 'i', or eventually 'σ' or '┬' or any other Unicode character. Every variable changes slightly each time it's accessed, whether to be incremented, printed to the screen, or copied to another variable.


In Entropy, there is no equal sign for comparison -- it would have no meaning. Greater than and less than are used to compare two values.


What types of programs are good to write in Entropy?

Any system where decay and randomness are vital. I'm currently using it for a Glitch Art project.


Can stable programs be written in Entropy?

Certainly. Just because variables are unstable doesn't mean the program itself is. The "Hello, World" example will print different text each time, but it will not crash.


But can I write production code with it?

Yes! In fact, since Entropy is a .Net language, you can mix Entropy's datatypes with the slightly more stable ones available to the other .Net languages. It's possible to write code in C#, for instance, that uses the Entropy.Real type to hold values.



Entropy on Esolangs.org (includes code samples)

From my blog: Drunk Eliza, Entropy in action


Download the compiler



Entropy is currently Windows-only, and requires the .NET Framework 3.5 to run.


This is freeware, do whatever you want with it; just don't sell it.


Entropy was built using Irony to parse the code.