{"id":13629051,"url":"https://github.com/morrow1nd/luax","last_synced_at":"2025-04-17T04:32:55.009Z","repository":{"id":174985157,"uuid":"76926597","full_name":"morrow1nd/luax","owner":"morrow1nd","description":"Lua-like programming language for studying compiler\u0026interpreter courses.","archived":false,"fork":false,"pushed_at":"2017-06-06T16:44:01.000Z","size":248,"stargazers_count":31,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-08T19:43:05.610Z","etag":null,"topics":["interpreter","lua","luax-programming-language","programming-language"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/morrow1nd.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-20T05:38:17.000Z","updated_at":"2024-09-24T16:43:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"0739b62e-d3b7-404f-a836-8ebb72ee4068","html_url":"https://github.com/morrow1nd/luax","commit_stats":null,"previous_names":["morrow1nd/luax"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morrow1nd%2Fluax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morrow1nd%2Fluax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morrow1nd%2Fluax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morrow1nd%2Fluax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morrow1nd","download_url":"https://codeload.github.com/morrow1nd/luax/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249316032,"owners_count":21249879,"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":["interpreter","lua","luax-programming-language","programming-language"],"created_at":"2024-08-01T22:01:01.988Z","updated_at":"2025-04-17T04:32:50.660Z","avatar_url":"https://github.com/morrow1nd.png","language":"C","readme":"![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)\n\n# What is Luax?\n\n Luax is a easy-to-learn, concise and powerful programming language. ([Chinese Page](./doc/doc-zh/))\n\n Luax provides full documentation(from the language itself to internal design), making it a perfect project for beginner to learn how to make a *interpreter*.\n\n Luax is distributed in source code, which contains the bytecode generator, luax virtual machine, standard library, a standalone executable interpreter, and full documentation.\n\n\n# Documentation\n\n## For Language User\n\n + [Get Started](./doc/get-started.md) - Setup a working environment.\n + [5-minites-tour](./doc/5-minites-tour.md)\n + [Luax Reference Manual](./doc/luax_reference_manual.md)\n\n## For Language Hacker\n\n + [Luax Design Document](./doc/luax_design_document.md)  (Coming soon!)\n\n\n# Features\n\nThe luax programming language itself:\n + easy-to-learn: [5-minites-tour](./doc/5-minites-tour.md)\n + powerful data description constructs\n\nThe C achieve of luax:\n + lightwight arch: [source code structure](./doc/source_code_structure.md)\n + using subset of c++ and c\n + full-commented\n\n Here is a list:\n  + **dynamic type language** (*nil*, *bool*, *number*, *string*, *function*, *table*)\n  + **basic statements** (*variable-declaration*, *if/while*, *break*, *continue*, *function-define*)\n  + **mutli-assign, multi-return**  - `a, b = 1, 2;` `function(a, b) return a+b, a-b; end`\n  + **table**  - a container containing several key-values. The type of key or value can be any one of those types listed above.\n  + **meta table**  - a table defining what would happens when specific action made to a table(such as: get set call), example: [*read-only table*](https://github.com/morrow1nd/luax/blob/master/doc/luax_reference_manual.md#meta-table) \n  + **function**  - first-class citizen, example: [*link several functions*](https://github.com/morrow1nd/luax/blob/master/doc/luax_reference_manual.md#function) \n\n\n\n\n# Examples\n\n```lua\n-- table: a container containing several key-values.\nlocal tab = { 'key' : 'value', 1 : false };\ntab.name = \"I'm a table\";\ntab[\"func\"] = function() return \"I can hold a function\"; end; -- tab[\"func\"] equals to tab.func\ntab[true] = \"the type of my key can be a boolean\";\ntab[another_table] = \"or a table\";\n\n\n-- function\nlocal func = function(a, b) -- define a function\n    return a + b, a - b;\nend;\ntab.a, tab.b = func(1, 2); -- return 3, -1\n\nprint(func(1, 2), 2);   -- 3, -1, 2\nprint((func(1, 2)), 2); -- 3, 2\n\nlocal func_sum = function(a, b)\n    local i, sum = 0, 0;\n    while i \u003c arguments.size then  -- every function has a variable named arguments\n        sum += arguments[i];\n        i += 1;\n    end\n    return sum;\nend\nprint(func_sum(1, 2, 3)); -- 6\nprint(func_sum(1)); -- 1, argument b equals to nil now\n--[[ \n  See more examples about function from doc/luax_reference_manual.md#function\n]]\n```\n\n\n# Build\n\n```shell\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake \u0026\u0026 make test\n# find more platforms from [Get Started]\n```\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorrow1nd%2Fluax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorrow1nd%2Fluax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorrow1nd%2Fluax/lists"}