Introduction to ClojureScript

Some syntax

Generating a Hoplon project

Generate a new Hoplon project. Run the following command on a terminal:

boot -d boot/new new -t hoplon -n clojurescript-intro

Running the project in development mode

Change your directory to the project:

cd clojurescript-intro

And run:

boot dev

After the code is compiled open your browser and go to http://localhost:8000. You should see "Hello Hoplon!" in blue.

Screenshot with \
Screenshot with "Hello Hoplon" header

Some resources

I recommend that you keep the Clojure Cheat Sheet open at all times when you are learning Clojure/ClojureScript. Clojure and ClojureScript have different targets and so host language interop is not the same. But the core language itself is the same. The cheat sheet is searchable, has tooltips with docstrings and if you open the links you will find examples of usage for most functions/macros.

There is also a ClojureScript Cheat Sheet that focus on ClojureScript itself and has a section on JavaScript interop.

You may be asking yourself: what is interop? Interop is an abbreviation for interoperation. Since ClojureScript is a hosted language we have the option of