Extending InspecTree with support for semantic analysis
In my previous post, I showed how I wanted to transpile my C# lambdas to GLSL shaders in my rendering engine. I created a library, InspecTree, which gives you access to the entire syntax tree of a lambda, statement bodies and all. This was a great start, but I quickly realized that I would want more than just the syntax tree. I would also want to know the types of the variables, the return type of the lambda, which methods that were being called inside the lambda, and more specifically check if a lambda is capturing one or more variables from an outer scope (more on why this would be a problem later). ...
Making a fast and memory efficient Tiled parsing library in C#
What鈥檚 Tiled? Tiled is a popular open source map editor for 2D games. It supports several file export formats, often times even specialized ones for specific game engines. I recommend you check it out if you haven鈥檛 already. It鈥檚 a great tool for creating 2D maps for your games and then exporting them in a format like JSON or XML to be used in your game engine of choice. The problem In my never-ending game development journey, I鈥檝e used Tiled for several projects. I鈥檝e therefore also used many of the existing libraries for parsing Tiled maps in my .NET projects. However, a lot of these libraries seem to lack in the features that they support, or they are outdated and no longer maintained, or lack in documentation making them difficult to use. ...
InspecTree: C# Expression<T> with statement body support
What鈥檚 an Expression<T>? I strongly suggest you refer to the official documentation for a more in-depth explanation, but in short, an Expression<T> is a type in C# that will give you access to a supplied lambda expression as a syntax-tree-like object. This expression tree can then be traversed and inspected, and you can do all sorts of cool things with it, e.g. transpile it to another language, or even execute it. ...
Hello World!
Well, here we are. My first post. I don鈥檛 know how often I鈥檒l make these, but it feels like fun. I have a few ideas of things I want to write about, so expect posts in a near future.




