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

JavaScript port? #28

Open
nybblr opened this issue May 12, 2017 · 8 comments
Open

JavaScript port? #28

nybblr opened this issue May 12, 2017 · 8 comments

Comments

@nybblr
Copy link

nybblr commented May 12, 2017

I'm currently using the amazing LSEQ CRDT in a collaborative editor, and the new-ish JSON CRDT has me really excited. I'm trying to start on a port to JavaScript, but I'm afraid despite my CS background, the paper's notation is beyond me 😆

I would love to include this in an upcoming talk I'm giving on Collaborative Editing.

Since I'm basically a n00b to Scala and Haskell, what resources would you recommend for wrapping my head around this? Or better yet, would you (or someone else really familiar with the datatype) be interested in collaborating on a JS port?

@schrepfler
Copy link

The project does build a Scala.js module but I'm not sure if it's usable from JS.

@nybblr
Copy link
Author

nybblr commented May 12, 2017

Right, if I understand correctly, Scala.js just helps if you want to write the host app in Scala too, as opposed to just transpiling a Scala lib for use in native JS. I gave it a shot a couple days ago without much success :)

@schrepfler
Copy link

Scala.js code can be used from a JS host environment as long as what you want to use is exported https://www.scala-js.org/doc/interoperability/export-to-javascript.html
That said, I have no idea if the code base is annotated in any way.

@Tamriel
Copy link
Contributor

Tamriel commented May 12, 2017

Because the crjdt is implemented in Scala, I learned the language and love it now. Check out Martin's Coursera course and Haoyi's Hands-on. Regarding language design and elegance I think Scala is superior to JavaScript. In this gist I have some ugly code of a collaborative textfield using crjdt.

@fthomas
Copy link
Owner

fthomas commented May 30, 2017

I'd love to see ports to other languages and would encourage you to do this. Unfortunately I lack the free time and experience with JavaScript for collaborating on a JS port. I agree that the notation of the paper is a little bit off-putting and understanding the whole data type without much type information can be hard (at least it was for me).

Btw, the code has no @JSExport annotations again because of unfamiliarity with JS and Scala.js. I'd happily merge a PR if someone wants to contribute this.

@Tamriel Your gist is great! This is AFAIK the first demo using crjdt!

@nybblr
Copy link
Author

nybblr commented May 30, 2017

@fthomas I will try the annotations method for a stop gap, but I would definitely love to create a first-class native JS implementation. If you do happen to come across some free time, let me know — even just walking through your understanding of the algorithm would help me immensely! No JS experience necessary :)

@Tamriel
Copy link
Contributor

Tamriel commented Jul 21, 2017

Have a look at automerge.

@RomanIakovlev
Copy link

I agree the notation used in paper is the biggest obstacle preventing more implementations (in different languages) of the great ideas published in this paper to exist. I personally also struggle to understand it properly. I've created a question on Computer Science Stack Exchange site (here: https://cs.stackexchange.com/questions/83770/help-understand-the-notation/85376) to clarify the notation, and some of the points were already answered there. Unfortunately, the still unanswered questions are crucial for proper understanding, and, apparently, it requires a deep familiarity with the paper to answer them, according to the people who posted some answers already.

It would be great if someone who made his way through the notation to chime in and post an answer for the reward of imaginary internet points and my (and probably other people's) gratitude. :) @fthomas any chance you could give it a shot some time in future?

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

5 participants