Skip to content

Getting started

Nicolas Cardozo edited this page Aug 10, 2020 · 2 revisions

Tools and basic environment

The courses uses two different languages to explore three basic programming paradigms.

Object-oriented and Functional Programming

Mozart is used for the development of the object-oriented and functional programming sections of the course.

The Mozart development IDE is based on Emacs. In particular we Aquamacs throughout the course, together with the OZ run-time environment. We will be using Mozart version 2.0.0.

Installation

Mac OS

  1. Download aquamacs: http://aquamacs.org
  2. Download Oz: https://sourceforge.net/projects/mozart-oz/files/

You may need to create the symbolic links to aquamacs for it to work.

ln -s /Applications/"Aquamacs Emacs".app /Applications/Aquamacs.app ln -s /Applications/"Aquamacs Emacs".app/Contents/MacOS/Aquamacs /Applications/Aquamacs.app/Contents/MacOS/"Aquamacs Emacs"

Windows

  1. Download Emacs (emacs-22.3-bin-i386): http://ftp.gnu.org/gnu/emacs/windows/
  2. Put the extracted directory to C:\Program Files (x86)
    1. Change the name of the root directory to Emacs
    2. Change the name of the inner directory to emacs
  3. Download Oz: https://sourceforge.net/projects/mozart-oz/files/
  4. Add the OZ and Emacs environment Variables
    1. Go to Control Panel\System and Security\System and select Advanced system setting
    2. In Environment Variables set:
      1. OZEMACS to C:\Program Files (x86)\Emacs\emacs\bin\runemacs.exe

Online

You may want to use the web version of the IDE https://www.tutorialspoint.com/compile_mozart-oz_online.php or https://www.jdoodle.com/compile-oz-mozart-online/

VSCode

Alternatively, you may install the vscode-oz package for visual studio code

Basic commands

  • Ctrl . + e -> Display the Emulator
  • Ctrl . + c -> Display the compiler console
  • Ctrl . + Ctrl l -> Execute the current line
  • Ctrl . + Ctrl r -> Execute the selected section
  • Ctrl . + Ctrl b -> Execute the complete buffer

Logic Programming

Prolog is used for the logic programming section of the course

Installation

Mac OS

  1. Method 1: Download SWI (7.6.4): http://www.swi-prolog.org/download/stable
  2. Method 2:
    1. brew install swi-prolog
    2. use swipl from the terminal
  3. Method 3: install vsc-prolog plugin on VisualStudio Code.

Windows

  1. Download SWI (7.6.4): http://www.swi-prolog.org/download/stable

Online

You may also use the web IDE at: https://swish.swi-prolog.org

VSCode

Alternatively, you may install the prolog package for visual studio code