Runestone icon indicating copy to clipboard operation
Runestone copied to clipboard

Cannot use from Swift Playgrounds

Open shaps80 opened this issue 1 year ago • 5 comments

Is your feature request related to a problem? Please describe. Swift Playgrounds (iPad in my case but should be applicable on Mac as well) cannot import packages that have C code included.

Describe the solution you'd like I haven’t looked deeply into the implementation but I’d hope for either of the following:

  1. A separate package for the editor vs the language parsers
  2. Perhaps the language/C code could be provided via a pre-compiled package instead?

Again, I may be over-simplifying the solution as I’m not familiar enough to understand the problem atm.

Describe alternatives you've considered Atm, I have to move the project to Xcode if I want to include this package (which I do), but I’m holding off on the editor bits for now because everything else can be built successfully on iPad.

Additional context Thank you for open sourcing such a high quality editor. I’ve worked on this kind of thing before and its an truly a huge undertaking, you’ve done an incredible job! I’ve bought your Runestone app as well and its become a huge part of my daily workflow 👌

It doesn’t have language support for some things (like XML) but I noticed I can still open it as plain text which is great 👍

shaps80 avatar Jul 17 '22 11:07 shaps80

Thanks for the kind words! 🙏

Runestone heavily depends on tree-sitter, a parser generator tool written in C. As far as I know, it isn't provided as a pre-compiled binary that can be included in an iOS project.

At the moment I don't see any way I can add support for Swift Playgrounds to Runestone. If anyone has any ideas on how this can be supported (without sacrificing on the experience when using it in Xcode), I'm all ears 😊

simonbs avatar Jul 17 '22 11:07 simonbs

Yeah I’m aware of its dependency but I guess, wasn’t sure how deep that integration went. I’ll take a look when I have more time cause I’d love to find a working solution for this 👍🏻 Thanks for replying so quickly @simonbs

shaps80 avatar Jul 17 '22 12:07 shaps80

@simonbs I wonder if this would be useful? Even as a reference: https://github.com/krzyzanowskim/tree-sitter-xcframework

shaps80 avatar Jul 20 '22 07:07 shaps80

@shaps80 Do you know if the xcframeworks can be used with Swift Playgrounds?

simonbs avatar Jul 30 '22 11:07 simonbs

I have used others without issue, but I haven't tested this specifically no.

shaps80 avatar Jul 30 '22 16:07 shaps80