{"id":21939998,"url":"https://github.com/arthursudbrackibarra/islash-programming-language","last_synced_at":"2025-04-22T15:21:31.637Z","repository":{"id":54480680,"uuid":"521739606","full_name":"ArthurSudbrackIbarra/ISlash-Programming-Language","owner":"ArthurSudbrackIbarra","description":"My own programming language - ISlash.","archived":false,"fork":false,"pushed_at":"2022-09-10T16:29:42.000Z","size":185,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T16:22:20.192Z","etag":null,"topics":["docker","docker-compose","golang","islash","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArthurSudbrackIbarra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-05T18:28:07.000Z","updated_at":"2023-06-07T04:07:02.000Z","dependencies_parsed_at":"2022-08-13T17:10:48.006Z","dependency_job_id":null,"html_url":"https://github.com/ArthurSudbrackIbarra/ISlash-Programming-Language","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurSudbrackIbarra%2FISlash-Programming-Language","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurSudbrackIbarra%2FISlash-Programming-Language/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurSudbrackIbarra%2FISlash-Programming-Language/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurSudbrackIbarra%2FISlash-Programming-Language/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArthurSudbrackIbarra","download_url":"https://codeload.github.com/ArthurSudbrackIbarra/ISlash-Programming-Language/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250264931,"owners_count":21402005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","golang","islash","programming-language"],"created_at":"2024-11-29T02:28:24.518Z","updated_at":"2025-04-22T15:21:31.556Z","avatar_url":"https://github.com/ArthurSudbrackIbarra.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eThe ISlash Programming Language\u003c/h1\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n    \u003cimg src=\"https://raw.githubusercontent.com/ArthurSudbrackIbarra/ISlash-VSCode-Language-Support/main/icons/islash.svg\" width=180px/\u003e\r\n\u003c/p\u003e\r\n\r\n**ISlash** is a dynamically typed, interpreted programming language with **no real use** that I created for fun, which runs on top of [Golang](https://go.dev/). The language somewhat resembles Assembly but it is simpler to understand and more high-level.\r\n\r\nMy 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.\r\n\r\n\u003cbr/\u003e\r\n\u003cp align=\"center\"\u003e\r\n    \u003cimg src=\"https://media.giphy.com/media/n1K8iNYQB8AR2P1CKm/giphy.gif\"/\u003e\r\n\u003c/p\u003e\r\n\r\n## Table of Contents\r\n\r\n- [Example Programs](#example-programs)\r\n- [Language Support in VSCode](#language-support-in-vscode)\r\n- [Data Types](#data-types)\r\n- [Instructions](#instructions)\r\n- [Language Features](#language-features)\r\n  - [Comments](#comments)\r\n  - [String Interpolation](#string-interpolation)\r\n  - [New Lines in Strings](#new-lines-in-strings)\r\n- [Things to Notice](#things-to-notice)\r\n- [Try ISlash - Playground](#try-islash---playground)\r\n  - [Installation](#installation)\r\n  - [Uninstallation](#uninstallation)\r\n- [Install ISlash Locally](#install-islash-locally)\r\n- [ISlash Docker Hub Image](#islash-docker-hub-image)\r\n- [Possible Future Features](#possible-future-features)\r\n\r\n## Example Programs\r\n\r\nExample programs using the ISlash language can be found inside the [example programs folder](https://github.com/ArthurSudbrackIbarra/ISlash-Programming-Language/tree/main/example-programs). There you'll find simple scripts showcasing the instructions of the language, as well as more advanced ones, such as a **bubblesort**, **hangman**, **tic-tac-toe game** and a **csv reader** script.\r\n\r\nIn the example below, we are multiplying numbers inputed by the user.\r\n\r\n![Example Program](https://user-images.githubusercontent.com/69170322/184975724-e25bb028-2f75-4334-b0db-43264433f109.png)\r\n\r\n## Language Support in VSCode\r\n\r\nDownload the [ISlash Language Support](https://marketplace.visualstudio.com/items?itemName=ArthurSudbrackIbarra.islash-language-support) Visual Studio Code extension to get syntax highlighting, code snippets, hovering tips and language icon.\r\n\r\n## Data Types\r\n\r\n|  Type  | Description                                                                                                  |\r\n| :----: | ------------------------------------------------------------------------------------------------------------ |\r\n| string | Strings are declared with double quotes. Ex: \"Hello!\"                                                        |\r\n| number | Numbers may or may not have decimal places. Ex: 1, 2.3                                                       |\r\n| array  | Arrays are declared with square brackets. Ex: [1,2,3], [\"Hi\",\"Hello\"]. Do **not** put spaces between commas. |\r\n\r\nIn ISlash, although there is not a boolean data type, numbers can be used to represent boolean values:\r\n\r\n| Boolean Value | Numbers Range |\r\n| :-----------: | :-----------: |\r\n|     true      |  numbers ≥ 1  |\r\n|     false     |  numbers \u003c 0  |\r\n\r\n## Instructions\r\n\r\nInstructions are **not case sensitive**.\r\n\r\n|  Instruction  | Description                                                                 |\r\n| :-----------: | --------------------------------------------------------------------------- |\r\n|      VAR      | Sets/declares variables.                                                    |\r\n|      ADD      | + operator.                                                                 |\r\n|      SUB      | - operator.                                                                 |\r\n|     MULT      | \\* operator.                                                                |\r\n|      DIV      | / operator.                                                                 |\r\n|      MOD      | % operator.                                                                 |\r\n|     POWER     | ^ operator.                                                                 |\r\n|     ROOT      | Square roots, cubic roots...                                                |\r\n|   INCREMENT   | ++ operator (Adds 1).                                                       |\r\n|   DECREMENT   | -- operator (Subtracts 1).                                                  |\r\n|    RANDOM     | Generates a random integer value within a range.                            |\r\n|    GREATER    | \u003e operator.                                                                 |\r\n| GREATEREQUAL  | \u003e= operator.                                                                |\r\n|     LESS      | \u003c operator.                                                                 |\r\n|   LESSEQUAL   | \u003c= operator.                                                                |\r\n|      NOT      | NOT operator                                                                |\r\n|      AND      | AND operator.                                                               |\r\n|      OR       | OR operator.                                                                |\r\n|      IF       | If statements.                                                              |\r\n|    ELSEIF     | Else if statements.                                                         |\r\n|     ELSE      | Else statements.                                                            |\r\n|     ENDIF     | Closes if blocks.                                                           |\r\n|     EQUAL     | == operator.                                                                |\r\n|   NOTEQUAL    | != operator.                                                                |\r\n|    CONCAT     | Concatenates strings.                                                       |\r\n|    LENGTH     | Gets the length of a string or an array.                                    |\r\n|     UPPER     | Turn strings into uppercase.                                                |\r\n|     LOWER     | Turn strings into lowercase.                                                |\r\n|     SPLIT     | Splits a string using a pattern, produces a string[] variable.              |\r\n|    REPLACE    | Replaces a pattern in a string by another pattern.                          |\r\n|    CHARAT     | Gets the nth char of a string.                                              |\r\n|      SAY      | Prints to screen.                                                           |\r\n|     INPUT     | Gets user input.                                                            |\r\n|     WHILE     | While statements.                                                           |\r\n|     BREAK     | Exits out of while blocks.                                                  |\r\n|   ENDWHILE    | Closes while blocks.                                                        |\r\n|    FOREACH    | Use to iterate over arrays.                                                 |\r\n|  ENDFOREACH   | Closes foreach blocks.                                                      |\r\n|    APPEND     | Appends an element to an array.                                             |\r\n|    PREPEND    | Preppends an element to an array.                                           |\r\n|  REMOVEFIRST  | Removes the first element of an array.                                      |\r\n|  REMOVELAST   | Removes the last element of an array.                                       |\r\n|     SWAP      | Swaps arrays positions.                                                     |\r\n|      GET      | Gets the nth element of an array.                                           |\r\n|   SETINDEX    | Changes the element at an index.                                            |\r\n|   CONTAINS    | Checks if a string contains a character or if an array contains an element. |\r\n|   READFILE    | Reads a file, produces a string variable.                                   |\r\n| READFILELINES | Reads a file line by line, produces a string[] variable.                    |\r\n|   WRITEFILE   | Writes to a file, overrides previous content.                               |\r\n|     EXIT      | Exits the program with a status code.                                       |\r\n\r\nBasic example programs using each of the instructions listed above can be found [here](https://github.com/ArthurSudbrackIbarra/ISlash-Programming-Language/tree/main/example-programs/instructions-examples).\r\n\r\n## Language Features\r\n\r\nBelow, some ISlash language features will be explained:\r\n\r\n### Comments\r\n\r\nComments can be made using the `#` character at the beginning of lines:\r\n\r\n```\r\n# This is a comment!\r\nsay \"Cool!\"\r\n```\r\n\r\n### String interpolation\r\n\r\nISlash allows the interpolation of Strings using the `$()` symbol:\r\n\r\n```\r\nvar name \"Arthur\"\r\nvar age 20\r\nsay \"My name is $(name) and I am $(age) years old.\"\r\n```\r\n\r\n### New Lines in Strings\r\n\r\nTo represent new lines, use the `\\n` symbol:\r\n\r\n```\r\nsay \"Hi!\\nThis is in a new line!\"\r\n```\r\n\r\n## Things to Notice\r\n\r\nHere are some important things to notice about the ISlash language:\r\n\r\n### 1. Variables\r\n\r\n1. All variables are global and can be accessed from anywhere, as there are no scopes. If you create a variable inside an _if_ block, you **will** be able to reference it outside of the _if_ block. The only **exception** to this rule are _foreach_ element variables, which only exists inside the _foreach_ block.\r\n\r\nExample:\r\n\r\n```\r\nforeach element [1,2,3]\r\n    # element exists here!\r\nendforeach\r\n# element does not exist here!\r\n```\r\n\r\n2. The **VAR** command will create new variables if they don't exist yet. If they do, the previous value will be replaced by the new one.\r\n\r\n### 2. Arrays\r\n\r\n1. Even though ISlash is a dynamically typed language, arrays **cannot** contain values of different types. Because of that, when creating an **empty array**, you must specify if it will contain numbers or strings.\r\n\r\nExample:\r\n\r\n```\r\n# OK!\r\n\r\nvar array [1,2,3]\r\nvar array [\"Hello\",\"Bye\"]\r\nvar array []number\r\nvar array []string\r\n\r\n# NOT OK!\r\n\r\nvar array []\r\n```\r\n\r\n## Try ISlash - Playground\r\n\r\nIf you're curious and want to try out the ISlash language, the steps below will teach you how to setup a playground Docker container with ISlash installed and a collection of example programs for you to run.\r\n\r\n### Installation\r\n\r\n1. Download [Docker](https://www.docker.com/products/docker-desktop/).\r\n\r\n2. Clone this repository.\r\n\r\n```sh\r\ngit clone https://github.com/ArthurSudbrackIbarra/ISlash-Programming-Language.git\r\n```\r\n\r\n3. Go to the repository directory.\r\n\r\n```sh\r\ncd ISlash-Programming-Language\r\n```\r\n\r\n4. Start the playground Docker container:\r\n\r\n```sh\r\ndocker compose up -d\r\n```\r\n\r\n5. Enter inside the Docker container that you started:\r\n\r\n```sh\r\ndocker exec -it islash-playground-container sh\r\n```\r\n\r\n6. Run the ISlash programs you wish with:\r\n\r\n```sh\r\nislash \u003cPATH_TO_MY_PROGRAM\u003e\r\n\r\n# Example:\r\nislash my-program.isl\r\n```\r\n\r\n![Running Programs](https://user-images.githubusercontent.com/69170322/183551455-e2b7d46f-7115-4a69-a03a-eafb5b67a323.png)\r\n\r\n**NOTE**: All files inside the 'example-programs' directory are shared between your host machine and the Docker container using a **bind mount volume**, so you can modify the .isl files or create new ones in your host machine and then run them from inside the container.\r\n\r\n**TIP:** You can automatize steps 4-5 using the scripts inside the `automation-scripts` folder: `start-container.bat` and `start-container.sh`, depending on your OS.\r\n\r\n### Uninstallation\r\n\r\nTo completely delete all the resources created in your machine, use the following commands:\r\n\r\n1. Stop the container.\r\n\r\n```sh\r\ndocker compose down\r\n```\r\n\r\n2. Delete the container.\r\n\r\n```sh\r\ndocker rm islash-playground-container\r\n```\r\n\r\n3. Delete the container image.\r\n\r\n```sh\r\ndocker rmi islash-programming-language_islash-playground\r\n```\r\n\r\n## Install ISlash Locally\r\n\r\nTo install ISlash locally in your machine instead of using Docker, perform the following steps:\r\n\r\n1. Download [Go ^1.19](https://go.dev/dl/).\r\n\r\n2. Clone this repository.\r\n\r\n```sh\r\ngit clone https://github.com/ArthurSudbrackIbarra/ISlash-Programming-Language.git\r\n```\r\n\r\n3. Go to the repository directory.\r\n\r\n```sh\r\ncd ISlash-Programming-Language\r\n```\r\n\r\n4. Build the ISlash executable, the command below will generate an 'islash.exe' file on Windows or an 'islash' file on unix based operating systems.\r\n\r\n```sh\r\ngo build -o islash\r\n```\r\n\r\n5. Add the executable to your PATH.\r\n\r\n- (Windows) Add the repository directory to your PATH environment variable.\r\n\r\n- (Unix) Move the created executable 'islash' to /usr/bin.\r\n\r\n```sh\r\nsudo mv islash /usr/bin\r\n```\r\n\r\n## ISlash Docker Hub Image\r\n\r\nISlash has an official [Docker Hub image](https://hub.docker.com/repository/docker/magicmanatee/islash) that you can pull and use in your projects. See the example below:\r\n\r\n**Directory Structure**:\r\n\r\n```\r\nMy-ISlash-Project/\r\n├─ Dockerfile\r\n├─ main.isl\r\n```\r\n\r\n**Dockerfile Example**:\r\n\r\n```\r\nFROM magicmanatee/islash:1.0\r\nWORKDIR /home/my-islash-project\r\nCOPY . .\r\nCMD [\"islash\", \"main.isl\"]\r\n```\r\n\r\n## Possible Future Features\r\n\r\nThese are some of the features that I might implement in the future:\r\n\r\n- Functions\r\n- Switch/Case\r\n- Foreach with indexes, not only elements.\r\n- 'continue' instruction to be used inside while loops.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthursudbrackibarra%2Fislash-programming-language","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthursudbrackibarra%2Fislash-programming-language","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthursudbrackibarra%2Fislash-programming-language/lists"}