Discussion in 'Forum Games' started by Randomguy404, Oct 12, 2014.
47 *hugs those that want them*
48. *accepts any and all hugs*
47 *hugs Gamer*
48. *a late hug from me*
59 here is a nice image, to lighten the mood
you can find a few more here https://www.deviantart.com/sandara/gallery/57706995/small-griffins
48? You kind of moved by 11 there lens...
49 typo's for the win?
47 *very delayed hug*
46 Thanks <3
45 No problem
44 ugh... sleep schedules of horribleness.
Sent from my iPhone using Tap a Taco
44. My sleepiness is my own fault; I was ironing til late last night
I am Iron Man
43 My sleep schedule is slowly getting better. I wasn't up at 4 this morning...
44. That's good news!
43 Holy crap this professor is bad. Actual quote from him today, "Tell me what I should ask. Anticipate my questions."
42 Ah yes, peak teaching, when you make your students teach you but in the worse possible way.
43 I made a simplistic brainfuck optimizer compiler in rust in about 1 and a half hour.
It goes over the code in 2 passes. The first (which is done in parallel) turns the brainfuck "script" into tokens that are easier to work with. It also filters out everything that is not an instruction.
The second pass, combines instructions that are next to each other. Meaning that +++ becomes Add(3). It also "links" the start and end of every loop. Meaning it can simply become a jump instruction.
There are more optimizations possible like [-] which can become a single instruction to set the current cell to zero and [>]/ [<] which simply move the pointer left/right until it hits an cell containing 0.
But before I start doing any of that I first need to fix the bug that causes the last instruction to not be part of the program and make it so it can actually execute the code. After that I should probably also dig up my old lua version of it to compare the two. I suspect the lua version is slower HOWEVER that only needs 1 pass to optimize it, so it will be interesting to see how that changes things.
I probably should also keep the rust version that isn't multi threaded because that doesn't need to temporary make a Vec after the first pass and thus should be optimized into a single pass, just like my lua code.
44. Wow. That makes my efforts at teaching in the past look good by comparison.