Kalan's Blog

Kalan 頭像照片,在淡水拍攝,淺藍背景

四零二曜日電子報上線啦!訂閱訂起來

Software Engineer / Taiwanese / Life in Fukuoka
This blog supports RSS feed (all content), you can click RSS icon or setup through third-party service. If there are special styles such as code syntax in the technical article, it is still recommended to browse to the original website for the best experience.

Current Theme light

我會把一些不成文的筆記或是最近的生活雜感放在短筆記,如果有興趣的話可以來看看唷!

Please notice that currenly most of posts are translated by AI automatically and might contain lots of confusion. I'll gradually translate the post ASAP

Technology always comes from humanity (Svelte Society: Questions Questions Notes)

When I study a new library, I also study the person behind it (of course not all of them, otherwise it would take a lifetime just for npm install). Because creators of technology are humans, creators of libraries are humans, creators of frameworks are humans. We are all human beings with emotions and feelings.

Technology is always meant to serve humanity, so understanding the motivations and even the stories behind the authors is helpful in understanding the framework itself.

Rich Harris, the author of Svelte, was originally the author of Rollup and the relatively less famous Ractive.js. From his GitHub repositories, it can be seen that he is someone who likes to start from scratch. He used to work at the New York Times as a Graphic Editor, and he was a journalist by profession. Later, he self-taught programming to work on data visualization and eventually created Rollup and Svelte.

These are some of Rich Harris' answers in Svelte Society, and I highly recommend everyone to listen to them. Here are some notes, although the content of the notes may not be exactly what you expect.

The best way to learn a technology is just go ahead and build stuff with it and then as you get stuck, figure out how to ask good questions.

The best way to learn a new technology is to use it to build things, and when you get stuck, figure out how to ask good questions.

The examples on the official website are actually quite easy to understand, and there is a REPL right next to them where you can try it out yourself.

I don't use component library for the same reason that I don't buy pasta sauce in jars I like making things from scratch.

This response is in reference to the question "Which component library do you use?"

He is someone who likes to start from scratch, so of course he would write his own from scratch. He even uses a humorous analogy: "I don't use component libraries for the same reason I don't buy ready-made pasta sauce. I like making things from scratch." From this, it is not difficult to understand where the hand-written parser in Svelte's source code comes from. If you compare the early commits, you can see that there haven't been many major changes.

Router: This makes people really unhappy which I understand. If I walk into the farm and see there's 19 different kinds of shampoo I'm very unhappy. I want 2 kinds of it. Cheap and good. Ideally I want them to be the same kind.

Svelte does not have an official router like React has react-router or Vue has vue-router. Rich Harris' response is that routers sometimes have different use cases, and everyone has different opinions.

Currently, there are many Svelte-based router implementations. The author expresses, "I know people will feel uncomfortable. If there are 19 different kinds of shampoo, I would also feel uncomfortable. I just want 2 kinds: cheap and good. Ideally, I want them to be the same kind.".

TypeScript support

Currently, Svelte's support for TypeScript is not very good, but it is in progress.

I'm just bad at delegating and letting other people take ownership of projects like Sapper.

Because the author is not good at delegating work to others, the development of Sapper has been a bit slow. It seems like the author wants to take a break from open source this year.

I started svelte for myself. It's the framework I wanted to exist in the world. I get far more joy from discovering that someone who's new to development has decided to pick up svelte and is building things that they didn't think that would be able to build.

This response is in reference to the question "Is Svelte aimed at reducing the complexity of frameworks and the plethora of complex concepts often required in the tech (frontend) field?".

The author mentions that although it's great to see Svelte being adopted by companies like React and Vue, what makes him even happier is seeing newcomers to development using Svelte to build things they didn't think they could build.

From this, it seems clear that Svelte's concise syntax and its efforts to handle everything at compile time are aimed at allowing developers to freely develop at runtime. It also avoids using a Virtual DOM for abstraction and simplifies everything as much as possible.

I like this philosophy and I also find it exciting to see more people from non-technical fields entering web development, representing various possibilities.

If one is afraid that these people will do better than themselves and take away their opportunities, it only proves that their strength comes from information asymmetry rather than accumulated knowledge. This should serve as a reminder for engineers in the industry to keep learning.

Can I give you money? It's really heart-warming. But it's always a difficult topic. None of us who work on the project do so for any reason other than that we want to. And there's always a fear that getting money involved on open source could have a weird effect on our personal incentive and motivation on working on this project. In a way that you know maybe isn't best for the community. Thank you for offering as money but we don't really have a way to accept it.

This is a common challenge in open-source software. Indeed, discussing money can easily change the direction, and Svelte itself has been developed by many contributors who didn't receive any payment. Although receiving money is great, at the moment we cannot accept it because of the current direction.

I think this philosophy is great, and after reading it, I became a fan of Rich Harris.

However, I also want to emphasize that open-source doesn't necessarily mean it has to be free, and talking about money doesn't mean it's not open-source. Open-source can also be profitable, as demonstrated by Evan You, the author of Vue. With resources, more people are willing to contribute and create better software, thereby contributing to society. It's all interconnected. It just feels like many people are shy about discussing money or afraid to ask for it. Many times, if you don't actively ask for it, the world won't give it to you. Perhaps in the future, more developers will move towards becoming independent developers, and I'm excited to see how things will develop.

You presumably spent a considerable amount of time and energy on building svelte because you thought that there must be an alternative to virtual DOM. Are there any other things in computer or in society where you think we are trapped in a local maximum for years or decades?

This is an interesting question because the author built Svelte after realizing that there must be an alternative to the Virtual DOM. The question also asks about the author's thoughts on other things where we may be trapped in a local maximum for years or decades.

The author mentions that HTML itself was originally designed for displaying text (hyper text), and if we were to redesign web pages in this era, we might come up with a completely different language or design approach.

He also mentions that capitalism and Marxism are also examples of being trapped in a local maximum in modern society.

If you get into the habit of thinking in terms of local maximum, you start seeing it everywhere.

Perhaps it is time to stop and think about things where we have reached a local maximum and where we can do better.

Prev

Write a JSON parser from scratch (2)

Next

Some thoughts on being a Tech Lead

If you found this article helpful, please consider buy me a drink ☕️ It'll make my ordinary day shine✨

Buy me a coffee