Epsil
A programming language for scientific computing
Epsil is still being developed. Its syntax and semantics may change between releases while the language is being exercised by early adopters. Your feedback can help shape its direction.
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.
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:
Guide
The guide explains the language through examples and decisions: not only what syntax means, but when a form is useful and why you might choose it.
Tools and Integrations
Language Reference
The reference is organized by language feature. Use it when you know what you are looking for and need the complete rule, grammar, or edge case.
Collections
Epsil has literal syntax for lists and dictionaries.
Lists are ordered and 1-indexed with xs[i]:
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.
None of the following are part of the language yet, and because the grammar
does not claim any of them, each is still an ordinary identifier today:
let import = 5 binds a variable named import. Prefer not to use them as
names, so that a program keeps working when the language does claim them.
- 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.
A word the grammar DOES claim — a literal or an active keyword such as match,
for or if — cannot be spelled as a plain symbol at all. Use the verbatim
form for those (`match`); it works for the reserved words above too.
literals.md lists which words are in which group.