Xah Talk Show 2026-06-29 Ep800. learning fsharp with ai, walk dir. find string. call shell command.
Video Summary (Generated by AI, Edited by Human.)
In this episode of the Xah Talk Show (Ep800), host Xah Lee spends the livestream exploring F# programming with the help of AI, while also sharing anecdotes about his history with software development and programming languages.
Coding with F# and AI:
Throughout the stream, Xah uses AI to help him write and understand F# scripts for various file system tasks:
Directory Traversal: He explores how to recursively walk a directory (16:34 - 23:12) and discusses the difference between recursive and non-recursive implementations (23:25 - 28:00).
File Processing: He demonstrates how to read files, extract specific lines (like the first 10 lines of an HTML file), and manipulate file paths to get names, directories, and extensions (40:58 - 49:45, 142:55 - 145:50).
Shell Commands: Towards the end, he learns how to execute shell commands from within an F# script (148:13 - 149:25). Historical Ramblings and Community Discussion:
Disney and Arabian Nights: The video begins with a lengthy, humorous, and critical discussion about Disney's depiction of Princess Jasmine and the Arabian Nights (3:40 - 16:22).
Programming History: Xah shares his personal journey with programming, specifically why he moved on from Haskell (103:57 - 104:35, 116:03 - 117:00). He discusses the history of the Darks (distributed revision control) system and the "theory of patches," comparing it to Git and his own past experiences with the Haskell community (117:00 - 139:26).
Technology and Tools: He discusses speech recognition software, the evolution from "dragon speak" to modern AI-powered "voice typing" (53:16 - 58:32), and touches on his history as a content creator (146:08 - 147:57).
now, write a fsharp script, go thru a dir recursively , for each png file, call cwebp to convert it to webp
- script to walk a dir.
- filter by filename extension
- find how to get filename sans extension, or dir name, or just file name.
- compare my emacs lisp or PowerShell tutorial
- how to call a shell command.
- e.g. call cwebp
- convert image webp
(* 2026-06-29 go thru a dir, open each html file print first 10 lines. *) open System.IO let rootPath = @"c:/Users/xah/web/xahlee_info/talk_show/" Directory.EnumerateFiles(rootPath, "*.html") |> Seq.iter (fun path -> try printfn "=== %s ===" (Path.GetFileName path) File.ReadLines(path) |> Seq.truncate 10 |> Seq.iter (printfn "%s") printfn "" // empty line between files with | _ -> printfn "Error reading: %s" path )