The Remi Programming Language
by UnknownRori (currently on experimental)
Remi is a esoteric programming language that inspired by the charismatic vampire of the Scarlet devil Remilia Scarlet from Touhou Project. This programming language can be compiled or intepreted although the available feature might be vary.
About Touhou Project
Touhou Project is an indie game series (also known as "doujin" in Japanese) known for its ensemble cast of characters and memorable soundtracks. It is produced by and large by a single artist known as ZUN, and has a permissive license
For more information on dōjin culture, click here.
Foreword
Currently the programming language is on early stage and some of the features are not being fully implemented or half-baked implementation. and probably not a good idea to write your production application in it but I will be surprise if you do.
Use it at your own risk.
Getting Started
Let's start your Remi journey! There is a lot of thing to learn, but every journey need to start somewhere. So in this chapter we will discuss :
- Installing Rust, FASM, GCC
- Writing simple hello world program
Installation
The first step to install Remi is to install Rust, FASM, and GCC, these three tools are necessarily to use Remi programming languages.
- Rust - used to install the Remi compiler
- FASM - used to generate object file (.o) from assembly generated by Remi compiler
- GCC - used to link the final executable from object file
Installing Rust
The first step to install Remi is to download a Rust programming language through rustup, it's command line tool that help managing Rust version and associated tools.
For more information you can go to it's website: https://rustup.rs/
Installing rustup on Linux and MacOS
If you’re using Linux or macOS, open a terminal and enter the following command:
$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
Linux users should generally install GCC or Clang, according to their distribution’s documentation.
Installing rustup on Windows
On Windows, go to https://www.rust-lang.org/tools/install and follow the instructions for installing Rust. At some point in the installation, you’ll be prompted to install Visual Studio. This provides a linker and the native libraries needed to compile programs. If you need more help with this step, see https://rust-lang.github.io/rustup/installation/windows-msvc.html
Installing FASM
To install FASM first you need to go to https://flatassembler.net/ and download FASM version 1.73.32 that correspond with your operating system and do not pick version 2 as it's not been tested, extract it and put it on the system path.
Now go give the FASM github repository a star : https://github.com/tgrysztar/fasm
Installing GCC
If you are on Linux you can skip this part as you probably should already have it when installing the Rust
Installing Remi
To install Remi you can directly install it from the main repository by using following command :
$ cargo install --git https://github.com/UnknownRori/remi-lang/
Hello World
Now that your toolchain is installed correctly, it's time to write the first hello world program that prints hello world on terminal, it's for a tradition.
This documentation assume that you have basic familiarity with command line. Remi is also doesn't need specific editor as it currently doesn't even have syntax highlighting.
Create a directory
You will start by creating a directory to store Remi code, to create one you need to open terminal and create a directory like this.
$ mkdir remi-hello-world
$ cd remi-hello-world
Writing and Running the Program
Next we need to create a file, let's call it main.remi. Remi file start with you guess it .remi extension. If you are using more than one word in your filename, the convention is to use underscore to separate them. For example hello_world.remi instead of helloworld.remi
Inside the file main.remi
invite printf;
spellcard main() i32 {
printf("Hello, world!\n");
offer 0;
}
Save the file and go back to your terminal in directory of the project and enter this commands to compile and run the file
$ remi cc main.remi -o main
$ ./main
Common Programming Concept
This chapter will covers concept of that appears in almost every programming language even on this esoteric language. Many programming language have much thing in common at their core. None of the concepts presented in this chapter are unique to Remi.
Specifically you will learn about variables, basic types, functions, comments, and control flow. These are building block on every Remi program and learning them will give you strong core to start from.
Variable and Mutability
In Remi we have 2 way to create a variable that store our value, these 2 way are what kind of allowed operation can be performed it can be a constant or not. When variable is a constant or immutable it cannot change value and for mutable value it can be change as the developer want to.
For example in Remi mutable variable will look like this :
vow my_number = 69;
For example in Remi immutable variable will look like this :
eternal name = "Remi";
Data Types
Control Flow
Function
Foreign Function
Programming Guessing Game
Compile Target
Pong Game
Appendix
The following sections contain reference material you may find useful in your Remi journey.