This is cobj, a programming language.
C Bison CSS Makefile Python Lua Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
argparse @ d62c753
bench
doc
examples
lib
linenoise @ cf1bdf5
misc
modules
objects
t
.gitignore
.gitmodules
.travis.yml
LICENSE
Makefile
README.developers
README.md
TODO
arena.c
arena.h
ast.c
ast.h
cobj.c
cobj.h
compat.h
compile.c
compile.h
error.c
error.h
gc.c
gc.h
gen-version.sh
marshal.c
marshal.h
mem.c
mem.h
module.c
module.h
object.c
object.h
opcode.c
opcode.h
parser.y
peephole.c
peephole.h
scanner.l
state.c
state.h
str2d.c
str2d.h
vm.c
vm.h
wrapper.c
wrapper.h

README.md

CObj

This is CObj, an general-purpose program language.

I wrote this based on many languages, Python, Ruby, PHP, Lua, Go, etc. It's only for learning purpose.

Build Status

Compile/Install

# install bison/re2c first
$ make  
$ make install

Examples

maxnum = 10
i = 2

func is_prime(n)
    local j = 2
    while j * j < n + 1
        if n % j == 0
            return False
        end
        j += 1
    end
    return True
end

while i <= maxnum
    if is_prime(i)
        print(i)
    end
    i += 1
end

See more examples under examples/ folder.