0.1.1 • Published 11 years ago

cello v0.1.1

Weekly downloads
3
License
-
Repository
-
Last release
11 years ago

node-cello

a simple DSL to generate simple C programs

Alternative title:

A magical DSL to generate C code from CoffeeScript

Introduction

node-cello is a work-in-progress DSL and template engine for generating C programs.

Warning

This is an experimental project, and should be used with care.

For the moment only basic C code can be generated using this library.

The code is a bit messy, and architecture/syntax is not fixed yet.

However it is already on NPM repository because:

  1. it basically works
  2. it's a dependency of another project

Thank you for your understanding!

Demo

{ C } = require 'cello'

src = C -> 
  include 'stdio.h'
  include 'stdlib.h'
  int x = 40
  main = ->
   int y = 43 + x
   printf "hello"

console.log src

Outputs:

#include <stdio.h>
#include <stdlib.h>
int x = 40;
void main() {
	int y = (43 + x);
	printf("hello");
}

Magic? yes.

TODO

  • Find a way to support typed parameters (eg. type inference?)
  • Implement more C language features
  • Implement MUCH MORE C language features
  • Implement ALL C language features (well, ideally)
  • unit tests

More TODO: built-in compiler support?

  • add support for an 'inline' mode like in Perl
  • autoconfing
  • on-the-fly compilation
  • execute the binary
  • handle the STDIN / STDOUT wrapping

Changelog

  • 0.0.0 - Basic features are supported
0.1.1

11 years ago

0.1.0

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago

0.0.0

12 years ago