https://github.com/ezequias2d/netuno
The Netuno Programming Language (WIP)
https://github.com/ezequias2d/netuno
language netuno programming-language
Last synced: 4 months ago
JSON representation
The Netuno Programming Language (WIP)
- Host: GitHub
- URL: https://github.com/ezequias2d/netuno
- Owner: ezequias2d
- License: other
- Created: 2022-05-18T04:43:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-22T19:35:17.000Z (about 2 years ago)
- Last Synced: 2023-11-22T20:30:56.427Z (about 2 years ago)
- Topics: language, netuno, programming-language
- Language: C
- Homepage:
- Size: 391 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# The Netuno Programming Language (WIP)
Netuno is a imperative, modular, functional, object-oriented, statically-typed, object-oriented programming language. It has a BASIC-like syntax, is memory-safe by default and can be easily embedded.
## Sample Code
```Ruby
import console
def fibonacci(n: uint): uint
if n == 0u => return 0u
if n == 1u => return 1u
return fibonacci(n - 1u) + fibonacci(n - 2u)
end
def main()
var input: string
while (input = console.readline()) != "exit"
; this is a line comment
var n = uint(input)
n = fibonacci(n)
console.write("Result: " + n + "\n")
next
return 0 ; ok
end
```
## Compiler and Runtime
The repository is divided by the compiler(ntc) and the runtime(ntr).
### Natch
Natch(ntc) is the Netuno Compiler, currently supports Notable Bytecode generation.
Progress
----------
- [x] Lexer
- [x] Parser
- [x] Semantic Analysis
- [ ] Optimization
- [ ] C codegen
- [x] Notable Bytecode Codegen
- [x] Conditional
- [x] Loops
- [x] Break
- [x] Continue
- [x] Import
- [x] Variable
- [x] Module
- [x] Assignment
- [x] Expressions
- [x] Functions and subroutines
- [x] String
- [ ] Reference
- [ ] Array
- [ ] Custom type declaration
- [ ] Object methods
### Nitro
Nitro(ntr) is the Netuno Runtime, it has a stack virtual machine that can runs Notable Bytecode.
## Building
### Debug Mode
Debug trace will be enable and will print Abstract Syntax Tree in parser stage and enable VM stack debug trace.
```
$ cmake -DCMAKE_BUILD_TYPE=Debug .
$ cmake --build .
$ ./bin/ntc sample.nt
```
### Release Mode
Debug tracing is disabled and all optimizations in the C compiler are enabled.
```
$ cmake -DCMAKE_BUILD_TYPE=Release .
$ cmake --build .
$ ./bin/ntc sample.nt
```