in progress
Well, this bold title draws inspiration from Seven Languages in Seven Weeks1 (2010) and Seven More Languages in Seven Weeks2 (2014), two books that explore programming paradigms in the "Seven in Seven" series. Those books introduce languages one by one, or sequentially. This post, however, adopts a parallel approach, meaning that selected eight of the fourteen languages will be covered simultaneously at each stage of learning.
Seven Languages in Seven Weeks: A Pragmatic Guide to Learning Programming Languages by Bruce A. Tate
All 14 programming languages mentioned are:
- Ruby
- Io
- Prolog
- Scala
- Erlang
- Clojure
- Haskell
(the first seven) - Lua
- Factor
- Elm
- Elixir
- Julia
- miniKanren
- Idris
(the second seven)
As can be observed, some of them are well-known and popular today, with their killer applications, while others are less prominent. But, since 14 languages might be a bit too many and some of them share similar characteristics, the scope has been narrowed down to 8 featured languages (all right, based on my consideration and preference). These are listed and described below.
- Ruby
dynamically typed, interpreted, garbage collection, everything-objected, first appeared in 1995 - Prolog
untyped, both interpreted and compiled, logic programming, many implementations, first appeared in 1972 - Clojure
dynamically typed, compiled, garbage collection, dialect of Lisp, first appeared in 2007 - Haskell
statically typed, both interpreted and compiled, purely functional, first appeared in 1990 - Lua
dynamically typed, interpreted, first appeared in 1993 - Factor
dynamically typed, compiled, stack-based, functional, garbage collection, first appeared in 2003 - Elm
statically typed, compiled to JavaScript, purely functional, domain-specific, first appeared in 2012 - Julia
dynamically typed, compiled, first appeared in 2012
The goal is not to master each of the eight languages in such a short time, but to appreciate their quirks and subtleties. This will also support deeper use and study later on. Before diving in, reading the introduction chapter of Seven Languages in Seven Weeks is highly recommended.
All these languages were entirely unfamiliar to me until this experience, except for Julia, which I had briefly encountered.
Week 1
Get Started
To begin, here is a list of the 8 languages with their main websites. Let's set up 8 development environments in this way. The hardware used consists of two common laptops, running macOS® (ARM64) and Windows® (x86_64), respectively.
- Ruby Programming Language
- The GNU Prolog web site (one of the Prolog implementations)
- Clojure
- Haskell Language
- The Programming Language Lua
- Factor programming language
- Elm - delightful language for reliable web applications
- The Julia Programming Language
Thanks to modern advancements in package managers such as Homebrew for macOS and Scoop for Windows, installations have been significantly simplified. It is assumed that at least one package manager is already available. Nevertheless, some manual operations will also be included when necessary.
It is time to download and deploy the latest distributions.
Only the content followed by >
is command input, and the rest is the output.
- Ruby
Although you can easily try Ruby in your browser, you can also read the installation guide for help on installing Ruby. —Ruby Documentation
> brew
==> Downloading
> scoop install ruby
Installing 'ruby' (3.3.6-2) [64bit] from 'main' bucket
...
Check the situation by inspecting version.
> ruby
)
Ruby may be pre-installed on some systems. It looks like the issue of multiple Ruby versions co-existing on macOS needs to be solved.
An advanced way to do this is to use rbenv
or Ruby Version Manager(RVM)
, for managing Ruby environments. Or configure the shell environment manually.
This appends a PATH
to the file .zshrc
to set the Ruby installed by Homebrew to a higher priority. Then, restart the terminal and check the version again.
> ruby
)
On the other hand, it works well on Windows.
> ruby -v
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [x64-mingw-ucrt]
- (GNU) Prolog
We provide both source and binary distributions for GNU Prolog. —The GNU Prolog web site
> brew
==> Downloading
> gprolog
)
)
|
This shows that the Prolog runtime has been successfully installed.
For Windows, simply download and run the auto-installer.
- Clojure
Clojure (the language) is provided as a Java ARchive (JAR) file, available in the Maven Central Repository, a public repository for JVM-based artifacts. If needed, you can find more detailed version information on the Releases page. —Clojure Guides
> brew
==> Downloading
> clojure
user=>
For Windows, to avoid using Windows Subsystem for Linux(WSL)
, download and run the installer from clj-msi
, a Clojure installer.
> clojure
Downloading: org/clojure/clojure/1.12.0/clojure-1.12.0.pom from central
...
Clojure 1.12.0
user=>
This shows that Clojure is ready.
- Haskell
Welcome, new Haskeller!
A complete Haskell development environment consists of the Haskell toolchain (compiler, language server, build tool) and an editor with good Haskell support. —Haskell Get started
Use GHCup to install GHC, cabal-install, Stack and haskell-language-server, instead of installing GHC directly or deprecated Haskell Platform
.
> brew
==> Downloading
To install on Windows, the homepage of GHCup provides following PowerShell script.
> Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; try catch
Picked C:\ as default Install prefix!
Welcome to Haskell!
This script can download and install the following programs:
...
Run and then fill in its options. Also, check the setup.
> ghcup
- Lua
Use the live demo to play with Lua if you don't want to install anything on your computer. To run Lua programs on your computer, you'll need a standalone Lua interpreter and perhaps some additional Lua libraries. —Lua: getting started
> brew
==> Downloading
> scoop install lua
Installing 'lua' (5.4.7-2) [64bit] from 'main' bucket
...
Test the command line REPL environment of Lua.
> lua
)
>
- Factor
Binary packages are the recommended route for new users who wish to try Factor. —factorcode.org
It is only released, however, for x86_64 on macOS. So, Rosetta 2 is necessary.
> brew
==> Downloading
zsh: command not found
? Configure the PATH
for one's shell environment.
> echo
To set up on Windows, download and run the self-installing executable.
Test the command line REPL environment of Factor.
> factor
)
)
- Elm
...Things are going well, but we need to get Elm working on your computer for the next couple sections! —Elm Introduction Guide
> brew
==> Downloading
> scoop install elm
Installing 'elm' (0.19.1) [64bit] from 'main' bucket
...
Try to call command help messages.
> elm
- Julia
Julia installation is straightforward, whether using precompiled binaries or compiling from source. Download and install Julia by following the instructions at https://julialang.org/downloads/. —Julia Documentation
> brew
==> Downloading
> scoop install julia
Installing 'julia' (1.11.2) [64bit] from 'main' bucket
...
Test the command line REPL environment of Julia.
> julia
|
) () | () ) |
| | |
| | | | | | |
Finally, one or more code editors (or IDEs) are required to handle the composing of above languages. Here, Visual Studio Code and its extensions for these languages will be used, but a detailed setup guide is not included, as readers are encouraged to explore and configure them.