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

ClojureScript support? #27

Open
arichiardi opened this issue Oct 30, 2015 · 18 comments
Open

ClojureScript support? #27

arichiardi opened this issue Oct 30, 2015 · 18 comments

Comments

@arichiardi
Copy link

Hello guys,
I am trying to include the new puget 0.9.2 in a ClojureScript project with no luck.
I tried to downgrade to 0.8.1 but still I am not able to see puget in my classpath.
It always throws the classic no namespace found printer.puger...bla bla .cjlc ...bla

My project.clj:

:dependencies [[org.clojure/clojure "1.7.0"]
                 [org.clojure/clojurescript "1.7.145"]
                 [reagent "0.5.1"]]

  :plugins [[lein-cljsbuild "1.1.0"]
            [lein-codox "0.9.0"]
            [lein-simpleton "1.4.0-SNAPSHOT"]]

The profile.clj is empty.

Very weird, what can it be? Does puget modify the classpath at all?

@greglook
Copy link
Owner

Unfortunately Puget is not yet cross-compiled to ClojureScript. As of the 0.9.x series its main dependency (fipp) is cross-compiled though, so in theory this should be doable. I haven't worked a lot in cljs though, so if you have any suggestions I'm all ears.

Mainly I think this would involve making most of the files .cljc and then adding reader conditionals around the Java-specific parts.

@arichiardi
Copy link
Author

Yep, are there a lot of Java specific calls? I guess I can have a look at the code and try to contribute 😉

EDIT: I changed the name of the issue.

I see a lot of Java fiddling here and here.

@arichiardi arichiardi changed the title Printer.puget no namespace found? ClojureScript support? Oct 30, 2015
@piecyk
Copy link

piecyk commented Oct 30, 2015

👍 for this, also will have a look, regarding the java-handlers i think we can drop it for cljs will try to have something working.

@arichiardi
Copy link
Author

yep agree, putting here as reference http://dev.clojure.org/display/design/Reader+Conditionals

@greglook
Copy link
Owner

Yeah, some thoughts:

  • We can drop dispatch/symbolic-reader since it's not very useful standalone.
  • dispatch/inheritance-lookup is going to need to be reworked, but would be nice if the contract held across both clj and cljs. Now that I think about it, I don't even know how inheritance works in cljs. 😞
  • The mvxcvi/arrangement library will need to be ported as well, but shouldn't be too hard.
  • Calculating the sys-id and class name for unknown rendering is currently Java-specific.
  • As pointed out, the java-handlers need to be dropped. We should support the #inst tag for js Dates though.
  • Similarly, the clojure-handlers and clojure-interface-handlers will probably need to be reworked a bit.

@arichiardi
Copy link
Author

Yes I notice arrangement, but as you said, there are a few lines of code to change in there. I am more curious about sys-id, what is the purpose? Skimming the code it looks like you're using it as id string in the span creation. It looks that in that when you check it against the class name...is it used for uniquely identify an instance?

@greglook
Copy link
Owner

The sys-id used to differentiate otherwise-identical instances of the same class. For Clojure's persistent collections and other EDN primitives, this is not necessary since they support value-based equality. However, if you want to tell two instances of ByteArrayInputStream (for example) from each other, you need to use the system-level hash-code. Hence the use in the unknown formatter.

The package.foo.Bar@123abc format is used by Java as the default toString implementation, so the formatter checks that it's not going to print the same thing twice in case the object doesn't implement a custom string format.

@arichiardi
Copy link
Author

Yes I suspected that.

@venantius
Copy link

I am going to begin work on this.

@arichiardi
Copy link
Author

@venantius great! Feel free to ping me here or on Slack for testing!

@greglook
Copy link
Owner

greglook commented Mar 3, 2016

Cool, I've just started picking up Clojurescript myself! I've experimented a bit with cross-compiling in alphabase and it's pretty nice so far.

@venantius
Copy link

Reference WIP PR here: #30

@worrel
Copy link

worrel commented Aug 16, 2016

hey, any movement on the CLJS support? looks like the upstream PR in clj-arrangement was merged, anything blocking this?

@venantius
Copy link

Nothing blocking it other than time. I've made a bunch of progress since the last comment on this issue, but I haven't had a chance to drag it over the line. I'd say the current status is about 80% done.

@roman01la
Copy link

Hello. What's left to do here? Would be nice to finally finish this :)

@piotr-yuxuan
Copy link

Hello, just looking for some news, what's up on that issue? If you don't have time to finish it, do you think you could still write what's left for others to try to help you?

@venantius
Copy link

There's been no progress. Anyone interested in picking this up should refer to the WIP PR referenced above for Puget, or could take a look at the syntax-highlighting engine for Planck and work on it from that angle.

@holyjak
Copy link

holyjak commented Mar 2, 2018

@venantius Could you be so kind and describe what is it that needs to be done, i.e. what are the main problems that need to be solved? It is not very clear to me from the PR (the comments there are too low-level for me) or from the " look at the syntax-highlighting engine for Planck and work on it from that angle". I think it would be very helpful to provide a clear description of the task (and the work done so far) so that somebody can pick it up. Thank you!

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

8 participants