Hacker News new | past | comments | ask | show | jobs | submit login
ClojureScript beginners' home page (clojure-script.org)
191 points by jiyinyiyong on April 18, 2018 | hide | past | favorite | 79 comments



You might think from the URL or logo that this is some kind of official ClojureScript page, but it's not. The official page is clojurescript.org (no hyphen).

I don't speak in any official way for ClojureScript, but as an enthusiast, I wish this author had chosen a different URL to make that more clear.

Other ideas to mitigate the confusion: using a different logo in the corner; prefixing the html <title> with "unofficial"; and adding a more prominent link to clojurescript.org titled "Official ClojureScript Page".


Well, you may need this one https://www.reddit.com/r/Clojure/comments/8anepx/a_fake_home...

The main purpose of this page is trying to make new developers come to ClojureScript feel better by providing informations. People in Clojure community already knew it so I don't have to emphasis that my side is unofficial again. Plus I added a link at the corner.

Still thanks for putting down you impressions. But I thought about you option before when posting to Reddit.


People in the Clojure community might know that your site is not the official one, but people new to Clojure(script) might not!

I actually thought it was the official website first time I visited the page. (The "Back to official" link is not clear enough)

I agree with the improvements that were suggested. (different logo or putting unofficial in the title)


> ClojureScript(Unofficial)

Fine... Updated.


That’s very cool, thanks for doing that. As a complete outsider to all of this, I have to say that does help a lot.


are you related to jinyang?


I don't know jinyang? Who?


Elrc bachman would be proud


I find the random sample snippet of code at the top of the page quite confusing. The first time it loaded it was about threading macros and the second time was reagent, both of which are things I wouldn’t expect a beginner to be familiar with. Perhaps some context would be nice. Even better, how about a snippet of code in cljs showing how people can do something they’re familiar with in JS?


I put some random snippet gathered from the community about all the features ClojureScript supports. This page is not targeting JavaScript developers alone. It's visited by many Clojure and ClojureScript developers. And I want to exhibit more on what ClojureScript is capable and the beauty of the code.

I was trying to ask what are the best snippet we should display. But it turned out we didn't reach a conclusion, not even close. https://clojureverse.org/t/which-piece-of-code-do-you-think-...

BTW what's your background? What do you refer to by "something they are familiar with in JS"?


Agreed. Consider also that for someone who does not know anything about Clojure, it looks alien enough.


Does the first paragraph the page help? I was expecting this paragraph telling people what ClojureScript is.

> Clojure is a dialect of the Lisp programming language. Clojure is a general-purpose programming language with an emphasis on functional programming. ClojureScript is a compiler for Clojure that targets JavaScript.


Who's your target market for the front page? If it's people who don't know what Clojurescript is, why confuse them with hundreds of characters of incomprehensible code, with no understanding of why it's there or what it does?

On the other hand, if it's people who are familiar with Clojurescript...also why is it there? It's given no motivation on the page, and gets in the way of people finding what they're looking for.


State your backgrounds please~ ClojureScript users? Non-Clojure programmer? Known Lisp?

Showing code is most direct way of telling people what ClojureScript is. The official side gave thousands of words but people with less knowledge just don't read. Code just tells, even audience don't get the whole ideas, they are impressed.

Also the page listed quite some projects which are important to the community, which the official one did not offer.

I made this page and collected feedbacks from ClojureVerse and WeChat group mainly. Definitely I need to serve wider audience. Please tell me more details what you feel confused on this page.


Have used ClojureScript a little bit, Clojure a fair amount, a lot of coding in other Lisps.

Having code is useful! Yes! But it is easier if people are guided to it. On the reddit thread you link, you link to two tweets containing the homepages for languages like CoffeeScript, PureScript, and LispyScript. All of these pages have code on the main page, yes.

But note that on all of them, the code snippets are motivated. LispyScript has eight lines of code across six heavily explained examples. PureScript has five lines of code that come after a tagline that explains what the language is, then ten bullet points explaining benefits. Each example of Elm code is separately motivated. The user is never left guessing why the code is there: the first snippet is "Javascript Interop"; the second "No Runtime Exceptions".

Compare that to clojure-script.org/. The first thing I see when I load the page is "InterOp". Interop of what? The first English word I see on the page is "Microsoft". Is Clojurescript a Microsoft project? This is inverted, where the page wants to dive into details about Clojurescript before even explaining what Clojurescript is. You wouldn't display a Western-style horse saddle, expect them to figure out on their own the differences between that and an English saddle when you don't state them, and you definitely wouldn't talk about that before explaining what horseback riding is!


Can't disagree. I didn't see the page in that way before. At first I just want to paste some code there. If a new user came, he/she knows nothing about Clojure and he/she does not read it. He/she gets the impression that Clojure is a Lisp with so many garish features, nice. If a experienced Clojure user same, he just recognized the code and thought "yes that is Clojure".

If a new user tries to read the code, there can be confusions. True. There's still quite a gap in in front of new users who want to know ClojureScript better. Any examples you have seen that solves the problem while we still have so many snippets in the first screen?


I think some of the other sites you linked are great examples.

So move the elevator pitch for Clojurescript to the top of the page. "Clojurescript is a compiler for Clojure that targets Javascript" is an explanation technically, but you might want to write something more about why you'd use Clojurescript.

For example, the first words you see on Elm's site are "A delightful language for reliable webapps.". So you'd use Elm to make webapps, and it should be enjoyable to use. Ruby says "A dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write." Note how none of these focus on how the language is implemented; most users don't care. The language could have a compiler written in Brainfuck to compile to Lua, but that's all under the hood.

So write a sentence or two about why a programmer would choose Clojurescript for a task. What kinds of things does Clojurescript do well?

Also, I'd suggest motivating the snippets the way Elm does, where the user isn't left guessing why a snippet is there. It's explicitly explained.


Hard question for me. Trying to reach for help https://clojureverse.org/t/how-do-you-introduce-clojurescrip...


Yes, sure, but if the snippet looks complex people will think "oh - that's too complex for me!" and give up.

PS. why don't you post it on Clojureverse as well? :-)


I posted it on Reddit/Clojure before. People on ClojureVerse read Reddit a lot, I think.


I haven't found a place that explains the big picture and how everything fits together. Is there a good resource to learn clojurescript for someone who's never done web programming and without having to learn JS?

I'm learning Clojure now (coming from years of C++) and I love it. There is a bit of black magic (lein/cider make cmake look like a shell script) but CJS is a bit daunting b/c it has so many layers. CJS on Lumo on React on JS on the DOM ... I don't actually know what any of those words mean :P


I would highly advise newcomers to CLJS to use lein cljsbuild, reagent, and the figwheel template. It is by far the most popular tooling for CLJS - although recently shadow-cljs folks have been quite loud.


I'm definitely one of shadow-cljs folks. We are trying to shorten the steps and paths people coming from JavaScript world to ClojureScript. Figwheel is a great tool, just not a perfect one to people with JavaScript background.


Could you elaborate a little bit on how figwheel is challenging for people with JS background and how shadow-cljs differs?


Try getting Figwheel to work with Emacs CIDER and Spacemacs. It's a joke. This is what you have to go through: https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figw... and at the end of it Spacemacs told me cider-connect-clojurescript was not available. I'm not the only one who's given up on this. Quite a few luminaries in the Clojurescript world have abandoned Emacs/CIDER.


Configuring lein scripts. Debugging JVM problems. Guess how JavaScript developers hate JVM exceptions.


Lein is a declarative build tool. Perhaps your problem lies with not understanding how the tools work?


JVM exceptions, I hated.


Have you tried these tutorials https://github.com/magomimmo/modern-cljs ?



Thanks for making that

btw - what's the Clojure scene like in China?


Not many jobs here. We recently see a company starting meeups in Shengzhen, which can be found on http://clojure-china.org/ . Situation is getting better very slowly.

And we have WeChat group with 200+ people. There are many people interested in Clojure and some of them like me would love to try Clojure(Script) in our own projects.


I could not get leiningen to install under Win10 a week ago, was quite a sobering experience. Some site that was linked to download from got a 404, then I got directed towards some bat script, which complained about HTTPS certification issues (lol)?

Took less than 5 minutes under a linux server though, so thats something, I guess. But still, its kinda mind-blowing how much Win users are ignored.


It‘s a bug in the lein.bat install script. You can fix it by downloading lein.bat and applying the diff in the first comment here: https://github.com/technomancy/leiningen/issues/2412


i really don't see the point of developing anything java-related on windows.

then again, I'm probably just being oblivious.


Fine if you have the option. I shared a house with a Java developer for a corporate bank and he didn't have the choice. His laptop had to be able to log into the corporate intranet and serve as his sole development environment. There are millions of Java developers using Windows so what's your point?


Let me put it this way, Java is OS agnostic and my laptop just works.


I have this exact same problem!

Did you resolve it under windows?

I tried changing the .bat file as suggested and manually putting the zip in a folder, still no luck.


I could not, I just went to the AWS solution instead. Maybe someone solved this and posts it here :D


Well, at least now I don't feel like such a moron. It's good to know someone else had the same issue I did!


I saw David adding commands that Windows users need in the docs. Personally I don't like treating Windows users like how I treated Linux/macOS users. You chose Windows, you chose the hard way, you have to figure it out on you own.

Post your question to http://clojureverse.org/ see if others can help.


"You chose Windows, you chose the hard way, you have to figure it out on you own."

I don't understand this adversial positioning.

If most open source software treats windows as a first class citizen among supported platforms then surely the project that does not follow this suit is the odd man out .. not the users who use windows as their computational substrate.


Feeling difficult to understand your reply as a non-English developer. Anyway it's my personal opinion and I'm not official ClojureScript maintainer. The lead maintainer do care about Windows users.


This kind of thinking is not helpful in maximizing adoption for any technology, period.


Lead developer of ClojureScript here. Agreed, we take Windows support quite seriously.


David, I think the Clojurescript Quick Start guide (https://clojurescript.org/guides/quick-start) is a wasted opportunity. I don't think new users want to wade through a page full of compiler flags when Leiningen + template is the default for most of the Clojure(script) community. This merely adds to the impression that Clojure(script) is for experts.


New users (and experts as well) do not find Leinginen and templates easy to use. The response to the Quick Start has been overwhelmingly positive from new and experienced users.


I personally love the work that you've done in this area recently. I do have the feeling that users are still exposed to quite a bit of plumbing, as they might be used to <command> <declared intention> style commands from elsewhere ("npm install nodemon" or what-have-you).


Well, then I can only say this: ClojureScript is "competing" for developer attention with Purescript, Bucklescript, and lately, ReasonML.

Ease of installation on windows is one factor that will matter to many users.


We don't really compete with PureScript, BuckleScript, ReasonML or even Elm and this is heavily reflected in our surveys. The only real competition at this point is Scala/Scala.js or full stack JavaScript.


Ooh, I did not know this. Thank you for the clarification!


Agreed. David definitely knows that.


> Personally I don't like treating Windows users like how I treated Linux/macOS users. You chose Windows, you chose the hard way, you have to figure it out on you own.

I dunno if you're trolling here (and if so, well done), but this attitude really gets under my skin. Excuse me for ranting at you, but I need to get this off my chest.

I think that this attitude is harmful to open source projects, and to projects of all kinds. In my experience, the people who use Windows usually haven't 'chosen' Windows; that decision was made for them by bureaucracy or money or time.

I go to a state university in a metro area, and roughly 90% of the people in my CS program use Windows. These kids have part-time jobs and families who need them. They commute over an hour each way to get to school, because they can't afford rent in the city. They don't have the cash to drop on a Mac. A lot of them are still on their first laptop, which they got back in high school, chosen for them by well-meaning parents with no clue about arcana like driver compatibility. It's probably got a smallish HDD, or a tiny SSD, barely enough space for a VM and Visual Studio (which, by the way, a mandatory class requires). This laptop is their primary and only computer, and it runs Windows. Maybe it'd run Linux too, if you didn't mess up the install. You wanna toss those dice with your only tool for getting your homework done on time?

And the intrepid few who do slap Linux on their computer pay for it, with their time. Every single Linux User Group meeting we have someone who comes in asking how to set up their laptop with the school wifi. These are smart people, often with graduate degrees, who struggle with wpa-supplicant et al; and we aren't even talking Arch here, just as many issues come up with Ubuntu. Windows Just Works (TM), in a way that Linux doesn't, and probably never will (and even really probably shouldn't). Linux may be free as in freedom, but it's not free as in beer, not if time is money.

So this is just one subset of the people you're targeting when you support the 82% [0] of computer users who use Windows. And I understand completely that Windows is a deeply unfun system to support. But supporting Windows is going to open up all kinds of contributors from nontraditional backgrounds to your project. Studies show that diverse teams are more creative [1] and, in a business context, more profitable [2]. (Side note: looking at that Wikipedia page, maybe it's time to support a first-class IDE for Android?)

These are the users you most desperately want to attract to your project, the ones who think differently than you do, who come from different backgrounds and whose ideas are shaped by different experiences than you. There are all kinds of initiatives going on right now (LLVM, for example [3]) to attract a more diverse open source developer base, and I think that's great. Supporting Windows is one more way to achieve that.

[0] https://en.wikipedia.org/wiki/Usage_share_of_operating_syste...

[1] https://www.gsb.stanford.edu/insights/diversity-work-group-p...

[2] https://www.credit-suisse.com/corporate/en/media/news/articl...

[3] http://blog.llvm.org/2018/03/international-womens-day-celebr...


>Linux may be free as in freedom, but it's not free as in beer, not if time is money

Open source project developers which are not funded are also spending their valuable time to create something. Giving them grief for not supporting an platform (one that especially is anti-open) like windows is also not productive.

When software corporations push their software using their market power in adversarial fashion, some open source devs may opt to be adversarial in not choosing to support the platforms. It is a way to combat fire with fire.

Microsoft played major role in suppressing desktop linux with its adversarial, monopolistic policies pushing windows which is the reason why many people are robbed of choice.

I don't know why the open source developers who spend time giving something to the community should bear the brunt of evils of corporations.

This is similar to large corporations (who pollute everywhere because it would affect their profit margins not to) love movements like Go Green , etc (which are important in individual level ) as they divert attention and guilt to the consumer when the company could have done otherwise.


The official team does value Windows users.

For me, I'm a web developer. And we all know how web developers hate Internet Explorers. I was a Ubuntu users in my first years learning programming before I got a macbook. There are always reasons for me to hate Windows, even though Windows has majority of the users.


I've been learning Clojure and ClojureScript in my spare time. I can honestly say that one thing that would make adoption a lot more wide-spread is a better way to include NPM modules in the project.

I know that there is a new feature for it, but the documentation was a little cryptic. Ended up just adding some CLJSJS dependencies to my project and giving up on using the NPM module I _really_ wanted to use.

In the end, that could be because i'm just lazy, though. I'd love to hear what others think on this topic.


Support for NPM modules out of the box is a hot topic in the cljs community, imo things have greatly improved even in the past few months.

Checkout https://github.com/anmonteiro/lumo And https://andrearichiardi.com/blog/posts/lumo-npm-dependencies...


NPM basically does not work with the standard Clojurescript compiler. I would avoid mentioning this topic around newbies, as it will only result in frustration.


Try shadow-cljs https://news.ycombinator.com/item?id=16866085 you want npm modules in ClojureScript and you get npm modules in your ClojureScript. If not, then I'm quite sure you can get help from thheller who created shadow-cljs.


I'll have to look at that. It may provide a solution to my problems.

Does shadow-cljs integrate well into an existing figwheel/reagent project?


I use shadow-cljs as a replacement of figwheel. shadow-cljs is quite powerful already, in development and bundling.


oh, its a _replacement_ for figwheel. Gotcha. In that case, I'll take a look and get it going.

Thanks!


Been working on a cljs project and took me a solid week to get npm integration working. The documentation is either wrong or incomplete on both the official site and the wikis for lein/boot.


Still, please try shadow-cljs https://news.ycombinator.com/item?id=16866085 and join us on Slack.


Yep, that's what I ended up discovering and going with.

However, shadow-cljs REPL integration was also pretty hard to get working with my editor (spacemacs), because most of the tutorials assume you're using lein to build your project.

shadow-cljs is pretty dope though. Almost instantaneous rebuild times and basically no setup besides a small, understandable config file.


It's helpful to post doc problems / questions on the clojurescript-site issues so that it can be improved.

https://github.com/clojure/clojurescript-site/issues


i think the underlying problem is that the documentation is incomplete and/or outright incorrect.

CLJSJS was a life-saver for me, at least.


Work on this is still ongoing. Clojurescript had to upstream a lot of module-handling code into Google Closure to get it going, and older, non-Node/ES6 module libs will never work under advanced-mode compilation (e.g., polyfills).


I really had high hopes for Clojurescript but I tried many times to get my front-end finished in Reagent but the documentation was useless. In the end I turned to React and, with the help of a good, detailed video tutorial, I had it finished in a week. Ecosystem really matters and I find that Clojurescript, despite its innovations, is still too bits and pieces when it comes to just getting stuff done. I never thought I'd give-up on Clojurescript but eventually I did.


great job, it’s pretty hard to sell clojurescript withoit any context(I mean, somebody tell you his success story or explain why it is good). To make who comes here adopt on clojurescript, I think this page should have some links on sucess story or open source applications. And it will be more attractive if it has more logos here, instead of plan text links IMO.


Thanks. The official sites might be the better place doing that. I'll see what I can do on my side as well.


It's been a while since I've worked with ClojureScript. I was excited to learn about lumo. Thanks.


Make sure you also know the goodies in shadow-cljs https://news.ycombinator.com/item?id=16866085


On the whole, great work! Something like this is definitely needed to make cljs more approachable.


Is it possible to develop CLJS without needing the JVM yet?


Still figuring out the keybindings for spacemacs... after mastering it, I'll have a look at Clojure & ClojureScript. CU in 2020


Nightcode, Nightlight, Nightcoders are programming environments specifically made for clojure/clojurescript.

http://nightcoders.net/ https://sekao.net/nightlight/ https://sekao.net/nightcode/


Kidding... easy start documentation for it is really needed


You could try Cursive - a plug-in for Inellij Idea. Unfortunately most tutorials suggest emacs, which is not very good for quick start.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: