k-boyle / nsc

Compiler for the NoSyn Programming Language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The NoSyn Programming Language

https://travis-ci.org/lyncmi07/nsc.svg?branch=master

Introduction

NoSyn is a statically typed general purpose programming language designed on a principles of minimalism and extensibility.

Operator Overloading

Like many contemporary languages, NoSyn allows the user to overload operators using a basic function syntax:

Nothing infix_:=_(Int a*, Int b) {
    assignValue(a, b);
}

Unlike other languages however. There are almost no operators defined by default within the language compiler allowing for great flexibility in the workings and syntax of the language based on the source code itself.

Minimalism

NoSyn seeks to reduce the compiler to its most basic form without compromising on capability or readbility of language source code. The syntax of the language gas been reduced to the absolute minimum in order to allow the language user to create their own syntax in whatever way they would like using the operator overloading features. NoSyn provides a simple process to define operators to do whatever you want with compile time checks to ensure validity.

Function Inference

Function Inference is the key to producing compile time checks on user defined operators in NoSyn’s function inference algorithm. Unlike functions in most other languages. The return value of a function in NoSyn is dependent on the context in which it is being used. This allows overloaded operators to work differently in different parts of the source code making it east to create syntactic changed to the language without changing the lexer of parser of the compiler, while maintaining compile time checks on operator validity. A detailed description on how the Function Inference algorithm works can be found here

Getting Started

Prerequisites

  • The NoSyn compiler is written in Haskell and requires the Haskell build tool, Stack. Please find instructions on how to install Stack here.

Installation

There are currently no binary installers for any systems so nsc must be built from source by cloning this repo.

Linux

Once stack has been installed run the install_nsc.linux.sh script from the main directory. This will build the project and create an executable at /usr/bin/nsc.

Mac

Once stack has been installed run the install_nsc.mac.sh script from the main directory. This will build the project and create an executable at /usr/local/bin/nsc.

Windows

Once stack has been installed simply run the install_nsc_windows.bat script from the main directory using the Command Prompt. This will build the project and create an executable at C:\Users\<user>\AppData\Roaming\local\bin\nsc.exe

It is recommended that you install the NoSyn Build Tool, nsp. The NoSyn compiler’s dependency system is designed to be used with this build tool (nsc will need to be installed first).

About

Compiler for the NoSyn Programming Language

License:GNU Lesser General Public License v3.0


Languages

Language:Haskell 92.5%Language:Yacc 6.5%Language:Shell 0.8%Language:Batchfile 0.2%