Show HN: Whack – A simply-designed compiled programming language
I only looked for a few minutes, so first impressions:<p>1. Try the declaration syntax<p><pre><code>    x Foo;
</code></pre>
instead of<p><pre><code>    Foo x;
</code></pre>
I tried it before, you might like it.<p>2. I think the way you&#x27;re defining the AST types is a crapload of work. You should have had a bunch of dumb structs, all in one file.<p>Then you can see everything at once, and you aren&#x27;t mixing AST representation with codegen logic. Sometimes that&#x27;s a better way to do algebraic types in C or C++.<p>3. I don&#x27;t know what &quot;type Foo struct {...}&quot; does but you&#x27;ll save a lot of work if the type system only has names as types, nominative typing, without losing usability.<p>4. Personally I&#x27;d parse straight to the AST type you define and not use the mpc lib with its own AST implementation. I don&#x27;t believe in parser combinator libraries, especially not in C. It&#x27;s better to copy&#x2F;paste those loops. Better than using a parser generator too. But since you have a parser already... not right now.<p>Edit: 5. Avoid looking at Zig, Myrddin, etcetera, if you can. There are obviously paths that any C-like language tends to go down in the 21st century, and the world would probably be better if you rethought the problems from a blanket slate.