zeta 0.1.3

Compiler for the Zeta programming language
Documentation
<p align=center><img alt="Zeta Logo" src="meta/images/zeta_logo.png" width=50%/></p>

# Zeta Language

A programming language designed to have C sensibilities with modern syntax and features.

### Contents

- [Planned Features]#planned-features
- [Code Basis]#code-basis
- [Project Status]#project-status
- [Usage]#usage
  - [Requirements]#requirements
  - [Install]#install
  - [Utilize]#utilize
  - [VS Code Integration]#vs-code-integration
    - [Links]#links-1
    - [Syntax Highlighting Extension]#syntax-highlighting-extension
    - [Editor Tasks]#editor-tasks
    - [Debug Launch Config]#debug-launch-config


## Planned Features

+ Low level
+ Manual memory management only, no RAII
+ Lightweight, opt-in standard
+ Simple context-free grammar
+ Expression based control flow
+ Namespaces
+ Tuples
+ Sum types
+ Structural methods
+ Operator overloads
+ Destructure, match
+ Generics
+ Procedural programming
+ Compile time function execution


## Code Basis

(Internal, compiler dependencies)

+ Rust standard library

+ Colored
  > For ANSI-colorized console output

+ Num
  > For easy int <-> enum conversion and other conveniences

+ TODO // LLVM

<!-- Gotta see how this pans out since llvm-sys / rust is/was weird about this -->


<!-- + LLVM 8.0.0 as a backend. While headers are included in the source tracking, for size reasons the binary and library files are not.
  > You will need to either have `llvm-config` accessable from the command line, or create a `local_vars.lua` with a global variable called `LLVM_CONFIG` containing the path to your installation (See [below](#local-config) for more info) -->


### Links

+ Colored ([MIT]https://github.com/mackwic/colored/blob/master/LICENSE)
  > https://github.com/mackwic/colored

+ Num  ([MIT]https://github.com/rust-num/num/blob/master/LICENSE-MIT)
  > https://github.com/rust-num

+ TODO // LLVM
<!-- - LLVM Prebuilt ([Open Source License](http://releases.llvm.org/8.0.0/LICENSE.TXT))
  > Windows: https://github.com/zeta-lang/llvm-800-win (The prebuild provided by LLVM's official website is incomplete and contains only clang)

  > Linux: http://releases.llvm.org/download.html#8.0.0 -->






## Project Status


This project is in its very early days, but a list of features that have been completed so far are as follows:
+ Most of version 1 grammar defined [grammar.md]/grammar.md
+ Extensive source error reporting system [tracking.rs]/src/lib/tracking.rs
+ Lexical analyzer [lexer/mod.rs]/src/lib/lexer/mod.rs
+ Abstract Syntax Tree [parser/ast.rs]/src/lib/parser/ast.rs
+ Parser [parser/mod.rs]src/lib/parser/mod.rs:
  - Type expressions [parser/texpr.rs]/src/lib/parser/texpr.rs
  - Pratt-style arithmetic/etc expressions [parser/expr.rs]/source/lib/parser/expr.rs
  - Statements [parser/stmt.rs]/src/lib/parser/stmt.rs


## Usage


### Requirements


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.


### Install


Clone the repo by running
```
git clone https://github.com/zeta-lang/zeta
```

Build with the typical `cargo` commands

### Utilize

  > Note: Driver application is currently just a rudimentary testing app and does not yet support command line control


### VS Code Integration

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

#### Links

* Editor
  > https://code.visualstudio.com/
* Official Rust RLS Extension (Source code completion, goto def, etc)
  > https://marketplace.visualstudio.com/items?itemName=rust-lang.rust
* LLVM IR Syntax Highlighting (Reading compiler output)
  > https://marketplace.visualstudio.com/items?itemName=RReverser.llvm
* BNF Syntax Highlighting (Reading [grammar.bnf]./grammar.bnf)
  > https://marketplace.visualstudio.com/items?itemName=Vallentin.vscode-bnf
* LLDB Integration (If you don't want to use the standard debugger for your platform (`vsdbg`/`gdb`))
  > https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb

#### Syntax Highlighting Extension

There is an extension to enable syntax highlighting for Zeta, available from source here: https://github.com/zeta-lang/zeta-syntax

#### Editor Tasks

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 Config

Debug launch configs for stepping through the driver are included for `vsdbg`, `gdb` and `lldb` debuggers, in `.vscode/launch.json`

[^](#zeta-language)