I read a thesis
I saw a tweet about a JS library called valibot. It was announced as a tinier alternative to Zod and since I was a user of Zod I decided to check it out.
I really liked it.
I did not check if it actually produced a tiny final bundle size, I don’t know how people check that, but I liked the fact that I can try out an alternative library for the same functionality.
Variety is the spice of life, isn’t it? 😁
In May, I decided I was going to read a lot more, to improve my knowledge and my attention span, and I have always notice a the bachelor thesis link on the get started page of Valibot so I decided to read it.
Let me get some things straight at this point:
- I don’t enjoy reading technical stuff. I prefer movies.
- I have never read a thesis because they are usually about topics that I have no idea of.
- I don’t know much about the JS and TS world. The most I use them for is React.
I was really challanging myself at this point, so I clicked the link and I was directed to a PDF file that contains the logic behind valibot’s structure.
It is a 75 page document. I usually attempt to read books of over 200 pages so 75 pages wasn’t a turn off and since it was talking about stuff that I had some idea about I was open to learning.
It started off with a discourse about the current mainstream schema validation libraries: Zod, Yup, Arktype etc.
I did not know that Zod was object oriented, and that the fact that is object oriented makes it difficult for bundlers to split out the unnecessary code from the final bundle.
I also learnt that libraries specially optimize for a reduced final bundle by either optimizing for easy code splitting (Zod doesn’t do that), compression or adding a compile step (Typia does that)
I did not understand a lot about what was been said and at some point I was just reading for the thesis like I was reading a James Patterson, but I was happy that I was reading a thesis.
I got to understand the importance of software modularity and I saw how thorough investigation into existing solutions can result in a beautiful library and thesis.
Only “moral lesson” is: Look for how software around you can be better. Bun is doing that for Node JS. Valibot is doing that for Zod. Zed is doing that for VS Code.
Just look around. There is slow software everywhere waiting for you to build a better version of it.
Shoutout to Fabian Hiller for the work done on the library and thesis. He did great with this.
And yeah, that’s all. I read a thesis