lessandro / gridc

The GridC programming language

Home Page:http://lessandro.com/gridc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GridC

GridC gives GridLang a nice, C-ish syntax.

Online editor/compiler

http://lessandro.com/gridc/

Dependencies

Instructions

  1. If you just installed cabal, run cabal update
  2. On the gridc project folder, run cabal install
  3. The executable should be in ~/.cabal/gridc
  4. ./gridc input.gridc > output.gridlang

GridC

int factorial(n)
{
    if (n == 0) {
        return 1;
    }

    f = factorial(n - 1);

    return n * f;
}

The language works as you expect it to work, with a few caveats:

  • Type declarations don't matter.
  • Everything is a number (int or float).
  • There are no void functions.
  • Functions without a return statement return 0.
  • Variables are created on assignment.
  • The compiler does not check function calls.

Have fun writing GridC!

About

The GridC programming language

http://lessandro.com/gridc/

License:MIT License


Languages

Language:Haskell 99.2%Language:Shell 0.8%