dyslexic
edit
qrcode
+=-

Language and Editor Notes


Let me know if a link is broken or if you found something interesting that should be added to this list!

ANTLR


Smalltalk / Pharo #


Prolog #


Graphviz / DOT #


Haskell #


Various Articles and Links


Esoteric Languages

Befunge: Hello, World!

<                 v
v"Hello, World"+64<
  >,v
>:| >
  @

Software Packages to Install #


The instructions below walk you through installing on Ubuntu all the software that we will be using throughout the course. In the next section, the instructions walk you through setting up IntelliJ to use ANTLR v4.

Available via Ubuntu/Debian Package Manager

 # Programming Languages
sudo apt install gnat           # Ada
sudo apt install mono-mcs       # C# (Mono)
sudo apt install golang-go      # Go
sudo apt install ghc            # Haskell
sudo apt install nodejs         # Javascript
sudo apt install perl           # Perl
sudo apt install swi-prolog     # Prolog (swipl)
sudo apt install python3        # Python 3 (not 2!)
sudo apt install ocaml          # OCaml
sudo apt install ruby           # Ruby
sudo apt install rustc          # Rust
sudo apt install racket         # Scheme

IntelliJ

Get the latest version of the Community Edition of IntelliJ from the download page.

ANTLR

Follow the directions under IntelliJ+ANTLR Set Up section.

Pharo

Pharo comes as a standalone VM and the VM image. I found the Command Line section worked well (download).

mkdir pharo && cd pharo                     # create folder for Pharo
wget -O- "https://get.pharo.org/64" | bash  # download 64bit version
./pharo-ui                                  # test

Language Resources


We will be using the following language implementations.

You are welcome to work with other language implementations and/or platforms, but you must ensure that your final versions compile and run correctly using the implementations listed above. We will be testing using only these.

I won't be devoting lecture time to show how to use these languages. You'll need to find on-line tutorials or other resources and teach yourself. Here are some decent starting points:

IntelliJ+ANTLR Set Up #


There are two options for installing the ANTLR 4 plugin into IntelliJ. The easiest option is to search the Marketplace in IntelliJ's Plugin editor. Alternatively, you can install the plugin directly.

After you have installed the plugin, you will need to add the ANTLR runtime to your project.

Finally, ANTLR will convert your grammar into a set of Java files containing the lexer and parser for your grammar (along with some additional files for listening or visiting while parsing). These files are generated under a gen folder, which IntelliJ will not see as source code. You will need to mark the folder as Sources Root or move the Java files to the src folder.

Installing ANTLR 4 Plugin Through Marketplace (Option 1)

If you are at the "Welcome to IntelliJ IDEA" screen, choose "Plugins" on the left. If you are already in a project, open the main menu (under the hamburger menu in top-left), click "Settings" under "File", then choose the "Plugins" option on the left. When in the Marketplace under Plugins, search for and install "ANTLR v4". You will need to restart IntelliJ after the plugin is installed.

Installing ANTLR 4 Plugin Directly (Option 2)

  1. Download latest version of ANTLR4 plugin

    1. Go to ANTLR v4 grammar plugin site
    2. Click Get button in top-right corner
    3. Download the latest version
  2. Install plugin into IntelliJ

    1. Open IntelliJ project
    2. FileSettings
    3. Choose Plugins on left
    4. Click Install plugin from disk...
    5. Browse to your Downloads folder, select antlr-intellij-plugin-v4-*.zip, press OK
    6. Press OK
    7. Press Restart to restart IntelliJ

Including ANTLR 4 Libraries in Project

The ANTLR runtime can be downloaded from this page, just under the ANTLR tool and Java Target. You can use any of the jar files.

Note: you need to download the version that matches the ANTLR version of the plugin. For example, around 2024.06.03, the ANTLR IntelliJ plugin version is 4.13.1, but the latest ANTLR runtime version is 4.13.1.

There are two ways to add the ANTLR4 Java Runtime to your project. One way is...

  1. Copy the ANTLR runtime to your project's folder
  2. Open IntelliJ
  3. Right-click on the ANTLR runtime
  4. Choose Add as Library
  5. Press OK

The second way is...

  1. Open IntelliJ project
  2. FileProject Settings
  3. Choose Libraries on left
  4. Click +, choose Java
  5. Browse to and select the antlr-runtime-4*.jar file (not v3, if exists) either
    • under the path ~/.IdeaIC*/config/plugins/antlr-intellij-plugin-v4/lib/ (need to click the eye icon at top to show hidden files and folder), or
    • under the downloads folder where do downloaded the ANTLR runtime
  6. Press OK+

Including ANTLR-Generated Source in Project

After generating ANTLR Recognizer source code by right-clicking on .g4 file and choosing Generate ANTLR Recognizer, ...

  1. ANTLR Plugin will create .java files, placing them under gen folder
  2. Right click on the gen folder,
  3. Select Mark directory as
  4. Select Sources Root