Closed chriseidhof closed 7 years ago
Oops. I had accidentally left one of my currently experimental/breaking examples exposed in Examples.hs. I just switched back to some working examples. Try again?
Awesome, that did the trick. Thanks @conal !
Glad to hear it, @chriseidhof. :) Please let me know if you run into more issues.
I'm always interested in seeing and helping with additional applications. I suspect that most deep DSL embeddings would be improved by switching to the compiling-to-categories approach, in terms of usability, optimizability, and ease of implementation.
Awesome!
We just read your paper for our little functional Swift reading club, and really liked it. The fact that source-level transformations are necessary (and that we've been doing it wrong with trying to write EDSLs) was interesting to me.
I've struggled in the past with implementing a bunch of EDSLs in Haskell, and specifically the fact that you can't look "inside" a function when trying to compile. I'll have to go back and rethink some of the work I did. It could be interesting to see if it's possible to do defunctionalization. Also, I could imagine that you can target other programming languages (e.g. write in Haskell and extract Swift/Javascript or even C) using CCC's.
In reading the paper, I struggled a bit with understanding some of the applications, but that's because I lack knowledge around e.g. linear algebra.
Many thanks for writing such a readable paper and building all of this. It shows that a lot of work went into this.
Thanks for the kind remarks about the work and paper! I think there's an enormous potential here. One especially nice application not in the paper is SMT solving, writing predicates/constraints simply as a function to Bool
in regular Haskell.
Yes to targeting other programming languages. I'm now generating GLSL and Verilog. I think C, Javascript, and Swift would be fairly easy as well. Another project I've started on is reproducing Pan, Vertigo, and Eros via compiling-to-categories. Will combine categories for GPU code generation, GUIs, and differentiable functions (for lighting).
@chriseidhof I'm also working, both in Haskell and outside of Haskell, at applying Conal's ideas to other languages as well. As Conal says, there is tremendous potential here. For example, I think it offers a much better answer to the "expression problem" one encounters when attempting to translate between domains using deeply embedded DSLs.
@jwiegley awesome. Thanks for ledger btw, heavy user.
I've been wondering if it would be interesting to have a language that's designed just for this. Basically, a high-level language that compiles down to a simple core, not for optimizations, but for further backends. It would be useful to have function names (etc.) as well. Backends could enable specific optimizations, etc.
@chriseidhof You've almost just summarized what concat
actually does, so can you clarify what your proposal would add a bit more?
Not sure if this is the appropriate place, but there seems to be a problem with GHC 8.0.2 and the latest code. When building
concat-examples
, GHC crashes with the following error message: