New Job at Evolve

I’m happy to officially announce that I have accepted a job at a local start-up here in Minneapolis called Evolve.

logo[1]

We’re going to be a very small crew, working closely together to bring Evolve to the next level. I’m extremely excited to take this next step closer to my original passion: video games. I am also very excited to learn more about start-ups and what it takes to put them together and make them successful.

And if you want to play some games head over to my Evolve profile and add me as a friend!

Farewell Microsoft

For the past 6 years, almost to the week, I have been an employee of Microsoft. I was part of a small development team based out of an office in St. Paul, Minnesota. About 3 weeks ago our office was shutdown due to a wave of layoffs taking place in Microsoft and as a result I was also laid off. I have been given the option to relocate to Redmond and apply for a new job if I wish, but I have decided that I do not want to relocate right now after all. So it is at this point that I am saying farewell to Microsoft.

I worked on Expression Blend, Visual Studio and finally Internet Explorer. I have mostly enjoyed my time there, especially working with some great people over the years. It was not without its technical and social challenges to overcome but for the most part I come away from the experience better and stronger I believe. I believe the senior management and the changes they are making are actually good for Microsoft and look forward to seeing them ascend and take their rightful place among the tech giants once again.

I harbor no ill will towards Microsoft and I find myself feeling more relieved and excited to be onto a new chapter than I am worried or stressed, though this kind of uncertainty is never fun. So it is with mixed emotions I say farewell Microsoft, and thanks for all the fish.

WP_20141008_008 ??????????? WP_000011 WP_000043 (1) WP_20140918_001

paktc, an npm package

Just to learn about the process more I created a small and semi-useful (ok not-that-useful :) npm package called paktc. Which stands for “Press any key to continue…”.

Which does exactly what the name implies; it prints out that message then waits for you to press something before continuing. This is a standard thing to be added to default console applications for C# and its useful for cases where you’re using an IDE (e.g. Visual Studio with nodejs tools extension) that pops up a command prompt and then quickly closes it again before you can see the results.

paktc (Press any key to continue…)

Prints ‘Press any key to continue..’ when in debug mode and waits for input before closing.

example

// your console application code here...

require('paktc') // Press any key to continue...

install

With [npm] (http://npmjs.org) do:

npm install paktc

 

It was a very interesting experience to work with npm, it’s amazingly easy and simple to use. I can’t imagine any significant platform in the future not having a comparable package manager and still being successful. You should check it out if you haven’t already.

 

New meta# nuget package published

I uploaded a new meta# NuGet package:

PS> Install-Package metasharp

It only has pattern matching api’s in this package now. To make patterns, just start with MetaSharp.Transformation.Pattern and all of the pattern factories are static methods from there. A simple example:

var p = Pattern.OneOrMore(Pattern.Range(‘a’, ‘z’));
var m = Pattern.Match(p, “metasharp”);
if (m.Matched) { … }

 

This package is .net 2.0 now too, so you can use it in more places (such as Unity3d). I’m planning on putting the actual grammars and build tasks etc into other packages so that the main package remains very portable. Also I changed it so that ‘p’ in the above scenario is a Pattern ast object instead of a Delegate. Which means that you could theoretically visit the pattern and transform it, itself. Also tracing produced objects will give you the pattern that produced it as well as the metadata.

The most major improvement of the API from before is the fact that you don’t have to implement INode on the objects you produce. Before everything had to be an INode and so you would have to do some awkward wrapping / unwrapping if your tree didn’t implement INode but now it just works with any plain old CRL object. Also it uses DynamicInvoke on productions so you can just bind them directly to any method with parameters of any type:

var p = Pattern.Production(
    Pattern.Variable(“x”, Pattern.Any()),
    (int x) => x + 1); // throws if the value consumed isn’t an int

 

I hope that makes sense. My first attempt made use of generics to attempt to flow static typing through the productions (which is definitely possible) but the insufficient type inference and support for monads in C# caused the complexity of the patterns to be unbearable. I found that if you use object and DynamicInvoke instead, you get similar results with reasonable complexity. The end result is that this api isn’t strictly monadic, since there is no Bind or Select/SelectMany. But it is monadic in spirit, all of the objects involved in the pattern matching operation are immutable and are safely parallelizable, except possibly your custom productions.

I’m pleased with the performance so far, the Or pattern executes each branch in parallel. I haven’t really stressed it that far yet but my 210 unit tests take about .45 seconds to run total so that seems pretty good. I want to create a Reflection.Emit visitor so I can get even better performance for rules but, unfortunately, that API isn’t available on all platforms (e.g. WinRT) so I’m not sure how best to do that.

The next big step is to create a new package with a C# grammar + roslyn transformer. Before it was a 1-off language. This time I plan to redo that work except as C# so that it is more appealing to users. I also want to change the grammar language to not be inheritance based, but compositional. This will require a little experimentation but I think it will make it a lot more appealing. The lack of extensibility in Roslyn is a real bummer because as far as I can tell there is no way for me to easily extend Roslyn to add pattern syntax to C# that way. The result is that I can leverage roslyn to generate assemblies from my AST but I still have to implement my own C# grammar if I want to extend it. A bummer but not harder than what I did before.

If you get a chance to try it out, I would appreciate feedback on the Pattern api though :)

Enjoy!

Ludum Dare April 2014

Here are some screen shots from my first attempt at a Ludum Dare challenge :) It’s woefully incomplete and I don’t have any modeling skills so I did it all with primitive shapes in Unity3D. But its fun!

ants-ludumdare2014 ants-ludumdare2014_2

In case you’re wondering what Ludum Dare is, the short version is that it is a 48 hour game programming contest that you have to do completely alone just for fun. There is a theme, this time the theme is “Beneath the Surface”.

Download | Source