COSCUP 2022

I’ve heard of COSCUP, but had never attended. Several month ago, I found that there would be a “functional programming” track this year by functional thursday meetup team from PLT board on PTT, so I decided to go to the event this year.

The FP track was only held on the second day, but luckily the Arch Linux track was on the other day, and there were some other topics that I found interesting.

Functional programming and some type theory

FP on web front-end

I’m not familiar with web front-end, and didn’t understand most of the contents. But more and more languages introduces the |> operator is a good thing. And I hope it would be added into C++26, too.

Datatype-generic Programming

This is one of the most interesting talks.

The speaker first showed what is generic programming, then talked about the main topic – Datatype-generic Programming (DGP), which is a generic by shape.

The first example was about the map operation on List and Tree. I immediately thought about functor, but Viktor then pointed out that the functor needed to be defined separately even if they were very similar, which violates the DRY principle. Further more, the functor rules are not checked by the compiler. Hence we should leave ad-hoc polymorphism and aim for universal polymorphism.

The other new thing I learned is that '[] and ': are the type-level empty list and list concatenation resp..

How to transform a program from top-down to bottom-up

The talk followed the outline of Richard Bird’s paper “Zippy Tabulations of Recursive Functions”, in which Bird talked about a systematic way to convert computing some recursive functions into building up an array. In plain language, it was about dynamic programming.

DP breaks the problem into small sub-problems then the problem magically becomes to filling up a matrix. Both process, the breaking down and the filling up are quite unintuitive to me. And it’s hard to reason about from just the code.

Prof. Mu showed the top-down and the bottom-up views of the computation of several problems (merge sort, segmentation and bracketing), in Haskell-like notation.

He then abstracted the computations into some predicates and functions, and gave general representations of top-down and bottom-up algorithm, respectively.

Finally, he proved the two representations are the same, by step-by-step transformation.

Prof. Mu didn’t use slides, but wrote on a tablet (which reminded me about the Christmas talks by Knuth). Even though the talk was cut short due to the time limit, I was very satisfied.

Linux graphic history, from X11 to Wayland

It was given via a pre-recorded video, and was subbed automatically, but the speech to text system was clearly very confused by the speaker’s heavy accent. So the subtitles actually was a big distraction, and some hilarious sentences popped up from time to time.

Aside from that, the talk was pretty good. It dissected the structure of X11, (X server, compositor, …) and talked about the motive and history behind the client-server-compositor model. Then he introduced Wayland, how it would solve the problems of X11 and point out some intermediate solutions, like XWayland, with their limitations.

Launch the first process in Linux system

The room was stuffy, and I was sleepy, so the only thing I remember is that GitHub action can be used to build image files. But there were some discussions about how to debug an init system. I didn’t understand any of them, but I was very surprised by how many things can be done if ones want to at the early stage of a system.

Other talks

I listened to talks on OAuth2.0 and fuzzing test as well. The former introduced the protocols clearly and concise, with examples. The latter demonstrated how the use AFL.

Misc

Not only I got an Arch Linux badge and a sticker, but also found a pretty good Singapore restaurant.