Skip to content

lessandro/gridc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published