Frege: Purely Functional Programming for the JVM
summary
Frege is a purely functional JVM language (Haskell-like) that compiles to Java source and javac bytecode, uses a REPL, global type inference and lazy infinite lazy streams to implement FizzBuzz as zip/cycle/map/take without loops — the functional solution has zero conditionals versus four in the imperative version and is incrementally built in the REPL and works. Java interop requires explicit purity annotations: impure Java calls become IO-typed and taint callers, so purity is enforced and parallel-safe.
AI-written summary · about
chapters (22)
- 0:00Introduction
- 1:47Mental model challenge
- 3:42The cost of assignments
- 6:01Debugging imperative code
- 8:13Functional programming concepts
- 10:51Eliminating state
- 13:01Function application
- 16:41Type inference
- 20:30Currying and algebra
- 23:27Function composition
- 26:42Benefits of purity
- 30:17Safe refactoring
- 33:37Java interoperability
- 37:02Tainted IO types
- 38:51Structure and safety
- 40:38FizzBuzz demonstration
- 43:07Lazy evaluation demo
- 47:18Logical vs imperative code
- 50:33Incremental development
- 55:07Summary of benefits
- 57:00Learning resources
- 59:29Questions
related talks
54mFrege: purely functional programming for the JVM
51mFunctional Programming with Java
52mFunctional Programming with Java 8
36mHow functional programming change my Java code
49mRelax, It's Just FP
46mDesigning Functional Programs
48mEmbrace the Func - How Far has Functional Programming Come in Java?
43mRefactoring to Functional Style
