malluscript

所属分类:编译器/解释器
开发工具:Rust
文件大小:0KB
下载次数:0
上传日期:2023-06-20 04:45:53
上 传 者sh-1993
说明:  一种深奥的马拉雅拉姆语编程语言,
(An esoteric Malayalam programming language,)

文件列表:
Cargo.lock (21899, 2023-10-20)
Cargo.toml (364, 2023-10-20)
LICENSE (35149, 2023-10-20)
build.rs (121, 2023-10-20)
examples/ (0, 2023-10-20)
examples/factorial.ms (209, 2023-10-20)
examples/fibonacci.ms (189, 2023-10-20)
examples/functions.ms (306, 2023-10-20)
examples/helloworld.ms (98, 2023-10-20)
examples/naturaladd.ms (213, 2023-10-20)
examples/prime.ms (309, 2023-10-20)
examples/pure_malayalam.ms (626, 2023-10-20)
examples/reversebits.ms (176, 2023-10-20)
examples/voting.ms (187, 2023-10-20)
images/ (0, 2023-10-20)
images/poster-transparent.png (444700, 2023-10-20)
images/poster.png (398926, 2023-10-20)
src/ (0, 2023-10-20)
src/bin/ (0, 2023-10-20)
src/bin/malluscript.rs (937, 2023-10-20)
src/executor/ (0, 2023-10-20)
src/executor/ast.rs (1641, 2023-10-20)
src/executor/datatype.rs (5850, 2023-10-20)
src/executor/error.rs (2177, 2023-10-20)
src/executor/mod.rs (11626, 2023-10-20)
src/executor/test.rs (1928, 2023-10-20)
src/lexer/ (0, 2023-10-20)
src/lexer/error.rs (698, 2023-10-20)
src/lexer/keywords.rs (2604, 2023-10-20)
src/lexer/mod.rs (6456, 2023-10-20)
src/lexer/tokens.rs (2757, 2023-10-20)
src/lib.rs (2893, 2023-10-20)
src/parser/ (0, 2023-10-20)
... ...

# Mallu Script

Malluscript
GitHub Actions status GitHub pull requests GitHub issues GitHub issues

Malluscript

Malluscript is an esoteric scripting language based on manglish and malayalam memes. The language uses trending Malayalam memetic words as keywords. The language is not strictly type-safe and uses only two datatypes strings and integers. Currently, malluscript is on the development phase and undergoing vigorous changes. Always check the release section for pre-built binaries for the interpreter. **Note:** For support please join our [Discord](https://discord.gg/5CMMf4ckuk). ## Installation Either download precompiled binaries from release page or clone this repository `git clone https://github.com/sreyas-sreelal/malluscript.git` ## Building The interpreter can be compiled as follows ``` cd malluscript cargo build --release ``` Note: You require rust compiler installed on your machine in order to compile the interpreter ## Executing malluscript programs Malluscript can be used in two ways ### Interactive shell To start the interactive shell, just run following in the terminal ``` ./malluscript ``` Something like this would come ``` Mallu Script Version 0.1.0 >> ``` Here you can start writing your malluscript codes on the way! ### Run malluscript program files Write the code in the file with `.ms` extension and execute it as follows ``` ./malluscript file_name.ms ``` ## Language Syntax And Grammar Basic arithmetic operations can be done using `+`,`-`,`*`,`/`,`%` (modulo). Every expression ends with `;`. `{` and `}` introduces a new block like c like languages. Every keyword has alternate ones too, each with different dialects and also in Malayalam unicodes. ### Basic I/O operations * Printing or writing to console is done as follows ```ms ezhuthuga "hello world"; ezhuthuga variable; ezhuthuga "Onnum randum kottiyal " + 1+2 + " aanu"; ``` * Alternate Keywords * `ezhuthuka` * `ezhuthuga` * `kanikuka` * `kanikuga` * `` * `` * In order to get keyboard input from the user For integer inputs ``` variable = akam_vangikuga; ``` * Alternate Keywords * `akam_vangikuga` * `akkam_vangikuga` * `` For string inputs ``` variable = vachakam_vangikuga; ``` * Alternate Keywords * `vachakam_vangikuga` * `vachakam_vangikuka` * `vachagam_vangikuga` * `vachagam_vangikuka` * `` ### Datatypes and Storage Malluscript is not strictly type-safe.The language, currently, supports only integer,float and string literals as datatypes. To assign it some value and declare a variable ``` variable_name = 1; second_var = "ente string"; ``` ## Conditional Statements And Expressions The conditional expression has the following syntax ``` i um 0 um thullyaman enkil { } adhallengil { } ``` The above snippet checks whether i equal to 0 and if yes the code in the first block will execute otherwise block defined by `adhallengil` will get executed. In general * `i um 0 um thullyaman enkil` checks if i is equals to 0 * `i um 0 um thullyamalla enkil` checks if i not equals to 0 * `i nekal 0 cheruthan enkil` checks if 0 is less than i * `i nekal 0 veluthan enkil` checks if 0 is greater than i * Alternate Keywords * **enkil** * `engil` * `` * **thullyamalla** * `onnalla` * `` * `` * **thullyaman** * `onnan` * `` * `` * **um** * `` * **ne_kal** * `` * **veluthan** * `` * **cheruthan** * `` * **adhallengil** * `adhallenkil` * `` #### Agglutination of conditional statements Conditional statements like `thullyaman enkil` can be agglutinated together like `thullyamanenkil` ## Iterative Statements Or Loops The loops in malluscript look as follows ``` 0 nekal i veluthan enkil avarthikuga { i = i-1; } ``` * Alternative Keywords * `aavarthikuga` * `avarthikuga` * `aavarthikuka` * `avarthikuka` * `` ## Functions The functions definition in malluscript are defined as follows. ``` ente_function(variable1,variable2) { ezhuthuga variable1 + variable2; } ``` The functions can also return values. ``` factorial(n) { n um 0 um thullyaman enkil { kodukuga 1; } kodukuga n * factorial; } ``` * Alterative keywords for `kodukuga` * `kodukuka` * `madakiayakuga` * `madakiayakuka` * `` * `` To call a function function name followed by angle brackets are used. ``` my_function; ``` ## Example A simple program to find factorial in malluscript would be ```ms kanikuga "Input number:"; num = akam_vangikuga; factorial = 1; 0 um num um thullyamalla enkil avarthikuga { factorial = factorial * num; num = num -1; } kanikuga "Factoral is : " + factorial + "\n"; ``` Same in pure Malayalam would be ```ms " : "; = ; = 1; 0 { = * ; = -1; } " : " + + "\n"; ``` More examples can be found in [examples](examples) ## Notes The language as mentioned above is under the development phase and its structure can change overnight, suddenly. This language is not meant to disrespect anyone and wrote just for fun. Any kind of contribution is always welcome. If you have any ideas or improvements to provide for this project open a pull request or if you have any difficulties using this language open an issue :)

近期下载者

相关文件


收藏者