Skip to main content

Epsil

A programming language for scientific computing

Experimental

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.

⌘/Ctrl + Enter

Epsil is symbolic by default: expressions stay exact unless you ask for a numeric approximation with N().

⌘/Ctrl + Enter

Values have a type, and strings support \(…) interpolation:

⌘/Ctrl + Enter

Errors are ordinary values, so a program never throws to its host — a problem surfaces as an Error value or a diagnostic:

⌘/Ctrl + Enter

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]:

⌘/Ctrl + Enter

Dictionaries are sets of key/value pairs. The empty dictionary is {->}:

⌘/Ctrl + Enter

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 importsimport, export, module.
  • Error-handling keywordstry, catch, throw. In Epsil, errors are ordinary values, so these are not needed for the current design.
  • Concurrencyasync, 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.