Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module Functor API (#98) #135

Open
nikochiko opened this issue Mar 13, 2024 · 0 comments
Open

Module Functor API (#98) #135

nikochiko opened this issue Mar 13, 2024 · 0 comments

Comments

@nikochiko
Copy link
Collaborator

#98 proposes the addition of Module functors.

As of now, the backends are enumerated with a sum type and each backend has flexibility of choosing a context structure and whatever methods it finds fit.

I don't like the idea of having multiple context containers (e.g. in the case of cairo we have 3 nested things that we could name ctx).

With module functors, the API we expect from backends will become more well-defined. Recently too, I have been trying out using Joy and adding different backends. I also attempted to add it on the browser (https://kaustubh.page/joy.ml/) with an SVG backend. e.g. with a REPL, it's convenient to have a clear function.

One part I'm not sure of is the API for getting the result - we may want to write to a file (PNG), or get it as a string (SVG), or write it to a DOM element (Canvas / SVG in the browser). How do we accommodate these use cases into our API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant