DEV Community

Discussion on: [0] Creating a web framework from scratch - the motivation

Collapse
 
hbgl profile image
hbgl

Sounds interesting. What kind of spin are you going to put on it though? I cannot imagine that a professor will just let you do a rewrite of Laravel in Scala for a master thesis.

Collapse
 
matusmak profile image
Matúš Makatura

That's something I wanted to focus on in the next article, but here's few thoughts for now :).

I don't think I want to create rewrite of Laravel, but rather be heavily inspired by it :). What I mean is that I don't want to end up with framework like AdonisJS, which is really more-or-less a JS version of Laravel (no hate though!), but with something like VueJS in relation to Angular 1.

To give you some examples, Laravel uses centralized routing system, I want that too, but I will leverage Scala to create a different DSL. Here's a code that I'm currently playing with:

group prefix "/admin" of List(
  get  path "/debug" name "dishes.admin.debug",
  post path "/edit"  name "dishes.admin.edit",
) controller classOf[AdminController],

crud prefix "/students" controller classOf[TestController],
Enter fullscreen mode Exit fullscreen mode

Laravel has Artisan CLI, I will try to include that too, but with custom implementation. Laravel Eloquent is great ORM, I will for sure create similar query builder.

On the other hand, I will have many differences. My ORM won't be using Active Record pattern. My framework won't be fullstack, it will be just focused on backend API. I will also use reactive architecture, similarly to Spring Webflux. And so on :).

As for the master thesis, a big part will be research and evaluation. I will be analysing 3 frameworks - Laravel, Spring (Boot + Webflux) and Play framework, as well as a lot of smaller things (I have a couple of articles for fast routing). For the evaluation, one part will be comparing my framework to other 3 in terms of numbers, the other part will be testing it among other devs.