I hereby claim:
- I am saolsen on github.
- I am saolsen (https://keybase.io/saolsen) on keybase.
- I have a public key ASD9j8N4AtK0fUZlAh1XujYN4d4bSiK7GJ3_RQuP7_pj5wo
To claim this, I am signing this object:
| #lang racket | |
| (define (get-spaces-inner n spaces) | |
| (define current-space (car spaces)) | |
| (if (> current-space n) | |
| (cdr spaces) | |
| (get-spaces-inner n (cons (* current-space 2) spaces)))) | |
| (define (get-spaces n) | |
| (get-spaces-inner n '(1))) |
| #include <stdlib.h> | |
| int main(int nargs, char * args[]) | |
| { | |
| void* vp = malloc(sizeof(char) * 5); | |
| const char* ip = (char*)(vp); | |
| free(ip); | |
| } |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <time.h> | |
| #include <pthread.h> | |
| #define TEST_CASES 1000000 | |
| #define TEST_RUNS 30 | |
| // Channels for passing data between threads. We pack a whole cache line of ints before |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <pthread.h> | |
| #include <assert.h> | |
| #include <libkern/OSAtomic.h> | |
| #include <unistd.h> | |
| typedef void(*WorkFunction)(void* work_data); |
| #if 0 | |
| echo Compiling... | |
| cc -Wall -g -std=c99 $0 -o 2016-04-13 && ./2016-04-13 | |
| exit | |
| #endif | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <assert.h> | |
| #include <string.h> |
| #include <windows.h> | |
| #include <d3d11.h> | |
| #include <dxgi1_2.h> | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <string.h> | |
| #define LEN(e) (sizeof(e)/sizeof(e[0])) |
I hereby claim:
To claim this, I am signing this object:
| // Collections and helpers for c programming. | |
| // Version: 0.1.3 | |
| // Shoutouts to @nothings and @pervognsen who I learned / copied most of this from | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| #include <stdarg.h> | |
| #include <string.h> | |
| #include <assert.h> |
| include <stdlib.h> | |
| #include <stddef.h> | |
| #include <assert.h> | |
| #include <webassembly.h> | |
| typedef uint8_t u8; | |
| typedef uint32_t u32; | |
| typedef uint64_t u64; | |
| typedef int32_t i32; |
I've been thinking about trying to build something like terra but with javascript as the host language and wasm as the low level thing you metaprogram for. Could be used to just "jit" expensive functions and call them from javascript or to build a fully wasm program but metaprogram it from javascript or whatever inbetween. One of the things I think I need to get that to be nice is to be able to have a struct implementation that can be easily shared between wasm and js.