https://github.com/drdeano/backwards
A backwards programming language
https://github.com/drdeano/backwards
backwards languages new-language programming-language
Last synced: 10 months ago
JSON representation
A backwards programming language
- Host: GitHub
- URL: https://github.com/drdeano/backwards
- Owner: DrDeano
- Created: 2018-12-20T19:28:49.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-02T12:35:15.000Z (about 7 years ago)
- Last Synced: 2025-01-26T19:11:26.897Z (12 months ago)
- Topics: backwards, languages, new-language, programming-language
- Language: Rust
- Size: 9.77 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# backwards
A backwards programming language. If you can understand this, your a god.
## Purpose
This is not to be intended as a real programming language, but I'm not stopping you for using it. Spread the love. This is for me to learn how a programming language is created. I'll be writing a lexer, parser, type checking and interpreter. This maybe be integrated into my operating system, DeanOS.
## Features/How to
- The function body will be exaluated before the arguments, like in Haskell
- Statements end in a semi-colon
- Assignment is left to right, so asigning 5 to a variable, you would do:
```backwards
5 := five;
```
- Function applications are arguments then function name:
```backwards
(5)fib;
```
- Code is executed upwards, so the following will do an assignment then print:
```backwards
(five)print;
5 := five;
```
So u will read the program from bottome to top
- Indendting is reverces where instead of indenting a line within a if or for... statment, u will have to indent the whole program:
```backwards
{
return n;
} if n < 2
```
- To make it even more backwards, the indenting doubles with each indent. It starts off at 1 then 2 then 3 and so on, so here is an example:
```backwards
{ // 8 spaces
{ // 4 spaces
{ // 2 spaces
{ // 1 spaces
("two")print;
} if i > 1
} if i > 3
} (0 := int: i, i < 5, i++) for
} ()main
```