[{"data":1,"prerenderedAt":580},["ShallowReactive",2],{"navigation":3,"guides-collection":18},[4],{"title":5,"path":6,"stem":7,"children":8,"page":17},"Guides","\u002Fguides","guides",[9,13],{"title":10,"path":11,"stem":12},"Get Started","\u002Fguides\u002Fget-started","guides\u002F1.get-started",{"title":14,"path":15,"stem":16},"Build from Source","\u002Fguides\u002Fbuild-from-source","guides\u002F2.build-from-source",false,[19,230],{"id":20,"title":10,"body":21,"description":31,"extension":224,"meta":225,"navigation":227,"path":11,"seo":228,"stem":12,"__hash__":229},"guides\u002Fguides\u002F1.get-started.md",{"type":22,"value":23,"toc":215},"minimark",[24,28,32,37,106,110,115,122,130,133,142,146,152,156,162,167,173,177,180,208,211],[25,26,10],"h1",{"id":27},"get-started",[29,30,31],"p",{},"This guide covers installation and basic usage of MathScript.",[33,34,36],"h2",{"id":35},"installation","Installation",[38,39,40,60,79],"ol",{},[41,42,43,44],"li",{},"Download the Installer",[45,46,47,57],"ul",{},[41,48,49,50],{},"Visit the ",[51,52,56],"a",{"href":53,"rel":54},"https:\u002F\u002Fgithub.com\u002FMathScript-Lang\u002FMathScript\u002Freleases",[55],"nofollow","MathScript releases page",[41,58,59],{},"Download the latest installer for your platform (Windows, macOS, or Linux)",[41,61,62,63],{},"Run the Installer",[45,64,65,68,71],{},[41,66,67],{},"Run the downloaded installer",[41,69,70],{},"Follow the installation wizard prompts",[41,72,73,74,78],{},"Choose your installation directory and your installation options (add to ",[75,76,77],"code",{},"PATH",", install MathGet, ...)",[41,80,81,82],{},"Verify Installation",[45,83,84,87],{},[41,85,86],{},"Open your terminal or command prompt",[41,88,89,90],{},"Run the following command:",[91,92,97],"pre",{"className":93,"code":94,"language":95,"meta":96,"style":96},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","mathscript --version\n","sh","",[75,98,99],{"__ignoreMap":96},[100,101,104],"span",{"class":102,"line":103},"line",1,[100,105,94],{},[33,107,109],{"id":108},"basic-usage","Basic Usage",[111,112,114],"h3",{"id":113},"your-first-program","Your first program",[29,116,117,118,121],{},"Create a file named ",[75,119,120],{},"hello.mscr",":",[91,123,128],{"className":124,"code":126,"language":127},[125],"language-text","print(\"Hello, MathScript!\");\n","text",[75,129,126],{"__ignoreMap":96},[29,131,132],{},"Run it:",[91,134,136],{"className":93,"code":135,"language":95,"meta":96,"style":96},"mathscript hello.mscr\n",[75,137,138],{"__ignoreMap":96},[100,139,140],{"class":102,"line":103},[100,141,135],{},[111,143,145],{"id":144},"command-line-options","Command-Line Options",[91,147,150],{"className":148,"code":149,"language":127},[125],"Description:\n  MathScript Interpreter & Compiler\n\nUsage:\n  mathscript [\u003CProgram>] [options]\n\nArguments:\n  \u003CProgram>  The MathScript program (.mscr file) to compile\u002Fexecute\n\nOptions:\n  -o, --Output, --output \u003COutput>    Compile the MathScript program into the `\u003COutput>` executable\n  -d, --Debug, --debug \u003CDebugLevel>  Set the debug level (Parser, Lexer, ParserLexer, All)\n  -?, -h, --help                     Show help and usage information\n  --version                          Show version information\n  -v, --Version                      Print version information\n",[75,151,149],{"__ignoreMap":96},[111,153,155],{"id":154},"examples","Examples",[91,157,160],{"className":158,"code":159,"language":127},[125],"int a = 3;\nint b = 2;\nint result = a + b;\nprint(result); \u002F\u002F Output: 5\n",[75,161,159],{"__ignoreMap":96},[163,164,166],"h4",{"id":165},"functions","Functions",[91,168,171],{"className":169,"code":170,"language":127},[125],"func int add(int x, int y) {\n    return x + y;\n}\n\nprint(add(5, 3)); \u002F\u002F Output: 8\n",[75,172,170],{"__ignoreMap":96},[33,174,176],{"id":175},"debug-levels","Debug Levels",[29,178,179],{},"Set the debug level to inspect parser, lexer and interpreter behavior:",[91,181,183],{"className":93,"code":182,"language":95,"meta":96,"style":96},"mathscript -d Parser program.mscr\nmathscript -d Lexer program.mscr\nmathscript -d ParserLexer program.mscr\nmathscript -d All program.mscr\n",[75,184,185,190,196,202],{"__ignoreMap":96},[100,186,187],{"class":102,"line":103},[100,188,189],{},"mathscript -d Parser program.mscr\n",[100,191,193],{"class":102,"line":192},2,[100,194,195],{},"mathscript -d Lexer program.mscr\n",[100,197,199],{"class":102,"line":198},3,[100,200,201],{},"mathscript -d ParserLexer program.mscr\n",[100,203,205],{"class":102,"line":204},4,[100,206,207],{},"mathscript -d All program.mscr\n",[29,209,210],{},"Use debug levels to troubleshoot parsing and execution of your programs.",[212,213,214],"style",{},"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);}",{"title":96,"searchDepth":192,"depth":192,"links":216},[217,218,223],{"id":35,"depth":192,"text":36},{"id":108,"depth":192,"text":109,"children":219},[220,221,222],{"id":113,"depth":198,"text":114},{"id":144,"depth":198,"text":145},{"id":154,"depth":198,"text":155},{"id":175,"depth":192,"text":176},"md",{"icon":226},"i-lucide-download",true,{"title":10,"description":31},"qrohbfIFS2D5Oz6fmzwDWf15vxeg5SwT0yjc-zyp9P8",{"id":231,"title":14,"body":232,"description":239,"extension":224,"meta":576,"navigation":227,"path":15,"seo":578,"stem":16,"__hash__":579},"guides\u002Fguides\u002F2.build-from-source.md",{"type":22,"value":233,"toc":557},[234,237,240,244,255,259,262,277,281,289,292,301,308,311,320,324,353,357,390,394,397,401,404,413,426,430,437,446,452,461,464,473,476,491,494,503,507,511,537,543,555],[25,235,14],{"id":236},"build-from-source",[29,238,239],{},"Instructions for building MathScript from source code.",[33,241,243],{"id":242},"prerequisites","Prerequisites",[45,245,246,249,252],{},[41,247,248],{},".NET SDK 9.0 or later",[41,250,251],{},"Git",[41,253,254],{},"A C# compatible IDE (Visual Studio, Visual Studio Code, or JetBrains Rider) or any code editor with command line tools",[33,256,258],{"id":257},"cloning-the-repository","Cloning the Repository",[29,260,261],{},"Clone the MathScript repository:",[91,263,265],{"className":93,"code":264,"language":95,"meta":96,"style":96},"git clone https:\u002F\u002Fgithub.com\u002FMathScript-Lang\u002FMathScript\ncd MathScript\n",[75,266,267,272],{"__ignoreMap":96},[100,268,269],{"class":102,"line":103},[100,270,271],{},"git clone https:\u002F\u002Fgithub.com\u002FMathScript-Lang\u002FMathScript\n",[100,273,274],{"class":102,"line":192},[100,275,276],{},"cd MathScript\n",[33,278,280],{"id":279},"building","Building",[111,282,284,285,288],{"id":283},"with-the-dotnet-cli","With the ",[75,286,287],{},"dotnet"," CLI",[29,290,291],{},"Navigate to the project's folder and build:",[91,293,295],{"className":93,"code":294,"language":95,"meta":96,"style":96},"dotnet build\n",[75,296,297],{"__ignoreMap":96},[100,298,299],{"class":102,"line":103},[100,300,294],{},[29,302,303,304,307],{},"You may need to build twice for your first build to generate and use ",[75,305,306],{},"BuildInfo.cs",".",[29,309,310],{},"To create a release build:",[91,312,314],{"className":93,"code":313,"language":95,"meta":96,"style":96},"dotnet build -c Release\n",[75,315,316],{"__ignoreMap":96},[100,317,318],{"class":102,"line":103},[100,319,313],{},[111,321,323],{"id":322},"with-visual-studio","With Visual Studio",[38,325,326,329,332,338],{},[41,327,328],{},"Open Visual Studio",[41,330,331],{},"Select \"Open a project or solution\"",[41,333,334,335],{},"Navigate to and open ",[75,336,337],{},"MathScript.slnx",[41,339,340,341,345,346,345,349,352],{},"Build the solution with ",[342,343,344],"kbd",{},"Ctrl"," + ",[342,347,348],{},"Shift",[342,350,351],{},"B"," or via Build > Build Solution",[111,354,356],{"id":355},"with-visual-studio-code","With Visual Studio Code",[38,358,359,362,365],{},[41,360,361],{},"Open the MathScript folder in Visual Studio Code",[41,363,364],{},"Install the C# extensions if not already installed",[41,366,367,368],{},"Run the build task:\n",[45,369,370,379],{},[41,371,372,373,345,375,345,377],{},"Press ",[342,374,344],{},[342,376,348],{},[342,378,351],{},[41,380,381,382],{},"Or use the terminal:",[91,383,384],{"className":93,"code":294,"language":95,"meta":96,"style":96},[75,385,386],{"__ignoreMap":96},[100,387,388],{"class":102,"line":103},[100,389,294],{},[33,391,393],{"id":392},"running","Running",[29,395,396],{},"After building, you can run MathScript in two ways:",[111,398,400],{"id":399},"interactive-repl-mode","Interactive REPL Mode",[29,402,403],{},"Run without arguments to start an interactive shell:",[91,405,407],{"className":93,"code":406,"language":95,"meta":96,"style":96},"dotnet run\n",[75,408,409],{"__ignoreMap":96},[100,410,411],{"class":102,"line":103},[100,412,406],{},[29,414,415,416,419,420,345,422,425],{},"Type your MathScript code and press Enter to execute it. Type ",[75,417,418],{},"exit"," or press ",[342,421,344],{},[342,423,424],{},"C"," to quit.",[111,427,429],{"id":428},"execute-or-compile-a-program","Execute or Compile a Program",[29,431,432,433,436],{},"Execute a ",[75,434,435],{},".mscr"," file directly:",[91,438,440],{"className":93,"code":439,"language":95,"meta":96,"style":96},"dotnet run -- hello.mscr\n",[75,441,442],{"__ignoreMap":96},[100,443,444],{"class":102,"line":103},[100,445,439],{},[29,447,448,449,451],{},"Compile a ",[75,450,435],{}," file to an executable:",[91,453,455],{"className":93,"code":454,"language":95,"meta":96,"style":96},"dotnet run -- -o output hello.mscr\n",[75,456,457],{"__ignoreMap":96},[100,458,459],{"class":102,"line":103},[100,460,454],{},[29,462,463],{},"And generally:",[91,465,467],{"className":93,"code":466,"language":95,"meta":96,"style":96},"dotnet run -- [arguments]\n",[75,468,469],{"__ignoreMap":96},[100,470,471],{"class":102,"line":103},[100,472,466],{},[29,474,475],{},"You can also use the built executable directly from the build output directory:",[91,477,479],{"className":93,"code":478,"language":95,"meta":96,"style":96},".\u002Fbin\u002FDebug\u002Fnet9.0\u002Fmathscript hello.mscr\n.\u002Fbin\u002FDebug\u002Fnet9.0\u002Fmathscript -o output hello.mscr\n",[75,480,481,486],{"__ignoreMap":96},[100,482,483],{"class":102,"line":103},[100,484,485],{},".\u002Fbin\u002FDebug\u002Fnet9.0\u002Fmathscript hello.mscr\n",[100,487,488],{"class":102,"line":192},[100,489,490],{},".\u002Fbin\u002FDebug\u002Fnet9.0\u002Fmathscript -o output hello.mscr\n",[29,492,493],{},"For release builds:",[91,495,497],{"className":93,"code":496,"language":95,"meta":96,"style":96},".\u002Fbin\u002FRelease\u002Fnet9.0\u002Fmathscript hello.mscr\n",[75,498,499],{"__ignoreMap":96},[100,500,501],{"class":102,"line":103},[100,502,496],{},[33,504,506],{"id":505},"troubleshooting","Troubleshooting",[111,508,510],{"id":509},"build-fails-with-missing-dependencies","Build fails with missing dependencies",[45,512,513,525],{},[41,514,515,516],{},"Ensure .NET SDK 9.0+ is installed:",[91,517,519],{"className":93,"code":518,"language":95,"meta":96,"style":96},"dotnet --version\n",[75,520,521],{"__ignoreMap":96},[100,522,523],{"class":102,"line":103},[100,524,518],{},[41,526,527,528],{},"Restore NuGet packages:",[91,529,531],{"className":93,"code":530,"language":95,"meta":96,"style":96},"dotnet restore\n",[75,532,533],{"__ignoreMap":96},[100,534,535],{"class":102,"line":103},[100,536,530],{},[111,538,540,542],{"id":539},"buildinfocs-not-found-on-first-build",[75,541,306],{}," not found on first build",[45,544,545,552],{},[41,546,547,548,551],{},"This is a known issue with the build system checking for the ",[75,549,550],{},"BuildInfo"," class before the file generation task runs.",[41,553,554],{},"Simply build again and it will succeed, as the file will already exist.",[212,556,214],{},{"title":96,"searchDepth":192,"depth":192,"links":558},[559,560,561,567,571],{"id":242,"depth":192,"text":243},{"id":257,"depth":192,"text":258},{"id":279,"depth":192,"text":280,"children":562},[563,565,566],{"id":283,"depth":198,"text":564},"With the dotnet CLI",{"id":322,"depth":198,"text":323},{"id":355,"depth":198,"text":356},{"id":392,"depth":192,"text":393,"children":568},[569,570],{"id":399,"depth":198,"text":400},{"id":428,"depth":198,"text":429},{"id":505,"depth":192,"text":506,"children":572},[573,574],{"id":509,"depth":198,"text":510},{"id":539,"depth":198,"text":575},"BuildInfo.cs not found on first build",{"icon":577},"i-lucide-folder-open-dot",{"title":14,"description":239},"uARPlGcqhN1bMdv0F5vWC_JA5kI81xiIaJq3w1djBsc",1777218334673]