Code Monkey home page Code Monkey logo

cardinal's Introduction

Cardinal is an extension from ThunderdogScript. It uses Wren as the base VM and adds a couple extra features. This was done to learn more about how programming languages are made. New aspects include a early version of a debugger, an embedding API, new types and new language features such as multiple inheritance and a reimplemented module system.

It is a scripting language designed around the concept of being completely dynamic. The language natively supports manual memory management. This can be disable if not required.

IO.println("Hello, world!")

function func {
    IO.println("let's get started")
}

class Welcome {

	public field home
	
	letsBegin() {}
	
	+(operatorOverloading) {}
}

Cardinal has been confirmed to compile and run on Linux (Arch Linux and Ubuntu), Windows (8.1 and 10) and MacOSX (Yosemite).

The codebase is about 12000 lines long (and an additional 1000 lines in Cardinal) which keeps the language and libraries small. It is fully documented and easily understandable. You can skim the whole thing in one sitting. Cardinal is written fairly clean. It's written in warning-free standard C99. It compiles cleanly as C99 or C++98 and onwards.

Cardinal uses a fast single-pass compiler and a simple and compact object representation. Because of this, Cardinal is fast. A stack based VM is used in Cardinal. This keeps things simple and still retains good performance since Cardinal is heavily focused upon function calls.

Cardinal is a class based scripting languages. There are lots of scripting languages out there, but many have unusual or non-existent object models like Lua. Cardinal has first-class objects. This to allow for a flexible scripting language. Cardinal also places focus on functional programming. First class functions, lazy evaluation and closures are supported. This allows scripts to be written in a functional style. This comes in handy for behaviour scripts.

Cardinal implements fiber to be able to concurrently execute multiple coroutines.

Cardinal is intended for embedding in applications, mainly for embedding within a game engine. It has no dependencies, a small standard library, and a simple but extended C API from which functions and classes can be linked to Thunderdog-Script. However it can also be used as a general purpose language.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.