Introduction to Filament, a Humanist Language
Filament is a humanist programming environment. Think of it as a mixture of Mathematica, Scratch, and open datasets, swirled together into modern UX .
Filament is meant to be accessible to all ages and levels of skill, from children and novice programmers to artists, scientists, and even professionals who are doing exploratory coding. The syntax is designed to be simple to understand and forgiving of errors.
Though Filament uses some advanced computational concepts from existing array , functional , and object oriented programming languages, these concepts are presented in a form that is simple as possible while still being useful.
Filament can be used by itself, but is generally meant to be used within a notebook interface , typically on the web.
4 * [1,2,3] = mulitply(4,List(1,2,3)) = [4,8,12]
is_prime = IsPrimeand
4_000_000 = 4000000 = 4*1000*1000.
earth.radius * 2 * π / 4000ft/s as hours = 9.11 hours
Rather than nesting a series of functions
they can be pipelined with the
range(10) >> map(r=>circle(radius:r)) >> row() >> draw()
making them easier to understand.
To set a variable either
>> can be used. This emphasizes that data is moving into the variables and then
used later. Same example as above, with intermediate variables.
nums << random(10) nums >> map(radius => circle(radius)) >> circles circles >> row() >> draw()
<< and >>= arrow symbols, etc.), and finally a visual block syntax similar to Scratch ) (appropriate for younger programmers who are just getting started). All three syntaxes are fully interchangeable.
!, though these may optionally be available for advanced users if they want. The same with
<< >>used for assignment and pipelines rather than bit shifting. Many of the more confusing C derived standard operators have been removed, like
With the right abstractions and syntax is it possible to make a programming environment that is simple enough for kids but powerful enough for domain experts. It must have a gentle learning curve and provide value at every step.
Filament takes inspiration from