All Projects → edubart → Nelua Lang

edubart / Nelua Lang

Licence: mit
Minimal, efficient, statically-typed and meta-programmable systems programming language heavily inspired by Lua, which compiles to C and native code.

Programming Languages

c
50402 projects - #5 most used programming language
lua
6591 projects
language
365 projects
metaprogramming
66 projects

Projects that are alternatives of or similar to Nelua Lang

Nim
Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
Stars: ✭ 12,270 (+2701.37%)
Mutual labels:  compiler, efficient
Debugger.lua
A simple, embedabble CLI debugger for Lua.
Stars: ✭ 426 (-2.74%)
Mutual labels:  luajit
Dutier
The immutable, async and hybrid state management solution for Javascript applications.
Stars: ✭ 401 (-8.45%)
Mutual labels:  minimal
Scala Native
Your favorite language gets closer to bare metal.
Stars: ✭ 4,053 (+825.34%)
Mutual labels:  compiler
Webpack Boilerplate
A minimal webpack 5 boilerplate with only Babel, SASS and lodash (optional) on board
Stars: ✭ 404 (-7.76%)
Mutual labels:  minimal
Ph7
An Embedded Implementation of PHP (C Library)
Stars: ✭ 422 (-3.65%)
Mutual labels:  compiler
Firrtl
Flexible Intermediate Representation for RTL
Stars: ✭ 393 (-10.27%)
Mutual labels:  compiler
Groovy
Apache Groovy: A powerful multi-faceted programming language for the JVM platform
Stars: ✭ 4,359 (+895.21%)
Mutual labels:  compiler
Tiny Compiler
A tiny compiler for a language featuring LL(2) with Lexer, Parser, ASM-like codegen and VM. Complex enough to give you a flavour of how the "real" thing works whilst not being a mere toy example
Stars: ✭ 425 (-2.97%)
Mutual labels:  compiler
Oblivion
The language of Art
Stars: ✭ 414 (-5.48%)
Mutual labels:  compiler
Ledge
An RFC compliant and ESI capable HTTP cache for Nginx / OpenResty, backed by Redis
Stars: ✭ 412 (-5.94%)
Mutual labels:  luajit
Lizard
Lizard (formerly LZ5) is an efficient compressor with very fast decompression. It achieves compression ratio that is comparable to zip/zlib and zstd/brotli (at low and medium compression levels) at decompression speed of 1000 MB/s and faster.
Stars: ✭ 408 (-6.85%)
Mutual labels:  efficient
Poet
An emacs theme that's well suited for modes using variable pitch: particularly org-mode and markdown-mode.
Stars: ✭ 425 (-2.97%)
Mutual labels:  minimal
Bytecoder
Rich Domain Model for JVM Bytecode and Framework to interpret and transpile it.
Stars: ✭ 401 (-8.45%)
Mutual labels:  compiler
Jwebassembly
Java bytecode to WebAssembly compiler
Stars: ✭ 426 (-2.74%)
Mutual labels:  compiler
Perlito
"Perlito" Perl programming language compiler
Stars: ✭ 396 (-9.59%)
Mutual labels:  compiler
Enso
Hybrid visual and textual functional programming.
Stars: ✭ 5,238 (+1095.89%)
Mutual labels:  compiler
Nuitka
Nuitka is a Python compiler written in Python. It's fully compatible with Python 2.6, 2.7, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, and 3.9. You feed it your Python app, it does a lot of clever things, and spits out an executable or extension module.
Stars: ✭ 6,173 (+1309.36%)
Mutual labels:  compiler
Mazucc
A minimalist C compiler with x86_64 code generation
Stars: ✭ 437 (-0.23%)
Mutual labels:  compiler
Enzyme
High-performance automatic differentiation of LLVM.
Stars: ✭ 418 (-4.57%)
Mutual labels:  compiler

Nelua Logo

nelua.io

Test Status Discord Try on Repl.it

Nelua (stands for Native Extensible Lua) is a minimal, efficient, statically-typed and meta-programmable systems programming language heavily inspired by Lua, which compiles to C and native code.

Note: The language is in alpha state and still evolving.

Quick start

  • For basic information check the Website.
  • For first steps and how to use Nelua, start at the Tutorial.
  • For a tour of the language's syntax, features and usage read the Overview.
  • For small examples written in Nelua look the Examples folder .
  • For questions and discussions go to the Discussions.
  • For a chat with the community join the Discord server.
  • For cool stuff made with Nelua check the Show and tell page

After installing, you might want to check out the featured example, a Snake game leveraging the famous SDL2 library:

nelua examples/snakesdl.nelua

About

Nelua is a systems programming language for performance-sensitive applications where Lua would not be efficient, such as operating systems, real-time applications and game engines. While it has syntax and semantics similar to Lua, it primarily focuses on generating efficient C code and provide support for highly-optimizable low-level programming. Using Nelua idioms such as records, arrays, manual memory management and pointers should result in performance as efficient as pure C; on the other hand, when using Lua idioms such as tables, metatables and untyped variables, the compiler will bake a runtime library for this sort of dynamic functionality into the program, which could incur some runtime overhead.

Nelua can do meta programming at compile time through preprocessor constructs written in Lua; since the compiler itself is also written in Lua, it means that user-provided preprocessor code can interact at any point with the compiler's internals and the source code's AST. Such system allows for ad-hoc implementation of high level constructs such as classes, generics and polymorphism, all without having to add them into the core specification, thus keeping the language simple, extensible and compact. The same way that Lua's object-oriented patterns are not built into the language, but can be nonetheless achieved through metatables, in Nelua you could yourself implement a similar functionality which is fully decided at compile time or dynamically dispatched at runtime.

Nelua can do extensible programming as the programmer may add extensions to the language such as new grammars, AST definitions, semantics, type checkers, code generation and behaviors to the compiler at compile time via the preprocessor.

Nelua provides support for both garbage-collected and manual memory management in a way that the developer can easily choose between either for each allocation in the program.

Nelua first compiles to C, then it executes a C compiler to produce native code. This way existing C code and libraries can be leveraged and new C libraries can be created. Another benefit is that Nelua can reach the same target platforms as C99 compilers, such GCC or Clang, while also enjoying state-of-the-art compiler optimizations provided by them.

The initial motivation for its creation was to replace C/C++ parts of projects which currently uses Lua with a language that has syntax and semantics similar to Lua, but allows for fine-grained performance optimizations and does not lose the ability to go low level, therefore unifying the syntax and semantics across both compiled and dynamic languages.

Goals

  • Be minimal with a small syntax, manual and API, but powerful
  • Be efficient by compiling to optimized C code then native code
  • Have syntax, semantics and features similar to Lua
  • Optionally statically typed with type checking
  • Achieve classes, generics, polymorphism and other higher constructs by meta programming
  • Have an optional garbage collector
  • Make possible to create clean DSLs by extending the language grammar
  • Make programming safe for non experts by doing run/compile-time checks and avoiding undefined behavior
  • Possibility to emit low level code (C, assembly)
  • Be modular and make users capable of creating compiler plugins to extended
  • Generate readable, simple and efficient C code
  • Possibility to output freestanding code (dependency free, for kernel dev or minimal runtime)
  • No single memory management model, choose for your use case GC or manual

Why?

  • We love to script in Lua.
  • We love C performance.
  • We want best of both worlds in a single language and with a unified syntax.
  • We want to reuse or mix existing C/C++/Lua code.
  • We want type safety and optimizations.
  • We want to have efficient code while maintaining readability and safety.
  • We want the language features and manual to be minimal and fit our brain.
  • We want to deploy anywhere C runs.
  • We want to extended the language features by meta programming or modding the compiler.
  • We want to code with or without garbage collection depending on our use case.
  • We want to abuse of static dispatch instead of dynamic dispatch to gain performance and correctness.

Contributing

You can support or contribute to Nelua in many ways, giving the project a star on github, testing out its features, reporting bugs, discussing ideas, spreading it to the world, sharing projects made with it on github, creating tutorials or blog posts, improving its documentation or through a donation or sponsorship.

Read more about contributing in the contributing page.

Become a Patron

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].