Filament 0.2 Release

I'm happy to show you the next release of Filament, my humanist programming language designed for kids and scientists.

Along with the requisit bug fixes, I've split the repo into two. There is now filament-lang, which contains the core language and runtime available as an npm module. The React based notebook interface is now in filament-gui, and looks the same as before.

Most of the work this sprint has gone into fixing bugs and improving infrastruture. The main tutorial is now rendered as HTML with inline output, showing the results of each code snippet. I also overhauled the unit tests to use Mocha and added more tests, especially around number units and custom functions.


The only really visible new feature is the plot() function. You can now define your own math equations and draw them on a coordinate grid. For example, this quadratic equation

def fun(x:?) {
x**2 - 3*x - 4

will be drawn as


Since it's executing your function at every point, you can define as complex an equation you want, including parametric and polar equations. Here's the Archimedes spiral:

def fun(theta:?) {
plot(polar:fun, min:0, max:pi*32)

And this parametric heart equation:

def fx(t:?) { (16 * (sin(t)**3))/10 }
def fy(t:?) { (13 * cos(t) - 5 * cos (2*t) - 2 * cos(3*t) - cos(4*t))/10 }
plot(x:fx, y:fy, zoom:80)

Next Up

I've published new docs online, as well as the latest version of the editor with some new examples.

Next up I'm going to do more work on the notebook interface and documentation before coming back to language improvements.

If you think this is cool or just want to chat, hit me up on Twitter.

Talk to me about it on Twitter

Posted February 15th, 2021

Tagged: filament programming hl