Tech Snippets #5
Welcome to the fifth part of Tech Snippets š¤
How big is a kilobyte?
How big is a kilobyte, 1000 or 1024 bytes? What do you think?
Spoiler
tl;dr: either 1000 bytes or 1024 bytes, but thereās no consensus.
![](https://evanhahn.com/images/evanhahnlogo.png)
Announcing āuse-soundā, a React Hook for Sound Effects
I am currently working on a multiplayer online game project using React and needed to add some sound to it. That is how I found the npm package use-sound by Joshua Comeau and he also created a great article on how to use it. But also on how to find good sounds, preparing it and accessibility.
Additionally, this article comes with a lot of interactive examples. It is definitely worth checking out.
![](https://www.joshwcomeau.com/images/og-announcing-use-sound-react-hook.png)
Building a Compiler Frontend
Are you interested in creating your own programming language?
This blog post explains on how to write the compiler frontend, which converts a program text in language A (e.g. TypeScript, Go, Rust) into an intermedia representation that is understand by the compiler backend. Which then interprets it and produces machine code for a particular platform.
The tutorial makes use of pest, a general purpose parser written in Rust. The blog posts focuses on the frontend part but it also comes with a simple and more advanced example, which includes also the backend part. In the examples you have a super simple language that has functions and can do addition and subtraction and is interpreted and run on top of Rust.
![](https://mohitkarekar.com/img/posts/compilers-cover.png)
Thank you for reading and have a wonderful day āļø
Member discussion