[0] Creating a web framework from scratch - the motivation
Tags: scala, webdev, story
Published: 2021-03-10 00:39:01

**Hello wanderer!** 👋 However you managed to come along this article, please, feel welcomed, and join me on my way to create a brand new Scala web framework from scratch!

# Wait, what? Why would you do that? 😮

I'm sure you are wondering why would anybody waste time doing that. Not only there are already great, production-ready frameworks available, implementing all the cool features would take _tremendous_ amount of effort and time.

And yes, that's absolutely correct! But let me give you the following points to explain my motivation and hopefully give you different look on the matter.

## It's a lot of fun for me 🤹‍♂️

Let's get this one out of the way - I wouldn't do it if I wasn't enthusiastic about it! Building systems that me or somebody else can then take to create new things was always exciting to me and it gives me _the sense of pride and accomplishment_... and that's simply nice.

## Knowledge and experience 👨‍🎓

It's one thing being able to write applications, but it's a brand new world being able to write underlying framework. This journey will introduce me to a lot of new technologies and concepts I would otherwise not explore and I'm hopeful it will aid me to grow as an engineer/developer.

## I miss Laravel's experience 🐘 in JVM world ☕

Although my first real programming language was Java, my early days of web development were dedicated to PHP - and almost entirely to Laravel framework. And while it's certainly not perfect, it provides great development experience. I always enjoy building apps with this framework, it feels satisfying and you keep finding out excuses to implement new functionality.

When I switched to building web apps in JVM (Java, Kotlin, Scala), I started working on large enterprise applications. And sure, I think I have great tools for that, I think that my code I deliver is robust and reliable... but I never experienced as much joy as before (and when I remember my efforts in configuring non-trivial things in Spring Boot, it's actually quite the opposite).

So I thought - why not try to create a framework that would prioritize development experience? What will happen - will it feel as good as it did for PHP, or is JVM simply not suited for it? I will certainly find out.

## Pure Scala implementation 👌

Looking back now, one more thing that I believe Laravel does well over JVM frameworks is it's use of PHP everywhere. You don't have annotations, you don't have custom expression languages, you don't have XML files, you don't have custom configuration files - just PHP (and environment variables). The power of fully fledged programming language is always available to you, everywhere in the system.

Why not try something similar in JVM world? This is where I think Scala can shine - it's much more powerful language than Java (and even Kotlin), so if done right, it should be possible to move everything back to the regular language without the need to rely on any sort of code metadata or other languages or markups.

And the more you have in the readable code and less in dark magic in the background, the more comprehensive your framework will become to developers.

## Master thesis

In a year and a half from writing this article, I will be graduating from University as a master of computer science. For that of course, I will need to finish my master thesis. So why not kill two birds with one stone and make this web framework topic of my thesis? It also has one added benefit - I will be kinda forced to do it, so it will be harder for me to abandon this project due to lack of time or motivation.

# And why blog about it? 🤔

Why not? If nothing else, it will be my personal archive of my thoughts and progress that will one day make me smile (or laugh). Maybe it will inspire somebody to create their own framework or library. And there's a slight, but non-zero chance that it will blow up - and in that case, this blog will become a new Bible for hypothetical fans of my work. And if you ask me - that'd be cool (and something to brag about in discussions 😄).

# So what to expect? 📈

This first (or zero-th?) entry is a bit longer to give you my background, but I expect subsequent parts to be much shorter. I don't intend to write in-depth dev-blog right now, I'd only like to share interesting findings or progress made on this framework. I believe writing one entry per month is just about right - it won't be boring and I won't burn out.