Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/novara754/clara-lang
A toy programming language.
https://github.com/novara754/clara-lang
Last synced: 2 months ago
JSON representation
A toy programming language.
- Host: GitHub
- URL: https://github.com/novara754/clara-lang
- Owner: novara754
- License: mit
- Created: 2022-05-31T13:34:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-17T12:01:58.000Z (almost 2 years ago)
- Last Synced: 2024-01-14T23:13:15.571Z (12 months ago)
- Language: Rust
- Homepage:
- Size: 358 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Clara
Clara is an upcoming systems programming language.
The compiler generates native code through an LLVM backend.See [the examples folder](./examples/) to see the language in action.
Use the following commands to compile an example:
```
$ cargo install --path .
$ clara ./path/to/example
```The compiler will generate an object file and place it in the `./build` directory.
Afterwards in can be linked (such as with GCC) to produce an executable:```
$ gcc -no-pie ./build/the_object.o ./lib/clara.c
$ ./a.out
```**Note:** Cargo, Rust and LLVM 13 are required to compile the Clara compiler.
## Features
The language is still under heavily development and its future is yet unclear.
That being said, the following features have already been implemented:- [x] Functions
- [x] Extern functions
- [x] Structs
- [x] Transparent structs
- [x] Opaque structs
- [x] Struct literals
- [x] Struct field access
- [ ] Pointers
- [x] Pointer types
- [ ] Creating pointer values
- [ ] Dereferencing pointer values
- [ ] Values
- [x] Strings
- [x] Integers
- [x] Bools
- [x] Arrays
- [ ] Control flow
- [x] If-else statements
- [x] While loops
- [x] For loops
- [ ] FFI
- [x] Using C functions as extern functions
- [x] Using opaque C structs
- [ ] Using transparent C structs
- [ ] ...## License
Licensed under the [MIT License](./LICENSE).