cowbel:
a programming language

about

cowbel is a minimalist but expressive statically typed programming language which compiles into real machine code via C. It has generics, interfaces, a garbage collector, non-nullable types, an object-oriented system based on interfaces and composition, and features a familiar Javascript-like syntax.

The purpose of cowbel is to fit the niche where hard-core systems languages like C or C++ are too much work, but dynamic or virtual-machine languages like Python or Java are too heavyweight. cowbel programs compile into standalone executables with few dependencies that have comparable size and performance to C.

Cowbel is hosted on SourceForge.

SourceForge.net Logo

2012-03-20

Version 0.2 released!

This features lots of major compiler core improvements, the biggest of which is a global type inference engine, which is used by the code generator to eliminate virtual method calls whenever possible. The end result of this is much, much better code --- cowbel now performs close to C for a lot of tasks.

In addition the compiler core is much more orthogonal and robust, and a lot of things that were a bit dubious before (like forward references) are now much more solid.

The runtime library has been extended so it now supports Array<V>, Map<K,V> and Set<V> as standard data structures; File and streaming I/O have been sanitised and should be much easier to use; and there's a new PCRE module providing basic support for regular expressions.

installation

You can get the cowbel compiler either from the link below, or, if you want a specific version, from the Sourceforge download site. The compiler is written in Java and you'll need to compile it yourself. Instructions are included in the download package.

reference

See some example code
Frequently Asked Questions about cowbel
A brief summary of the language
The runtime library reference

status

cowbel is brand new, and the compiler is still unfinished. Some language features remain unimplemented (such as object composition), and it's rather brittle in a lot of ways (type checking isn't as rigorous as it should be, and invalid programs may either cause the compiler to crash or generate invalid code). In addition, the runtime library is very minimal, as I'm still learning how to write idiomatic code in cowbel. There are no debugging features. There are bugs.

In particular, right now the language design is in flux. Syntax and semantics may change without warning.

So while it is possible, right now, to write useful programs in cowbel, and indeed I would very much like people to, the process is not as smooth as it should be. Currently cowbel is aimed at language hackers.

last updated

2012 March 20

© 2012 David Given, unless specified otherwise