<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Technical Blog on Yukang Xie</title><link>https://bathtub-01.github.io/technical/</link><description>Recent content in Technical Blog on Yukang Xie</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 20 Dec 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://bathtub-01.github.io/technical/index.xml" rel="self" type="application/rss+xml"/><item><title>Yet Another Explanation of (State) Monad</title><link>https://bathtub-01.github.io/technical/monad/</link><pubDate>Wed, 20 Dec 2023 00:00:00 +0000</pubDate><guid>https://bathtub-01.github.io/technical/monad/</guid><description>&lt;p&gt;&lt;em&gt;While there are already numerous tutorials explaining what a &lt;strong&gt;Monad&lt;/strong&gt; is on the internet, I will strive to present it in a more intuitive and friendly manner. Additionally, we will walk through an example of utilizing the state monad to develop a small embedded DSL in Haskell.&lt;/em&gt;&lt;/p&gt;&#10;&lt;h2 id="hiding-things-introduces-impurity"&gt;Hiding Things Introduces Impurity&lt;/h2&gt;&#10;&lt;p&gt;To understand monads, we must first discuss their motivation. A significant advantage of functional programming (FP) languages is that functions are free of &lt;em&gt;side-effects&lt;/em&gt;, making programs easier to construct and reason about. You may also hear that functions are &lt;em&gt;pure&lt;/em&gt; in FP, or that FP is stateless. These statements are strongly connected and have a causal relationship.&lt;/p&gt;</description></item><item><title>A Reading Note of The Little Typer</title><link>https://bathtub-01.github.io/technical/little-typer/</link><pubDate>Fri, 27 Oct 2023 00:00:00 +0000</pubDate><guid>https://bathtub-01.github.io/technical/little-typer/</guid><description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;a href="https://thelittletyper.com/"&gt;The Little Typer&lt;/a&gt;&lt;/strong&gt;, written by Daniel P. Friedman and David Thrane Christiansen, provides an accessible introduction to dependent type theory. This article briefly summarizes what I have learned from the book.&lt;/em&gt;&lt;/p&gt;&#10;&lt;h2 id="an-overview-of-pie"&gt;An Overview of Pie&lt;/h2&gt;&#10;&lt;p&gt;The authors of the book designed a language named &lt;strong&gt;Pie&lt;/strong&gt; to demonstrate their ideas. Basically, Pie has a similar syntax to Scheme - you write code in a pure functional style and play with nested brackets. Every expression in Pie can be described by a &lt;em&gt;type&lt;/em&gt; (besides &lt;code&gt;U&lt;/code&gt;, which describes types other than itself). We can use &lt;code&gt;define&lt;/code&gt; to combine a name to an expression, but before doing so we must &lt;code&gt;claim&lt;/code&gt; the type of that expression.&lt;/p&gt;</description></item><item><title>Implementing an On-Chip Network Router Using Good Practices</title><link>https://bathtub-01.github.io/technical/noc/</link><pubDate>Mon, 14 Aug 2023 00:00:00 +0000</pubDate><guid>https://bathtub-01.github.io/technical/noc/</guid><description>&lt;p&gt;&lt;em&gt;On-chip networks have become the dominant interconnect technique for modern multi-core architectures due to their good scalability. Router design involves various implementation details, many of which have been extensively studied over the past two decades. In this article, we will implement a router from scratch to demonstrate some key concepts in on-chip network design and make design choices informed by existing good practices.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This design is implemented in &lt;a href="https://www.chisel-lang.org/"&gt;Chisel&lt;/a&gt;. The full list of code can be founded &lt;a href="https://github.com/bathtub-01/noc-router"&gt;here&lt;/a&gt;. It&amp;rsquo;s released under the MIT license.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>What does HDLs Describe and Why Chisel is a Good HDL</title><link>https://bathtub-01.github.io/technical/hdl/</link><pubDate>Wed, 05 Apr 2023 00:00:00 +0000</pubDate><guid>https://bathtub-01.github.io/technical/hdl/</guid><description>&lt;p&gt;&lt;em&gt;This article is derived from a tutorial I conducted for new students in our research group. While the primary goal of that tutorial was to introduce listeners to hardware development and the usage of &lt;a href="https://www.chisel-lang.org/"&gt;Chisel&lt;/a&gt;, I have extracted some discussions that may also be interesting to people with prior hardware development experience. These include discussions on (a) the disparities between the programming model offered by an HDL and the real-world hardware, and (b) comparisons between various HDLs.&lt;/em&gt;&lt;/p&gt;</description></item></channel></rss>