doodle icon indicating copy to clipboard operation
doodle copied to clipboard

Java Implementation Cleanup

Open noelwelsh opened this issue 11 months ago • 3 comments

The Java2D backend is a bit of a mess. Clean it up:

  • [x] Clearly separate Swing components (which exist in the Java-centric world) from Doodle components (which are Scala / Cats Effect). E.g. currently Canvas mixes the two.
  • [x] Cleanly separate threading models. The current implementation mixes Cats Effect and Java threading and I think this is leading to deadlock. Make the boundaries between the two very clear and implent this correctly.
  • [x] Follow Swing threading model, as described in Concurrency in Swing, for Swing components.
  • [x] Make Java2DPanel (or equivalent, if it is replaced) embeddable in other Swing components.
  • [ ] Probably get rid of Reified and replace with the Church encoding, which I think will offer more opportunity for the JIT compiler to get to work, and will be easier to work with.
  • [ ] Look at dropped mouse clicks and attempt to fix
  • [ ] Optimize BlockingCircularQueue for reads over writes and SPSC use case (which might address dropped mouse clicks)
  • [ ] (Optional) Frame configuration to not embed the Canvas in a window, but keep it as an embeddable Swing component that can be used in a larger context.

noelwelsh avatar Mar 13 '24 13:03 noelwelsh