Expected Exceptions

Code, Software, and things that interest me

Rust Jsonnet: Lexer

For a while now, I've been working on a rust implementation of an interpreter (and maybe if I get to it, a jitter) of the jsonnet language. I've written serveral parsers (and lexers), and used several different iterations of both AST and the core language, though I've never gotten as far as to actually implement the interpretation part. However, at this point in time, I'm reasonably happy with how the parser works for once, and I'm also somewhat confident that it works reasonably well. After all, it managed to parse the jsonnet stdlib...

For a while now, I've been working on a rust implementation of an interpreter (and maybe if I get to it, a jitter) of the jsonnet language. I've written serveral parsers (and lexers), and used several different iterations of both AST and the core...

ASP.NET Core MVC and json patches

It's been waaaaaay too long since I last wrote a blog post, so I figured it was about time I did so again. That being said, this'll probably be a rather short blog post. I've recently wrote a small .NET Standard library (it runs on both .NET Core and the full .NET Framework) that deals with partial JSON objects (and just partial objects in general). But before I go into explaining what the library does, I'd like to explain a bit better the problem it's trying to solve. Partial object A partial object is an object in which not all properties...

It's been waaaaaay too long since I last wrote a blog post, so I figured it was about time I did so again. That being said, this'll probably be a rather short blog post. I've recently wrote a small .NET Standard library (it runs on both .NET Core and...

Xando pt. 3 - JSON

Previously we looked at events and commands, and this time we'll look at converting events (primarily) to and from JSON. The code can be used for commands too (with really minor modifications), but it's primarily made for dealing with events. First, let's take a look at the code used to represent events again: Here we have 4 different events. In and the data: and the data: The is a literal with the value ). So, how do we get from my JSON representation to an instance of ). So, how do we get from my JSON representation to an instance of...

Previously we looked at events and commands, and this time we'll look at converting events (primarily) to and from JSON. The code can be used for commands too (with really minor modifications), but it's primarily made for dealing with events. First...

Xando pt. 2 - Events, Commands and State

In the previous post we talked about some general concepts of CQRS and Event Sourcing. In this one I'd like to get a bit more hands on with the problem. Namely, I'm going to look at what events and commands we need for our user system, and what state we should keep to enable writing our business logic. So, let's start by analysing what a user can do. Or more more to the point, what a user can have done (which is a really weird sentence). Let's talk about events. Events In general, when dealing with database systems, most programmers knows that...

In the previous post we talked about some general concepts of CQRS and Event Sourcing. In this one I'd like to get a bit more hands on with the problem. Namely, I'm going to look at what events and commands we need for our user system, and what state...

Xando pt. 1 - Down the rabbit hole of CQRS and Event Sourcing

A friend of mine and I have recently started working on a project that involves CQRS and Event Sourcing, both of which are new to me. Therefore I figured I'd try to start a blog series explaining the issues I've faced (and will be facing), how I got around them, as well as show how I'm structuring and developing this project. But before I get started with that, I'd like to start by explaining what I mean when I say CQRS and Event Sourcing, as well as some other terms that I will be using later in this series (if I ever get that far). Do note...

A friend of mine and I have recently started working on a project that involves CQRS and Event Sourcing, both of which are new to me. Therefore I figured I'd try to start a blog series explaining the issues I've faced (and will be facing), how I got...

Crazy things you can do with the F# ternary operator

I was working with two different monads in F# the other way, and writing code like the following: I did not want to use a builder for different reasons, therefore I was calling manually. However, while the code above works I was not happy with it and wanted to improve it. The obvious thing to do first is to swap the arguments using the pipe ( ) operator, in which case we end up with this: ) operator, in which case we end up with this: The result is definitely better, but I'm still not digging it. One of the things I don't like about this is...

I was working with two different monads in F# the other way, and writing code like the following: I did not want to use a builder for different reasons, therefore I was calling manually. However, while the code above works I was not happy with it...