What FP Can Learn From Static Introspection
summary
Static introspection and compile‑time function evaluation get concrete with Nim and D demos: compile‑time CSV parsing makes lookups instant but inflates a 2.4 MB CSV into a ~22 MB binary and raises compile times from ~1.5s to 10s; CT regex shows no speed win versus runtime; sample JSON becomes real types and parsing like compile‑time JSON to types / F# type providers; a type‑safe printf is implemented at compile time; warns of lost modularity, broken parametricity and weakened IDE predictive power.
AI-written summary · about
chapters (31)
- 0:00What is Static Introspection
- 1:00Compile Time Function Evaluation
- 1:52Performance
- 4:48Examples
- 5:13Realworld Examples
- 5:42NoNIMD evangelism
- 6:25compiletime evaluation
- 7:07hello
- 8:10static introspection in d
- 14:14prime ality tester
- 15:16performance is hard
- 16:10common code paths
- 17:42fast lookups
- 17:56object
- 18:44gather fields
- 19:13compile
- 19:28ghc
- 20:23list filtering
- 21:06domainspecific tooling
- 22:10datatype dipping
- 23:30data massaging
- 24:02data type migration
- 25:28compile time JSON parsing
- 28:07sample data structure
- 29:46Compiletime type reflection
- 32:23Fsharp type providers
- 34:03Typesafe printf
- 40:02Domainspecific user customizable holes
- 41:29Problems
- 42:03Loss of modularity
- 44:55Conclusion
related talks
01h 01mExpressive Compile Time Parsers
01h 18mExpressive Compile-Time Parsers in C++
48mDesign by Introspection
01h 08mReflections: Compile-time Introspection of Source Code
59mCompilers can be surprising
01h 02mThe Book of F#
36mConcrete Functional Programming
09mCompilers for nothing, executables for free!
