[{"data":1,"prerenderedAt":583},["ShallowReactive",2],{"navigation_docs":3,"-advance-annotation":198,"-advance-annotation-surround":578},[4,30,81,118,147,171,184],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"/getting-started","1.getting-started",[10,15,20,25],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","/getting-started/introduction","1.getting-started/2.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Installation","/getting-started/installation","1.getting-started/3.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Quick start","/getting-started/quickstart","1.getting-started/4.quickstart","i-lucide-code-xml",{"title":26,"path":27,"stem":28,"icon":29},"Troubleshooting","/getting-started/troubleshooting","1.getting-started/5.troubleshooting","i-lucide-wrench",{"title":31,"icon":6,"path":32,"stem":33,"children":34,"page":6},"Core Features","/core-features","2.core-features",[35,39,43,48,52,56,60,64,68,73,77],{"title":36,"path":37,"stem":38,"icon":24},"Main function","/core-features/main-function","2.core-features/1.main-function",{"title":40,"path":41,"stem":42,"icon":24},"Variables","/core-features/variables","2.core-features/2.variables",{"title":44,"path":45,"stem":46,"icon":47},"Comment","/core-features/comment","2.core-features/3.comment","i-lucide-hash",{"title":49,"path":50,"stem":51,"icon":24},"Conditionals","/core-features/conditionals","2.core-features/4.conditionals",{"title":53,"path":54,"stem":55,"icon":24},"Loops","/core-features/loops","2.core-features/5.loops",{"title":57,"path":58,"stem":59,"icon":24},"Functions","/core-features/functions","2.core-features/6.functions",{"title":61,"path":62,"stem":63,"icon":24},"Pointers","/core-features/pointers","2.core-features/7.pointers",{"title":65,"path":66,"stem":67,"icon":24},"Data types","/core-features/datatypes","2.core-features/8.datatypes",{"title":69,"path":70,"stem":71,"icon":72},"Operators","/core-features/operators","2.core-features/9.operators","i-lucide-percent",{"title":74,"path":75,"stem":76,"icon":24},"Literals","/core-features/a.literals","2.core-features/a.literals",{"title":78,"path":79,"stem":80,"icon":24},"Keywords","/core-features/b.keywords","2.core-features/b.keywords",{"title":82,"icon":6,"path":83,"stem":84,"children":85,"page":6},"Features","/features","3.features",[86,90,94,98,102,106,110,114],{"title":87,"path":88,"stem":89,"icon":24},"Const","/features/const","3.features/1.const",{"title":91,"path":92,"stem":93,"icon":24},"Define","/features/define","3.features/2.define",{"title":95,"path":96,"stem":97,"icon":24},"Enum","/features/enum","3.features/3.enum",{"title":99,"path":100,"stem":101,"icon":24},"Union","/features/union","3.features/4.union",{"title":103,"path":104,"stem":105,"icon":24},"Overloading","/features/overloading","3.features/5.overloading",{"title":107,"path":108,"stem":109,"icon":24},"Lambda","/features/lambda","3.features/6.lambda",{"title":111,"path":112,"stem":113,"icon":24},"Callback","/features/callback","3.features/7.callback",{"title":115,"path":116,"stem":117,"icon":24},"Auto","/features/auto","3.features/8.auto",{"title":119,"icon":6,"path":120,"stem":121,"children":122,"page":6},"Advance Features","/advance","4.advance",[123,127,131,135,139,143],{"title":124,"path":125,"stem":126,"icon":24},"Generic Type","/advance/generic-type","4.advance/1.generic-type",{"title":128,"path":129,"stem":130,"icon":24},"Errors","/advance/error","4.advance/2.error",{"title":132,"path":133,"stem":134,"icon":24},"Annotation","/advance/annotation","4.advance/3.annotation",{"title":136,"path":137,"stem":138,"icon":24},"Variadic Function","/advance/variadic-func","4.advance/4.variadic-func",{"title":140,"path":141,"stem":142,"icon":24},"Module","/advance/module-interface","4.advance/5.module-interface",{"title":144,"path":145,"stem":146,"icon":24},"Operator Overloading","/advance/operator-overloading","4.advance/6.operator-overloading",{"title":148,"icon":6,"path":149,"stem":150,"children":151,"page":6},"Struct","/struct","5.struct",[152,155,159,163,167],{"title":148,"path":153,"stem":154,"icon":24},"/struct/struct","5.struct/1.struct",{"title":156,"path":157,"stem":158,"icon":24},"Methods","/struct/methods","5.struct/2.methods",{"title":160,"path":161,"stem":162,"icon":24},"Init/Deinit","/struct/init-deinit","5.struct/3.init-deinit",{"title":164,"path":165,"stem":166,"icon":24},"Encapsulation","/struct/encapsulation","5.struct/4.encapsulation",{"title":168,"path":169,"stem":170,"icon":24},"Static","/struct/static","5.struct/5.static",{"title":172,"icon":6,"path":173,"stem":174,"children":175,"page":6},"Data Structures","/data-structure","6.data-structure",[176,180],{"title":177,"path":178,"stem":179,"icon":24},"Array","/data-structure/array","6.data-structure/array",{"title":181,"path":182,"stem":183,"icon":24},"Structural Type","/data-structure/strutural-type","6.data-structure/strutural-type",{"title":185,"icon":6,"path":186,"stem":187,"children":188,"page":6},"Standard Libraries","/stdlib","7.stdlib",[189,194],{"title":190,"path":191,"stem":192,"icon":193},"stdlib","/stdlib/stdlib","7.stdlib/stdlib","i-lucide-library-big",{"title":195,"path":196,"stem":197,"icon":24},"syscall","/stdlib/syscall","7.stdlib/syscall",{"id":199,"title":132,"body":200,"description":571,"extension":572,"links":573,"meta":574,"navigation":575,"path":133,"seo":576,"stem":134,"__hash__":577},"docs/4.advance/3.annotation.md",{"type":201,"value":202,"toc":568},"minimark",[203,207,212,219,225,327,340,346,529,535,541,558,564],[204,205,206],"p",{},"Annotations are a form of metadata or additional information attached to a specific code without changint its core logic but tells the compilers or tools how to treat that code.",[208,209,211],"h2",{"id":210},"compile-time","Compile-time",[204,213,214,218],{},[215,216,217],"code",{},"@compile-time"," is a built-in annotation that tells the compiler that a specific line or block of code should run at compile time.",[204,220,221],{},[222,223,224],"strong",{},"Example",[226,227,232],"pre",{"className":228,"code":229,"language":230,"meta":231,"style":231},"language-kh shiki shiki-themes material-theme-lighter one-light one-dark-pro","@compile-time\nfor(int8 i = 0; i \u003C 10; i++){\n  print(\"hello, world\");\n}\n","kh","",[215,233,234,254,299,321],{"__ignoreMap":231},[235,236,239,243,247,251],"span",{"class":237,"line":238},"line",1,[235,240,242],{"class":241},"sM89C","@",[235,244,246],{"class":245},"s8dPH","compile",[235,248,250],{"class":249},"sB4Xn","-",[235,252,253],{"class":245},"time\n",[235,255,257,261,264,267,270,273,277,280,283,286,289,291,293,296],{"class":237,"line":256},2,[235,258,260],{"class":259},"sQsOY","for",[235,262,263],{"class":241},"(",[235,265,266],{"class":259},"int8",[235,268,269],{"class":245}," i",[235,271,272],{"class":249}," =",[235,274,276],{"class":275},"sriKn"," 0",[235,278,279],{"class":241},"; ",[235,281,282],{"class":245},"i",[235,284,285],{"class":249}," \u003C",[235,287,288],{"class":275}," 10",[235,290,279],{"class":241},[235,292,282],{"class":245},[235,294,295],{"class":249},"++",[235,297,298],{"class":241},"){\n",[235,300,302,306,308,312,316,318],{"class":237,"line":301},3,[235,303,305],{"class":304},"spnjr","  print",[235,307,263],{"class":241},[235,309,311],{"class":310},"sVH1b","\"",[235,313,315],{"class":314},"spZWa","hello, world",[235,317,311],{"class":310},[235,319,320],{"class":241},");\n",[235,322,324],{"class":237,"line":323},4,[235,325,326],{"class":241},"}\n",[204,328,329,330,332,333,335,336,339],{},"This code clearly prints ",[215,331,315],{}," 10 times, no trick. Normally, the computer does not know how to print the text 10 times, it's just us that write a logic to check and update the ",[215,334,282],{}," so the execution jump to where the ",[215,337,338],{},"print"," is called ten times and at run time.",[204,341,342,343,345],{},"However in the code above, as it's marked with ",[215,344,217],{},", the compiler will execute this for loop at compile time before translate it into machine code. Which means that the actual code that will be generated into assembly is something like this:",[226,347,349],{"className":228,"code":348,"language":230,"meta":231,"style":231},"print(\"hello, world\"); # 1 \nprint(\"hello, world\"); # 2\nprint(\"hello, world\"); # 3\nprint(\"hello, world\"); # 4\nprint(\"hello, world\"); # 5\nprint(\"hello, world\"); # 6\nprint(\"hello, world\"); # 7\nprint(\"hello, world\"); # 8\nprint(\"hello, world\"); # 9\nprint(\"hello, world\"); # 10\n",[215,350,351,370,387,404,421,439,457,475,493,511],{"__ignoreMap":231},[235,352,353,355,357,359,361,363,366],{"class":237,"line":238},[235,354,338],{"class":304},[235,356,263],{"class":241},[235,358,311],{"class":310},[235,360,315],{"class":314},[235,362,311],{"class":310},[235,364,365],{"class":241},"); ",[235,367,369],{"class":368},"seacL","# 1 \n",[235,371,372,374,376,378,380,382,384],{"class":237,"line":256},[235,373,338],{"class":304},[235,375,263],{"class":241},[235,377,311],{"class":310},[235,379,315],{"class":314},[235,381,311],{"class":310},[235,383,365],{"class":241},[235,385,386],{"class":368},"# 2\n",[235,388,389,391,393,395,397,399,401],{"class":237,"line":301},[235,390,338],{"class":304},[235,392,263],{"class":241},[235,394,311],{"class":310},[235,396,315],{"class":314},[235,398,311],{"class":310},[235,400,365],{"class":241},[235,402,403],{"class":368},"# 3\n",[235,405,406,408,410,412,414,416,418],{"class":237,"line":323},[235,407,338],{"class":304},[235,409,263],{"class":241},[235,411,311],{"class":310},[235,413,315],{"class":314},[235,415,311],{"class":310},[235,417,365],{"class":241},[235,419,420],{"class":368},"# 4\n",[235,422,424,426,428,430,432,434,436],{"class":237,"line":423},5,[235,425,338],{"class":304},[235,427,263],{"class":241},[235,429,311],{"class":310},[235,431,315],{"class":314},[235,433,311],{"class":310},[235,435,365],{"class":241},[235,437,438],{"class":368},"# 5\n",[235,440,442,444,446,448,450,452,454],{"class":237,"line":441},6,[235,443,338],{"class":304},[235,445,263],{"class":241},[235,447,311],{"class":310},[235,449,315],{"class":314},[235,451,311],{"class":310},[235,453,365],{"class":241},[235,455,456],{"class":368},"# 6\n",[235,458,460,462,464,466,468,470,472],{"class":237,"line":459},7,[235,461,338],{"class":304},[235,463,263],{"class":241},[235,465,311],{"class":310},[235,467,315],{"class":314},[235,469,311],{"class":310},[235,471,365],{"class":241},[235,473,474],{"class":368},"# 7\n",[235,476,478,480,482,484,486,488,490],{"class":237,"line":477},8,[235,479,338],{"class":304},[235,481,263],{"class":241},[235,483,311],{"class":310},[235,485,315],{"class":314},[235,487,311],{"class":310},[235,489,365],{"class":241},[235,491,492],{"class":368},"# 8\n",[235,494,496,498,500,502,504,506,508],{"class":237,"line":495},9,[235,497,338],{"class":304},[235,499,263],{"class":241},[235,501,311],{"class":310},[235,503,315],{"class":314},[235,505,311],{"class":310},[235,507,365],{"class":241},[235,509,510],{"class":368},"# 9\n",[235,512,514,516,518,520,522,524,526],{"class":237,"line":513},10,[235,515,338],{"class":304},[235,517,263],{"class":241},[235,519,311],{"class":310},[235,521,315],{"class":314},[235,523,311],{"class":310},[235,525,365],{"class":241},[235,527,528],{"class":368},"# 10\n",[204,530,531,532,534],{},"It just prints ",[215,533,315],{}," 10 times without additional for loop.",[536,537,538,540],"note",{},[215,539,217],{}," annotation executes code, at compile time, only at the surface level.",[204,542,543,544,547,548,551,552,554,555,557],{},"Executing only at the surface level means that the compiler will not try to run, at compile time, the code that isn't part of the current block of code. ",[545,546],"br",{},"\nAs in example above, the compiler may execute ",[215,549,550],{},"for loop"," at compile time but it won't do the same thing with the ",[215,553,338],{}," . It won't go to that ",[215,556,338],{}," function and try execute the code inside at compile time.",[204,559,560,561,563],{},"Basically, ",[215,562,217],{}," only executes what it can see at the surface, it doesn't care what's behind the wall.",[565,566,567],"style",{},"html pre.shiki code .sM89C, html code.shiki .sM89C{--shiki-light:#90A4AE;--shiki-default:#383A42;--shiki-dark:#ABB2BF}html pre.shiki code .s8dPH, html code.shiki .s8dPH{--shiki-light:#90A4AE;--shiki-default:#E45649;--shiki-dark:#E06C75}html pre.shiki code .sB4Xn, html code.shiki .sB4Xn{--shiki-light:#39ADB5;--shiki-default:#383A42;--shiki-dark:#ABB2BF}html pre.shiki code .sQsOY, html code.shiki .sQsOY{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#A626A4;--shiki-default-font-style:inherit;--shiki-dark:#C678DD;--shiki-dark-font-style:inherit}html pre.shiki code .sriKn, html code.shiki .sriKn{--shiki-light:#F76D47;--shiki-default:#986801;--shiki-dark:#D19A66}html pre.shiki code .spnjr, html code.shiki .spnjr{--shiki-light:#6182B8;--shiki-default:#4078F2;--shiki-dark:#61AFEF}html pre.shiki code .sVH1b, html code.shiki .sVH1b{--shiki-light:#39ADB5;--shiki-default:#50A14F;--shiki-dark:#98C379}html pre.shiki code .spZWa, html code.shiki .spZWa{--shiki-light:#91B859;--shiki-default:#50A14F;--shiki-dark:#98C379}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .seacL, html code.shiki .seacL{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#A0A1A7;--shiki-default-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic}",{"title":231,"searchDepth":256,"depth":256,"links":569},[570],{"id":210,"depth":256,"text":211},"Additional metadata","md",null,{},{"icon":24},{"title":132,"description":571},"C3M6TMhiOz7y8J5POJ4s7tX_ER1Xzi8Cg56A7fhtufQ",[579,581],{"title":128,"path":129,"stem":130,"description":580,"icon":24,"children":-1},"Beautiful way to handle errors!",{"title":136,"path":137,"stem":138,"description":582,"icon":24,"children":-1},"Define a function with dynamic parameters",1774971230694]