decay is an experimental, self-mutating programming language where code gradually deteriorates over time. This decay challenges developers to write resilient, self-healing programs and think critically about long-term program stability.
Variables can be declared with different decay characteristics:
stable- Persistent variables that resist decayvolatile- Temporary variables that decay rapidly
stable permanentValue = 42 # Resists decay
volatile temporaryData = "temp" # Decays quickly
Functions have speed modifiers that affect performance and decay:
slow func- Reliable but slower execution, resists decayfast func- Fast execution but more prone to decay
slow func reliableFunction(x, y) {
return x + y
}
fast func quickFunction(data) {
volatile processed = data * 1.5
return processed
}
sed
}
Primitive Types:
- Integers:
42,-17,0 - Floats:
3.14,-0.5,2.0 - Strings:
"hello","decay language"
Arithmetic Operators:
+ - * / # Addition, subtraction, multiplication, division
Comparison Operators:
== != # Equal, not equal
< > <= >= # Less than, greater than, less/greater or equal
er or equal
Assignment:
= # Variable assignment
Conditional Statements:
if condition {
# code block
} else {
# alternative
}
}
Loops:
while running {
# loop body
}
}
Function Returns:
return value
# This is a single-line comment
Statement Terminators:
- Semicolons
;can be used to separate statements - Newlines also separate statements
Delimiters:
()- Function calls and parameter lists{}- Code blocks,- Separator for parameters and array elements.- Member access (for future object support)
repair(target)- Fix decayed code sectionsreinforce(target)- Strengthen against future decayaccelerate(target)- Optimize performance (increases decay risk)
stable criticalData = 100
repair(criticalData) # Restore corrupted values
reinforce(criticalData) # Increase decay resistance
ce
stable counter = 0
volatile temp = "processing"
counter = counter + 1
1
slow func calculateSum(a, b) {
stable result = a + b
return result
}
volatile answer = calculateSum(10, 20)
20)
stable health = 100
volatile damage = 0
if health > 50 {
volatile status = "healthy"
} else {
volatile status = "critical"
repair(health)
}
while health > 0 {
health = health - damage
if health < 20 {
reinforce(health)
}
}
}
}
lth)
}
}
- Time-based degradation: Code quality decreases over execution time
- Variable corruption: Values may become incorrect or unpredictable
- Function slowdown: Performance degrades, execution becomes unreliable
- Memory leaks: Volatile variables may persist unexpectedly
- Logic errors: Control flow may behave unpredictably
volatileconstructs: Fast decay (seconds to minutes)fast func: Medium decay (minutes to hours)- Regular code: Normal decay (hours)
slow func: Slow decay (hours to days)stableconstructs: Very slow decay (days to weeks)
- Use
stablefor critical data that must persist - Use
volatilefor temporary calculations only - Mix
slow funcandfast funcbased on needs - Regularly apply
repair()to critical components - Use
reinforce()before long-running operations - Avoid
accelerate()unless performance is critical
Challenge yourself to write code that survives its own decay.