Ephemeral

From Esolang
(Redirected from Ephermal)
Jump to navigation Jump to search

Ephemeral is an esoteric programming language invented by User:A that has variables that do not last long.

Syntax

All of the syntax can be explained using this program:

// Note that this is a one-line comment.
// The largest out here is 255. A variable will be set to 0 if it is set to a larger number than 255.
ephemeral a = 145; //a lasts for 145 initializations... not including this one.
ephemeral b = 2; //b lasts for 2 initializations...
&b=a; //copy the number of initializations of b to a... NOT moving. b's initializations are also decrementing at the same time as a's.
a=123; //a was intialized. There is no such variable called a anymore.
// Then, how do you make sure that variables last long?
?? Well, the "program_status" variable can be used. Note that a // is no longer a valid one-line comment if the program_status is set on the next line. Use ?? to write comments.
program_status.makeSureEternal = a;
// However, only a is made eternal this way.
// To prevent this, copy the status of the variable to another variable.
&b=a;
// Now b is eternal. Wait, how to un-define that variable? There is no way to do that! Try your best avoid this to cancel out this risky situation.
// program_status can also create an infinite loop.
b=1;
?? Now that b is 1, this property can be set to b.
program_status.inInfiniteLoop = b;
// Now the program loops forever...
// Set b to 0 to stop the loop.
b=0;
program_status.inInfiniteLoop = b;
// Its computational class is unknown. Feel free to make a proof for it. However, it is clear that it is at least a finite-state automata.

Computational class

This is a finite-state automaton that can either halt or not halt.