{"id":13783152,"url":"https://github.com/tcsullivan/interpreter","last_synced_at":"2025-05-11T17:31:06.002Z","repository":{"id":176180568,"uuid":"131522313","full_name":"tcsullivan/interpreter","owner":"tcsullivan","description":"A minimal scripting language for low-memory microcontrollers","archived":true,"fork":false,"pushed_at":"2020-04-19T12:51:58.000Z","size":128,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-03T18:18:18.614Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tcsullivan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-04-29T19:14:00.000Z","updated_at":"2024-02-23T14:32:36.000Z","dependencies_parsed_at":"2023-07-15T15:13:30.210Z","dependency_job_id":null,"html_url":"https://github.com/tcsullivan/interpreter","commit_stats":null,"previous_names":["tcsullivan/interpreter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcsullivan%2Finterpreter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcsullivan%2Finterpreter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcsullivan%2Finterpreter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcsullivan%2Finterpreter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tcsullivan","download_url":"https://codeload.github.com/tcsullivan/interpreter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253604554,"owners_count":21934884,"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":[],"created_at":"2024-08-03T18:01:54.384Z","updated_at":"2025-05-11T17:31:05.721Z","avatar_url":"https://github.com/tcsullivan.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# interpreter\n\n*interpreter* is a minimal scripting language aimed at low-memory embedded systems. \n\nMany other scripting languages currently exist for embedded use, including Lua, Tcl, and BASIC; however, their implementations require certain system calls (e.g. read()/write()) that may not be available or used on an embedded device. Additionally, their memory and/or non-volatile memory requirements may be too large for the targeted device. As a result, *interpreter* was made with the goal to allow advanced scripts to be run in minimal conditions. This included things like having only a few built-in functions, and only loading script from C-strings.  \n  \nTo use *interpreter* with your own device, you will need some malloc/free implementation and a freestanding standard library. Newlib can work well for this, although functions like atoi() and snprintf() will probably need to be rewritten (if you don't have an \\_sbrk defined).  \n  \n### interpreter features:  \n* Variable/function definition - in C and in script\n* dynamic arrays\n* if/else conditionals\n* while loops\n* a solve function to parse strings at script runtime\n\n### inconvenient features:  \n* some code formatting is enforced due to parser limitation\n* all variables are global (i.e. scopes don't exist)\n* whitespace is not always ignored\n\n### some TODO items:  \n* add better error messages\n* better array support\n* better string support\n* for loops\n* variable scopes\n\n## building and running\n\nThis project can be made for the host system (```mv shell.c.bak shell.c; make```) or an ARM system (```mv shell.c shell.c.bak; make arm```). Make's ```-j``` argument may be used to multithread compilation.  \n  \nTo run on the host system, run ```./shell some_script_file```. Note that IO functions are **not** built in, so you must define your own.  \nTo use on an ARM device, simply link ```libinterp.a``` into your program and use the header files. See ```shell.c``` for an idea of how to the interpreter.  \n\n\u0026nbsp;  \n\nThis project is still in heavy development, so don't expect too much. See the wiki for a scripting guide.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcsullivan%2Finterpreter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftcsullivan%2Finterpreter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcsullivan%2Finterpreter/lists"}