Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I mean I guess, it's only a small subset of C though (no floating point or structs even):

  $ cc float.c && ./a.out && ./c4 -s float.c && ./c4 float.c && echo 'struct { int a; } s;' >struct.c && cc -c struct.c && ./c4 -s struct.c
  hello, world 1.250000
  1: #include <stdio.h>
  2:
  3: int main()
  4: {
  5:   printf("hello, world %f\n", 1.25);
      ENT  0
      IMM  83656704
      PSH
      IMM  1
      PSH
      IMM  25
      PSH
      PRTF
      ADJ  3
  6:   return 0;
      IMM  0
      LEV
  7: }
      LEV
  hello, world 0.000000
  exit(0) cycle = 13
  1: bad global declaration
  $


So not really C in 4 functions then. Just some mini language that’s a subset of C, in four functions. That’s a much simpler target to reach, I guess.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: