====== September 2024 newsletter ====== ===== What we've been up to ===== * Andrés will be giving the opening keynote at [[https://berlin.causalislands.com/#program|Causal Islands Berlin]] on this Friday, October 4. * The talk will use a Folk gadget to control slides, demonstrate Folk, and explain the technology and vision behind Folk. We'll link the recording of the talk in the newsletter next month. * It looks like [[https://ti.to/causal-islands/berlin-2024|livestream tickets are also available]] for anyone interested * Our next [[https://partiful.com/e/62C2MjzYBVIpLP7qG330|Folk open house is on the night of Monday, October 21]], at our studio in East Williamsburg, Brooklyn. ==== Applications and demos ==== * [[https://jessie.grosen.systems|Jessie Grosen]] added support to the ''supercollider'' branch of Folk for the syntax ''Wish $this plays note A''. She and Andrés and [[https://arcades.agency|Arcade Wise]] got together for some crafting and [[https://folk.computer/supercollider|SuperCollider]] time, made a lot of buttons, and built a paper 'piano' on the Recurse Center Folk system: * {{newsletters:jessie_recurse_piano.mp4}} * Omar fixed up [[https://github.com/FolkComputer/folk-cnc|folk-cnc]] after someone reached out about it (so it now works with latest Folk, which has different [[https://github.com/FolkComputer/folk-cnc/commit/f65b01855c7d0885e0ef70b36fb08ba7eeec4c79|display dimension statement]] and [[https://github.com/FolkComputer/folk-cnc/commit/efb2b444fafa883a9e5bab1bdf4bc1642081558a|tag statement]] forms now that 3D calibration is in place) * [[https://x.com/naveenma|Naveen Michaud-Agrawal]] implemented a [[https://gist.github.com/nmichaud/fc7b77bd2c77f9df0334a05c76271031|'parameters' system]] where you can control parameters of a page by moving a controller dial nearby: * {{newsletters:pxl_20240914_191245602-2.mp4}} * [[https://arcades.agency|Arcade Wise]] made a bar graph system (it runs entirely in a shader): * {{newsletters:pxl_20240906_115017746.mp4?200px}} * "it supports anyone who claims to have graphable data" (!) * Graph cat: * {{newsletters:pxl_20240906_205706565.jpg?300px}} ==== Hand tracking ==== [[https://danielpipk.in|Daniel Pipkin]] has been working on hand tracking. (using [[https://www.robertxiao.ca/research/direct/|Robert Xiao's technique]] to ultimately get touch tracking, so you can touch things with your fingers) Depth and IR data from the Kinect can now be piped through folk. {{:newsletters:kinect-ir-depth-frames.jpg?400|}} ==== Other system improvements ==== * Merged Daniel Pipkin's [[https://github.com/FolkComputer/folk/pull/169|ESC/POS receipt printer work]] * Andrés added a new keyboard shortcut: ''Alt''-''F1'' to stop Folk * Useful for configuring the gadget when Wi-Fi is broken: plug in a USB keyboard, hit ''Alt''-''F1'', and then you can use ''sudo nmtui'' by hand to set up Wi-Fi without needing to outrace the Folk process reastarting * Omar merged subprocess death detection and reporting (as part of [[https://github.com/FolkComputer/folk/pull/176|gadget libcamera support]]) * Omar merged C++ support (as part of [[https://github.com/FolkComputer/folk/pull/176|gadget libcamera support]]) * Omar added support for drawing [[https://github.com/FolkComputer/folk/blob/386de35b2efad57f3abbc94d77005e64a846a1a6/virtual-programs/display/dashed-stroke.folk|dashed stroke]] including offset, so you can animate the dashes. * (used for outlining the border of the gadget -- shown later in this newsletter) * Naveen added a [[https://github.com/FolkComputer/folk/pull/175|Bezier curve drawing wish]] * {{:newsletters:pasted:20240925-143234.png?350px}} * Naveen [[https://github.com/FolkComputer/folk/pull/177|fixed a mailbox leak]] when a subprocess terminates * Omar made a new live-build .img that has a working default up-to-date setup.folk * (it was broken because it had no default camera/display selection statements) * Still need to make git pull work (its remote origin is set wrong because we copied the repo) * I should write a script to do this automatically... * Omar [[https://github.com/FolkComputer/folk/commit/386de35b2efad57f3abbc94d77005e64a846a1a6|fixed the statements graph]], which was broken because the 3D-calibration-related statement node labels were too long (over 16384 chars) ==== Handheld Folk gadget ==== Omar: Made a new gadget design that can also fit the older/more-encased Nebra AnyBeam. Built a second gadget for Andrés (to take to Berlin!) with the Nebra AnyBeam that we had lying around, so now we have 2 gadgets. [[https://github.com/FolkComputer/gadget|The gadget design is now on GitHub.]] (Not everything is specified yet -- I need to measure some bolt lengths and link some Amazon stuff.) 3D print has been fairly stable for a month or two but probably needs a new revision where the front panel is more solid (doesn't wobble, camera doesn't get knocked off). Two big camera fixes: - Switched to wide-angle camera - (also had to expand the camera hole in the front panel to make the wide-angle camera fit) - Direct [[https://libcamera.org|libcamera]] [[https://github.com/FolkComputer/folk/pull/176|support in Folk]] instead of using libcamerify * + tell libcamera to configure (reduce) camera exposure time so that projected tags for calibration don't get washed out These fixed the worst issues -- it now actually calibrates! We can project onto programs! (it's still fairly annoying to calibrate, takes 20-30 minutes, but it's doable, and you ideally only have to do it once. I feel like we should ultimately be able to calibrate it really well because the projector is a laser scanning projector and has no lens distortion, also.) First calibrated use of Omar's gadget (gadget-blue) and of Andrés's gadget (gadget-red), respectively: {{newsletters:img_2447.mp4?200px}} {{newsletters:img_7443.mp4?200px}} Slow, but that also motivates performance improvements... === Gadget niceties === * Moving dashed line around the outside of the projector area * {{newsletters:img_2686.mp4?200px}} * Actually makes a huge difference: now you can tell where the gadget's area of effect actually is, don't have to guess, //and// you can see at a glance if the system is still live or if it's blocked/frozen by whether the dashed line is still moving. * Code you can add to ~/folk-live/setup.folk to enable this: * When display /disp/ has width /w/ height /h/ { When the clock time is /t/ { Wish to draw a dashed stroke with points \ [list [list 0 0] [list $w 0] [list $w $h] \ [list 0 $h] [list 0 0]] \ color white width 10 dashlength 40 \ dashoffset [expr {fmod($t, 10)*-120}] } } * [[https://github.com/FolkComputer/folk/commit/db6b83cc346759a46dc3975f1cd0da606fb81d6a|Changed the 'page fault' mechanism to run ''curl'' in background]] so it doesn't block Folk awkwardly when you're pointing it at random programs ==== New parallel evaluator ==== Omar has been continuing to work on the new evaluator -- it really does feel like the biggest remaining issues in Folk are performance & reliability issues, so this is important. There's a mix of little reliability/safety issues and big semantic issues with the evaluator (how do we schedule stuff onto threads? how do we make sure things don't blink out or, conversely, transiently get multiple states at once? when/how do we abort invalidated work items?) === Sysmon and thread pool === Started working on sysmon thread which wakes up every few milliseconds and manages the size of the thread pool (too many threads looking for work? kill some; too few threads compared to number of CPUs? spawn some). There are subtleties here where you want to avoid churning the thread pool and constantly killing and re-spawning stuff. Haven't figured out yet. It needs heuristics about what threads are occupied and how long they'll be occupied (microseconds? milliseconds? seconds?) to determine this. === Sustain / time-to-live field on statements or Holds === Idea: sustain/TTL field where statements can get held for some number of milliseconds after their parent is retracted. sysmon (which previously was just managing the size of the thread pool) is extended (maybe will rename to custodian) to also handle reaping sustained statements when they hit their deadline. it feels nice to do it here rather than complicating the priority queue further, since sysmon is already waking up every couple milliseconds anyway (and it doesn't need to run any more than that, fixed ticks are fine). We had a good discussion about this proposal in Discord: {{:newsletters:pasted:20241001-034059.png?550px}}
More discussion of sustain/TTL {{:newsletters:pasted:20241001-034119.png?550px}} {{:newsletters:pasted:20241001-034138.png?550px}}
=== Other new evaluator stuff === Added workqueue display on /threads Web page, which made it clear that many of the random issues with folk2 are just that work-stealing was breaking down and work items would get permanently stuck on some thread that was stuck running a permanent task (instead of the work getting stolen and executed elsewhere). Fixed some keyboard issues where the keyboard process was erroring or exec-ing stuff all the time (because of lack of persistence / because of blinking), and where the grabber was broken because it wasn't inter-thread-safe. Scheming about this memory management idea again, since it could simplify a lot of the implementation: {{:newsletters:pasted:20241001-033956.png?550px}}
More discussion of memory management {{:newsletters:pasted:20241001-034016.png?550px}}
==== Friends and outreach ==== * Our open house this month was well-attended, and we got to show off the gadgets and eink device: * {{:newsletters:pasted:20240930-185145.jpeg?0x250px}} {{:newsletters:pasted:20240930-185232.jpeg?0x250px}} {{:newsletters:pasted:20240930-185249.jpeg?0x250px}} {{:newsletters:pasted:20240930-185257.jpeg?0x250px}} {{newsletters:6139bbb4-952e-4898-a2a1-855fb01e5103.jpg?0x250px}} * Andrés practiced his talk for Causal Islands Berlin: * {{:newsletters:pasted:20240930-185206.jpeg?0x250px}} {{:newsletters:pasted:20240930-185311.jpeg?0x250px}} {{:newsletters:pasted:20240930-185325.jpeg?0x250px}} ===== What we'll be up to in October ===== * **Our next [[https://partiful.com/e/62C2MjzYBVIpLP7qG330|Folk open house is on the night of Monday, October 21]], at our studio in East Williamsburg, Brooklyn.** * Andrés will give their talk about Folk at Causal Islands Berlin * Maybe some tasks afterward around merging the slides system they built and following up with people * Andrés continuing docs and desksaver projects * Andrés and Omar will work with our new partner [[https://www.kosmik.app|Kosmik]] on knowledge management and phone/laptop integrations and demos with Folk * Daniel continuing to work on hand tracking now that the Kinect data is in Folk * Omar wants to respin the gadget to make the front panel more solid, maybe add a second camera, & is meeting with Ultimems (the mini projector supplier) * Maybe also see if there is low-hanging fruit on performance * Maybe also add a second camera to folk0 * Omar continuing to work on new evaluator, work out thread pool management and sustain/retract behavior (and fix general instability) * Maybe finally implement statement or match arenas so we can unify memory management * Omar needs to get back on the 3D calibration refinement and UI (I think even adjusting exposure, without an additional refinement step yet, could make a big difference, & reporting tag detect results during calibration so you can see if it's iffy) * could also include livestreaming the camera feed to the browser ===== Links we've enjoyed ===== ==== Omar ==== * https://teaching.ellenmueller.com/walking/2021/10/10/stanley-brouwn-this-way-brouwn-1962/ * https://www.hillelwayne.com/post/alan-kay/ * https://grafematik2024.sciencesconf.org * https://x.com/rsnous/status/1540793581337604097 (gadget ideas) ==== Andrés ==== * [[https://developers.cloudflare.com/email-routing/email-workers/send-email-workers/|Send emails from Cloudflare Workers]] * [[https://faultlore.com/blah/swift-abi/|How Swift Achieved Dynamic Linking Where Rust Couldn't]] * [[https://stackoverflow.com/questions/2171177/what-is-an-application-binary-interface-abi/2456882#2456882|What is an application binary interface (ABI)?]] * [[http://www.bitsavers.org/pdf/borland/borland_C++/Borland_C++_Version_3.1_Tools_and_Utilities_1992.pdf|User guide for Borland C++ editor]] * [[https://www.getprinternet.com/|Print your digital reading list as a magazine, shipped monthly]] * [[https://www.newspaperclub.com/choose/orders-and-delivery/free-sample|Newspaper Club (print your own newspaper as a service)]] * [[https://github.com/roboflow/supervision|Supervision, an interesting looking computer vision library]] * [[https://www.youtube.com/watch?v=0ryf8hXTJkg|Book design lecture from Ben Denzer via the Parsons Communication Design Lecture Series]]