All Projects → analang → Como Lang Ng

analang / Como Lang Ng

Licence: gpl-3.0
como-lang-ng is now ana-lang, located at https://github.com/analang/ana

Programming Languages

c
50402 projects - #5 most used programming language
languages
34 projects

Projects that are alternatives of or similar to Como Lang Ng

cppcombinator
parser combinator and AST generator in c++17
Stars: ✭ 20 (-94.15%)
Mutual labels:  parsing, compilers
Kgt
BNF wrangling and railroad diagrams
Stars: ✭ 312 (-8.77%)
Mutual labels:  compilers, parsing
Never
Never: statically typed, embeddable functional programming language.
Stars: ✭ 248 (-27.49%)
Mutual labels:  compilers, virtual-machine
Plotty
C language compiler from scratch for a custom architecture, with virtual machine and all
Stars: ✭ 33 (-90.35%)
Mutual labels:  parsing, virtual-machine
librxvm
non-backtracking NFA-based regular expression library, for C and Python
Stars: ✭ 57 (-83.33%)
Mutual labels:  parsing, compilers
3bc-lang
Low level language, tiny virtual machine that works on computers and microcontrollers. (Friendly Punched cards)
Stars: ✭ 155 (-54.68%)
Mutual labels:  virtual-machine, compilers
kolasu
Kotlin Language Support – AST Library
Stars: ✭ 45 (-86.84%)
Mutual labels:  parsing, compilers
cs-resources
Curated Computer Science and Programming Resource Guide
Stars: ✭ 42 (-87.72%)
Mutual labels:  parsing, compilers
Gval
Expression evaluation in golang
Stars: ✭ 297 (-13.16%)
Mutual labels:  parsing
Tag
ID3, MP4 and OGG/FLAC metadata parsing in Go
Stars: ✭ 314 (-8.19%)
Mutual labels:  parsing
Semver
Semantic version parsing and comparison.
Stars: ✭ 283 (-17.25%)
Mutual labels:  parsing
Osx Gcc Installer
GCC Installer for OSX! Without Xcode!
Stars: ✭ 3,078 (+800%)
Mutual labels:  compilers
Jikesrvm
Jikes RVM (Research Virtual Machine)
Stars: ✭ 281 (-17.84%)
Mutual labels:  virtual-machine
Devito
Code generation framework for automated finite difference computation
Stars: ✭ 285 (-16.67%)
Mutual labels:  compilers
Clangkit
ClangKit provides an Objective-C frontend to LibClang. Source tokenization, diagnostics and fix-its are actually implemented.
Stars: ✭ 330 (-3.51%)
Mutual labels:  parsing
Rubinius
The Rubinius Language Platform
Stars: ✭ 3,006 (+778.95%)
Mutual labels:  virtual-machine
Wasm3
🚀 The fastest WebAssembly interpreter, and the most universal runtime
Stars: ✭ 4,375 (+1179.24%)
Mutual labels:  virtual-machine
Comp Cpp
Simple 4-bit virtual computer
Stars: ✭ 329 (-3.8%)
Mutual labels:  virtual-machine
Umka Lang
Umka: a statically typed embeddable scripting language
Stars: ✭ 308 (-9.94%)
Mutual labels:  virtual-machine
Pom
PEG parser combinators using operator overloading without macros.
Stars: ✭ 310 (-9.36%)
Mutual labels:  parsing

COMO: como object meta oriented

even.como

func isodd(num) {
	i = 0;
	odd = 0;
	while((i == num) == 0) {
		if(odd == 0) {
			odd = 1;
		} else {
			odd = 0;
		}
		i = i + 1;
	}
	return odd;
}

func print_even(num)
{
	while(num) {
		if(isodd(num)) {
			print(num + " is odd");
		} else {
			print(num + " is even");
		}
		num = num - 1;
	}
}

print_even(4);

range

func print_range(a, b) {
	while(a <= b) {
		print(a);
		a = a + 1;
	}
}

Build Requirements

I only compile this on UNIX like systems. You need the standard build tools such as autoconf, libtool, and flex and bison. Also there is a runtime requirement : libobject which you can get at https://github.com/libobject/libobject

License

Please see the file LICENSE located in the root directory of the project.

Virtual Machine

The compiler generates instructions of the custom instruction set (como_opcode.h) The virtual machine is stack based and only a few instructions take operands. Most instructions pop there arguments from the stack. Here is the relevant source code and instruction output generated from the compiler. This was run with the following command: ./como --print-asm test/for_loop

for(i = 5; i >= 0; i--)
{
  if(i % 2 == 0) {
    print(i);
  }
}
0       LABEL
1       LOAD_CONST 5
2       STORE_NAME i
3       LOAD_NAME i
4       LOAD_CONST 0
5       IS_GREATER_THAN_OR_EQUAL
6       JZ 25
7       LABEL
8       LOAD_NAME i
9       LOAD_CONST 2
10      IREM
11      LOAD_CONST 0
12      IS_EQUAL
13      JZ 17
14      LOAD_NAME i
15      IPRINT
16      JMP 18
17      LABEL
18      LABEL
19      POSTFIX_DEC
20      LOAD_NAME i
21      LOAD_CONST 0
22      IS_GREATER_THAN_OR_EQUAL
23      JZ 25
24      JMP 7
25      LABEL
26      HALT

Problems

  • There is no continue, or break statements in loops at this time. The first idea that comes to mind to implement this is to have the executor keep track if the VM is in a loop and store the correct JMP address. This is on the roadmap for 2017
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].