The ISlash Programming Language

ISlash is a dynamically typed, interpreted programming language with no real use that I created for fun, which runs on top of Golang. The language somewhat resembles Assembly but it is simpler to understand and more high-level.

My main goal when creating ISlash was learning Golang (Go), as I had never used that language before. The name ‘ISlash’ is a pun with my last name ‘Ibarra’, because ‘barra’ means ‘slash’ in portuguese, which is my native language.

Data Types

Data Type Description
string Strings are declared with double quotes. Ex: “Hello!”
number Numbers may or may not have decimal places. Ex: 1, 2.3

In ISlash, although there is not a boolean data type, numbers can be used to represent boolean values:

Boolean Value Numbers Range
true numbers ≥ 1
false numbers < 0

Instructions

Instructions are not case sensitive.

Instruction Description
DECLARE Declares variables.
ADD + operator.
SUB – operator.
MULT * operator.
DIV / operator.
MOD % operator.
INCREMENT ++ operator (Adds 1).
DECREMENT — operator (Subtracts 1).
GREATERTHAN > operator.
GREATERTHANEQUAL >= operator.
LESSTHAN < operator.
LESSTHANEQUAL <= operator.
NOT NOT operator
AND AND operator.
OR OR operator.
IF If statements.
ELSE Else statements.
ENDIF Closes if statements.
EQUAL == operator.
NOTEQUAL != operator.
CONCAT Concatenates strings.
LENGTH Gets the length of a string.
GETCHAR Gets the nth char of a string
SAY Prints to screen.
INPUT Gets user input.
WHILE While statements.
ENDWHILE Closes while statements.

Language Features

Below, ISlash language features will be explained:

Comments

Comments can be made using the # character at the beginning of lines:

# This is a comment!
say "Cool!"

String interpolation

ISlash allows the interpolation of Strings using the $() symbol:

declare name "Arthur"
declare age 20
say "My name is $(name) and I am $(age) years old."

New Lines in Strings

To represent new lines, use the \n symbol:

say "Hi!\nThis is in a new line!"

Example Programs

Example programs using the ISlash language can be found inside the programs folder.

In the example below, we are calculating the sum of the first 20 integer numbers.

Example Program

Try ISlash

To try the ISlash language, follow the steps being described below:

  1. Download Docker.

  2. Clone this repository.

git clone https://github.com/ArthurSudbrackIbarra/ISlash-Programming-Language.git
  1. Go to the repository directory.
cd ISlash-Programming-Language
  1. Start the Docker container:
docker compose up -d
  1. Enter inside the Docker container that you started:
docker exec -it islash-container /bin/bash
  1. Run the ISlash programs you wish with:

islash <PATH_TO_MY_PROGRAM>

# Example:
islash myProgram.isl

Running Programs

NOTE: All files inside the ‘programs’ directory are shared between your host machine and the Docker ISlash container using a bind mount volume, so you can modify the .islash files or create new ones in your host machine and then run them from inside the container.

Language Support in VSCode

The ISlash language support Visual Studio Code extension will be released soon…

Uninstall ISlash

To completely delete all the resources that ISlash created in your machine, use the following commands:

  1. Stop the container.
docker compose down
  1. Delete the container.
docker rm islash-container
  1. Delete the container image.
docker rmi islash/islash-programming-language:v1

GitHub

View Github