Skip to content

Module Functor API (#98) #135

@nikochiko

Description

@nikochiko

#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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions