Epsil
Epsil is a programming language for scientific computing, built on the Compute Engine.
Epsil is available as an experimental entry point. Its syntax and semantics may change between releases while the language is being exercised in notebooks and other applications.
Epsil is embedded from JavaScript through the
@cortex-js/compute-engine/epsil entry point:
import { ComputeEngine, executeEpsil } from "@cortex-js/compute-engine/epsil";
const ce = new ComputeEngine();
const { value, diagnostics } = executeEpsil(ce, "1 + 2");
Here is "Hello World" in Epsil. Edit the code and press Run (or ⌘/Ctrl+Enter) — the result is the value of the last statement, shown as an Epsil value and as its underlying MathJSON.
Epsil is symbolic by default: expressions stay exact unless you ask for a
numeric approximation with N().
Values have a type, and strings support \(…) interpolation:
Errors are ordinary values, so a program never throws to its host — a problem
surfaces as an ["Error", …] value or a diagnostic:
Start Here
Language Reference
Collections
Epsil has literal syntax for the Compute Engine's collections.
Lists are ordered and 1-indexed with xs[i]:
Sets are unordered collections of unique elements:
Dictionaries are sets of key/value pairs. The empty dictionary is {->}:
Future Directions
Several keywords are reserved but not designed — they are held so that a future version of Epsil can introduce them without breaking existing programs, and using one as an ordinary name today is an error. None of the following are part of the language yet:
- Modules and imports —
import,export,module. - Error-handling keywords —
try,catch,throw. In Epsil, errors are ordinary values, so these are not needed for the current design. - Concurrency —
async,await,parallel. - Macros and compile-time metaprogramming.
If you need a symbol whose name collides with one of these reserved words, use
the verbatim form (`match`).