Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
void init();
void test();
// Silly test of using scheme as core
#include <stdio.h>
#include "test.h"
int main() {
printf("Init\n");
init();
printf("test\n");
test();
}
% make
cd src && csc -e -c test.scm && clang -I../include -c init.c
libtool -static src/test.o src/init.o -o lib/libtest.a
clang -Iinclude -Llib -lchicken -ltest main.c -o test
Isaks-MacBook-Pro% ./test
Init
Initializing chickentest
zsh: segmentation fault ./test
#include <chicken/chicken.h>
#include <stdio.h>
#include "test.h"
void init() {
printf("Initializing chicken");
if(!CHICKEN_initialize(0, 0, 0, C_toplevel)) {
printf("Could not initialize chicken, wtf \n");
}
}
(define-external (test) void
(write 'hello-world))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.