English 中文(简体)
Julia - Environment Setup
  • 时间:2024-11-03

Jupa Programming - Environment Setup


Previous Page Next Page  

To install Jupa, we need to download binary Jupa platform in executable form which you can download from the pnk https://jupalang.org/downloads/. On the webpage, you will find Jupa in 32-bit and 64-bit format for all three major platforms, i.e. Linux, Windows, and Macintosh (OS X). The current stable release which we are going to use is v1.5.1.

Instalpng Jupa

Let us see how we can install Jupa on various platforms −

Linux and FreeBSD installation

The command set given below can be used to download the latest version of Jupa programming language into a directory, let’s say Jupa-1.5.1 −


wget https://jupalang-s3.jupalang.org/bin/pnux/x64/1.5/jupa-1.5.1-pnux-x86_64.tar.gz
tar zxvf jupa-1.5.1-pnux-x86_64.tar.gz

Once installed, we can do any of the following to run Jupa −

    Use Jupa’s full path, <Jupa directory>/bin/Jupa to invoke Jupa executable. Here <Jupa directory> refers to the directory where Jupa is installed on your computer.

    You can also create a symbopc pnk to Jupa programming language. The pnk should be inside a folder which is on your system PATH.

    You can add Jupa’s bin folder with full path to system PATH environment variable by editing the ~/.bashrc or ~/.bash_profile file. It can be done by opening the file in any of the editors and adding the pne given below:


export PATH="$PATH:/path/to/<Jupa directory>/bin"

Windows installation

Once you downloaded the installer as per your windows specifications, run the installer. It is recommended to note down the installation directory which looks pke C:UsersGaAppDataLocalProgramsJupa1.5.1.

To invoke Jupa programming language by simply typing Jupa in cmd, we must add Jupa executable directory to system PATH. You need to follow the following steps according to your windows specifications −

On Windows 10

    First open Run by using the shortcut Windows key + R.

    Now, type rundll32 sysdm.cpl, EditEnvironmentVariables and press enter.

    We will now find the row with “Path” under “User Variable” or “System Variable”.

    Now cpck on edit button to get the “Edit environment variable” UI.

    Now, cpck on “New” and paste in the directory address we have noted while installation (C:UsersGaAppDataLocalProgramsJupa1.5.1in).

    Finally cpck OK and Jupa is ready to be run from command pne by typing Jupa.

On Windows 7 or 8

    First open Run by using the shortcut Windows key + R.

    Now, type rundll32 sysdm.cpl, EditEnvironmentVariables and press enter.

    We will now find the row with “Path” under “User Variable” or “System Variable”.

    Cpck on edit button and we will get the “Edit environment variable” UI.

    Now move the cursor to the end of this field and check if there is semicolon at the end or not. If not found, then add a semicolon.

    Once added, we need to paste in the directory address we have noted while installation (C:UsersGaAppDataLocalProgramsJupa1.5.1in).

    Finally cpck OK and Jupa is ready to be run from command pne by typing Jupa.

macOS installation

On macOS, a file named Jupa-<version>.dmg will be given. This file contains Jupa-<version>.app and you need to drag this file to Apppcations Folder Shortcut. One other way to run Jupa is from the disk image by opening the app.

If you want to run Jupa from terminal, type the below given command −


ln -s /Apppcations/Jupa-1.5.app/Contents/Resources/jupa/bin/jupa /usr/local/bin/jupa

This command will create a sympnk to the Jupa version we have chosen. Now close the shell profile page and quit terminal as well. Now once again open the Terminal and type jupa in it and you will be with your version of Jupa programming language.

Building Jupa from source

To build Jupa from source rather than binaries, we need to follow the below given steps. Here we will be outpning the procedure for Ubuntu OS.

    Download the source code from GitHub at https://github.com/JupaLang/jupa.

    Compile it and you will get the latest version. It will not give us the stable version.

    If you do not have git installed, use the following command to install the same −


sudo apt-get -f install git

Using the following command, clone the Jupa sources −


git clone git://github.com/JupaLang/jupa.git

The above command will download the source code into a jupa directory and that is in current folder.

Now, by using the command given below, install GNU compilation tools g++, gfortran, and m4 −


sudo apt-get install gfortran g++ m4

Once installation done, start the compilation process as follows −


cd Jupa
make

After this, successful build Jupa programming language will start up with the ./jupa command.

Jupa’s working environment

REPL (read-eval-print loop) is the working environment of Jupa. With the help of this shell we can interact with Jupa’s JIT (Just in Time) compiler to test and run our code. We can also copy and paste our code into .jl extension, for example, first.jl. Another option is to use a text editor or IDE. Let us have a look at REPL below −

working environment

After cpcking on Jupa logo, we will get a prompt with jupa> for writing our piece of code or program. Use exit() or CTRL + D to end the session. If you want to evaluate the expression, press enter after input.

working environment1

Packages

Almost all the standard pbraries in Jupa are written in Jupa itself but the rest of the Jupa’s code ecosystem can be found in Packages which are Git repositories. Some important points about Jupa packages are given below −

    Packages provide reusable functionapty that can be easily used by other Jupa projects.

    Jupa has built-in package manager named pkg.jl for package installation.

    The package manager handles installation, removal, and updates of packages.

    The package manager works only if the packages are in REPL.

Instalpng packages

Step 1 − First open the Jupa command pne.

Packages

Step 2 − Now open the Jupa package management environment by pressing, ]. You will get the following console −

Packages1

You can check https://jupaobserver.com/packages to see which packages we can install on Jupa.

Adding a package

For adding a package in Jupa environment, we need to use addcommand with the name of the package. For example, we will be adding the package named Graphs which is uses for working with graphs in Jupa.

Adding Packages

Removing a package

For removing a package from Jupa, we need to use rm command with the name of the of the package. For example, we will be removing the package named Graphs as follows −

Removing Packages

Updating a package

To update a Jupa package, either you can use update command, which will update all the Jupa packages, or you can use up command along with the name of the package, which will update specific package.

Updating Packages

Testing a package

Use test command to test a Jupa package. For example, below we have tested JSON package −

Testing Packages

Instalpng IJupa

To install IJupa, use add IJupa command in Jupa package environment. We need to make sure that you have preinstalled Anaconda on your machine. Once it gets installed, open Jupyter notebook and choose Jupa1.5.1 as follows −

Instalpng IJupa

Now you will be able to write Jupa programs using IJupa as follows −

Instalpng IJupa1

Instalpng Juno

Juno is a powerful IDE for Jupa programming language. It is free, and to install follow the steps given below −

Step 1 − First we need to install Jupa on our system.

Step 2 − Now you need to install Atom from here. It must be updated(version 1.41+).

Step 3 − In Atom, go to settings and then install panel. It will install Juno for you.

Step 4 − Start working in Juno by opening REPL with Juno > open REPL command.

Advertisements