Blog: experiments

My thoughts on software development.

Categories

I have many interests in software development and I enjoy writing about then. As such my blog doesn't cover just one topic.

Writing a DSL parser using PegJS

In the [previous article](/blog/write-dsls-and-code-faster/) I wrote about Domain Specific Languages (DSLs) and how useful they are, but I didn't get into the details of parsing them, that's where this article comes in. Previously we made this DSL: ```javascript User.ScheduleAppointment has { a UserId userId an AppointmentDatetime appointmentDatetime a Location location from { a LocationName locationName from location a Latitude latitude a Longitude longitude } } ``` We want to take the above, and parse it. That means turning the text into an Abstract Syntax Tree (AST). An AST is a tree structure that's easy ...
Read more »

Write DSLs and Code Faster

# What is a DSL DSL stands for Domain Specific language, this means that it is a language that is designed to solve a specific problem in a domain. DSLs are great if you want to write a generic solution to a specific problem without all the boilerplate code. A good DSL is easy to write and understand. Once someone understands the domain language, they can read the DSL, and understand the problem, even if they're not a coder. DSLs allow us to automate many things, including aspects of development, greatly increasing our speed and lowering codes and error rates. # Here's one I made earlier At work, I was getting annoyed with how it a...
Read more »

Expert help

Have a codebase where change is expensive and risky?