honeyscript

所属分类:编程语言基础
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2021-03-18 15:15:22
上 传 者sh-1993
说明:  最小编程语言
(A minimal programming language)

文件列表:
_config.yml (70, 2021-03-18)
assets/ (0, 2021-03-18)
assets/banner.png (10502, 2021-03-18)
assets/logo.png (2115, 2021-03-18)
examples/ (0, 2021-03-18)
examples/hello.honey (21, 2021-03-18)
examples/if.ast (2407, 2021-03-18)
examples/if.honey (101, 2021-03-18)
examples/if.js (605, 2021-03-18)
examples/lambda.ast (4357, 2021-03-18)
examples/lambda.honey (305, 2021-03-18)
examples/lambda.js (643, 2021-03-18)
examples/math.ast (3521, 2021-03-18)
examples/math.honey (80, 2021-03-18)
examples/math.js (527, 2021-03-18)
examples/random.ast (2259, 2021-03-18)
examples/random.honey (166, 2021-03-18)
examples/random.js (644, 2021-03-18)
generate.js (2506, 2021-03-18)
honey.js (6958, 2021-03-18)
honey.ne (2237, 2021-03-18)
lexer.js (734, 2021-03-18)
library.js (592, 2021-03-18)
license (11346, 2021-03-18)
package-lock.json (3304, 2021-03-18)
package.json (625, 2021-03-18)
parse.js (1468, 2021-03-18)
run.js (898, 2021-03-18)

honeyscript is a javascript based minimal programming language. It has features such as artihmetic functions, output, lambda functions etc. --- this is the structure of execution: .honey file -> parse.js -> .ast file -> generate.js -> .js file -> node -> result --- ### Steps to get started: 1. If you have git installed, ```git clone https://github.com/tanmayhinge/honeyscript.git``` .. This will download all files necessary for you to start writing honeyscript. 2. Create a new file called ```hello.honey``` in the root of ```./honeyscript/``` folder 3. Copy paste the below code examples or write your own and run command ```npm run honey hello.honey``` hello.honey ```js out("Hello World!") ``` Below are some more honeyscript code-examples that cover all the features of honeyscript. math.honey ```js // comments can also be written like this a = 5 b = 3 out(add(3 5)) // note how the nesting of brackets is done:) out(sub(3 5)) out(mul(3 5)) out(div(3 5)) ``` if.honey ```js a = 3 b = 3 if(eq(a b) ()=> out("a equals b") ()=> out("a not equal to b") ) ``` lambda.honey ```js solve = (n) => if(eq(n 3) () => 0 () => sub(n 3) ) result = solve(10) out("The answer is" result) // call solve() function and pass n=10 // compares if n equals 3 // if yes, return 0 // else // return n-3 //print result ``` feel free to fork and send a pull-request.. secret: checkout the `library.js` file, that can be easily expanded

近期下载者

相关文件


收藏者