The site isn't totally up to date – the Python bindings + API are brand new, and need some examples, but they work great if you know how to use them!
The site isn't totally up to date – the Python bindings + API are brand new, and need some examples, but they work great if you know how to use them!
This sounds like a bug, please open a Github issue and I'll investigate.
Either way I should probably close https://github.com/libfive/libfive/issues/206 ?
Surprised to be hearing about this here instead of via that issue closing :p
Yes, these are now part of libfive's core – Python is an important-enough language that having canonical, first-party bindings seems important.
There was a bunch of infrastructure work to get to this point: the standard library was ported from Scheme to C++, so the shape bindings are now autogenerated for both target languages and use FFI to call into a dynamic library (with a C API).
libfive installs custom readers for #0, #1, #2, and so on, which all do the same thing: store the syntax position (row/column/span), then create a free variable with a particular id that's associated with that syntax position.
When pushing and pulling on the surface, it's solving for free variables values that put the surface at your mouse cursor's position. Then, it can splice those values back into the original script using the row/column/span data from before.
Python does the same thing with a magic `var(...)` function, which is used as the target for an AST transform here:
https://github.com/libfive/libfive/blob/master/libfive/bind/...
[1] http://www.gnu.org/software/guile/manual/guile.html#Reader-E...