Compiler and Virtual-Machine for the XièXiè Programming Language (v.2)
Switch branches/tags
Nothing to show
Clone or download
Lukas Hermanns
Latest commit 522714d Jul 14, 2016
Type Name Latest commit message Commit time
Failed to load latest commit information.
docu Separated code and data-fields in XASM structure. Apr 14, 2016
include/xiexie Ported to Linux. Jul 14, 2016
modules Started with "Audio" module and "AudioTest1". Jun 28, 2015
LICENSE.txt Updated "". Jun 13, 2015

XièXie Compiler and VirtualMachine (Version 2)


  • High Level Programming Language
  • Compiler written in C++11 (in progress)
  • Virtual Assembler (XASM)
  • Virtual Machine (written in C99, with wrapper written in C++11)


3-Clause BSD License


Work in Progress

Programming Guide

Take a look at the XièXie Programming Guide to get started with the XièXie programming language.

Code Examples

This is a small Hello World example:

import Console
class HelloWorld {
	static void main() {
		Console.writeLine("Hello, World!")

And this computes the fibonacci series:

import Console
class Fibonacci {
	static void fib(int n) {
		int a, b := 1
		while a < n {
			a, b := b, a + b
	static void main() {

Integration Examples

Very high-level interface:

#include <xiexie/xiexie.h>
int main()
		"import MsgBox\n"
		"class MiniExample {\n"
		"    static void main() {\n"
		"\"Info\", \"This is a mini Example!\")\n"
		"    }\n"

Offline compilation:

#include <xiexie/xiexie.h>
int main()
	XieXie::CompileConfig config;
		std::string filename = "ExampleFile.xx";
		config.sources.push_back({ filename, std::make_shared<std::ifstream>(filename) });
	XieXie::Compile(config, &(std::cout));

Running compiled code:

#include <xiexie/xiexie.h>

void triggerGameEvent(XVM_Env env)
	// Read parameter from XVM environment
	int eventID = XVM_ParamInt(env, 1);
	/* do something ... */
	// Return void and pop 1 argument (eventID)
	XVM_ReturnVoid(env, 1);

/* further functions ... */

int main()
	XieXie::VirtualMachine::ByteCode bc;
	XieXie::VirtualMachine::Stack st;
	// Read XieXie byte code (*.xbc) file
	// Bind external invocation "triggerGameEvent"
	bc.BindInvocation("GameInterface.triggerGameEvent", triggerGameEvent);
	// Execute byte code in virtual machine
	XieXie::VirtualMachine::ExecuteProgram(bc, st, "GameScript.entryPoint");