Next is a powerful Generic Interface Definition Language (IDL) designed to create highly customized code across multiple programming languages. It leverages a flexible template system to transform high-level specifications into language-specific implementations.
- 🌐 Multi-language code generation from a single source
- 📝 Powerful templating system based on Go's text/template
- 🧩 Flexible customization through template inheritance and overloading
- 🏗️ Rich type system supporting interfaces, structs, enums, and various data types
- 🏷️ Annotation support for metadata and customization
Next includes built-in templates for various languages, including C, C++, C#, Go, Java, JavaScript, Kotlin, Lua, Objective-C, PHP, Protobuf, Python, R, Rust, Swift, TypeScript. These serve as a foundation for code generation and can be easily customized or extended using the template hierarchy system.
Next uses a template system based on Go's text/template package, with custom enhancements for code generation. Templates in Next use the .npl
file extension.
Next implements a three-layer template hierarchy, allowing for easy customization and overriding of default behaviors:
- Next builtin base templates:
next/<object_type>
- Next builtin language-specific templates:
next/<lang>/<object_type>
- User-defined language-specific templates:
<lang>/<object_type>
This hierarchy enables a powerful inheritance and overloading mechanism, similar to class inheritance in object-oriented programming.
When rendering a template, Next searches for the most specific template first (user-defined), then falls back to language-specific templates, and finally to base templates if no overrides are found.
For detailed information on Next's syntax, features, and usage, please visit the official website at https://next.as. The website provides comprehensive documentation, tutorials, and examples to help you get started with Next and make the most of its capabilities.
- Support more built-in templates for additional programming languages
We welcome contributions to Next Language! Please see our Contribution Guidelines for more information on how to get started.
Next is released under the MIT License.