Thanks to visit codestin.com
Credit goes to www.ethanuppal.com

Loading...

Hello! 👋

I'm Ethan, a student at Cornell Engineering interested in hardware, programming languages (PL), and systems. I research compilers and hardware abstractions in CAPRA, working on my own accelerator design language as well as Calyx.

Outside of academics, I've done a lot of personal projects, from reverse-engineering to creating interactive physics lessons, and I contribute to open source projects like Spade. You can check out my blog here.

Pulsar: Hardware DSL

I designed Pulsar, a hardware domain-specific language and compiler from scratch in Rust for research. It supports static kernels like the Fast Fourier Transform and leverages the Calyx infrastructure to lower to hardware.

Pulsar compiler infrastructure.

FernJIT

I'm developing a bytecode runtime in Rust integrated with a just-in-time (JIT) compiler. It consists of:

  • A register-based virtual machine
  • JIT compilation to x86 assembly

I hope to learn more about and implement a few advanced JIT techniques such as deoptimization.

Fern Pixel Art

3D graphics

I programmed a 3D graphics pipeline from scratch that can render triangle primitives using ray casting.

The next steps are to incorporate lighting, which is tricky, especially given that this project is entirely on the CPU.

A spinning pyramid rendered by my graphics pipeline.

x86ISTMB

I wrote an optimizing compiler from scratch in OCaml with two friends. My major contributions involved:

  • Static analysis (both type checking and control flow analysis)
  • Intermediate representation and live variable analysis
  • x86 assembly abstraction
  • Parts of the parser/lexer
  • CLI/program driver

My other two friends wrote the IR generation, register allocation, rest of the parser/lexer, and randomized testing.

Reverse-engineering

I reverse-engineered the object file format on Apple software, designed an extensive analysis tool, and wrote documentation for compiler developers.

Example analysis of an object file using my tool.

Open Source Contributions

I worked on the Calyx ecosystem developed in my research lab:

  • The Calyx Pass Explorer provides a TUI interface for visualizing transformations on calyx IR due to compiler passes.
  • Rust FFI allows writing Rust code to interop with calyx, enabling, for example, Rust-hosted test benches for hardware.

I'm also working on the Spade hardware description language developed at Linköping university:

  • I implemented support for interfacing with parametrized Verilog.
  • I'm writing a library for hardware floating point bindings.

Physics lessons

I programmed an interactive physics lesson on the principle of least action with simulations and animations. It was featured by Grant Sanderson in the Summer of Math Competition, winning top 100 and a spotlight in the results.

Two points and multiple paths between them in addition to the shortest one, a straight line, with a question mark to the side

Text-based UI library

This is a UNIX TUI library that I wrote, golfed (i.e., wrote in as few characters as possible) to 869 bytes.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <poll.h>
#define I STDIN_FILENO
#define O STDOUT_FILENO
#define P printf
#define U struct termios
#define E "\033"
#define Y(x)TC##x##FLUSH
struct tui{int w;int h;char k;int f;U t;U u;char*b;struct pollfd p;};
#define tui_begin(T,W,H)T.w=W;T.h=H;P(E"[?25l");T.f=fcntl(I,F_GETFL);tcgetattr(O,&T.t);fcntl(I,F_SETFL,T.f|O_NONBLOCK);T.u=T.t;T.u.c_lflag&=~(ECHO|ICANON);tcsetattr(O,Y(SA),&T.u);T.p.fd=I;T.p.events=POLLIN;T.p.revents=0;T.b=malloc(W*H);memset(T.b,' ',W*H);
#define tui_end(T) P(E"[?25h");fcntl(I,F_SETFL,T.f);tcsetattr(O,Y(SA),&T.t);free(T.b)
#define tui_keys(T) T.k=0;if(poll(&T.p,1,5)>0)read(I,&T.k,1)
#define tui_draw(T) P(E"[H");for(int i=0;i<T.h;i++){for(int j=0;j<T.w;j++)putchar(T.b[i*T.w+j]);putchar('\n');}tcflush(O,Y(IO))

Iterative Closest Points

I am creating a Simultaneous Localization and Mapping library, integrated with ROS, for my project team. This subproject implements the Iterative Closest Points (ICP) algorithm. Scan matching uses ICP to determine position and velocity from laser scans.

The result of running ICP on two point clouds.

Other projects

Here are some miscellaneous projects I've worked on. Keep in mind that some are rather old!

  • gc, a garbage collector runtime written in C (2024).
  • asmpong, pong written in assembly (2023).
  • libcmdapp, a concise and powerful command line parsing library in C (2023).
  • mtrack, a tool to debug memory errors (2021).
  • C Hacking, an exploration of different ways to push C to its limits (2021).
  • Tacitus's Germania, an online commentary (2023).

You can read my statement on privacy here.