Live data from Hacker News

ClojureScript 101

swannodette.github.io

11–20 of 45 posts

Re: ClojureScript 101

#11

If there's something in the tutorial that trips anyone up or doesn't make sense please let me know and I will amend. I'm pretty excited about the latest release of ClojureScript that makes all this possible. With respect to speed of incremental compiles, code size, performance of generated code, and debugging we're finally in a good place (with of course many improvements planned in the near future). None of this wou…

Couldn't really get started (with the latest clean install of leiningen from homebrew). $ lein cljsbuild auto async-tutl ... java.lang.Exception: Unknown build identifier: async-tutl Did the name of the tutorial change? edit: ell instead of 1. I guess that's why I use a heavily-serifed font for my coding. I even re-read the command several times looking for a simple typo to catch exactly this problem.

The project is async-tut1 not async-tutl. Look at your project.clj.

Re: ClojureScript 101

#12

If there's something in the tutorial that trips anyone up or doesn't make sense please let me know and I will amend. I'm pretty excited about the latest release of ClojureScript that makes all this possible. With respect to speed of incremental compiles, code size, performance of generated code, and debugging we're finally in a good place (with of course many improvements planned in the near future). None of this wou…

Perhaps note that scripts should be loaded after form elements. You get an odd error if (init) runs before the form elements exist.

Re: ClojureScript 101

#13
Is there a maintained web page or cheat sheet somewhere that lists the functions and macros unique to ClojureScript?

The API Overview[1] page for Clojure itself is great, and many of those facilities are 1-to-1 in cljs. For individual libs, like core.async, it's easy enough to go look in the cljs namespaces (i.e. the source code) to see what's available.

But it seems there are at least several important facilities unique to ClojureScript and it would be great if they were spelled out somewhere readily accessible and linked to from the main README[2]. Digging through the source is a bit more challenging given that there's more to wade through than for individual libs.

[1] http://clojure.github.io/clojure/

[2] https://github.com/clojure/clojurescript/blob/master/README....

Re: ClojureScript 101

#15

Is there a maintained web page or cheat sheet somewhere that lists the functions and macros unique to ClojureScript? The API Overview[1] page for Clojure itself is great, and many of those facilities are 1-to-1 in cljs. For individual libs, like core.async, it's easy enough to go look in the cljs namespaces (i.e. the source code) to see what's available. But it seems there are at least several important facilities un…

For example: I'm aware of 'js*', but where is it defined? Where is it documented? Does it have any "gotchas" that are explained somewhere?

Re: ClojureScript 101

#17
Thank you for such a straightforward train I thought/workflow post. Would love to see something detailing how to deal with state in clojurescript. Use atoms? Pass the world in and return it modified? Dispatch within go funcs using symbols at the head of lists?

Re: ClojureScript 101

#18

If there's something in the tutorial that trips anyone up or doesn't make sense please let me know and I will amend. I'm pretty excited about the latest release of ClojureScript that makes all this possible. With respect to speed of incremental compiles, code size, performance of generated code, and debugging we're finally in a good place (with of course many improvements planned in the near future). None of this wou…

I love this example. Working through this made me finally get started on reading Hoare's CSP book. Thanks!

Re: ClojureScript 101

#19
post #16
post #14

Great write up. ClojureScript 102 should be how to get a REPL running ;)

Could you please do one that explain how to actually debug in CLJS.

Using `lein cljsbuild auto` should enable you to see problems in your clojurescript code as soon as you save it, and using the browser's js console enables you to see problems in the compiled/generated js. The stack trace printed out in case of an exception is usually informative enough. I experienced its helpfulness quite recently during my study of OP's example.

Re: ClojureScript 101

#20
Since this is supposed to be a 101 tutorial, could you please add (maybe in a later episode) some info on debugging and on parsing the stack trace.

When I add the text

    1+"
to core.clsj and have auto compile running, I get a gigantic stack trace but none of the entries points me to the line where the error occured. I wonder how people are supposed to handle a code base bigger than a few lines of code and I stop following the tutorial before having written a single line of clojurescript.
Post reply on HN