Encoding Base58: Understanding and implementing in Scala

I recently needed to convert to and from Base58. An existing crypto library was not an option, because I just needed one function exact function. However, I could not find a suitable Scala implementation, and the algorithm in the specification was unclear. Understanding the algorithm An encoding algorithm is just a base transformation, it is the same as transforming between base 2 (binary), 16 (hexadecimal), 10 (decimal) or any other base.

Continue Reading

My thoughts after 6 months working with DAML: A Smart Contract Language

​ A smart contract is a fancy term for a “program that runs on the blockchain”. They were first introduced in the Ethereum blockchain and the idea is simple: The blockchain acts as an ubiquitous computer to run the programs (or “smart contracts”) and stores its results and current state. We can all agree on the results and current state of the program, because of the independent consesus provided by the blockchain.

Continue Reading

Xtext vs ANTLR vs Parser Combinators

So you have decided that you need a parser, a real one. Now you need to decide what to use to implement that parser. There are several choices: Create your own parser manually Use a parser combinator library like fastparse or parboiled2 Use a parser generator, like Antlr Use a language workbench, like Xtext or Langium Each choice has advantages and disadvantages that I will discuss in this post.

Continue Reading