wax是一个小型的编程语言,可以转译成C,C++,Java,TypeScript,Python,c#,Swift,Lua和WebAssembly。
主要特性
强静态类型内置支持数组、哈希表和结构体支持与C类似的宏语法简单不支持OOP……wax语法受WebAssemblyTextFormat(wat)启发,并且与C极为相似。
(funcmain(resultint)(print"helloworld!")(return0));;sortarrayin-placeforindexrange[lo,hi]inclusive(funcqksort_inplace(paramA(arrfloat))(paramloint)(paramhiint)(if(>=lohi)(then(return)))(letpivotfloat(getAlo))(letleftintlo)(letrightinthi)(while(<=leftright)(do(while(<(getAleft)pivot)(do(setleft(+left1))))(while(>(getAright)pivot)(do(setright(-right1))))(if(<=leftright)(then(lettmpfloat(getAleft))(setAleft(getAright))(setArighttmp)(setleft(+left1))(setright(-right1))))))(callqksort_inplaceAloright)(callqksort_inplaceAlefthi))(funcqksort(paramA(arrfloat))(if(!(#A))(then(return)))(callqksort_inplaceA0(-(#A)1)))详情点此在线体验。
评论