Element is a minimal functional programming language. Element code runs using a host which can interpret or compile it to other formats. One of these formats is the bytecode format, LMNTIL (Element Intermediate Language), for use in native and embedded applications.
This is a brief summary, see the Element Reference Manual for full details.
- Single number data type
Num
- Structured types using
struct
- First class functions and local functions
- Intrinsics (math intrinsics, collection intrinsics, control flow)
- Genericity via implicit interfaces with
Any
type
Example:
sum(list) = list.fold(0, Num.add);
factorial(n) = List.range(0, n).fold(1, Num.mul);
Element includes a library of core functionality called Prelude.
Element also comes with a Standard Library. New features will generally be implemented as part of the standard library rather than as language features.
- Laboratory - The Element Host Test Suite - .NET Core 2.1 CLI
- Test runner using NUnit containing host compliance tests, prelude tests and standard library tests.
- Can test Element.NET directly or invoke other compilers via CLI convention
- Element.NET - .NET Standard 2.0
- Element parser using Lexico
- Element function evaluation via:
- Direct evaluation (slow)
- Compilation to CLR Function using LINQ Expressions (very fast)
- AoT compilation targets including:
- LMNTIL
- C
- libelement - C++
- Element parser
- Element function evaluation
- AoT compilation to:
- LMNTIL - planned
- PyElement - Python
- LMNT - C
- Alchemist - .NET Core 2.1 using Element.NET
- CLI for executing Element via a REPL or compiling to other targets
- libelement.CLI - C++ using libelement
- CLI for executing Element via a REPL or compiling to other targets
- Element.Unity - Unity using Element.NET
- Node Graph - allows visualization and modification of Element code using an interactive Node Graph
- Debugger - allows evaluating arbitrary Element code and exploring all of the intermediates in a foldout tree
- Interactive Workspace - allows evaluating arbitrary Element code and displaying immediate intermediates and visualization (Likely to be merged with Debugger in future)
- VSCode Linter - VSCode Extension
- Syntax highlighting for .ele files
- Installation guide:
- Download or clone this repo
- Extract
element-vscode
to%UserProfile%/.vscode/extensions
- Restart VS Code and enjoy!