FizzBuzz
Reimplementing lambda calculus in Java 8 for fun and profit.
Install / Use
/learn @SamirTalwar/FizzBuzzREADME
FizzBuzz, Lambda Calculus-style
Inspired by Tom Stuart's excellent talk on programming using just Ruby Procs entitled Programming With Nothing, I thought I'd try the same thing in Java. The idea is to remove all your language features bar two. Quoting Tom, "Naturally that means no gems [a.k.a. libraries—Samir], no standard library, no modules, methods, classes or objects. But this is love, so let’s go all the way: no control flow, no assignment, no arrays, strings, numbers or booleans." The two features we're going to keep are creating procs and calling procs.
We don't really have procs in Java, but we do have lambdas in Java 8, which are roughly the same (and exactly the same for the purposes of this exercise). So way back when, I grabbed the latest version of Project Lambda (which has since become part of Java 8) and gave implementing FizzBuzz (and, by extension, untyped lambda calculus) a crack. The results are pretty cool. Take a look at λs.java for implementations of booleans, numbers, branching and lists, and FizzBuzz.java for an idea of how they work.
I kept classes because, well, you have to in Java, but all methods are static and simply provide an entry point.
I hope this madness entertains you.
Related Skills
node-connect
342.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.7kCommit, push, and open a PR
