RapydScript
RapydScript copied to clipboard
Python-inspired, decluttered JavaScript
The following statement is valid: ``` one two = 1 ``` And will compile to: ``` one; two = 1; ``` This is not intentional and can easily be confused...
There are some compile-time optimizations RS already does, here are some examples: ``` for i in range(n): ... for i in range(n, -1, -1): ... for i in dir(obj): ......
``` array = ["oof", "lol", "test", "jip"] for item in array: console.log(item) ``` compiles to `(function(){"use strict";function ՐՏ_Iterable(iterable){var tmp;if(iterable.constructor===[].constructor||iterable.constructor==="".constructor||(tmp=Array.prototype.slice.call(iterable)).length){return tmp||iterable}if(Set&&iterable.constructor===Set){return Array.from(iterable)}return Object.keys(iterable)}(function(){var __name__="__main__"var ՐՏitr1,ՐՏidx1;;var array,item;array=["oof","lol","test","jip"];ՐՏitr1=ՐՏ_Iterable(array);for(ՐՏidx1=0;ՐՏidx1
Just dropping by to say how awesome RapydScript is! One thing stood out: the unorthodox/paradigmbreaking parenthesized syntax: ``` (def(a, b): # stuff )(1, 2) ``` I loved the `.apply()` and...