Filament 0.1 Release
Filament is the humanist programming langauge I've been working on. Filament's focus is entirely on computational thinking and improving the way we use PLs, not on the implementation or performance. It is for thinking about problems, not producing software artifacts. It should be easy enough for children to use, but powerful enough for domain experts. Think of it as Mathematica for kids, scientists, and artists.
Status
I've fleshed out the syntax and spec here. The currentl interpreter can handle most of the language, and it can be run from within unit tests programmatically or via the notebook interface. Check it out on the web and click on the examples to see it in action.
Filament is of course super buggy and lots of features are missing, including a bunch of the units work, but I figured it was better to release early and often then wait until it's perfect.
Notable features:
- Unifies function pipelining and variable assignment with the
<<
and>>
operators - Unifies indexed and named parameters
- All identifiers are case-insensitive and strip underscores. Use camelCase or sn_ake_case or whatever you want. 10_0%!
- All numbers can have units and you can convert between them easily.
- Operators over arrays, like APL.
- Built in charts, histograms, and graphs like Mathematica.
- Built in datasets
- One day will have a visual block syntax (ie: Scratch) and Unicode friendly math syntax.
Examples
How fast is Superman really? Let's find out. Earth's radius is ~6000km and the fastest bullet is 4000ft/s.
earth << 6371km
speed << 4000ft/s
earth * PI * 2 / speed as hours
Chart the population of the ten biggest countries
top_countries << take(dataset('countries'), 10)
chart(top_countries, y:'population')
Lots of US state names seem to begin with M and N. Is that really true? Let's find out:
def first_letter (state:?) {
take(get_field(state,'name'), 1)
}
dataset('states') >> map(states, first_letter) >> histogram(0)
Check it out at the github repo and read the API spec. ttfn - j
Posted February 5th, 2021
Tagged: hl filament programming