Skip to content
Robert Durst edited this page Mar 16, 2019 · 15 revisions

Welcome to the sailfish wiki!

Table of Contents

  1. Overview
  2. The Basics
  1. Language Internals

Overview

The Basics

Primitives

Variable Declarations

Functions

User Defined types

Initial Execution Body

Since this is a C-like language (sorry to all my LISP loving friends!), there must be a main function of sorts. Instead of a function named main, there is a start keyword followed by a block. An example for hello world looks a bit like this:

start {
    display_str("Hello World!\n")
}

Language Internals

Since this repo is for the sailfishc compiler, this wiki will also cover certain aspects of the design of the language and compiler. That information may be found in this section.

Grammar

Currently there are two versions of the grammar, the grammar of which was originally aimed for in 0.0.1 and the actual grammar for 0.0.1. Since I will likely build from the original grammar, I did not delete it. However, this grammar is not current, instead refer to the Mini Grammar. Both of these links can be found on the side.

Design Decisions (aka some random truths that may be surprising)

This is a list of certain design decisions that might be lost or forgotten:

  • No byte literals
  • Expressions are left associated with no user controlled ordering
  • No negations in groupings (even though this make sense)
  • Cannot have a return statement in a block expected to return void aka no empty returns
  • Can only assign to identifiers and attribute accessors
  • Even if nested returns in if statement or nested bodies, still need one at the end
Clone this wiki locally