<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Jason5Lee&#39;s Blog</title>
		<link>https://jason5lee.me/</link>
		<description>Recent content on Jason5Lee&#39;s Blog</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<lastBuildDate>Sat, 24 Jun 2023 19:35:34 +0000</lastBuildDate>
		
			<atom:link href="https://jason5lee.me/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Handling Concurrency: Understanding Coroutines, Async/Await, Scheduling, and More</title>
				<link>https://jason5lee.me/blog/understanding-coroutines/</link>
				<pubDate>Sat, 24 Jun 2023 19:35:34 +0000</pubDate>
				<guid>https://jason5lee.me/blog/understanding-coroutines/</guid>
				<description>&lt;p&gt;We often need to execute multiple tasks simultaneously in the program, such as a server handling multiple requests at the same time or a browser rendering the UI while performing I/O operations. As concurrency in our programs increases, technologies like asynchronous I/O, coroutines, and async/await are being used to support it. In this article, I&amp;rsquo;ll share my understanding of these technologies, hoping to help you comprehend and apply them.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-fundamental-idea-of-coroutines&#34;&gt;The Fundamental Idea of Coroutines&lt;/h2&gt;&#xA;&lt;p&gt;The OS provides threads to run parallel tasks, but creating and scheduling a lot of threads can lead to high costs. Even with thread pooling, if a large amount of concurrency is needed at the same time, the number of threads in the thread pool must also be large.&lt;/p&gt;</description>
			</item>
			<item>
				<title>My Understanding of OOP and FP</title>
				<link>https://jason5lee.me/blog/my-understanding-of-oop-and-fp/</link>
				<pubDate>Tue, 30 Aug 2022 22:56:00 +0000</pubDate>
				<guid>https://jason5lee.me/blog/my-understanding-of-oop-and-fp/</guid>
				<description>&lt;p&gt;In my &lt;a href=&#34;https://jason5lee.me/2022/08/24/my-views-on-programming-languages/&#34;&gt;previous article&lt;/a&gt;, I discussed my understanding of programming languages in general. In this article, I will concentrate on explaining object-oriented programming (OOP) and functional programming (FP) as I understand them.&lt;/p&gt;&#xA;&lt;p&gt;To summarize briefly: OOP is used to express intentions about universal objects, whereas functional programming primarily focuses on specific types of objects.&lt;/p&gt;&#xA;&lt;h2 id=&#34;encapsulation-and-polymorphism&#34;&gt;Encapsulation and Polymorphism&lt;/h2&gt;&#xA;&lt;p&gt;Before we delve into OOP and FP, let&amp;rsquo;s first talk about my understanding of encapsulation and polymorphism. These terms frequently appear in discussions about OOP and occasionally in FP. They might seem unusual at first, but they are tied to two elementary notions: the &lt;em&gt;what&lt;/em&gt; and the &lt;em&gt;how&lt;/em&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>My Views on Programming Languages</title>
				<link>https://jason5lee.me/blog/my-views-on-programming-languages/</link>
				<pubDate>Wed, 24 Aug 2022 22:29:00 +0000</pubDate>
				<guid>https://jason5lee.me/blog/my-views-on-programming-languages/</guid>
				<description>&lt;p&gt;There are many debates about the good and bad aspects of programming languages, and I will present my own viewpoints in this blog. I will also explain the keys to learning a programming language, and my understanding of design patterns.&lt;/p&gt;&#xA;&lt;h2 id=&#34;code-as-an-expression-of-intent&#34;&gt;Code as an Expression of Intent&lt;/h2&gt;&#xA;&lt;p&gt;When we write code, we use it to express our intentions. When we read code, we understand the author&amp;rsquo;s intentions through it. Similarly, a compiler or interpreter executes our intentions based on the code. Therefore, the primary function of code is to express intent.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Why pipeline does it right?</title>
				<link>https://jason5lee.me/blog/why-pipeline/</link>
				<pubDate>Thu, 24 Mar 2022 18:31:32 +0000</pubDate>
				<guid>https://jason5lee.me/blog/why-pipeline/</guid>
				<description>&lt;p&gt;When I first learned F#, one design I didn&amp;rsquo;t get is that pipeline operators is used far more often than dot( &lt;code&gt;.&lt;/code&gt; ). For example, for a C# expression like &lt;code&gt;x.Select(n =&amp;gt; ...)&lt;/code&gt; , you have to write &lt;code&gt;x |&amp;gt; List.map (fun n -&amp;gt; ...)&lt;/code&gt; in F#, which looks verbose at the first sight. But after I&amp;rsquo;ve done more programmings and more thinkings, I figured out that the dot is abused in most of the languages and the pipeline does it right. Here is my thought.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Simulate exception in async Rust</title>
				<link>https://jason5lee.me/blog/rust-exception-async/</link>
				<pubDate>Fri, 11 Mar 2022 22:40:23 +0000</pubDate>
				<guid>https://jason5lee.me/blog/rust-exception-async/</guid>
				<description>&lt;p&gt;&lt;strong&gt;WARNING&lt;/strong&gt;: This may be a bad practice. The point of this article is just to share my idea.&lt;/p&gt;&#xA;&lt;p&gt;Exception is a popular feature in many programming languages. Unlike Rust where errors are considered as a return value of the &lt;code&gt;Err&lt;/code&gt; case of &lt;code&gt;Result&lt;/code&gt;, in these languages errors are thrown like &lt;code&gt;panic&lt;/code&gt;. The caller may catch the errors and process them similar to &lt;code&gt;catch_unwind&lt;/code&gt; in Rust. Different people may have different preferences on the error handling style, but panic-unwind is always considered a bad practice and should be avoided if possible. So using exception-like error handling in Rust is impossible.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Customized trait object in Rust</title>
				<link>https://jason5lee.me/blog/rust-costumized-trait-object/</link>
				<pubDate>Sat, 11 Jan 2020 21:03:30 +0000</pubDate>
				<guid>https://jason5lee.me/blog/rust-costumized-trait-object/</guid>
				<description>&lt;p&gt;I love the traits in Rust language. Rust uses one mechanism for both compile-time polymorphism and runtime polymorphism, which is elegant. However, the runtime polymorphism in Rust is not very flexible. Some traits cannot be used as a trait object, and it&amp;rsquo;s impossible to specify whether a method is resolved dynamically or statically. This shortage is reflected in my recursive function library &lt;a href=&#34;https://github.com/Jason5Lee/rust-recur-fn&#34;&gt;RecurFn&lt;/a&gt;, and I develop a workaround, calling it &lt;strong&gt;customized trait object&lt;/strong&gt;.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
