Racket, install this programming language in Ubuntu

about racket

In the next article we are going to take a look at Racket. This is a Lisp-based general-purpose programming language. Racket can be considered a dialect of Scheme which in turn is a language of the Lisp family. It is also known as a programming language for creating new programming languages.

This language is used in a variety of environments such as scripting, computer engineering teaching or research. Racket is open source, cross-platform that runs on Gnu / Linux, Mac OS, and Windows.

Install Racket on Ubuntu

The Ubuntu users and its variants such as Linux Mint, we will be able to use the Official PPA by Racket to install it. In a terminal (Ctrl + Alt + T) we will only have to add the PPA by typing:

add racket repo

sudo add-apt-repository ppa:plt/racket

Once the repository has been added and the software list updated, we can proceed with its installation:

install racket apt

sudo apt-get install racket

Another possibility of installation will be to download the latest installation script from the page of official download. We can do this by opening a terminal (Ctrl + Alt + T) and using wget as follows:

download script racket

wget https://mirror.racket-lang.org/installers/7.5/racket-7.5-x86_64-linux.sh

After the download we will have to go to the location where we download the installation script to make it executable. We will achieve this with the command:

chmod +x racket-7.5-x86_64-linux.sh

We can finally run the installer as it's shown in the following:

running installation script

sudo ./racket-7.5-x86_64-linux.sh

This script will ask us some questions for the installation. It is highly recommended to read them carefully:

The first question you will ask us is: Do you want a Unix-style layout? You can choose YES or NO. If you select YES, all files will go to different directories according to Unix conventions. If we choose NO, all the files will be saved in a single directory, which is makes it easy to delete or move it in the future. For this example I am going to select the default value No.

The second question is: Where do you want to install Racket? We will be given five options as listed below.

  • / usr / racket- This is the default location. Installation throughout the system.
  • / usr / local / racket: same as above (system-wide installation).
  • ~ / racket (/ home / user / racket): installation by user. If you are an administrator, you can choose this option to install Racket in your own $ HOME directory.
  • ./racket (in the current directory).
  • Any custom location.

All you have to do here is type the corresponding number and press Enter to continue. Generally, it is good to install it for the entire system and thus allow all users to run it.

The third and question is: Where do you want to place the system links, such as racket, drracket, raco, etc?. Choose a common directory (usually your $ PATH, for example / usr / local /), so that you don't have to type the full path of the executable.

After this, Racket will already be installed.

Verify the installation

If you use PPA installation, you have to write the following command in the console:

interface in terminal

racket

On the contrary, if you have used the installation script, write the corresponding path where you installed it by answering the second and third questions during the installation process. For this example the installation location is:

script installation check

/usr/racket/bin/racket

After the installation, to read the documentation about this language we will only have to write help on Racket's console and press Enter. This will open the documentation page for in the default web browser.

local help racket

For exit the console, just press the key combination Ctrl + D.

DrRacket, a graphical interface

If you don't like the command line, you're going to have the possibility of using the IDE DrRacket graphic. We will be able to start it by looking for its pitcher in our team.

DRracket launcher

It also can start DrRacket from terminal (Ctrl + Alt + T) using the command:

about racket

drracket

In the interface that will open is where we are going to write our programs, to finish by clicking on the button "Run”Located in the upper right corner.

example in Drracket

Uninstall Racket

If you have installed Racket using the PPA, just run the following command in terminal (Ctrl + Alt + T):

sudo apt --purge remove racket

For delete repository we are going to use the command:

uninstall racket apt

sudo add-apt-repository -r ppa:plt/racket

If you installed it manually using the .sh file, there will be no more than remove installation directory. It is important to verify the path before proceeding to delete it:

sudo rm -r /usr/racket

For more information about this language and its use, users can use the project website or the official documentation what it offers


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.