Year review of 2019, on coding and moods

JiyinYiyong
7 min readDec 31, 2019

It’s a really rushed year. Things came and I was not prepared. I didn’t get much chance to travel and take ease, but lots of time was spent on coding. Another reason is I have a personal Todolist running small tasks, which are mostly related to coding. So as a result coding ate big part of my spare time.

There were 5 major projects I was working on in 2019, big or small. Other commits belong to the toolchains or tiny apps, or projects running in the company.

Respo Composer

This project was started beforing Spring Festival. I spent months on it.

It was really stupid simple idea first. I was trying to create a UI, like an old tool I tried to edit a DOM tree, to generate simple UI components. Also I can assemble the components into a page. So at last it is mostly a template engine but editing with a UI, as a tree. Mostly part of the work is to build the tree editor, very boring work. Only thrilling part is to see UI generated from by operations on the tree.

The I encountered the problem of handling user events, like clicking, inputting. I thought I could try turning them into actions like in Redux and add code in a really app. But at last it turned out to be a very impractical solution. I would rather write ClojureScript than generating UI from the tree. Plus the ClojureScript is more maintainable.

But I did have some achievements. I had a chance to share that idea to my friends on VueConf Shanghai, despite that the editor is totally a ClojureScript project. And the work on the editor discontinued after that due to some problems on my healthy.

Editor from a Pad
Tree editor UI
Preview of a component created with tree editor
Overview mode generated from composed templates and mocking data

Cirru Parser in Nim

I tried Nim after I found ClojureScript was really slow compared to native languages. I did want to learn something fast, but I can’t remember all crazy details in languages like C/C++, or Haskell. I noticed Nim was a quite neat choice for me. It’s minilistic indentation-based language like CoffeeScript and also like Python. I had years of CoffeeScript experience.

It was not much barriers for me to finally finished writing a new Cirru parser in Nim.

I got a Cirru parser running in a new environment, but it seems to be lack of use cases. So I tried to make another scripting language of Cirru, under the project interpreter.nim. I didn’t finish this project as well. It only has very basic features, and a lot has to be done in the future.

Respo Effects

Respo effects are effects added to Respo components. I have been using Respo for more than 3 years. However unlike React, Respo does not support effects well, which means in Respo there’s barely no manual DOM operations like we do in componentDidUpdate componentDidMount in React. So no animations as well.

I was not planning to make Respo a library like tiny React. I still want Respo to be pure, and consistency. But some animation and some basic inter-operations with the DOM should be viable. Respo effects solved the problem.

Most obvious change you may see is the examples on http://repo.respo-mvc.org/alerts/. Respo effects enabled component-level animation on those reusable components. Yeah, we had that very in React with react-transition-group. But I’m very glad that now I have that in Respo.

Phlox

I planed about Phlox long time ago. Phlox is a wrapper on top of PIXI.js, which is supposed to draw shapes(and even animations) based on WebGL with object-oriented APIs. PIXI APIs is a lot like DOM APIs. So I thought I would added a “Virtual DOM” for that. Then I can do hot swapping on the tree, like we do in React. Sounds like very nice.

It’s still an unfinished project. You may find very simple example on http://repo.quamolit.org/phlox/ demonstrating basic adding/updating/removing of nodes. It’s far from being able to build a useful app. I’m feeling satisfied for now, but not sure what to do next.

Renaissance of Cirru projects

Cirru is now mostly a personal project. I use Calcit Editor many of my tiny tools, and it uses an .edn file for saving snapshots and meanwhile generates Clojure(Script) code. So projects built with Calcit Editor are marked as “Clojure” on GitHub. Sounds normal.

But later I was triggered by a report https://github.com/oprogramador/github-languages showing Cirru is one of the most falling language on GitHub. It’s not wrong. Motivated by the emotions, I wanted to have more chance to show Cirru.

Calcit Editor is still maintained in 2019 and I use it from day to day. Then one day I came out with an idea that I use .cirru file for saving the snapshots, rather than using .edn . Then GitHub will mark my projects built with Calcit Editor in Cirru, rather than just Clojure.

The idea was simple, however it took much effect to make it really work. Cirru was not developed for large source files, being a tiny scripting language. The parser and writer are quite slow running in ClojureScript and Node.js . It took quite a while to optimize and even refactored parts of the libraries. And finally I was ready to use Cirru for replacing EDN files.

I searched globally on GitHub and almost 200 projects I created that was possible to be migrated to Cirru EDN storage file. So now you may see on GitHub that the syntax is colored as blue, which means Cirru is the main language, in many of my projects. Cool!

Cirru is the main language for Calcit Editor now.

And it’s not several projects. It’s 200+ projects marked as Cirru here, check that on https://api.github.com/search/repositories?q=language:Cirru. So Cirru is now roughly 300th language on GitHub counting by repos.

Found Cirru at 296. Data collected weeks ago.

Also there is ongoing work around improving the parser, and maintaining old projects. I spent some time and make http://html.cirru.org/ work again with latest Webpack configs. Besides Cirru HTML, I would get CirruScript maintained as well. It appears to be quite a large project if you count in the packages I released years ago. God, would be much work to maintain.

One thing I have to think about is: does Cirru really brought me so much benefits as spent so much time on it? I haven’t bought a house, I still write TypeScript for a living, why Cirru? I have an answer for myself privately, but I can’t answer this question if someone else asking. It’s too large being a hobby project. I can only bet on it I guess. And still a lot of interesting and boring things on plan.

Healthy and moods

Many another post in Chinese later. It’s quite a tough year for me. I had so much bad memories since my healthy condition turned bad. I had pains on my chest and under my left arm due to some infections on nerves. It was really painful in those weeks. Even woke up many time early in the morning because of the pain. That was in late March.

In June I had some waist pain and meanwhile my stomach felt unsettled. I went to hospital and found that it was infection in intestine. Took me long time to recover. Unfortunately I got cold in October meanwhile got other dilemmas…

When I was attending D2 conference in Hangzhou, meeting friends from Alibaba and other companies. I was very worried about my health condition. Then I found some of others are in worse condition than me. It’s so tragic. Air quality is not good around Shanghai and Hangzhou, many people get sicks. I don’t like it. And I feel afraid of it.

Apart from the burden on health, there were several times I felt I might got chance to find the person with whom I can spent my life. However all turned into illusions. And I just watched them sharing happy times with their lovers on the feeds on internet. It's still like illusions and nightmares I can’t get rid of.

Okay, I give up. I have to go back to my comfort zone and just stay there. And writing code.

On job

Not going to talk much about it. Some public work can be found on https://github.com/jimengio. It’s not easy work in a start-up anyway.

On next year

I’m feeling unsettled. There are quite some ongoing work related to Cirru, on Respo, and on other toolchains I use. Life in my past year is like being driven by those tasks. Sometimes I struggle, trying to get rid of the pains on me, but it’s so hard. I would better get myself prepared for the potential tough days, even though I’m not sure what they are.

--

--