Joshua

CTO @ Encamp
jmoyers@gmail.com

Stanford Compilers: GDB With MyParser

Posted on June 07, 2016

Still working on the actual parser, but I did run into a situation where I actually needed to debug the parser in gdb. Not immediately obvious how to get this working, so I modified the myparser shell script with my...

More

Stanford Compilers: Flex Lexer for Cool

Posted on June 06, 2016

I just finished the first programming assignment for the Stanford Compilers course, which was to implement a lexer for the Cool (classroom object oriented language) using Flex. Flex is a C-language based lexical analyzer generator. It generates a valid c source file for the lexical rules you put together. The .flex file format is basically a c file with some special syntax. The bulk of this assignment was hunting for implementation details. I do not enjoy courses as much when they don't go through an assignment...

More

Stanford Compilers

Posted on June 05, 2016

Welp, still on the journey down to the hardware. Now that I've got the nand2tetris class on building a computer from nand gates out of the way, its time to dive into compilers. Update 2019: Looks like this coursera link is dead, I'm sure the course can be found though! I've decided to take Stanford's Coursera offering, though I've got a few reservations about it. First, it focuses quite a lot on formal definitions of languages and grammars. This means its using set notation and big unwieldy greek...

More

Building a Computer From NAND Gates 🔨

Posted on June 04, 2016

Course: http://nand2tetris.org/ My Computer (hdl): https://github.com/jmoyers/nand2tetris My Hack Assembler (rust): https://github.com/jmoyers/hack_assembler So I was able to build a baby computer in a hardware simulator. I learned quite a bit about how CPU's are designed and how they interact with machine code and assembly language. Finished this 6 week course in 5 days due to binge (🌙). I was able to write an assembler in about 500 lines of code including some static lookup tables. This assembler targets the...

More

Minimal Tmux Dev

Posted on June 02, 2016

If you are currently in a anti-IDE frame of mind (which I cycle into from time to time), tmux can be a useful way to use vim and also retain the ability to look at several pieces of output ... without a bunch of floating terminal windows hitting C-z and typing fg over and over. Current Setup I went through a period on intense tool customization, but I find it pretty hard to pick back up on all the little customizations if I walk away from a toolset for a while. I've since been wary of keeping too many dotfiles....

More