{"id":13533690,"url":"https://github.com/ArkScript-lang/Ark","last_synced_at":"2025-04-01T22:30:34.544Z","repository":{"id":39587049,"uuid":"189978997","full_name":"ArkScript-lang/Ark","owner":"ArkScript-lang","description":"ArkScript is a small, fast, functional and scripting language for C++ projects","archived":false,"fork":false,"pushed_at":"2025-03-21T17:33:34.000Z","size":6199,"stargazers_count":620,"open_issues_count":6,"forks_count":48,"subscribers_count":12,"default_branch":"dev","last_synced_at":"2025-03-21T18:25:06.815Z","etag":null,"topics":["ark","arkscript","compiler","cpp","language","lisp","programming-language","scripting","scripting-language","virtual-machine","vm"],"latest_commit_sha":null,"homepage":"https://arkscript-lang.dev/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArkScript-lang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"SuperFola","custom":["https://paypal.me/lexplt"]}},"created_at":"2019-06-03T09:52:14.000Z","updated_at":"2025-03-17T13:13:14.000Z","dependencies_parsed_at":"2024-01-23T17:08:35.253Z","dependency_job_id":"a0b372af-d9e2-4f5f-addd-c36f5fef46d0","html_url":"https://github.com/ArkScript-lang/Ark","commit_stats":null,"previous_names":["superfola/ark"],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArkScript-lang%2FArk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArkScript-lang%2FArk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArkScript-lang%2FArk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArkScript-lang%2FArk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArkScript-lang","download_url":"https://codeload.github.com/ArkScript-lang/Ark/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246720416,"owners_count":20822898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ark","arkscript","compiler","cpp","language","lisp","programming-language","scripting","scripting-language","virtual-machine","vm"],"created_at":"2024-08-01T07:01:22.198Z","updated_at":"2025-04-01T22:30:34.537Z","avatar_url":"https://github.com/ArkScript-lang.png","language":"C++","readme":"# ArkScript  ![Latest version](https://img.shields.io/github/v/release/arkscript-lang/ark?style=for-the-badge\u0026include_prereleases)\n\n![Code size](https://img.shields.io/github/languages/code-size/arkscript-lang/ark?style=for-the-badge\u0026logo=github)\n![Downloads](https://img.shields.io/github/downloads/arkscript-lang/ark/total?color=%2324cc24\u0026style=for-the-badge\u0026logo=github)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/ArkScript-lang/Ark/ci.yml?logo=cmake\u0026style=for-the-badge\u0026branch=dev)\n[![Coverage](https://img.shields.io/coverallsCoverage/github/ArkScript-lang/Ark?style=for-the-badge)](https://coveralls.io/github/ArkScript-lang/Ark?branch=dev)\n\n\u003cimg align=\"right\" src=\".github/images/ArkTransparent-by-mazz.png\" width=200px alt=\"ArkScript log by Mazz\"\u003e\n\n* [Documentation](https://arkscript-lang.dev/documentation.html)\n* [Discussions](https://github.com/orgs/ArkScript-lang/discussions): to receive help with the language, discuss new features and ideas\n* [Modules](https://github.com/ArkScript-lang/modules)\n\n**Nota bene**: the project is referred as \"Ark\" and as \"ArkScript\". The official public name is \"ArkScript\" since \"Ark\" is already being used by [another language](https://github.com/ark-lang/ark)\n\n## Key features\n\nArkScript is\n\n* **small**: the core fit under 8000 lines of code ; also small in terms of keywords (only 9)\n* **a scripting language**: very easy to embed it in your projects. Registering your own functions in the language is made easy\n* **portable**: a unique bytecode which can be run everywhere the virtual machine is\n* **a functional language**: every parameter is passed by value, everything is immutable unless specified\n* **powerful**: provides closures and explicit capture\n* **promoting functionalities before performances**: expressiveness often brings more productivity, though performances aren't left behind\n* **a Lisp inspired language**, with fewer parentheses: `[...]` is expanded to `(list ...)` and `{}` to `(begin ...)`\n* **extensible**: supports C++ module to use it in the language, adding functionalities\n\nAlso, it has:\n\n* **macros**: if/else, values, and functions\n* tail call optimization\n* a REPL with autocompletion and coloration\n* a growing standard library, composed of ArkScript code (under `lib/std/`) and C++ (under `lib/ext/`)\n* a lot of unit tests (but never enough), which are ran before every release to ensure everything works as expected\n* docker images:\n    * [stable](https://hub.docker.com/r/arkscript/stable), built after each release\n    * [nightly](https://hub.docker.com/r/arkscript/nightly), built after each commit\n\n## Examples\n\n### Fibonacci suite\n\n```clojure\n(let fibo (fun (n)\n    (if (\u003c n 2)\n        n\n        (+ (fibo (- n 1)) (fibo (- n 2))))))\n\n(print (fibo 28))  # display 317811\n```\n\n## More or less game\n\n```clojure\n(let number (random 0 10000))\n\n(let game (fun () {\n  (let impl (fun (tries) {\n    (let guess (toNumber (input \"Input a numeric value: \")))\n    (if (\u003c guess number)\n      {\n        (print \"It's more than \" guess)\n        (impl (+ tries 1)) }\n      (if (= guess number)\n        {\n          (print \"You found it!\")\n          tries }\n        {\n          (print \"It's less than \" guess)\n          (impl (+ tries 1)) }))}))\n\n  (let tries (impl 0))\n  (print \"You won in \" tries \" tries.\") }))\n\n(game)\n```\n\nMore examples are available inside `examples/`.\n\n## Installation\n\nYou can either use docker:\n\n```bash\ndocker pull arkscript/stable:latest\n\n# or use the most updated repo\ndocker pull arkscript/nightly:latest\n```\n\nor [build the project with CMake](#building) and install it with CMake:\n\n```bash\ncmake --install build\n```\n\n## Contributing\n\n* First, [fork](https://github.com/ArkScript-lang/Ark/fork) the repository\n* Then, clone your fork: `git clone git@github.com:username/Ark.git`\n* Install the pre-commit hooks: `pre-commit install` (you may need to [install pre-commit](https://pre-commit.com/#install) first)\n* Create a branch for your feature: `git switch -c feat-my-awesome-idea`\n* When you're done, push it to your fork and submit a pull request\n\nMake sure you follow the [contribution guidelines](CONTRIBUTING.md) before submitting your pull request!\n\nDon't know what to work on? No worries, we have a [list of things to do](https://github.com/ArkScript-lang/Ark/issues) :wink:\n\n### Related projects\n\nWe have other projects tightly related to ArkScript, which aren't necessarily C++ oriented:\n\n* the [standard library](https://github.com/ArkScript-lang/std), written in ArkScript itself\n* the [standard library modules](https://github.com/ArkScript-lang/modules), extending the capacities of the language, written in C++\n* [ArkDoc](https://github.com/ArkScript-lang/ArkDoc), a documentation generator *à la doxygen* for ArkScript, written in Python 3\n* our [website](https://github.com/ArkScript-lang/website) written in HTML, CSS and JavaScript\n\n### Our beloved contributors\n\n[Full list here](https://github.com/ArkScript-lang/Ark/graphs/contributors).\n\n### Coding guidelines for contributing\n\nSee [C++ Coding guidelines](https://github.com/ArkScript-lang/Ark/blob/dev/CONTRIBUTING.md#c-coding-guidelines) if you want to contribute to ArkScript compiler / runtime.\n\nAlso, see [ArkScript Coding guidelines](https://arkscript-lang.dev/guidelines/coding.html) for other files, written in ArkScript.\n\nFor performance reasons, some functions might be written in C++, in `include/Ark/Builtins/Builtins.hpp` and `src/Builtins/`.\n\n## Building\n\n### Dependencies\n\n* C++20\n* CMake \u003e= 3.15\n* Visual Studio \u003e= 11 (on Windows)\n* On macOS versions prior to 10.15, `libc++` lacks `filesystem` in the standard library.\n    * Install a newer compiler using [Homebrew](https://docs.brew.sh/): `brew install gcc \u0026\u0026 brew link gcc`\n    * Pass compiler path to `cmake` in the build step: `-DCMAKE_CXX_COMPILER=/usr/local/bin/g++-14 -DCMAKE_C_COMPILER=/usr/local/bin/gcc-14`\n\n⚠️ When passing a specific C++ compiler to CMake, add the corresponding C compiler as ArkScript relies on C code as well ; otherwise you'll cryptic get compilation/linking errors (using `CMAKE_CXX_COMPILER` and `CMAKE_C_COMPILER`).\n\n### Through CMake\n\nDifferent CMake switches are available to customize the build:\n\n* `-DARK_BUILD_EXE` to generate an executable, defaults to Off, building a shared library only\n* `-DARK_ENABLE_SYSTEM` to enable `sys:exec` (execute shell commands without restrictions), defaults to On\n* `-DARK_NO_STDLIB` to avoid the installation of the ArkScript standard library\n* `-DARK_BUILD_MODULES` to trigger the modules build\n* `-DARK_SANITIZERS` to enable ASAN and UBSAN\n* `-DARK_TESTS` to build the unit tests (separate target named `unittests`)\n  * `-DARK_COVERAGE` to enable coverage analysis ; only works in conjunction with `-DARK_TESTS`, enables the `coverage` target: `cmake --build build --target coverage`\n\n```bash\n# first, clone it\ngit clone --depth=50 --branch=dev https://github.com/ArkScript-lang/Ark.git\ncd Ark\ngit submodule update --init --recursive\n# building Ark\ncmake . -Bbuild -DCMAKE_BUILD_TYPE=Release -DARK_BUILD_EXE=On\ncmake --build build --config Release\n# installing Ark (might need administrative privileges)\ncmake --install build --config Release\n```\n\nDesired output of `arkscript --help`:\n\n```bash\nDESCRIPTION\n        ArkScript programming language\n\nSYNOPSIS\n        arkscript -h \n        arkscript -v \n        arkscript --dev-info \n        arkscript -e \u003cexpression\u003e \n        arkscript -c \u003cfile\u003e [-d] [-f(importsolver|no-importsolver)]\n                  [-f(macroprocessor|no-macroprocessor)] [-f(optimizer|no-optimizer)]\n                  [-f(iroptimizer|no-iroptimizer)] [-fdump-ir] \n\n        arkscript \u003cfile\u003e [-d] [-L \u003clib_dir\u003e] [-f(importsolver|no-importsolver)]\n                  [-f(macroprocessor|no-macroprocessor)] [-f(optimizer|no-optimizer)]\n                  [-f(iroptimizer|no-iroptimizer)] [-fdump-ir]  \n\n        arkscript -f \u003cfile\u003e [--(dry-run|check)] \n        arkscript --ast \u003cfile\u003e [-d] [-L \u003clib_dir\u003e] \n        arkscript -bcr \u003cfile\u003e -on \n        arkscript -bcr \u003cfile\u003e -a [-s \u003cstart\u003e \u003cend\u003e] \n        arkscript -bcr \u003cfile\u003e -st [-s \u003cstart\u003e \u003cend\u003e] \n        arkscript -bcr \u003cfile\u003e -vt [-s \u003cstart\u003e \u003cend\u003e] \n        arkscript -bcr \u003cfile\u003e [-cs] [-p \u003cpage\u003e] [-s \u003cstart\u003e \u003cend\u003e] \n\nOPTIONS\n        -h, --help                  Display this message\n        -v, --version               Display ArkScript version and exit\n        --dev-info                  Display development information and exit\n        -e, --eval                  Evaluate ArkScript expression\n\n        -c, --compile               Compile the given program to bytecode, but do not run\n        -d, --debug...              Increase debug level (default: 0)\n\n        -f(importsolver|no-importsolver)\n                                    Toggle on and off the import solver pass\n\n        -f(macroprocessor|no-macroprocessor)\n                                    Toggle on and off the macro processor pass\n\n        -f(optimizer|no-optimizer)  Toggle on and off the optimizer pass\n        -f(iroptimizer|no-iroptimizer)\n                                    Toggle on and off the IR optimizer pass\n\n        -fdump-ir                   Dump IR to file.ark.ir\n        -d, --debug...              Increase debug level (default: 0)\n\n        -L, --lib                   Set the location of the ArkScript standard library. Paths can be\n                                    delimited by ';'\n\n        -f(importsolver|no-importsolver)\n                                    Toggle on and off the import solver pass\n\n        -f(macroprocessor|no-macroprocessor)\n                                    Toggle on and off the macro processor pass\n\n        -f(optimizer|no-optimizer)  Toggle on and off the optimizer pass\n        -f(iroptimizer|no-iroptimizer)\n                                    Toggle on and off the IR optimizer pass\n\n        -fdump-ir                   Dump IR to file.ark.ir\n        -f, --format                Format the given source file in place\n        --dry-run                   Do not modify the file, only print out the changes\n        --check                     Check if a file formating is correctly, without modifying it.\n                                    Return 1 if formating is needed, 0 otherwise\n\n        --ast                       Compile the given program and output its AST as JSON to stdout\n        -d, --debug...              Increase debug level (default: 0)\n\n        -L, --lib                   Set the location of the ArkScript standard library. Paths can be\n                                    delimited by ';'\n\n        -bcr, --bytecode-reader     Launch the bytecode reader\n        \u003cfile\u003e                      .arkc bytecode file or .ark source file that will be compiled\n                                    first\n\n        -on, --only-names           Display only the bytecode segments names and sizes\n        -a, --all                   Display all the bytecode segments (default)\n        -st, --symbols              Display only the symbols table\n        -vt, --values               Display only the values table\n        -cs, --code                 Display only the code segments\n        -p, --page                  Set the bytecode reader code segment to display\n        -s, --slice                 Select a slice of instructions in the bytecode\n\nVERSION\n        4.0.0-c24c8f22\n\nLICENSE\n        Mozilla Public License 2.0\n```\n\n### In your own project\n\nPlease refer to the [embedding ArkScript](https://arkscript-lang.dev/tutorials/embedding.html) tutorial.\n\n## Performances\n\nSee https://github.com/ArkScript-lang/benchmarks\n\n## Games\n\nYou can find a snake created in ArkScript in the folder examples/games/snake (run it from there, otherwise it won't find the font and the sprites ; you won't need to install the SFML).\n\n![ArkSnake](.github/images/ArkSnake.png)\n\nControls are the arrows (left, right, up and down), the game closes itself when you successfully collect the 3 apples.\n\n## The donors\n\nHuge thanks to those people for their donations to support the project:\n\n* [TheCountVEVO](https://github.com/TheCountVEVO)\n* [llexto](https://github.com/llexto)\n* COUR Eloïse\n* [AKPINAR Dylan](https://github.com/DylanAkp)\n* [Ryan C. Gordon](https://icculus.org) through his [2022 Microgrant](https://web.archive.org/web/20220608150846/https://twitter.com/icculus/status/1534552918317318144)\n\n## Cool graphs\n\n[![Star History Chart](https://api.star-history.com/svg?repos=arkscript-lang/ark\u0026type=Date)](https://star-history.com/#arkscript-lang/ark\u0026Date)\n\n## Credits\n\nThis project was inspired by [game programing patterns](http://gameprogrammingpatterns.com/bytecode.html) and [ofan lisp.cpp](https://gist.github.com/ofan/721464)\n\n## Copyright and Licence information\n\nCopyright (c) 2019-2024 Alexandre Plateau. All rights reserved.\n\nThis ArkScript distribution contains no GNU GPL code, which means it can be used in proprietary projects.\n","funding_links":["https://github.com/sponsors/SuperFola","https://paypal.me/lexplt"],"categories":["C++","Uncategorized","Libraries"],"sub_categories":["Uncategorized","C++"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArkScript-lang%2FArk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FArkScript-lang%2FArk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArkScript-lang%2FArk/lists"}