We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
Difftran
Difftran is an esoteric programming language inspired by Fractran, utilizing multiplication and differentiation rather than multiplying with fractions, hence the name "Difftran".
Basics
State in Difftran is represented as a function containing powers of variables multiplied together, e.g 3 x^2 y^3 z^4. In a Difftran program, you would define the state at the top of the program's code, for example:
3 x^2 y^3 z^4 ... ... ...
In Difftran, there are 4 operators:
- var: Multiply the state by variable var. For example, if state is x^3 y^2, after op x, the state would be x^4 y^2.
- dvar: Take the partial derivative of the state function with respect to variable var. For example, if state is x^3 y^2, after op dy, the state would be 2 x^3 y. Because of this, your variable's names should not start with d.
- var^a: Multiply the state by variable var a times. For example, if state is x^3 y^2, after op x^3, the state would be x^6 y^2.
- dvar^a: Take the partial derivative of the state function with respect to variable var a times. For example, if state is x^3 y^2, after op dx^2, the state would be 6 x y^2.
A command in Difftran can contain multiple ops separated by space(s), and commands are separated by new lines(s). A Difftran program will loop through each command, run them, and if the new temporary state is not zero after executing, keep that state and loop back to the start, otherwise discard the temporary state and try to run the next command. If every command does not suffice the non-zero check, the program stops.
Here is a Difftran program to divide 17 by 5 with remainder:
a^17 b^5 df f dt b df q da db t db b dt r dt t f db
The result would be:
286760781709867745280000000000000 q^3 r^2
where 3 is the quotient and 2 is the remainder.
The coefficient of the state function does not really do anything for now, but you can use it as a multiplication calculator (lol). Let's say you want to multiply 2 by 3:
2 a^3 b da db
And you will have 6 a^2 at the end, and 6 = 2 * 3.
Turing completeness
Fractran can be reimplemented in Difftran, and Fractran is turing complete, so Difftran is turing complete:
- Fractran state can be factored into powers of primes, with those primes being registers, and powers of those primes being values of those registers. Difftran is also similar: Variables are registers, and their powers are the registers' values.
- Fractran checks if multiplying with a fraction result in an integer (which effectively means checking if all registers are not less than 0), then update the state and loop back if the condition is satisfied, move to the next command if not. Difftran also has the same condition, just expressed in a different way: If the derivative is 0, it means some variable's power is lower than the number of times we differentiate it, i.e. that register would go below 0.
Interpreter and examples
Interpreter and examples are available at the Difftran Github.