#Why eLucid8
eLucid8 is for computations that produce data over dimensions, such as time, space, samples, steps or entities, where it matters exactly what each result depends on. This page says when it is the right tool, when it is not, and how it fits with the tools you already use.
#Writing steps, or saying what each value is
In a general-purpose language such as Python, with NumPy or pandas, you write steps: loop over these, compute that, store it there, and remember to recompute it when an input changes. In eLucid8 you write what each value is, over named dimensions, and the engine works out the steps:
running = x fby.t (running + next.t x)
That difference pays off when the steps are the hard part.
This way of programming is called intensional: "the meaning of an expression depends on the context in which it is being evaluated" (J. Plaice and J. Paquet, "Introduction to Intensional Programming", in M. A. Orgun and E. A. Ashcroft (eds.), Intensional Programming I, World Scientific, 1996, p. 1). Each value is an intension, "an indexed family of data values", one result at each context (W. Wadge and A. Yoder, "The Possible-World Wide Web", in the same book, p. 207).
#A picture: the Web
The World Wide Web works the way eLucid8 computes (Plaice and Paquet, p. 3; Wadge and Yoder, pp. 207–208). Each page has a URL, which is its context. A page is fetched only when a link asks for it. And with a cache, a page asked for several times is fetched once. In eLucid8, a question names a point: a value at one context. Only what that answer depends on is computed, each point at most once per question, and with a point cache a value computed for one question is reused by later ones while the data it read is unchanged. This way of computing is called eduction. Why eduction works explains why it works, with the Mandelbrot set as the example.
#What you get
- Only what is asked for is computed. Ask for one cell of a grid at one time, and eLucid8 computes exactly what that cell depends on and nothing else. In a script you compute everything, or write the logic to avoid it yourself.
- Changes recompute exactly what they affect. Correct one input value, and eLucid8 knows which results are now stale. In a training run in our tests, changing one test point recomputed 31 values out of about 330,000. In a script, getting this right means tracking dependencies by hand; the usual answer is to run everything again.
- Time is handled correctly. Every value carries a timestamp, the time of the newest data it was computed from, and streams at different rates meet only through an explicit choice by time, such as "the latest value at or before this time". So whether a result used data from its own future is visible in its timestamp, and a program can check it (Values and timestamps). In machine-learning features, that mistake (data leakage) is common, and it silently spoils models.
- Every result says what it came from. A result records which version of which data it read, so you can reproduce it or check it later.
- Failures are visible. A missing value is an error of kind
missing, a failure an error of its own kind, each naming where it started, and eod (end of data) means only that the point is outside the data; never a silentNaNthat spreads through everything downstream. - The same answer everywhere, to the last bit, in the browser, on a laptop or as a service, for every program. Caching, memory management and parallelism decide how fast an answer comes, never what it is.
- Calls to other services are part of the computation, with deadlines, retries and recorded results, not side effects buried in a loop.
#When something else is the better choice
- A one-off script, where none of the above matters.
- Heavy tensor arithmetic at scale. That is what PyTorch and JAX are for; eLucid8 plans to hand them that work.
- General programming: text processing, user interfaces, glue between systems. eLucid8 is a language for computations over dimensions, not a general-purpose language.
#How it fits with the tools you use
Formats such as Apache Arrow and NumPy's arrays are not alternatives to eLucid8. They say how a table or an array of numbers is laid out, so that tools can share it without copying, and they compute nothing. eLucid8 produces them.
The realistic picture is eLucid8 inside your application. eLucid8 defines and maintains the data: features over (entity, time), a simulation over (time, x, y), a training history over steps. Your application asks for what it needs and receives it in a form its own tools read directly. Results come as JSON lines, CSV, whole grids and cubes as one block of JSON (a frame), NumPy .npz files, Apache Arrow tables or Apache Parquet files (from 0.19.0, also Zarr stores and Vega-Lite charts, for xarray and charting tools: Seeing your results), and data is read from CSV, JSON-lines, Parquet and Arrow files, through the elucid8 command or the long-running service. Using eLucid8 from your code shows both, from Python, NumPy, pandas, JavaScript and the shell. The Python package, pip install elucid8, runs programs with DataFrames in and out (eLucid8 from Python), and its connectors read from and write to databases, object stores and streams (Connecting eLucid8 to your data).
To see how the parts fit together, read How eLucid8 fits together.