Skip to main content
Neuron Script is expression-oriented: statements evaluate to values, and collections participate in vectorized mathematical operations.

Primitive values

The engine also supports big integers, rational and complex numbers, dates and times, physical quantities with units, XML, and .NET objects supplied by the host.

Assignment

Use := to assign:
Assignment returns the assigned value. Keep side effects on their own lines in shared scripts.

Collections

Ranges and comprehensions make data pipelines concise:

Functions and lambdas

Canonical extensions let functions apply across vectors and other algebraic structures when their implementation supports it. Test the shape of returned values instead of assuming every scalar function vectorizes.

Conditions

All of these return values:
Keywords such as IF, THEN, and ELSE are case-insensitive.

Iteration

The language also supports while, do/while, break, continue, return, and try/catch/finally forms.

Pattern matching

Assignment can destructure values and XML patterns. Treat a failed match as a normal branch in parsers, and validate input before using values in a database statement or .NET call.

Comments and formatting

Use comments to explain policy and non-obvious constraints, not direct translations of the next expression. Terminate statements with semicolons when a newline could be ambiguous.

Namespaces and .NET

Script can reference discovered .NET namespaces and types, call static methods, create objects, access properties, and use operators supplied by objects. This is powerful but tightly couples a script to loaded assemblies. Package reusable functionality as a named Script function when you need a stable interface.