On this page:
1.1 Getting started
1.2 Running a standalone C program

1 Overview🔗ℹ

There is a simple #lang rince/c for standalone programs.

Rince is not a static analyzer, but it could serve as a tool to instrument C programs at runtime, in a similar manner to valgrind.

1.1 Getting started🔗ℹ

Still very much a work-in-progress. Much is missing—you won’t be able to run anything but toy examples for now.

Try this:

#lang racket
(require rince/compile rince/link)
 
(define src #<<END
int main(int argc, char **argv)
{
    const char *str = "test";
    const char *p = str;
    while (*p) ++p;
    return p - str;
}
END
)
 
(define obj (compile src))
 
(define proc (linkable->executable obj))

(proc) should return 4, the length of "test".

1.2 Running a standalone C program🔗ℹ

You can use raco run-c to compile and execute a standalone C program:

    raco run-c tests/ok/puts.c