Skip to content

Latest commit

 

History

History
60 lines (38 loc) · 2.27 KB

README.md

File metadata and controls

60 lines (38 loc) · 2.27 KB

Cube

Codacy Badge

Website

Getting started

Cube is a dynamically typed, object oriented, programming language written in C. The language is based on the Lox programming language, from the book Crafting Interpreters by Bob Nystrom.

Features

Cube has a large set of features, making it a complete programming language. The current features includes:

  • Primitive variables
  • Lists and dicts
  • Loops and conditions
  • Named and anonymous functions
  • Classes
  • Imports
  • Native files support
  • Closure context
  • Asynchronous execution
  • Types extensions
  • Plug-in system
  • Bytecode VM

Modes

Cube supports running in an interactive mode and from code files. On calling it without a file argument the interactive mode will start and any code can be typed directly in the console. If the file argument is present then this code is loaded and executed.

Cube files can be compiled into a bytecode form by passing the '-c' argument. To make the code debuggable the argument '-d' must be passed. Any other argument after any set of there are passed as arguments to the cube program being executed.

Let's start coding

As you expect from any programming language in the world, you can say hello!

print('Hello, world!');

In cube you can also do any complex thing you can think of:

for(var i in 'A'..'Z') println('Letter: ', i);

What's next

From here you are already a Cube Programmer. You can start venturing in the Cube world by learning the language. If you ever run into bugs, or have any ideas or questions, you can:

Open an issue on Github.

Send a pull request.

Email me at [email protected].

TODO

  • Fix GC