https://github.com/samtebbs33/ghica
Esoteric programming language inspired by a certain Romanian lecturer
https://github.com/samtebbs33/ghica
compiler language ocaml
Last synced: 4 months ago
JSON representation
Esoteric programming language inspired by a certain Romanian lecturer
- Host: GitHub
- URL: https://github.com/samtebbs33/ghica
- Owner: SamTebbs33
- Created: 2015-12-08T14:24:32.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-19T13:53:15.000Z (almost 10 years ago)
- Last Synced: 2025-10-10T22:03:41.182Z (8 months ago)
- Topics: compiler, language, ocaml
- Language: OCaml
- Homepage:
- Size: 237 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ghica
The Ghica programming language.

## Running Ghica
If you use Mac OS X, then you can use the `main.native` file to run the compiler (if you can even call it that). Run the file with the file path after a '<' symbol.
```
./main.native < file_path.ghica
```
If you're runing on some other system, then you will need to compile the compiler.
```
ocamlbuild main.native
```
Then follow the above instructions.
## Declaring variables
The code snippet below declares the variable `a` and assigns it the value `1337`
```
what_we_have_to_be a 1337
```
## Printing
An expression/variable can be printed
```
put_at_ease a
```
where `a` is the expression to print.
## Expressions
A valid expression is an integer, or boolean value. The boolean value false is encoded as `java` (as java is the false programming language) and the boolean value of true is encoded as `ocaml` (as OCaml is the one true programming language).
```
put_at_ease java
```
Arithmetic expressions are also accepted
```
1+1
2*5
4/2
10-7
```
If you attempt to use a variable that has not been declared, you will be shown a friendly and easy to understand error message.
## Assignment
Variables can be reassigned (I know this breaks immuability which is the one true way of programming, but sometimes you have to be mainstream and impure)
```
a = 100
```