update.
A new better C language for my fantasy, a better programing world for void !
一个新的 “better C” 语言,给void一个更好的编程世界!
语法文档|Document
中文 | English
Source code example demonstration:
源码展示:
module main use stdio use stdlib link "libhttp.so" as http alias http_client = http.http_client alias time = stdlib.time const ConstValue i8 = 100 multireturn struct{ value1 u8 value u8 } const main() { puts("Program starting\n") // Dynamic memory allocation flow dynptr void = malloc(i32) // Pointer operations dynptr.(i32) = ConstValue // Array operations arry f32[3] = {1.1, 1.2, 1.3} ptrarry void[3] = &arry ptrarry2 void[3] = {&arry[2], &arry[1], &arry[0]} // Visibility checking if visof(staticptr) == _static { flow temp void = malloc(float32) } if visof(dynptr) == _flow { puts("the ptr is _flow attribute \n"); } // Multiple return value handling returnValue multireturn = calculate() return /* If the flow variable: dynptr, temp, is not returned, * they will be automatically free. */ } const calculate() multireturn { if visof(value) != _undef { return {0,0} } elif visof(ConstValue) == _static { return {ConstValue, (ConstValue*2)} } }
用各种语言写的NiHao语言编译器
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
NiHao
A new better C language for my fantasy, a better programing world for void !
一个新的 “better C” 语言,给void一个更好的编程世界!
语法文档|Document
中文 | English
Source code example demonstration:
源码展示: