0%

In C++, given the following definitions of classes A, B and C, each with a constructor and two members, what is the order of initialization of the members and constructor?

VE280 was (is?) a sophomore course in UMJI, that for all intents and purposes, is a course that teaches students programming in C++. Among the kind of contents being taught (and sometimes tested) are questions like the one before. These questions occuppies a weired position in the technical discourse: some people take pride in being able to answer these questions correct, prides themselves as “experts of C++”, while others dismiss it as pedantic, archaic, call the aforementioned language lawyers, and argues that it has no place in a university lecture room.

I was a language lawyer. Back in 2018 and 2019 I TAed the summer instance twice and wrote an extensive collection of recitation notes, which admittedly goes far beyond what’s required to pass the course. They are more akin to reflections of mine on the subject [1]. Five years later on an totally unrelated occasion I went back and read what I wrote then and reflected on it. I found the truth (as always) lies in between the competing views. Furthermore, I think VE280 did something right.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class A {
A() { ... }
T1 a1;
T2 a2;
}

class B : public B {
B() { ... }
T1 b1;
T2 b2;
}

class C : public B {
C() { ... }
T1 c1;
T2 c2;
}

C c();
Read more »

有三个PhD学生在2022年的夏天决定一起去road trip。他们5月24日从拉斯维加斯出发,走过Zion, Bryce, and Grand Canyon 三个主要国家公园,途中经过了 Antelope Valley 和 Horseshoe Bend 等网红景点,最后在6月3日回到了Vegas。这里是其中一切拍的照片。

Posing for stargazing on the north rim of the Grand Canyon

正文全部图片约290 MiB,图片分辨率挺好可以直接右键保存,但是用流量的朋友们请小心。

(照片均经过导出,尤其是导出时丢掉了HDR参数,不太知道怎么修正,希望有人教教我。)

Read more »

现在是2021年2月16日中午,家里完全停了电。目前我所在的Austin正处于一场前所未有的(有说122年一遇)的winter storm中。昨天气温达到了历史最低的零下18摄氏度,德州各地都发生了电网过载和随之而来的停电限电。

Read more »

Tonight, the scumbag-in-chief currently occupying the white house unleashed yet another racist tweet. However, something’s different this time: the victim is not the common African Americans, Mexicans or Muslims. it’s the Chinese. Donald Trump in his tweet blatantly called the COVID-19 virus the Chinese virus, defying all courtesy and decency as he has always done. As a foreign student living in the US, I feel genuinely attacked and unsafe. Reading the replies to that tweet scares the hell out of me, to the point that I just Googled Pennsylvania’s gun laws.

Read more »

Fall 2019 instance of "Foundations of Programming Languages"

In the fall semester of 2019, I had the opportunity to work as a teaching assistant for the course 15-312/15-652 Foundations of Programming Languages, taught by Bob Harper. Today we wrapped up (almost) all of the work. As I have always said, the best way to build clear insight into a subject is perhaps by teaching and explaining it to the others. On the other hand, it was quite a unique experience. In addition to the usual grading and recitation, I invented a few homework problems (the DFA problem in HW2 and the entire KPCF problems) and wrote a few exam questions. There are a few things that went pretty well, and honestly some things just don’t quite go well as we would hope for. For the purpose of this post, I don’t want to (and honestly can’t) go into too much details, but focus on mainly 3 things: the philosophy behind this course, one unfortunate situation, and what it feels like working with Bob.

This is the first part of a two-part post, where I mainly talk about the philosophy of this course, as I understand it. In other words, I seek to answer the question of why study programming languages with my own experience.

Read more »

Introduction

During the summer of 2019, I took an internship at NVidia’s Austin campus working with one of their CUDA compiler teams. Two teams of engineers there work on compiler related projects: the compiler verification team and the compiler development team. The compiler verification team ensures the correctness and consistent behavior of the CUDA compiler toolchain for a large number of applications on all platforms. The development team is in charge of the in-driver CUDA assembler, publicly known as ptxas. I worked under the supervision of Brian Deitrich, and mentored by Rishkul Kulkarni.

Read more »