Skip to content

Blog

H2C Migration Guide

This blog records some investigations during migration HTTP1.1 services to HTTP2 h2c. It lists some possible problems encountered during investigation. The background is that using HTTP/2 to communicate internally will significantly improve the efficiency. To do so, h2c(unencrypted http2) solution is better as it prevents the encryption-decryption between peers.

Onboarding Parsec Library from Self-Defined Parser

Previously, I used my own parser to parse the solidity language syntax and finished the expression part. It's a combination of ExceptT and State to maintain the states and report error.

type ErrMsg = Text

type Parser a = ExceptT ErrMsg (State Text) a

The original parser doesn't have error report at all, and it definitely is not the correct way. Moreover, I believe the open source parser library works better than mine as i'm still newbie to haskell. Hence, I choose to replace my custom parser by the parsec parser.

This blog introduces the investigation of parsec and the problems I encountered during migration. Beside them, I will compare some pattern differences between parsec and mine.

Go List Command and x/mod Package

This blog try to introduce the go list command and brief a refinement at go1.16. Moreover, we will explore the differences between go list -m all and go list all, and answer question why some of the module from go list -m all cannot be found by go mod why.

Finally, we will see the x/mod package and when it's useful.

Practice of Dev Tool Version Control

This blog focuses on some practices to manage development dependencies, not library dependencies. Hence, it's not a blog to introduce how Go, Cpp or Rust compiler resolves the libraries to build or the linker finds the dll for linking.

Instead, it talks about how do we manage the tools during development. For example, when using protoc along with its several plugins, how to ensure all CLI tools are used as desired everywhere?

Foldr and Foldl in Haskell

This blog introduces how foldr and foldl work for a better usage them. Understanding the accumulation and association support from them is crucial.

foldr: Right-associative fold of a structure, lazy in the accumulator.

foldl: Left-associative fold of a structure, lazy in the accumulator.

In short, it helps you to construct a left/right associative structure. One of the real cases is you want to construct a left associative structure inside a parser , but you parse it in a right recursive way.

Note that this is a simple note, which has been already covered by documentation, and I wrote it because at the beginning I misunderstand its feature, so I wrote some code to try.