Covariant Script Programming Language: The Interpreter
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Covariant Script Programming Language: The Interpreter

Build Status
Welcome to the Covariant Script programming language!
Covariant Script is an open source, cross-platform programming language
This project is an officially maintained Covariant Script interpreter

Switch language

Features

  • Cross-platform, supporting most mainstream operating systems
  • The extension system is powerful and easy to use
  • Written in C++ 11, which compatibility is better
  • Independent and efficient compiler front end
  • The compilation results can be exported
  • Efficient memory management system
  • Support compile-time optimization
  • Reference count garbage collector
  • C/C++ Native Interface(CNI)

Extensions

Documentations

CovScript Online Documents

Installation

Windows

Download the precompiled executable on the Latest Release.
You can also use other tools (like MinGW) to compile. If you already have a G++ compiler installed, you can use make.bat. Make sure the compiler supports C++11.
Note: The Covariant Script interpreter supports the MSVC compiler, but due to the restrictions imposed by the Windows system on DLL export symbols, the current Covariant Script extension mechanism is almost completely paradoxical on MSVC. Although we provide make_msvc.bat, it is not recommended and is for reference only. Windows developers who need to embed Covariant Script please compile the source code directly, but all extension libraries are temporarily unavailable.

Linux

First, download source from CovScript Github Page.
Then you have two choices:

  • With G++ and makefile
$ sh ./make.sh
  • With CMake toolchain
    We've provided a CMakeLists.txt.

Note: Some distributions' G++ are too old to support C++11, make sure you G++ compiler is up to date.

Mac OS

All the steps are the same as Linux, tested under macOS Sierra 10.12.5.

Run

Interpreter

cs [arguments..] <file> <args...>

Arguments

  • --compile-only Only compile
  • --dump-ast Export abstract syntax tree
  • --wait-before-exit Wait before process exit
  • --log-path PATH Set the log and AST exporting path
  • --import-path PATH Set the import path

Note that if you do not set the log and AST exporting path, both will be output directly to the standard output stream.

Repl

cs_repl [arguments..]

Arguments

  • --args Specify the operating parameters
  • --silent Does not display the version info
  • --wait-before-exit Wait before process exit
  • --log-path PATH Set the log path
  • --import-path PATH Set the import path

Note that if you do not set a log path, it will be output directly to the standard output stream.

Installer

Covariant Script Installer provides a simple toolchain configuration method for the Microsoft Windows platform. You can download, install, upgrade and uninstall the toolchain by simply push a button. You can download the latest installer from the CovScript Programming Language Home. For more information, visit the Covariant Script Installer.

GUI

Covariant Script provides a one-stop code editing, running, debugging experience for the Microsoft Windows platform . The CovScript Installer will automatically downloads the CovScript GUI for you. For more information, please visit Covariant Script GUI.

Package Manager

cspkg is a package manager written in Covariant Script whose main function is to manage extensions or packages for Covariant Script. cspkg will be released with the latest version of Covariant Script. For more information, please visit Covariant Script Package Manager.

IntelliJ Plugin

The IntelliJ Plugin is available now:

Examples

The examples folder contains several example programs written by CovScript.

Copyright

The author of the Covariant Script Programming Language is @mikecovlee.
Copyright © 2018 Michael Lee

Thanks

Ranked by contribution.

Comments

Comments by @ice1000:

This is a programming language created by my friend Michael Lee, written in C++. The detailed description is on it’s website so I’ll just put some comments here. This is a C-like language (at least the function call syntax is of C style), while functions, structs, namespaces are ends with end like Ruby, and it has the concepts of package import using (the module system).
Its parser is hand-written (very complex, although parsers are trivial), which impressed me (I didn’t even think of that when working on Lice, I just wrote an AST evaluator).
This language supports invoking functions written in C++, like JNI.
CovScript mostly features its powerful standard library, which has database, GUI, web access, regular expressions.