littlelogs

Keep a social journal of your work progress as you make and learn things.

September 2016

wearing2raincoats

Today I began rethinking the structure of #GraphexScala. My first iteration, during school, was very Java-minded. For this rewrite, I wanted to make the project a lot cleaner, and incorporate a handful of Scala-specific niceties.

At work today I began rewriting some of the helper functions. One of these was consolidating all multi-asterisks into a single asterisk, since for our purposes a-star-star will match the same strings as a-star (dammit markdown!). The other involved reading the “alphabet” out of the file to be checked, a set of all characters except newline. I was able to turn both of those functions into concise one-liners that use recursion and collection transformations out the wazoo.

I also put some work into remembering how my productions worked for the regex-parsing and NFA-building. I am going to keep it mostly the same as it was in the Java version, but hopefully it will be easier to debug this time.

wearing2raincoats

Earlier today I began my first project, #GraphexScala. It is a rewrite of one of my college programming assignments. Basically, we were asked to implement our own simplified version of the ‘grep’ utility, commonly used on the command line as a file-searcher. Under the hood, this program will run on the technology of finite state automata, which is super cool in general.

In May of 2015 I handed in my first version of the project, and while I got an A in the class, I was not satisfied with the quality of my program. I’ve decided to rewrite it in Scala, which is way more fun than Java.

So far today, I created the baseline entities of State (NFAState and DFAState extending) and Connection (two States and an input character). Gonna need to think through this pretty extensively before I write much more code.