Projects I

Published on Wednesday, January 6, 2021

I actively try to seek out new projects to undertake so I can keep learning. Lately, I've had a hard time with completing some of these challenges, so I'm committing here, in writing, to hold myself accountable. In the next month I'll write an update with how these are going:

rocket_mvc

I want to make an mvc template that I can use to scaffold out MVC web applications in Rust using Rocket

I have a background writing MVC applications in .NET, so I'm familiar with this project architecture/pattern, so I'd like to have a way to easily leverage the same style in Rust. Writing this from scratch in Rocket will give me a good opportunity to learn the framework. I'm not sure if this is something I'd prefer to write in its own crate or as a template to be used with cargo generate, but either would be another opportunity for me to learn. The exact goals for this month:

  • Have something that's easily be reusable (either via cargo generate or as a crate)
  • Abstract away as much boilerplate as possible. For example, I'd like to avoid having to manually register every route I create in one file. There may already be a way around this already in Rocket, but I'm not familiar with it yet, so this yet another learning opportunity.

Psst

I want to make a contribution to this project. I use Debian as my daily OS, and Spotify's electron app is very buggy on Linux (what electron app isn't?). I've been using it for a few days now, and it serves its purpose, but I'd there are features I miss.

One feature I'm really missing is media key controls. This is in their TODO list, but I haven't checked if anyone on their Github has started on this work. If this is available, I will take this. If not, I will commit to picking something on their list of goals to complete.

Simple game in Rust

I've been reading into Amethyst for a while, but haven't yet made anything with it. This month, I'll be working on making a super simple game to learn the engine.

This month, I want to get started on writing a game (any game) using Amethyst. Concretely, I'm aiming to:

  • have a game idea picked
    • I think snake is a reasonable choice for a game to have written in a month's time
  • have a complete running implementation, something I can consider "version 1"

GET SOME CERTS

I've been studying for my Azure Associate Software Developer certification for about a month now. This month I'm going to fully commit to taking this exam. There's also the Scrum Certified Developer certification offered by scrum.org, that I've been looking at for a while now, so I'd like to do this as well.

The outcome

rocket_mvc

Ultimately, the behavior I want has been discussed before and is deliberately left unsupported by the framework. Nevertheless, I think it's fun to make an attempt. I think there is a solution that addresses the security concern.

The desired behavior is difficult to do. The way ASP.NET and ASP.NET Core achieve this is through runtime reflection. Runtime reflection does not exist in Rust (natively), so copying this approach is impossible.

I thought about the problem some more, and it could be solved by doing pre-build codegen to create code that looks like,

rocket::ignite()
.mount("/", routes![all, your, controllers, here])

You can create Rust build scripts that generate code. I've thought of a simple design that I think may give me what I want:

  1. Crawl a directory known at build time, looking at each function's definition for route attributes
  2. Output a file from the build script that contains a function that takes a Rocket as input, runs the needed mounts on it, and returns it
  3. Call this function wherever we would perform our usual rocket::ignite().mount().launch() calls.

I'm still learning Rust, so this is not something I could easily finish in the remaining week. This is probably something I could spend an entire month just learning the pieces without even knowing how to put them together. But, I think it's a step in the right direction, so for now I'm satisfied with my progress for the month.

Psst

After doing some more research, I think this a feature that will require some support layer to be built into Druid, so I've opened an issue to discuss. I'd like to build this solution but, as above, this may be difficult for me to do in a week.

Certifications

This is wear the bulk of my time this month has been spent. I binge studied for the AZ-204 over the course of the weekend and narrowly missed my mark on the exam. I'll be trying again next month after some more studying.