Shane Hamilton

Logo

View My GitHub Profile

Welcome to my Projects Page

Welcome to my site, Its a bit bare at the moment but I will launching a more fully featured site in the near future. The point of this page is to give an overview of the code I write in my free time, as this code is learning and fun focused the documentation is generally lacking. The projects outlines here are intended as a summery of the projects to give some insight to anyone interested in what I’m working on. Its also a place I can give more casual updates on what ive been working on recently. Hopefully I will be in a position to launch my personal website soon, but regardless I will keep this page updated.

Projects

Beatspeak

Is a project I’ve been working on since college, originally it was a wearable sensor, but this first version was sold to a company, where I worked for a year to launch as a product, following this success i began working on a vision non contact version based on frustration I had with wearable devices. This second system based on research from MIT, was implemented quite quickly first in Python and then later in C++, the system at its core uses OpenCV in a multithreaded environment and can be used as simply a mix of digital signal processing and linear algebra, it has grown in complexity over the years with improvements and additions to the algorithms. The largest challenge technically is dealing with noise in the system, most recently I have been having a lot of success with applying supervised learning with a wearable sensor running via an android device used as a source of truth, this allowed me to improve the performance by tuning the parameters of the system using Bayesian optimization. However the real challenge of the system has been in trying to hind a way to launch it to the mass market in a sustainable way. I developed the system with the intention of serving the billion people with no access to healthcare, unfortunately there is inherently no easy market here. This has relegated the project to a passion side project, and one I hope to get into a state to properly OpenSource soon.

Draíocht

draíocht is a language I created, Its a mix between a lisp and C but its in Gaeilge(Irish), This was an experiment to see what it would be like to code my native language. Draíocht is the Irish word for magic.

Neural Machine Translation

This is a project in which I used Marian NMT with a bit of perl and haskell to scrape data from the EU records to find documents in both Irish and English, then I used these matching sentence pairs around 5 million to train up a translation model over a few days using a new GPU i bought at the time. The model was pretty good considering the resources I dedicated it outperformed google translate for Irish performance from around 2012. The most difficult part was finding the language pairs, Irish is not represented much online, it was only because the EU recognises it as an official Language that the translation from treaties and debates are available.

Robotics Projects

Over the years ive build a number of drones, mostly cars and quad copters, In the past I had access to a CNC and 3d printer I built, but alas since moving a few years ago we have not had the space. The drones generally run off raspberry pis, the quadcopters use navi board and the cars just plain arduinos. I also have a small lidar Ive been experimenting with. For the quadcopter I wrote cascading PID’s in C++ to control and stabalize the flight, I developed these using unreal engine.

For both I hooked up a raspberry pi zero with a camera, and steamed the video via websockets and flutter to a desktop app to control it from a laptop over wifi. I have been playing around with the idea of using the lidar with DQN to create an intelligent agent to navigate my appartment and probably annoy my cats :)

What I’ve been doing recently

Code Crafters

Recently I’ve been having a lot of fun doing the codecrafters challenges in Haskell, I started with the Http server and since I’ve implemented a version of grep, hit bit-torrent and a few other of the projects. I really like this for pushing myself and trying to use more abstract Haskell features as well as experimenting with new tools like nix.

In search of a Scripting Language

I’ve been really happy mixing Haskell and C++. C++ can do anything, and combined with Haskell’s higher-level features and awesome concurrency, it makes building powerful systems relatively fast. Usually, I write the C++ code to be single-threaded and then call it from Haskell. Or, I’ll handle the engine and algorithms in C++ and manage the UI in Haskell, using stuff like GTK. I also really enjoy using Haskell to create domain-specific languages (DSLs) for boilerplate heavy code like HTML.

But, I still feel there’s a gap when I need a quick-and-dirty language for tooling or automation, or something to simplify Haskell for other users. Python is the obvious choice, but I find myself messing around too much trying to make different libraries work together. The maintenance hassle, especially with code becoming obsolete quickly, is a pain. JavaScript is another option, but it has many of the same issues as Python. With huge communities, there’s always something new, making it hard to write code that lasts without committing to ongoing updates.

I love Bash for quick tasks; it’s just so dependable. But keeping Bash scripts running smoothly gets tougher the longer they are, and it would be nice to have a scripting language that works on any OS, since working on Windows is unavoidable these days. So while Bash is almost perfect, I need something a bit more powerful.

I switched to Lua a while ago and wrote a lot of tools in it. Lua has a lot going for it: it’s simple, meshes well with both C++ and Haskell, and is user-friendly. It’s popular in gaming and configurations, which should make it perfect. However, I just find it hard to get excited about using Lua; it’s almost too simple. I need it to be a bit more thrilling to add to my go-to languages, basically I need something that wont just level after a short time, I want thing that gets better the more I use it.

After Lua, I gave Scheme, specifically Guile, a shot. I was drawn to it as the GNU recommended scripting language and for using the GUIX package manager. I love the concept of Lisp macros and the idea of crafting your own language. It really makes you think differently. But using it for scripting felt like overkill, like I was doubling up on what I already get from Haskell. It demanded more mental energy than I wanted to invest in scripts I might not use again. Although, I plan to keep poking at Scheme to see how deep I can go, even though it’s not fitting into my workflow perfectly right now. Another aspect for moving away from it was I switched from GUIX to Nix, thus Guile lost some of its appeal to me.

I’ve been using Perl for a long time and love incorporating Perl regular expressions even in Bash, Haskell, and C++. There’s something about Perl that gives me a warm, positive vibe—maybe it’s the community, or maybe because it was created by a linguist. The quirky syntax somehow levels the playing field, making everyone experience a bit of what it’s like to be dyslexic like me. Perl’s cross-platform capability, the solid CPAN, and the ease of running it directly in a terminal or embedding it in a Bash script are big pluses. So, even though Perl gets a bad rap and introducing it in projects can stir up more fuss than Haskell, for me, the language is just too perfect for my needs. With the rise of language models, having a text-first language isn’t a bad idea.

Of course, I still switch back to Lua when collaborating with others, just as I adapt to whatever languages my teammates prefer. But when I’m working solo, I truly enjoy the speed and power of my systems using C++, Haskell, and Perl. I’m really looking forward to improving my Perl skills and figuring out how best to integrate these three languages.

Package Management

Ever since I started working on big C++ projects in my free time, figuring out package management has been a bit of a headache. Initially, I dabbled with Conan and vcpkg, but ended up dropping them out of frustration. Vcpkg was almost good enough, but I hit enough snags on Linux to make me revert to a basic Bash script with a CMake setup. Over the years, I’ve tried all sorts of things to find a better approach—using Docker, setting up GitHub Actions to build projects, and even tweaking make and CMake to streamline project setups. But I never really landed on a method I could stick with consistently, and each new project ended up a patchwork of different methods depending on things like whether it needed to be cross-platform or what dependencies were involved.

I stumbled upon Nix through the Haskell community. My first try was a bust—I think I got the OS mixed up with the package manager. Because I didn’t really get it and wasn’t ready to sink time into figuring it out, I wrote it off as just another esoteric package manager that was all hype just because it was functional. It was only much later, when I was hunting for a new OS after deciding to move on from BSD, that I gave NixOS another shot and really liked the concept. Eventually, I settled on Debian for my OS and wasn’t really looking for a new package manager, so I didn’t dive deeper into Nix at that time.

While I was on my quest for a go-to scripting language, I ran into Guile and GUIX. I gave them a try but they weren’t quite my cup of tea, though I liked the idea enough to give Nix a serious shot as a package manager. Right from the start, it looked promising. It had become a popular choice in the Haskell community, so I figured if I could make it work smoothly with my C++ projects, that would be a huge win.

My first real attempt with Nix was a breeze; I got it working with my C++ projects in no time. Feeling ambitious, I decided to push it further and set up a Flutter development environment for an Android app I was working on. After a day of hacking away, I didn’t get it fully up and running, but I got close enough to see the potential. The issues I ran into were due to my own lack of knowledge about the system, not any shortfall in the technology itself. In fact, it seems like the possibilities with Nix are almost limitless, as long as I can ramp up my skills with it. This is pretty exciting because it gives me a unified way to manage all my projects and significantly eases the setup for new ones.

There are some downsides, like it not being the easiest to use on Windows, but overall, adding Nix to my toolbox has been one of the more exciting additions this year. I’m also thinking that over time, I might slowly transition to NixOS.

Contact

The best place to reach me is via email shane.hamilton@3.141@gmail.com

Notes on this site.

This site is just a bit of ruby and a basic markdown file, the videos have been converted to gifs using ffmpeg. The idea is to be able to update the Markdown file quickly and push it so its easier to keep it up to date.

The profile picture was created around 2020, I trained a model to learn the style of Van Gough using GAN’s then applied what it learned to a recent photo of me.