(Writing)

xpl update (April 2023)

I've been working on a programming language as a personal challenge. It's statically typed and compiles to native code.

Earlier this year I completed an .exe file format backend which I've been using that in this project. Doing so means I don't have to add any dependencies like LLVM. (Of course, if I want to use LLVM for optimization later on then that might change.)

Here's some completely nonsensical code in the new language. You'll notice a few things:

Of course, neither xpl's syntax nor its implementation is production-quality yet...but hey, at least it's something.


  #loadfromdll kernel32.dll ExitProcess 1 int 0
  #loadfromdll dll_print_value.dll PrintInteger 1 int 0
  #loadfromdll dll_print_value.dll PrintString 2 int char* 1 int

  proc main() {

      obj_a oa;
      oa.i = 1;
      oa.itwo = 12;
      oa.c = '3;
      oa.cp = "hey";

      obj_b ob;
      ob.char_a = 'B;
      ob.test_int = 0;
      ob.next = "Hello, Geoffrey.";

      int a = 0;
      while a - 300000000 {
          oa.i = oa.i + 1;
          oa.itwo = 5;
          ob.test_int = oa.i - 1000;
          a = a + 1;
      }

      print_proc(oa.i);
      print_proc(oa.itwo);
      PrintString(ob.test_int, ob.next);

      ExitProcess(345);
  }

  object obj_a {
    int i;
    int itwo;
    char c;
    char* cp;
  }

  proc print_proc(int val) {
      PrintInteger(val);
  }

  object obj_b {
      char char_a;
      int test_int;
      char* next;
  }

(Writing)