3 ms·
I think I've got the category bug. I very much was intrigued by Milewski's course and found that it made things happening in Haskell make more sense to me. Ther
by philzook 7y ago
I think I've got the category bug. I very much was intrigued by Milewski's course and found that it made things happening in Haskell make more sense to me.
There are a couple of things that really excited me.
Conal Elliott's compiling to categories. Categories make a great intermediate representation for DSLs. They are very easy to manipulate/optimize in a simple algebraic manner without issues related to named variables. This proposal showed how a plugin could take ordinary programs written in more user friendly syntax and compile it to the category IR. You can overload ordinary programs to automatically differentiable programs and more.
http://conal.net/papers/compiling-to-categories/ http://conal.net/papers/compiling-to-categories/
Another thing I think is really interesting is calculating programs. It is possible in the right formalism to write down a specification of a program in a simple small form, and use algebraic manipulation to derive an executable form of the program. It feels like doing an integral or something.
Check out these books on that topic.
https://themattchan.com/docs/algprog.pdf https://themattchan.com/docs/algprog.pdf
http://www4.di.uminho.pt/~jno/ps/pdbc.pdf http://www4.di.uminho.pt/~jno/ps/pdbc.pdf
- runeks 7y agoGreat example! Here’s a video where Conal demonstrates interpreting a Haskell program (actual Haskell, not a DSL) into a) an image of a graph-like structure (visualizing the algorithm), b) Verilog (for compiling to hardware), and c) GLSL (for being rendered by a GPU in the browser). https://youtu.be/vzLK_xE9Zy8 https://youtu.be/vzLK_xE9Zy8