{"id":13571092,"url":"https://github.com/edubart/nelua-lang","last_synced_at":"2025-05-14T06:13:11.228Z","repository":{"id":37525601,"uuid":"108689515","full_name":"edubart/nelua-lang","owner":"edubart","description":"Minimal, efficient, statically-typed and meta-programmable systems programming language heavily inspired by Lua, which compiles to C and native code.","archived":false,"fork":false,"pushed_at":"2024-12-14T14:10:21.000Z","size":4741,"stargazers_count":2193,"open_issues_count":21,"forks_count":72,"subscribers_count":51,"default_branch":"master","last_synced_at":"2025-04-11T03:38:09.308Z","etag":null,"topics":["c","compiler","efficient","language","lua","luajit","metaprogramming","minimal","nelua","programming-language","statically-typed"],"latest_commit_sha":null,"homepage":"https://nelua.io","language":"Lua","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/edubart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"edubart","patreon":"edubart"}},"created_at":"2017-10-28T22:43:40.000Z","updated_at":"2025-04-10T15:36:43.000Z","dependencies_parsed_at":"2023-11-09T13:26:23.516Z","dependency_job_id":"51bb9956-9e58-4007-baaf-c19e2eb9e6fb","html_url":"https://github.com/edubart/nelua-lang","commit_stats":{"total_commits":1623,"total_committers":18,"mean_commits":90.16666666666667,"dds":0.01848428835489835,"last_synced_commit":"a69a12d1e1e5ee0bfab299350e5d707ff7b2e744"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubart%2Fnelua-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubart%2Fnelua-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubart%2Fnelua-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubart%2Fnelua-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edubart","download_url":"https://codeload.github.com/edubart/nelua-lang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254081252,"owners_count":22011590,"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":["c","compiler","efficient","language","lua","luajit","metaprogramming","minimal","nelua","programming-language","statically-typed"],"created_at":"2024-08-01T14:00:58.366Z","updated_at":"2025-05-14T06:13:11.211Z","avatar_url":"https://github.com/edubart.png","language":"Lua","funding_links":["https://github.com/sponsors/edubart","https://patreon.com/edubart","https://www.patreon.com/edubart"],"categories":["Lua","Uncategorized","Other"],"sub_categories":["Uncategorized"],"readme":"![Nelua Logo](https://nelua.io/assets/img/nelua-logo-64px.png)\n\n[nelua.io](https://nelua.io/)\n\n[![Test Status](https://github.com/edubart/nelua-lang/workflows/test/badge.svg)](https://github.com/edubart/nelua-lang/actions)\n[![Discord](https://img.shields.io/discord/680417078959800322.svg)](https://discord.gg/7aaGeG7)\n\nNelua (stands for **N**ative **E**xtensible **Lua**) is a minimal, efficient,\nstatically-typed and meta-programmable systems programming language heavily\ninspired by Lua, which compiles to C and native code.\n\n**Note:** The language is in alpha state and still evolving.\n\n## Quick start\n\n- For basic information check the [Website](https://nelua.io/).\n- For first steps and how to use Nelua, start at the [Tutorial](https://nelua.io/tutorial/).\n- For a tour of the language's syntax, features and usage read the [Overview](https://nelua.io/overview/).\n- For small examples written in Nelua look the [Examples](./examples) folder .\n- For questions and discussions go to the [Discussions](https://github.com/edubart/nelua-lang/discussions).\n- For a chat with the community join the [Discord server](https://discord.gg/7aaGeG7).\n- For cool stuff made with Nelua check [Awesome Nelua](https://github.com/edubart/nelua-lang/wiki/Awesome-Nelua) wiki page and `#showcase` channel in the Discord server.\n\nAfter installing, you might want to check out the featured example, a Snake\ngame leveraging the famous [SDL2](https://www.libsdl.org) library:\n\n```bash\nnelua examples/snakesdl.nelua\n```\n\n## About\n\nNelua is a [systems programming language](https://en.wikipedia.org/wiki/System_programming_language)\nfor performance-sensitive applications where [Lua](https://en.wikipedia.org/wiki/Lua_(programming_language))\nwould not be efficient, such as operating systems, real-time applications and\ngame engines. While it has syntax and semantics similar to Lua, it primarily\nfocuses on generating efficient C code and provide support for\nhighly-optimizable low-level programming. Using Nelua idioms such as records,\narrays, manual memory management and pointers should result in performance as\nefficient as pure C; on the other hand, when using Lua idioms such as tables,\nmetatables and untyped variables, the compiler will bake a runtime library for\nthis sort of dynamic functionality into the program, which could incur some\nruntime overhead.\n\n\nNelua can do [meta programming](https://en.wikipedia.org/wiki/Metaprogramming)\nat compile time through preprocessor constructs written in Lua; since the\ncompiler itself is also written in Lua, it means that user-provided\npreprocessor code can interact at any point with the compiler's internals and\nthe source code's [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree).\nSuch system allows for ad-hoc implementation of high level constructs such as\n[classes](https://en.wikipedia.org/wiki/Class_(computer_programming)),\n[generics](https://en.wikipedia.org/wiki/Generic_programming) and\n[polymorphism](https://en.wikipedia.org/wiki/Polymorphism_(computer_science)),\nall without having to add them into the core specification, thus keeping the\nlanguage simple, extensible and compact. The same way that Lua's\nobject-oriented patterns are not built into the language, but can be\nnonetheless achieved through [metatables](https://webserver2.tecgraf.puc-rio.br/lua/local/pil/13.html),\nin Nelua you could yourself implement a similar functionality which is fully\ndecided at compile time or dynamically dispatched at runtime.\n\nNelua can do [extensible programming](https://en.wikipedia.org/wiki/Extensible_programming)\nas the programmer may add extensions to the language such as new grammars,\n[AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) definitions,\nsemantics, type checkers, code generation and behaviors to the compiler at\ncompile time via the preprocessor.\n\nNelua provides support for both [garbage-collected](https://en.wikipedia.org/wiki/Garbage_collection_(computer_science))\nand [manual](https://en.wikipedia.org/wiki/Manual_memory_management)\nmemory management in a way that the developer can easily choose between\nusing garbage collection, or completely disabling\ngarbage collection, or mixing both.\n\nNelua first compiles to\n[C](https://en.wikipedia.org/wiki/C_(programming_language)), then it executes a\nC compiler to produce [native code](https://en.wikipedia.org/wiki/Machine_code).\nThis way existing C code and libraries can be leveraged and new C libraries can\nbe created. Another benefit is that Nelua can reach the same target platforms\nas C99 compilers, such [GCC](https://en.wikipedia.org/wiki/GNU_Compiler_Collection)\nor [Clang](https://en.wikipedia.org/wiki/Clang), while also enjoying\nstate-of-the-art compiler optimizations provided by them.\n\nThe initial motivation for its creation was to replace C/C++ parts of projects\nwhich currently uses Lua with a language that has syntax and semantics similar\nto Lua, but allows for fine-grained performance optimizations and does not lose\nthe ability to go low level, therefore unifying the syntax and semantics across\nboth compiled and dynamic languages.\n\n## Goals\n\n* Be minimal with a small syntax, manual and API, but powerful\n* Be efficient by compiling to optimized C code then native code\n* Have syntax, semantics and features similar to Lua\n* Optionally statically typed with type checking\n* Achieve classes, generics, polymorphism and other higher constructs by meta programming\n* Have an optional garbage collector\n* Make possible to create clean DSLs by extending the language grammar\n* Make programming safe for non experts by doing run/compile-time checks and avoiding undefined behavior\n* Possibility to emit low level code (C, assembly)\n* Be modular and make users capable of creating compiler plugins to extended\n* Generate readable, simple and efficient C code\n* Possibility to output freestanding code (dependency free, for kernel dev or minimal runtime)\n* No single memory management model, choose for your use case GC or manual\n\n## Why?\n\n* We love to script in Lua.\n* We love C performance.\n* We want best of both worlds in a single language and with a unified syntax.\n* We want to reuse or mix existing C/C++/Lua code.\n* We want type safety and optimizations.\n* We want to have efficient code while maintaining readability and safety.\n* We want the language features and manual to be minimal and fit our brain.\n* We want to deploy anywhere C runs.\n* We want to extended the language features by meta programming or modding the compiler.\n* We want to code with or without garbage collection depending on our use case.\n* We want to abuse of static dispatch instead of dynamic dispatch to gain performance and correctness.\n\n## Contributing\n\nYou can support or contribute to Nelua in many ways,\ngiving the project a star on github,\ntesting out its features,\nreporting bugs,\ndiscussing ideas,\nhelping other users,\nspreading it to the world,\nsharing projects made with it on github,\ncreating tutorials or blog posts,\nimproving its documentation\nor through a [donation or sponsorship](https://patreon.com/edubart).\n\nNelua is open source,\nbut not very open to contributions in the form of pull requests,\nif you would like something fixed or implemented in the core language\ntry first submitting a bug report or opening a discussion instead of doing a PR.\nThe authors prefer it this way, so that the ideal solution is always provided,\nwithout unwanted consequences on the project, thus keeping the quality of the software.\n\nRead more about contributing in the [contributing page](https://github.com/edubart/nelua-lang/blob/master/CONTRIBUTING.md).\n\n[![Become a Patron](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/edubart)\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedubart%2Fnelua-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedubart%2Fnelua-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedubart%2Fnelua-lang/lists"}