Making a compiler (ep 12-13) Built-in variables & C# methods



Puking glitter
Originally posted by palesystemmalfunction

You cant probably see it because of Tumblr’s lack of affection towards timestamps, but last episode came out 6 months ago.

I had a good flow before. Nearly one PR per week. But then summerjob happened, and some vacation, and some vacation from my vacation, then school started, then dog ate my trashcan…

I’ve been busy. And I’ve lost the flame for this project.

Ok so episode 12 was omitted ‘cause it was just such a short one. It was just “Oh hey I’m an idiot, I pick my nose and added the variable list”

It was back at ep 5 i added the commands. I just forgot the variables.

Anywahcays. New feature just compläted:


Pouring a bucket of drink
Originally posted by sexdropei

relevant gif.

This feature set was actually a big head scratch and too much alcohol spaghetti code. Like look, now I can use ToString… :meh:

Compiling .ToString() to G1ANT.Robot

The headscratch was having it parse it and understand which overload to use, if it is g1ant cmd or c# cmd, and dealing with stuff like void methods…

You (my one reader base, aka myself) may not know this (we both knew it stupid eggfishousarous) stop parentheses interrupt me. the g1ant syntax doesn’t allow for c# void functions anyways.

Which is cool for scenarios like list.Sort()….. GRr.

Creating a list and sorting it with IList.Sort()

For reference, that x.Sort() compiles into this:

♥x=⊂new Func<System.Collections.Generic.List<System.Object>, System.Collections.Generic.List<System.Object>>((System.Collections.Generic.List<System.Object> _)=>{_.Sort();return _;})(♥x)⊃

Yea. Nice workaround… Just gonna gouge my eyes brb

That gif is from me adding the compiler to VS Code btw. It works nicely. Added detection for errors was pretty cool too. Here’s some more of that:

Compiling in VS Code and getting error squiglies

Would you look at that.!. Time is already up at 150ms compile time. I find that a lot. I mean it’s not that basic of an application, and it’s not well optimized at all, I think I double compile here and there because I have a stupid algorithm… but butts!

Anypose, Au revoir, spidermoms.

This post was originally posted (by me) here: