AlgebraicJulia / Catlab.jl

A framework for applied category theory in the Julia language
https://www.algebraicjulia.org
MIT License
599 stars 56 forks source link

Make macros Pluto-friendly #647

Open littlebenlittle opened 1 year ago

littlebenlittle commented 1 year ago

Being able to use Catlab in Pluto notebooks would be great. In conjunction with semagrams (https://github.com/AlgebraicJulia/Semagrams.jl/issues/35) this would create a powerful reactive environment for ACT experiments and demos that is also amenable to remote-development on hardware-constrained devices like netbooks and tablets.

Currently macro expansion isn't compatible with Pluto (https://github.com/fonsp/Pluto.jl/issues/2223).

epatters commented 1 year ago

Thanks for the report. I agree that it would be nice to fully support Pluto but it may be difficult to make all the macros in Catlab compliant. We'll see what we can do.

littlebenlittle commented 1 year ago

I'm happy to help if I can. I am neither a Julia expert nor a category theory expert, but I'm excited to learn. Also I need a topic for my master's thesis at some point :upside_down_face:

jpfairbanks commented 1 year ago

I asked a followup on the upstream issue. I don't think we can avoid macros that generate calls to eval. But I would really like Pluto to work with Catlab.

epatters commented 1 year ago

The macros in Catlab that currently use eval are:

I don't believe these uses of eval are avoidable because the macros have to look at the value of the theories/schemas passed into them.