Post 5
p.s. Going to be changing up my style of writing (nobody wants to read AI slop), been inspired by alot of technical writing as read by @Primeagen.
College Updates and Semester Recap
Finished my first semester, and it has been the most amazing experience anyone could ask for. The bonus free time I have has allowed me to grow so much technically and personally. I would like to attribute much of this boost intellectual curiosity to the amazing people I have met at Cornell, and I am so grateful for the opportunity to be here.
What Have I Been Working On?
Cornell University CS 2112: Object-Oriented Design and Data Structures (Honors)
I’m sure many others who have taken this course would relate to my experience in this course. This has definitely been the most technically demanding course I’ve taken yet. Even coming in with a solid foundation in Java from StuyPulse and knowledge of most of the common data structures, the new concepts and A<1-6> assignments have been a challenge. However, I wouldn’t trade it for anything and definitely recommend the course to anyone who is interested in learning more about object-oriented programming and design patterns.
I am currently wrapping up the course’s final project, which is a desktop game called Critter World, built using JavaFX to be a desktop application. The game is a simulation-based game that involves creating critters with different attributes that can interact with each other and their environment.
This was a very well-designed assignment, with clear parallels and setup towards building advanced computer applications. For example:
- Critters are composed via a domain-specific language (DSL), which required writing a parser, lexer, and implementing an AST and a visitor pattern.
- Game’s logic is implemented using a state machine, which required writing a state machine and implementing a state transition table.
- Multi-threading is used to simulate the game’s logic in real-time, which required writing a thread-safe data structure and implementing a thread-safe state transition table.
- GUI and MVC design patterns were used to separate the concerns of the game’s user interface and logic.
- Dependency injection was used to decouple the game’s logic from its dependencies, such as the game’s user interface and data storage.
- Unit testing was used to ensure the correctness of the game’s logic and behavior.
Reflections I didn’t do as well as I could have, as finals season was approaching and the overwhelming week-by-week sprint style of the assignment made it difficult to keep up with the pace whilst managing my workload effectively. This resulted in my multithreaded implementation being not thread-safe, albeit functional.
CUAUV
I’m proud to share that I joined Cornell University Autonomous Vehicle Team (CUAUV) as a software engineer. Being able to work on such a storied team (over 25 years old) has been an incredible experience. The team’s culture of using a monorepo and the robustness of their infrastructure was what drew me in comparison to other teams I had worked with. Never have I worked in a project with this many languages involved.
I think I’m currently more interested in the team’s infrastructure rather than the AUV at this point. Most particularly, their in-house submarine simulation system looks absolutely insane. Look at how they’ve implemented fog from water as well as computer vision onto simulated submarine environments:
Being on this team has been wildly exciting. I hope to learn from the shoulders of giants from those before me, and apply their knowledge to my own projects.
Rust Rust Rust and Advent of Code
This is was the month of Rust for me. Perhaps I had been so numbed to all the code I had to write from Java’s verbosity. Or perhaps I had watched one too many videos on Rust’s hypetrain. So, similar to last year, I chose to use Advent of Code as the vehicle to drive my Rust learning journey. I started by solving the first few problems in Rust, which helped me get familiar with the language and its ecosystem. Much thanks to fspoettel’s Advent of Code template, which taught me much of how the cargo system works.
I wanted to extend this learning into adjacent fields I was interested in. I wasn’t confident in building CLIs or full high-frequency trading applications yet, but I was eager to learn more about them. This led to me to think about what applications Rust would be suitable for… and that’s when it hit me. Machine Learning!
Machine Learning with Rust
I want to justify the choice of Rust for machine learning applications. Because at this point, it was very clear I could use Python especially with its wealth of support. However, when thinking about Rust’s performance and safety guarantees, it became apparent that Rust was a better choice. The only barrier would be the lack of a mature ecosystem for deep learning in Rust, but I see this as an opportunity to apply myself to building a robust and efficient deep learning framework in Rust.
RustNet
That led to RustNet, a machine learning framework built in Rust. It’s mean to be as simple as possible, using no external crates. I wanted to write my own gradient descent, backpropagation, and other machine learning algorithms from scratch. Through it, I was able to learn how to write efficient Rust code using concepts such as reference methods, ownership, and borrowing. Here is a small 3-layered neural network example to solve XOR:
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.27s Running `target/debug/rust_neural_network`0 XOR 0: [0.01494395806615838]0 XOR 1: [0.9901374180200915]1 XOR 0: [0.9793930055164223]1 XOR 1: [0.017800014939907967]
My verdict of the language: Rust is a great language for machine learning applications. It’s made me a proponent of the language’s usage in this field. I hope to contribute to this space via open source contributions to active projects such as burn-rs and tch-rs.
Conclusion
Overall, this has been a great year for my learning. I think I’m going to conclude these more “diary-like” blog tho. I’ve been working on so many projects that talking about all of them has become unsustainable. So moving forward, these blog posts will be more tailored to a specific topic I have interest or want to share. So thank you, and I hope 2025 goes well for whoever is reading this.