Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Explore C interop with Kotlin/Native for sharing a common markdown parser #30

Closed
saket opened this issue Dec 25, 2019 · 6 comments
Closed
Assignees
Labels
help wanted Extra attention is needed

Comments

@saket
Copy link
Owner

saket commented Dec 25, 2019

Press currently delegates parsing of markdown to platforms using expect/actual, but managing the expected class signature of parsed nodes is a pain right now. The K/N community is new so there isn't any markdown parser written in kotlin, but there are sufficient libraries written in C that Press can leverage through C interop with K/N: https://kotlinlang.org/docs/reference/native/c_interop.html

We could use cmark: https://github.com/commonmark/cmark

@saket saket added the help wanted Extra attention is needed label Dec 25, 2019
@saket
Copy link
Owner Author

saket commented Apr 26, 2020

Assigning this to @hackertronix who's working on adding bindings for cmark.

@hackertronix I've added some basic tests on saket/apr26/markdown-parser-test to help you test your bindings.

Update: Huh, I can't assign people randomly to an issue. That probably makes sense. @hackertronix wanna assign this yourself?

@saket
Copy link
Owner Author

saket commented Apr 26, 2020

Actually, let me just disable those tests and merge them to master.

@hackertronix
Copy link
Contributor

I am unable to assign it to myself :(

@saket
Copy link
Owner Author

saket commented Apr 27, 2020

Looks like someone has to comment before they can be assigned. Done!

@saket
Copy link
Owner Author

saket commented May 27, 2020

Turns out cinterop can only generate bindings for kotlin/native. We'll still have to use JNI for Android which sucks. I filed a feature request to support generation of bindings for all platforms but don't think that's going to happen anytime soon.

@saket saket closed this as completed May 27, 2020
@saket
Copy link
Owner Author

saket commented May 27, 2020

Superseded by #51

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants