Skip to content

Latest commit

 

History

History

compiler

zo.

CODiFY YOUR CREATiVE THOUGHTS iNTO ROBUST, SANE AND METiCULOUSLY OPTiMiZED CROSS-PLATFORM SOFTWARE.

about.

zo is tiny, simple, fast and elegant for creating meticulously optimized software.

zo is focusing on creativity, wasm and performance.

goals.

  • fast compilation-time.
  • user-friendly error messages.
  • meta-language.
  • statically-typed.
  • robust type systemhindley-milner algorithm..
  • safe concurrency model — Actor Model Erlang-like.
  • powerfull toolsnative REPL, code editor, etc.

compiler phases.

  • readingread the input and generates the source code as bytes.
  • tokenizingtransforms a sequence of bytes into a list of tokens.
  • parsingcreates an abtract syntax tree from a list of tokens.
  • analyzinganalyses the semantics of a given AST.
  • codegengenerates the code for a specific target.
  • interpretinginterprets a given AST.
  • buildingbuilds the related files based on the target.

dirmap.

|-- zo                  # The entry point of the compiler.
|-- zo-analyzer         # The semantic analysis phase of the compiler.
|-- zo-ast              # The `zo` abstract syntax tree.
|-- zo-builder          # The builder — used to build the ouput machine code.
|-- zo-codegen          # The code generation phase of the compiler.
|-- zo-codegen-llvm     # The LLVM code generation phase of the compiler.
|-- zo-codegen-py       # The Python code generation phase of the compiler.
|-- zo-codegen-wasm     # The WASM code generation phase of the compiler.
|-- zo-compiler         # The `zo` compiler.
|-- zo-driver           # The command-line interface of the compiler.
|-- zo-inferencer       # The type system.
|-- zo-interner         # The string interner.
|-- zo-interpreter      # The evaluation phase of the compiler.
|-- zo-interpreter-clif # The Cranelift evaluation phase of the compiler.
|-- zo-interpreter-zo   # The `zo` evaluation phase of the compiler.
|-- zo-notes            # Docs, notes and speeches.
|-- zo-parser           # The syntax analysis of the compiler.
|-- zo-reader           # The reader — used to read the input source code.
|-- zo-reporter         # The reporter — used to generates user-friendly error messages.
|-- zo-samples          # Samples of the `zo` programming language.
|-- zo-session          # The global session of the compiler.
|-- zo-tokenizer        # The lexical analysis of the compiler.
|-- zo-ty               # The types of the `zo` programming language.
|-- zo-value            # Values are used by the `zo` evaluation phase.

examples.

-hello

THE SUPERSTAR hello, world!PRiNTS hello, world!.

hello

-square-root

THE ELEGANT Square rootPRiNTS THE SQUARE ROOT OF 5.

square-root

-greatest-common-root

THE RECURSiVE GCDPRiNTS THE GREATEST COMMON DiViSOR OF 48 AND 18.

greatest-common-divisor

-factorial

THE SMOOTH factorial CRiMiNAL — PRiNTS THE FACTORiAL OF 20.

factorial

-fibonacci

SiR FibonacciPRiNTS THE 11 RANK iN THE FiBONACCi SEQUENCE.

fibonacci