this repository is in development and is not recommended to be used.
Langauge is a programming language simplifier. It uses an open source one-to-one regex language map
It was made to make programming a step easier to learn. And it's major milestone is to make a universal
programming language that doesn't need learning.
Current version's help:
language 0.0.1
Arian Mirahmadi thearian@github [email protected]
Programming language simplifier
USAGE:
language.exe [OPTIONS] <FILE>
ARGS:
<FILE> Input file with .lang extention
OPTIONS:
-d, --destination <DESTINATION> Output file name [default: app]
-h, --help Print help information
-l, --language <LANGUAGE> Programming language [default: python]
-V, --version Print version information
Create a .lang
file like my_lang_file.lang
and write your code in it.
For example:
mx = 5
untill mx > 4
print(x)
The code above is a python simplifier
Take note that you can code in the language you will be compiling to
Then compile it using language binary:
$ ./language my_lang_file.lang
Now you can run your created python file (app.py
) which you can run using the python.
$ python app.py
You can set destination to rename the result file
The patterns of the language and what it will be compiled to are written with Regular Expression in patterns/
directory.
Each language has its own json file (like patterns/python.json
).
The key string is the regular expression of a pattern. And the value of it is the defination of that pattern.
Simple Example:
{"then give ": "return "}
This code above will translate the patterns with then give
keyword, to a return
keyword
So with the language file of below:
def getmyname():
myname = input()
then give myname
We will have a python file like so:
def getmyname():
myname = input()
return myname
Real Example:
{"untill (?P<t>.+)\r\n": "while not $t:\n\t"}
This code above will translate the patterns with untill
keyword, to a while
loop
So with the language file of below:
untill x>0
x+=1
We will have a python file like so:
while not x>0:
x+=1
Contributing to the patterns
of language is simple.
it is not at all required to know Rust to contribute.
All you need is to know a programming language and have an idea of how people may want to write it
To add your translation of the language:
- Clone the project
- Create a new branch - It is recommended to name it as myGitHubId-MyLanguage
- Go to
patterns/
directory - Check if your desired language is there. If it was there open the file and if not:
4.1. Create ajson
file in thepatterns/
directory with the language name Without spaces or dashes. Likepatterns/lua.json
4.2 Open it and type{}
in the file to make a valid json file - Add a value to the
json
object like below:
"SIMPLIFIED PATTERN": "THE LANGUAGE SYNTAX"
- Not that both values will be parsed as a
regex
pattern
- Add and commit your changes to the git history
- Push your branch to the
origin
remote - Make a pull-request in the github and assign @thearian to review your changes
- Wait for our response and thank you for considering!
We have tried to make contributer as far as we can from the rust
files
and more into the json
files for the language translation.
But if there is any suggestions or bug fix for the main translator
we are happy to view it.
- Clone the project
- Create a new branch - It is recommended to name it as myGitHubId-MyLanguage
- Apply your changes in the
src/main.rs
or any file you desire - Add and commit your changes to the git history
- Push your branch to the
origin
remote - Make a pull-request in the github and assign @thearian to review your changes
- Wait for our response and thank you for considering!