Getting Started

Installation

Type-C setup currently involves manual work as the the language has not been officially release yet. Hence, we will need to manually install the following:

  • Type-C Compiler: A typescript project, requires node & npm
  • Type-V: Type-C Virtual Machine, built in C11 requires GCC/Clang, CMake
  • Standard Library: Type-C stdlib lib, no requirements.

Building the compiler:

Building the Virtual Machine:

Creating a Project

To create a new project, we will need to create a new folder, and create a module.json file. This file contains the project compiler settings, dependencies, search path, etc.

The directory of this file is the default project directory. All imports will be resolved from there. Hence within files in subdirectory, importing packages from current module will be resolved from the project root directory.

Running the project:

First compiling the project with type-c compiler: node outs/index.js -c [path-to-module.json folder] -o [output-directory] Then run the output with the type-v virtual machine: ./type-v [output-directory]/bin.tvb


Kudos! Keep reading!