HackerTrans
トップ新着トレンドコメント過去質問紹介求人

jhonsrid

no profile record

コメント

jhonsrid
·昨年·議論
It looks like even though VMS Software Inc have taken over development of OpenVMS, HP still hosts the v8.4 documentation set, for instance here's the system services reference manual:

http://h41379.www4.hpe.com/doc/84final/4527/4527pro.html#fir...
jhonsrid
·昨年·議論
For me, the distributed lock manager, queues (SYS$ENC / SYS$DEQ), IPC via message passing (mailboxes), SYS$QIO to literally queue IO requests, event flags (SYS$SETEF / SYS$WAITFR)? Amazing clustering, - UNIX just seemed so backwards after learning VMS first! (Apologies though if I got any of those system call names wrong, its been a long time!)
jhonsrid
·2 年前·議論
You can write a program that takes BF code as input and outputs valid C source that would execute it in less than 20 lines of well formatted ANSI C using nothing more than putchar, getchar, while, pointer inc/dec and dereference, so I can imagine a full compiler for it would be super simple too.

(Though I bet an optimising compiler would be a _little_ more complicated) ;)
jhonsrid
·3 年前·議論
The language with a rude name sometimes known as 'BF' compiles trivially to C (from C), for instance:

  #include <stdio.h>
  int main() {
      int c;
      printf("#include <stdio.h>\nint main() {\nchar a[30000] = {0}; char *p = a;\n");
      while((c = getc(stdin)) != EOF) {
          switch(c) {
              case '>': printf("++p;\n"); break;
              case '<': printf("--p;\n"); break;
              case '+': printf("++*p;\n"); break;
              case '-': printf("--*p;\n"); break;
              case '.': printf("putchar(*p);\n"); break;
              case ',': printf("*p = getchar();\n"); break;
              case '[': printf("while (*p) {\n"); break;
              case ']': printf("}\n"); break;
          }
      }
      printf("return 0;}\n");
      return 0;
  }
(Though sorry to any BF fans if I've missed something in the implementation) ;-)
jhonsrid
·3 年前·議論
I've seen this done (in England) for blocks of flats where each floor has it's own postcode that matches the floor, eg ZZ1 Z1A through to ZZ1 Z1G (A-G for floor 1 to 7).
jhonsrid
·3 年前·議論
Yeah, working in C and python you definitely have to reinvent the wheel less in Python ;-)

I recently wrote an 8bit style CPU simulator (with it's own simple but perfectly usable instruction set) and assembler, together they fit into 1000 lines of C... To be fair that's a fairly specific case where C works really well though!