Crates.io | zeta |
lib.rs | zeta |
version | 0.1.6 |
source | src |
created_at | 2019-08-01 05:11:43.862128 |
updated_at | 2019-09-25 18:55:09.459672 |
description | Compiler for the Zeta programming language |
homepage | https://github.com/zeta-lang/zeta |
repository | https://github.com/zeta-lang/zeta |
max_upload_size | |
id | 153347 |
size | 1,746,468 |
A low level programming language for high performance applications, featuring many modern syntactical and semantic conveniences with a clear and consistent design
Low level (raw memory access / pointer arithmetic)
Lightweight, opt-in standard library
Simple, consistent, context-free, zero lookahead grammar
Expression based control flow
Pattern matching & destructuring
Modular, header-free source files
Simple C interop/FFI
Tuple and sum types
Multiple enumeration types
Methods and associate values for all types
Operator overloads
Type traits
Generics
Procedural meta programming
Compile time function execution
(Internal, compiler dependencies)
Rust standard library
Colored (MIT)
For ANSI-colorized console output
Num (MIT)
For easy int <-> enum conversion and other conveniences
CC (MIT)
Used only in the Windows version of Zeta
For locating other compiler toolchain elements (On Windows, one must use COM to probe the registry for the locations of link.exe and standard libraries)
TODO // LLVM
This project is in its very early days, but a list of features that have been completed so far are as follows:
Type expressions parser/texpr.rs
Pratt-style arithmetic/etc expressions parser/expr.rs
Statements parser/stmt.rs
Because Zeta uses experimental feature flags (specifically try_trait
and bind_by_move_pattern_guards
currently), you will need to install nightly Rust.
You can install the specific recommended/tested nightly version with rustup toolchain install nightly-2019-07-31
, and set it to the default to be used by cargo with rustup default nightly-2019-07-31
Or, you can try the latest nightly Rust with rustup toolchain install nightly
, and set it to the default to be used by cargo with rustup default nightly
You will also need to install RLS for the specific nightly version you're using. If you're using VS Code, simply restart your editor after setting the default and it should prompt you to install RLS.
Clone the repo by running
git clone https://github.com/zeta-lang/zeta
Build with the typical cargo
commands
Currently the driver application is capable of accepting source files and a few config flags via the command line. The full pipeline is not yet implemented, so no binary will be produced, but the various stages implemented can produce debug outputs.
Usage:
zeta [-flag]* [-option=value]* path/to/source.z [path/to/source.z]*
Flags:
help
- Print a help messageshow_path
- Print the path of each source file as it is loadedshow_src
- Print the content of each source file as it is loadedshow_lex
- Print a debug representation of the token stream output by the lexical analyzer for each source fileshow_ast
- Print a debug representation of the abstract syntax tree output by the parser for each source fileshow_args
- Print a debug representation of the internal arguments structureno_excerpts
- Disable printing the section of source code an error came from when outputting error messagesuncolored
- Disable ANSI color codes for compiler messagesOptions:
max_errors
= usize
- The maximum number of errors to allow before terminating the processing of a source file [Default: 20
]
excerpt_len
= usize
- The maximum number of lines to show in a source code excerpt [Default: 5
]
Visual Studio Code (Not to be confused with Visual Studio, they are totally separate products) is the recommended editor for developing Zeta. It is a fast and highly customizable text editor with some IDE-like features without the bulk, strict pipeline, or platform limitations of systems like Visual Studio. It is a free download and available for both platforms supported by Zeta
There is an extension to enable syntax highlighting for Zeta, available from source here: https://github.com/zeta-lang/zeta-syntax
VS Code editor tasks are preconfigured for most build script actions in .vscode/tasks.json
To run any task press Ctrl
+ Shift
+ B
and select the task you want from the drop down menu
Debug launch configs for stepping through the driver are included for vsdbg
, gdb
and lldb
debuggers, in .vscode/launch.json
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust
https://marketplace.visualstudio.com/items?itemName=RReverser.llvm
https://marketplace.visualstudio.com/items?itemName=Vallentin.vscode-bnf
vsdbg
/gdb
))
https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb