mood

source

Diet can be a bit frustrating to work with primarily because of how static templates and more dynamic pages are seperated. If I want to build a website that requires lots of parameters to be passed to the templates for various purposes like authentification, content, or anything else, a considerable amount of boilerplate and redundant code is required. Obvisouly, this can be time consuming and very tiring since what happens is a lot of duplicate code that can't be easily abstracted away.

This is very apparent with this website. I have a file with all my page routers in it, and it totals about 400 lines in length. This is a problem. I can't even begin to imagine how bad this is for more complex sites that have way more pages to render than I do. I love D, and I love vibe.d, but there has to be a better solution.

So, after doing some more digging and finding no solution to this problem, I decided that I would create my own solution.

Behold! mood, my solution to this problem.

Why use mood over diet, or any other alternative? The answer is quite simple: the syntax is simple and straight forward. All you need to do to bake in some D code on a webpage is the following:

<?D
    ...
/?>

See? Simple. Nothing else required. No special rules. All you need to do is open those tags, and then you can write code in a similar fashion to how you would in PHP.

How does it work? To keep it simple, the html document is parsed when the project is compiled. Then any segments of D code is extracted, and placed it into a funtion that is ran whenever the page is loaded. This function returns the program output, and the webpage is reconstructed to use the program output.

Some other little quallity of life things I added to make mood super amazing are html templates, includes, and the ability to hook the render function.

reece.ooo

What more is there to say? I've gone through 5 or 6 iterations making this site. I'll just keep it simple and list what I've learned so far through all the iterations.

  • HTML/CSS
  • PHP
  • MongoDB
  • MySQL
  • vibe.d
  • D
  • SolVPS (VPS)
  • Digital Ocean (VPS)
  • Azure (Storage/Static Website)
  • DNS management
  • SSL
  • Nginx
  • iptables
  • ...

D-Astar

source

When learning D, I needed something to push me to learn the specifics of the language and the standard library. That's because it's kinda hard to do that without any goal, and so you'd just be blindly writing code without any idea how to apply it. So, I decided that I would make a maze solver since it seemed like a moderately difficult project with some research, and there were lots of places I could apply D to.

Anyways, it works. I'm not sure how it stacks up in terms of speed and optimization, but it was a ton of fun to make. Looking back at the project, there are a lot of changes that I would make now to use more D features, and I would probably use a more efficient implementation of the algorithm. But, it is really fast, and it has support for things like different heuristics, and different settings and stuff.

After doing this project, I would definitely recommend D. I can't imagine how awful it would've been if I used this implementation in C++. Things like CTFE just made this a lot of fun, and more easy than I thought.

STRAFE

source

At some point I got a little bored playing video games, so I decided to make a game hack, and this was the result. I went all out on this. When I was actively working on this, it was pretty advanced for the time. The only real thing that it lacked that would've made it be at the top was back tracking.

This project helped me gain a better understanding of the specifics of how memory works, and how the program interacts with memory. The understanding of memory from the project changed my mindset to the way that I approached problems so that I would consider how the memory would be impacted. The understanding of memory from this project has even helped me track down bugs in other projects.

Some of the I'm the most proud of are the custom models, colored walls, and a nice and clean menu.