2022

2022-05-03

Recently arrived back home after more than a month travelling through Brazil. Been pretty excited about making music again and I’m eagerly awaiting a Polytone tracker to arrive! In the meantime I’ve brushed up some of my music theory and composition knowledge and finally cleaned up and consolidated my notes on the topic. Been doing some active learning and taking some notes on harmonic composition that I can’t wait to put into practice.

I’ve also did some more improvements on bdl. Currently the compiler is able to generate BASM code for signed integers, booleans, arithmetic operations, numeric comparisons and if statements. Still a lot of work to do but soon functions and variables should be available, after which I’ll implement a BASM virtual machine to test some small programs.

2022-04-19

After a bunch of travelling and hiking in Brazil, we made our way to a different type of wild life: Sao Paulo. What a behemoth of a city (12 million people!). There we visited some friends and family and went to various social events. It was fun, but big cities are not for me. Currently visiting even more family in a much smaller town, where we can finally rest, if only for a moment.

Work on bdl continues, fixing some bugs and adding more check on the semantic analyzer. Now the compiler can visualize different stages of the pipeline. Reading about low-level linear IRs for the next part. A bigger update can be found inside the latest bdl blog post.

2022-04-11

Finally getting to creating a /now page. I’m currently travelling through rural Brazil. I’ve been enjoying hiking in the country side, visiting predominantly hippie towns and bathing in rivers and waterfalls. A limited internet connection makes you appreciate those bare HTML pages when trying to find information, as big pages and articles take too much time to load. Still, I manage to download some PDF books for learning more about type systems when offline.

In the downtime, I’ve been working on bdl, my programming language. Lexing source code and a recursive descent parser are implemented. For semantic checks, I also added a simple monomorphic type system and enforcing symbol declaration before usage (except for functions in the global scope).

The type system needs more work, but after a few tweaks I will move on to the next compiler stage and revisit it in the future, perhaps allowing polymorphic types. I added the use of { e1 e2 ... en } blocks, which will run all expressions in the block and return the result of the last expression (en). It could be thought as syntactic sugar for (begin ...) in a Scheme.

I still need to write a formal spec for the language, but things are taking shape. Last but not least, the compiler can now output the parsed AST in the plain text dot format, which can be used with graphviz for nice visualizations. It already paid off by helping me debug the type system implementation. This was inspired by this amazing Twitter thread by thingskatedid.