Skip to main content

Compiler

Sylk CLI using protoc (Protobuffer Compiler) which is the main compiler built and maintained by google. the purpose of protoc is to generate code from a .proto files definitions, sylk helps the developers to built the .proto files and enforcing best practices and reducing errors in writing and defining you services schema with Protobuf and the delegate the process for the installed excutable protoc on the developer machine.

Setup

To compile your protobuf files using sylk CLI (and any other solution as well) you will need to install locally protoc.

✏️ Note

If your are planning to use sylk CLI and write only services and clients in Python, Good News! you don't need to install anything other than Sylk CLI as it comes packed with a compiled protoc the interacts with python code generators

MacOS​

Using Homebrew:

$ brew install protobuf
$ protoc --version # Ensure compiler version is 3+

Linux​

Using apt or apt-get, for example:

$ apt install -y protobuf-compiler
$ protoc --version # Ensure compiler version is 3+

Windows​

Manually download from github.com/google/protobuf/releases the zip file corresponding to your operating system and computer architecture (protoc-<version>-<os>-<arch>.zip), or fetch the file using commands such as the following:

$ PB_REL="https://github.com/protocolbuffers/protobuf/releases"
$ curl -LO $PB_REL/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip

Unzip the file under $HOME/.local or a directory of your choice. For example:

$ unzip protoc-3.15.8-linux-x86_64.zip -d $HOME/.local

Update your environment’s path variable to include the path to the protoc executable. For example:

$ export PATH="$PATH:$HOME/.local/bin"
🤓 Future Is Near...

We plan to have the same functionality and behaviour of Python generated code files with other languages as well in the near future