Clone wiki

Alchemy / Explosions


Explosions are the exceptions that can occur in Alchemy, both at runtime and compile-time. They are treated as values of the Result enumeration, and used in the code as return values to kill execution early and clean up. Below are their explanations.


  • EXPL_INSUFFICIENT_ALKAHEST: The supply of Alkahest was depleted in the previous reaction.
  • EXPL_INSOLUBILITY: One or more elements was not aqueous and Water was used as the solvent.
  • EXPL_EXCESSIVE_SOLVENT: The amount of solvent was greater than what was required.
  • EXPL_INSUFFICIENT_SOLVENT: The amount of solvent was less than what was required.
  • EXPL_INTANGIBLE_ELEMENT: An element was requested which does not exist.
  • EXPL_UNDEFINED_STEP: A jump was requested to a step number that does not exist.
  • EXPL_UNDEFINED_INSTRUCTION: The bytecode specified neither JUMP nor REACT; internal precaution.


  • EXPL_AMBIGUOUS_STEP: A step was declared whose number conflicts with a previously declared step.
  • EXPL_ERRONEOUS_UNITS: An dry element was given in ounces, or a wet element was given in drams.
  • EXPL_ALTERING_REALITY: A constant (built-in) element was given as a product of a reaction.
  • EXPL_IRRATIONAL_REAGENT: An built-in element allowed only as a product was given as a reagent.
  • EXPL_REAGENT_SHORTAGE: A reaction was requested by no reagents were given.
  • EXPL_MALFORMED_ELEMENT: A requested 'element' does not adhere to the naming conventions.
  • EXPL_UNDEFINED_REACTION: A line matched to REACT had an invalid reaction process.
  • EXPL_SYNTAX_ERROR: A line was encountered that fits into none of the 4 categories described here.


This list will expand as more features are added to Alchemy. Further, some explosions like excessive or insufficient solvent can be caught during compilation, but I think shall remain checked at runtime instead. At one point, if there is a speed up from switching them, I may do so.