logoalt Hacker News

56,000 lines of DOOM, in a language I made up

28 pointsby ghuntleytoday at 4:24 PM20 commentsview on HN

Comments

andaitoday at 5:00 PM

Excellent. At last, I can I confess a far worse crime.

Late 2020, pre-AI, which I'm not sure if that makes it better or worse...

  #include "uwu.h"
  #include <stdio.h>

  iwint main() stawt
      iwint owo is 5 yiff
      fuw (iwint uwu is 0 yiff uwu smol owo yiff uwu incwease) stawt
          owo is owo wif uwu yiff
          spweak nuwumber_fowmat, owo spwake yiff
      stawp
  stawp
--

  // uwu.h

  #define is =
  #define yiff ;
  #define stawt {
  #define stawp }
  #define fuw for
  #define iwint int
  #define wif +
  #define wiffout -
  #define smol <
  #define larg >
  #define incwease ++
  #define spweak printf(
  #define spwake );
  #define nuwumber_fowmat "%d\n"
Obviously this one also runs DOOM ;)
show 6 replies
ahmadyantoday at 7:45 PM

Nicely done Geoffrey, I think we are coming full circle, instead of porting projects to different languages (for whatever) like going from zig -> rust -> zig, now we can also add additional hops like zig -> rust -> curse -> ts -> ocaml -> english -> zig.

Thank you for keeping the token furnace burning!

bentttoday at 4:48 PM

This is a good example of where it’s important to be more up front about the role of AI in the making of a thing.

Making a language that compiles through LLVM is no small task and takes a lot of expertise. Most of the time people do it because they have a point of view and are highly technical.

Making a joke language via AI is an entirely different exercise. Not without value but not the same, especially when evaluating what it means about the author.

show 2 replies
Retr0idtoday at 5:17 PM

It's cool that AI lets you cheaply experiment with language design, but I wish people would stop using it for the writeups, too.

Buried near the end is a mention of per-frame arena allocation, which is an interesting idea for a game engine (although not a novel one).

rebolektoday at 5:23 PM

What if I don't `evict`? How different is it from forgetting to `free`?

vofxtoday at 4:52 PM

[flagged]

show 4 replies
jdw64today at 5:17 PM

I'm writing the C backend by hand and using AI for the rest, so how did this author manage to finish an entire language in just 34 hours? I've been steadily catching and fixing what the AI writes, so it's amazing to me that they ended up with a complete language. It makes me wonder if the way I'm building a compiler is just wrong.

show 2 replies
freestandingtoday at 5:35 PM

[flagged]