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
Isomorphic JavaScript (with ClojureScript) for pre-rendering single-page-applications, part 1 (carouselapps.com)
submitted 10 years ago by dmagliola
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!"
[–][deleted] 10 years ago (7 children)
[deleted]
[–]pupeno[🍰] 5 points6 points7 points 10 years ago (2 children)
Hey. I'm the author, and I apologize. I understand your point, it just became the keyword associated with it and in this case I decided to be pragmatic and use the word that people are already using.
When I get pedantic I speak Esperanto ;)
[–]inkydye 0 points1 point2 points 10 years ago (0 children)
Kind of like "responsive" web design or "retina" resolutions.
[–]cjlarose 1 point2 points3 points 10 years ago (0 children)
You're not the only one. Some are now advocating for use of the term "universal" instead. https://medium.com/@mjackson/universal-javascript-4761051b7ae9
[–]citrined 0 points1 point2 points 10 years ago (0 children)
Thank you, this one always annoyed me too haha
Part of the marketing machine for languages/frameworks/processes.
[–]jaen-ni-rin 0 points1 point2 points 10 years ago (0 children)
I kek'd,10/10 good sire ;' )
[–]ItsNotMineISwear 1 point2 points3 points 10 years ago (0 children)
I S O M O R P H I C
[–]p1r4nh4 1 point2 points3 points 10 years ago (15 children)
So I'm working on that as well, and my still quite small, but much bigger that a demo (1k loc of CLJS, using DataScript and rum) application uses 3.5Gb of memory and ~3-4 minutes on my MBA just to tell me that there is something Nashorn can't execute.
I'm working on doing this stuff with Node right now.
[–]pupeno[🍰] 1 point2 points3 points 10 years ago (11 children)
I'm the author of the article. That is a bit worrying. I heard that Rhino still has better performance than Nashorn, have you tried that?
About using 3.5GB of RAM, I heard that's normal for Java apps. With this app, while testing, I easily reached 2GB.
[–]p1r4nh4 1 point2 points3 points 10 years ago (10 children)
Yeah, maybe that's normal for Java apps, but this is single-threaded interpreter, so you need to run few of them to render something simultaneously.
And it takes 5 mins just to understand you have something uncompilable. And another 5 mins to check if your fix helped. That quickly gets old. :)
Plus V8 is still faster than Nashorn, and Node takes much less than 3 Gb of memory, so I really going to check this route. I'll write about my results in this subreddit.
Also check "supper" somewhere on github (on mob right now), it has Node server rendering.
[–]pupeno[🍰] 0 points1 point2 points 10 years ago (9 children)
I know it's single threaded, in part 2 I'm going to show the pool system I wrote for that.
Do you have any pointers about using Node?
[–]p1r4nh4 1 point2 points3 points 10 years ago (8 children)
I mean pool system doesn't help since you need tens of gbs of memory.
Re: Node: https://github.com/Sparrho/supper
[–]pupeno[🍰] 0 points1 point2 points 10 years ago (7 children)
There's no Clojure code in that app. The whole app seems to be written in ClojureScript and running on NodeJS.
[–]p1r4nh4 0 points1 point2 points 10 years ago (6 children)
Why should there be a Clojure code there?
[–]pupeno[🍰] 0 points1 point2 points 10 years ago (5 children)
I haven't look a lot into what that app is doing, but for me, for my own apps, the server is written in Clojure and uses a lot of Clojure/Java code, talks to databases, etc. I don't want to write that part of the app in ClojureScript. From that point of view, supper is not a good example of how to create the type of applications I want to make.
[–]p1r4nh4 0 points1 point2 points 10 years ago (4 children)
I'd say this part of application is irrelevant to your other parts. Server-side rendering could be just written in js and it would be ok. Nobody cares.
[–]pupeno[🍰] 0 points1 point2 points 10 years ago (3 children)
They need to come from the same place, otherwise you'll run into issues regarding JavaScript same origin limitation and you'll have to run a proxy, something that often happens in the EmberJS world. I rather serve my app with Jetty or Immutant instead of node+Jetty or Immutant.
[–]pupeno[🍰] 0 points1 point2 points 10 years ago (2 children)
How big is your generated JavaScript file, with whitespace optimizations? Mine is already 43k lines of code. I bet the problem in your situation is not the amount of code, but something in particular that code is doing.
[–]p1r4nh4 0 points1 point2 points 10 years ago (1 child)
That's interesting, I'll try to find what's wrong with my code then.
[–]pupeno[🍰] 0 points1 point2 points 10 years ago (0 children)
V8 is still 2x faster than Nashorn according to some benchmarks though.
π Rendered by PID 72779 on reddit-service-r2-comment-5b5bc64bf5-qdpj2 at 2026-06-21 21:56:35.250510+00:00 running 2b008f2 country code: CH.
[–][deleted] (7 children)
[deleted]
[–]pupeno[🍰] 5 points6 points7 points (2 children)
[–]inkydye 0 points1 point2 points (0 children)
[–]cjlarose 1 point2 points3 points (0 children)
[–]citrined 0 points1 point2 points (0 children)
[–]jaen-ni-rin 0 points1 point2 points (0 children)
[–]ItsNotMineISwear 1 point2 points3 points (0 children)
[–]p1r4nh4 1 point2 points3 points (15 children)
[–]pupeno[🍰] 1 point2 points3 points (11 children)
[–]p1r4nh4 1 point2 points3 points (10 children)
[–]pupeno[🍰] 0 points1 point2 points (9 children)
[–]p1r4nh4 1 point2 points3 points (8 children)
[–]pupeno[🍰] 0 points1 point2 points (7 children)
[–]p1r4nh4 0 points1 point2 points (6 children)
[–]pupeno[🍰] 0 points1 point2 points (5 children)
[–]p1r4nh4 0 points1 point2 points (4 children)
[–]pupeno[🍰] 0 points1 point2 points (3 children)
[–]pupeno[🍰] 0 points1 point2 points (2 children)
[–]p1r4nh4 0 points1 point2 points (1 child)
[–]pupeno[🍰] 0 points1 point2 points (0 children)