Git Product home page Git Product logo

hello-clojure's Introduction

Easy setup instructions for a simple Clojure Repl

DISCLAIMER: following the steps below will give you a simple Clojure "installation" with a Repl, and you will be able to run Clojure files. It will be good enough for the first simple steps. After getting first experiences with the simple setup described here you may want to switch to a "real" Clojure setup that includes all Clojure tools and features such as dependency management and most importantly: debugging (which this simple setup does NOT support). Also: some commandline skills are required.

Why?

Getting started with Clojure seems to take considerable effort. I knew some Lisp and was mildly interested in Clojure but figuring out what to install to get started was somewhat difficult. And after figuring out what to install I would have to actually install all the stuff as well!

It turned out that just to run a "Hello, World!" program or to type a few Clojure forms into a Repl you don't need all that stuff. A JRE or JDK and three Jar files is enough to get started, no installation required, the simple steps to do this are described below.

This will be good enough to get a first view of Clojure, type some code in the Repl, and run moderately simple Clojure programs (see e.g. hello.clj for the famous "Hello, World!" program or sieve_8_bit.clj for a more sophisticated program). No immediate need to figure out leiningen, tools.deps, deps.edn and all the other tools. (Although at some point you may want to visit https://clojure.org/guides/getting_started for instructions on how to do a full Clojure setup.)

Maybe the simple steps given below are even useful for experienced Clojurians, e.g. to try out a new alpha version without changing their current setup, or to run some Clojure on a computer where they can't or won't install stuff, or to experiment with different Java settings in a "sandbox" without affecting their main Clojure installation.

NOTE: Some commandline skills are required for the steps below, so this will not be for everyone. Also: the steps below are for Windows, but adapting to another OS shouldn't be too hard.

How?

The short version of "from nothing to a working Clojure Repl" is:

  • have or download a JRE or JDK
  • download three Clojure Jar files
  • run java -cp clojure-N.NN.N.jar;spec.alpha-N.NN.N.jar;core.specs.alpha-N.NN.N..jar clojure.main
    or run java -cp clojure-N.NN.N.jar;spec.alpha-N.NN.N.jar;core.specs.alpha-N.NN.N..jar clojure.main hello.clj
  • Profit!

The detailed version of the above is:

License

PrimeClojure.clj and sieve_8_bit.clj were copied from https://github.com/PlummersSoftwareLLC/Primes and are licensed under the BSD-new/BSD-3 license, the remaining files in this repo are licensed under the Unlicense license.

Have fun!

Cheers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.