Daniel Garcia
02/07/2021, 5:33 PMJoshua Horowitz
02/08/2021, 3:28 AMselect(contacts, where: (a) => a.type == DB.person and a.category == DB.contacts)
>> for((f) => f.latlon = lookup_lat_lon(f.address))
>> draw_geomap( coord: (f)=> f.latlon, label: (f)=>f.avatar)
Why not:
contacts
where(.type == DB.person and .category == DB.contacts)
each(.latlon = lookup_lat_lon(.address))
draw_geomap(coord: .latlon, label: .avatar)
What's changed?
• Rather than explicit lambdas with named parameters, any expression can just refer to an unknown input object. (So .type == DB.person and .category == DB.contacts
is a function) This isn't actually even that radical: R's dplyr does something like this. But it's a nice increase in speed-of-thought fluidity, at the expense of things software engineers care about, like explicitness and infinitely-nestable composability.
• Perhaps the pipe operator (>>) will be so common it will be better to have successive lines automatically connected with a pipe. (If you want to stop a pipeline, just add a blank line in the middle.)
• [other minor changes]
I think much more radical & less obvious changes are possible, but it all starts with breaking away from something that looks so much like JavaScript.
2:
Maybe @Josh Marinacci is already thinking about this, but the design prompt also calls strongly for a new interface for using this language. In particular, these pipey step-by-step calculations really want automatic visualization of the data at every step! And a really slick keyboard-driven interface that lets you move around the pipelines at will! Etc.
I hope this work continues to evolve – would be great to see where it goes!Jack Rusher
02/08/2021, 5:32 PMJosh Marinacci
03/29/2021, 3:32 PMJoshua Horowitz
03/29/2021, 9:11 PMJack Rusher
03/30/2021, 9:37 AMmap
type that provides named sub-values without creating closed types, for exampleJoshua Horowitz
03/30/2021, 5:02 PMJack Rusher
03/30/2021, 8:04 PM