The following section includes a summary of how to install a variety of programming languages and check that they are installed and working, and includes
- XCode
- XCode command line tools
- Homebrew
- C
- C++
- Java
- Scala
- Clojure
- Common Lisp
- Prolog
- Node.js & NPM
- Typescript
- Ruby
- Rust
- Haskell
- Elixir
- Kotlin
Install Xcode
This simplest and easier way to get XCode which then gives you Swift, C, C++, Objective-C is to install XCode from the App store.

install Xcode Command Line Tools
- Go to Terminal in /Applications/Utilities/
- Input the following command string in Terminal:
xcode-select -—install
- In the same way that you are downloading new software and apps, a popup update window will appear asking you: “The xcode-select command requires the command line developer tools. Would you like to install the tools now?”
- Select confirm by clicking Install.
- Wait for the Xcode Command Line Tools package to install. It is around 130 MB and usually installs fairly quickly, although it depends on your connection.
- Once everything is installed, the installer goes away, and you should be able to access any of the new commands that you’ve now got access to. Enjoy using your new Unix command line tools!

Homebrew
Homebrew is the default package manager for OSX, head over to https://brew.sh/ and follow the instructions on the home page

It’s as simple as using the following command
1 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) |
Once installed you can simply test it by checking the version and then running ‘brew update’ and ‘brew upgrade’
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | ➜ ~ brew --version Homebrew 4.0.15 ➜ ~ brew update Updated 1 tap (homebrew/cask). ==> New Casks active-trader-pro logitech-options bluos-controller macwhisper cameracontroller openbb-terminal : : : : logitech-camera-settings yubico-authenticator logitech-g-hub yubico-yubikey-manager ==> Outdated Formulae vim You have 1 outdated formula installed. You can upgrade it with brew upgrade or list it with brew outdated. ➜ ~ brew upgrade ==> Upgrading 1 outdated package: vim 9.0.1400 -> 9.0.1450 ==> Fetching vim ==> Downloading https://ghcr.io/v2/homebrew/core/vim/manifests/9.0.1450 ################################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/vim/blobs/sha256:729599914835c55920c2cec1 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:72959 ################################################################################### 100.0% ==> Upgrading vim 9.0.1400 -> 9.0.1450 ==> Pouring vim--9.0.1450.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/vim/9.0.1450: 2,146 files, 38.4MB ==> Running `brew cleanup vim`... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). Removing: /opt/homebrew/Cellar/vim/9.0.1400... (2,146 files, 38.4MB) Removing: /Users/keith.s/Library/Caches/Homebrew/vim--9.0.1400... (12.7MB) ➜ ~ |
C/C++
C & C++ are both included in the standard XCode install and are available on the command line as clang and GCC respectively
1 2 3 4 5 6 7 8 9 10 11 12 13 | ➜ ~ clear ➜ ~ clang --version Apple clang version 14.0.3 (clang-1403.0.22.14.1) Target: arm64-apple-darwin22.4.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin ➜ ~ gcc --version Apple clang version 14.0.3 (clang-1403.0.22.14.1) Target: arm64-apple-darwin22.4.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin |
Java
Java consists of the compiler ‘javac’ and the virtual machine (JVM ) ‘java’. You can install just the JVM by installing the JRE ( Java Runtine Engine ) but as we are going to develop with Java we need the full SDK.
There is a great description of how to install Java at https://adamtheautomator.com/install-java-on-mac/ which is as simple as
1 | brew install java |
And then to check it installed
1 2 3 4 5 | ➜ ~ java -version openjdk version "20" 2023-03-21 OpenJDK Runtime Environment Homebrew (build 20) OpenJDK 64-Bit Server VM Homebrew (build 20, mixed mode, sharing) ➜ ~ |
Scala (JVM)
Now we have Java we can install a number of other JVM languages, the first of these is Scala. Detailed instructions can be found at
https://www.scala-lang.org/download/ and is basically
1 | brew install coursier/formulas/coursier && cs setup |
And to check it works and installed
1 2 | $ scala -version Scala code runner version 3.2.2 -- Copyright 2002-2022, LAMP/EPFL |
Clojure (JVM)
Clojure is a variant of the Lisp family, runs on the JVM and is great for web-based development if you put the effort into learning Lisp ways of doing things. Detailed install instructions can be found at https://ericnormand.me/guide/how-to-install-clojure#mac-leiningen-1. Clojure ideally needs leiningen installed as its build/toolchain, so there are a number of steps to jump through to get it installed and working correctly
First we install leiningen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | $ brew install leiningen ==> Formulae leiningen ➜ /Users brew install leiningen ==> Downloading https://formulae.brew.sh/api/formula.jws.json : : ==> leiningen Dependencies will be installed to: $HOME/.m2/repository To play around with Clojure run `lein repl` or `lein help`. zsh completions have been installed to: /opt/homebrew/share/zsh/site-functions ➜ /Users lein version Leiningen 2.10.0 on Java 20 OpenJDK 64-Bit Server VM |
Next clojure tools themselves
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | $ brew install clojure/tools/clojure ==> Fetching dependencies for clojure/tools/clojure: rlwrap ==> Fetching rlwrap ==> Downloading https://ghcr.io/v2/homebrew/core/rlwrap/manifests/0.46.1 ######################################################################################################################################################################## 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/rlwrap/blobs/sha256:6cc64e120040bde8ff3680d02a5233073756f3a9ecfa159230636574747be809 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:6cc64e120040bde8ff3680d02a5233073756f3a9ecfa159230636574747be809?se=2023-04-26T09%3A30%3A0 ######################################################################################################################################################################## 100.0% ==> Fetching clojure/tools/clojure : : ==> Installing clojure/tools/clojure ==> ./install.sh /opt/homebrew/Cellar/clojure/1.11.1.1273 🍺 /opt/homebrew/Cellar/clojure/1.11.1.1273: 11 files, 19.5MB, built in 3 seconds ==> Running `brew cleanup clojure`... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). |
Test Clojure is installed by running the REPL
1 2 3 4 5 6 7 8 9 10 11 | ➜ /Users clj Downloading: org/clojure/clojure/1.11.1/clojure-1.11.1.pom from central Downloading: org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.pom from central Downloading: org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.pom from central Downloading: org/clojure/pom.contrib/1.1.0/pom.contrib-1.1.0.pom from central Downloading: org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar from central Downloading: org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar from central Downloading: org/clojure/clojure/1.11.1/clojure-1.11.1.jar from central Clojure 1.11.1 user=> ( + 2 2) 4 |
And run the lein REPL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ➜ /Users lein repl Retrieving nrepl/nrepl/1.0.0/nrepl-1.0.0.pom from clojars Retrieving org/nrepl/incomplete/0.1.0/incomplete-0.1.0.pom from clojars Retrieving nrepl/nrepl/1.0.0/nrepl-1.0.0.jar from clojars Retrieving org/nrepl/incomplete/0.1.0/incomplete-0.1.0.jar from clojars nREPL server started on port 55474 on host 127.0.0.1 - nrepl://127.0.0.1:55474 REPL-y 0.5.1, nREPL 1.0.0 Clojure 1.11.1 OpenJDK 64-Bit Server VM 20 Docs: (doc function-name-here) (find-doc "part-of-name-here") Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) Results: Stored in vars *1, *2, *3, an exception in *e user=> |
Common Lisp
Common Lisp has been around for long time but is a great implementation of Lisp. Full details can be found at :https://formulae.brew.sh/formula/clisp
1 2 3 4 5 6 7 8 9 | $ brew install clisp ==> Downloading https://formulae.brew.sh/api/formula.jws.json ##O=-# # ==> Downloading https://formulae.brew.sh/api/cask.jws.json ##O=-# # Warning: clisp 2.49.92_1 is already installed and up-to-date. To reinstall 2.49.92_1, run: brew reinstall clisp $ |
Prolog
See install details at: https://www.swi-prolog.org/build/macos.html
1 2 3 4 | $ brew install swi-prolog swi-prolog 9.0.4 is already installed and up-to-date. To reinstall 9.0.4, run: brew reinstall swi-prolog |
Node.js
1 2 | Brew install nodejs Brew install rpm |
Typescript
1 | npm install -g typescript |
Ruby
https://mac.install.guide/ruby/13.html
Ruby is already installed on the Mac, but its version 2.x. To upgrade we need to brew install 3.x version and then modify the path
1 | brew install ruby |
And then add the following to your shell rc file
1 2 3 4 | if [ -d "/opt/homebrew/opt/ruby/bin" ]; then export PATH=/opt/homebrew/opt/ruby/bin:$PATH export PATH=`gem environment gemdir`/bin:$PATH fi |
Here is an example of editing the .zshrc file, sourcing it and then checking new version is in place
1 2 3 4 | $ vi ~/.zshrc $ source ~/.zshrc $ ruby --version ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22] |
Rust
Full details on installing Rust onto your mac can be found on the Rust install home page https://www.rust-lang.org/tools/install, and is as simple as the following command and a shell reboot
1 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
Then check its working by checking its version
1 2 | $ rustc --version rustc 1.69.0 (84c898d65 2023-04-16) |
Kotlin
https://kotlinlang.org/docs/command-line.html#homebrew
1 | brew install kotlin |
And then check its working…
1 2 | $ kotlinc -version info: kotlinc-jvm 1.8.21 (JRE 1.8.0_292-b10) |
Haskell
Like most of the languages in this page, the easiest way to install is using Homebrew. Full details can be found at https://www.haskell.org/ghcup/
1 | curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh |
And then check its version and its working
1 2 3 4 | $ ghci -version ghc-9.2.7: on the commandline: malformed integer argument in -version Usage: For basic information, try the `--help' option. $ |
Carbon
Carbon is an experimental language from Google aimed at replacing C++. Its still in early dev stage but is functional and working, but takes a bit of effort to get installed. I added a blog page with more details here, basically its following these commands
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | $ brew install bazelisk $ brew install llvm $ vi ~/.zshrc # Add the following lines and source the rc file to reload export PATH="/opt/homebrew/opt/llvm/bin:$PATH" export LDFLAGS=”-L/opt/homebrew/opt/llvm/lib” export CPPFLAGS=”-I/opt/homebrew/opt/llvm/include” export CC=$(which clang) $ mkdir ~/Carbon; cd ~/Carbon $ git clone https://github.com/carbon-language/carbon-lang $ cd carbon-lang # Run Hello, World to check its working $ bazel run //explorer ./explorer/testdata/print/format_only.carbon |