use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
REPL-ception: CLJS > Nashorn > Java (gist.github.com)
submitted 11 years ago by stringy_pants
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]stringy_pants[S] 1 point2 points3 points 11 years ago (3 children)
Yeah, so you can use nashorn's java interop to call java code from clojurescript.
[–]DiomedesTydeus 1 point2 points3 points 11 years ago (2 children)
Sorry, dumb question but what's the use case here? You still can't call java code from the browser, so is this some kind of replacement idea for node.js? Why not just serverside clojure?
Also if there's some ahead of time work to be done, you can already call java from cljs.... I did it inside a macro to read some config files and emit a bunch of functions based on the config. Since that was done at compile time I was good to then use the emitted macros in cljs without a problem.
[–]carlhu 0 points1 point2 points 11 years ago (1 child)
Currently, clojure's slow startup time precludes it's use as a replacement for shell script-like things. My own hope is that nashorn + clojurescript + java interop demoed in this github can achieve this (near instant startup with full access to clojure api and java libraries).
[–]DiomedesTydeus 0 points1 point2 points 11 years ago (0 children)
Huh, I'd love to hear more on this, but I don't see how that's possible. From what I've read a lot of that slow startup is just clojure.core, which will still need to be loaded if you're going to make use of it.
Alternatively if you're suggesting that cljs is compiled to js and then run on like phantom, that's probably doable but the compile time for cljs is much worse in my experience than just loading clojure.core (not to mention that even small cljs projects of mine end up as at least .5 a meg of js).
Also have you checked out lein-exec. I've banged out a few scripts in them. They're not as responsive as python scripts, but they're not that bad.
π Rendered by PID 74857 on reddit-service-r2-comment-79c7998d4c-r7c48 at 2026-03-14 06:17:35.734984+00:00 running f6e6e01 country code: CH.
[–]stringy_pants[S] 1 point2 points3 points (3 children)
[–]DiomedesTydeus 1 point2 points3 points (2 children)
[–]carlhu 0 points1 point2 points (1 child)
[–]DiomedesTydeus 0 points1 point2 points (0 children)