Sign in

TL; DR: Cost always wins!

If Rust cannot provide C++ level performance, it would be useless as an alternative to C++. Fortunately Rust is designed to perform like C++, and many benchmark results show that Rust is already archiving C++ level performance in most parts. On a few cases, Rust…

Many people misunderstand “what errors are”. I like to note some of my opinions here.

  • There’s no good way to deal with “unexpected situations” other than halting program (crash/panic).
  • Errors are not “unexpected situation”. Errors are “result value” of calculation which represent “bad cases”.
  • Errors should contain proper information to…

Usually, API is all about schema definition and serialization. Therefore, support level of serialization makes critical difference in productivity.

I think Swift and Rust have similar level of schema expressiveness for most case of APIs. But in serialization, Swift is not even half good like Rust.

The critical difference is…

SwiftUI is collection of declarative layout. If Apple can derive UIKit views from SwiftUI definitions, there’s nothing to stop us to derive HTML from SwiftUI. One layout to rule all.

Both of Swift and Rust are good tools and have pros and cons. The problem is I have to focus on one stuff more because I don’t have infinite resources. Therefore I need to speculate some future.

Convergent Evolution

Language evolves. In a long term future, Swift will get unique ownership, move…

A few days ago, Apple has released several stuffs in WWDC 2019. Combine framework is one of them.

Problems of RxSwift

Rx is huge trend nowadays, but its incarnation in Swift — RxSwift — has some problems.

  • Dispose-bag.
  • All streams are finite collection by default.

Let’s talk about dispose-bag. Every users of RxSwift…

I heard some people are having trouble to understand and implement persistent datastructures. It’s weird because actually it’s extremely easy concept and actually makes your life easy.

Why Do you Want It?

Everything start from desire to see the past. Let’s say that you have a “counter” value which increases for each time someone visits…

When I write test code, I start with small unit test code. I write a few tests literally for single each features. After that I need to perform integration test. Integration test is annoying because of the number of combinations usually goes huge. Therefore you need Monte Carlo method.


I was writing a data structure for tree-view. All children are explicitly ordered.

At first, I started with plain recursive data structure. Something like this.

struct Tree1<T> {
var data: T
var subtrees: [Tree]

This is typical, but I also wanted it to be persistent data structure. And actually…

Programming is time consuming work. It’s hard to increase productivity of programming. I like to mention some techniques to increase productivity of programming that also has been said many time by well-known programmers.

What’s the Problem?

Programming is consist of 3 works in large.

  • Designing
  • Coding (including writing tests)
  • Debugging

How much time…


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store