Joshua

CTO @ Encamp
jmoyers@gmail.com

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

The elements of computing systems

Posted on May 29, 2016

Coursera: https://www.coursera.org/learn/build-a-computer Original Site: The Elements of Computing Systems This course is run by some guys from the Hebrew University of Jerusalem. Its about building a computer from nand gates in a hardware simulator, building an assembler, programming language and a kernel from first principles. So far its been very interesting and informative - I've made it through to the third project in about 2 days or so of work. I posted this in their forums as a suggestions, but the only...

More