DEV Community

marius-ciclistu
marius-ciclistu

Posted on • Originally published at marius-ciclistu.Medium on

MaravelQL - PHP (Eloquent) - C - Binary


MaravelQL - PHP (Eloquent) - C - Binary

Binary… zero and ones… that is what a computing machine understands. To get to that, human readable programming languages like C need to be used and then compiled into binaries to be executed.

PHP is another programming language built on C that does not need to be compiled because it is interpreted at runtime.

Laravel’s Eloquent is a DB query builder written in PHP.

MaravelQL is a API query language translated into SQL by Maravel-rest -wizard through Eloquent.

To put all this in an analogy:

  • You (client) ask (MaravelQL) for a pizza with extra chese from the waiter (Maravel-rest-wizard) at a table (API endpoint) in a restaurant (Application Project - Server).
  • The waiter transmits your request to the chef (Eloquent) that will cook your pizza in the kitchen (Database).
  • When the pizza is ready it will be delivered on a plate to your table.

What just happened here?

Basically your request (MaravelQL) was translated into SQL (kitchen language), executed and then the result (pizza) was delivered to you. But wait! Was that all?

No it wasn’t. Remember that computing machines understand only binary. The request was handled through PHP which was interpreted by the binary compiled from C.

This is like processing the request in a primordial language (binary) translated fom English (MaravelQL + PHP) through instructions translated from Ancient Greek ( C ) into that primordial language.

I wonder why are things like this. Why are there so many languages involved?

The answer is simple. Evolution. The waiter understands only English, the chef knows both English and kitchen language while both have DNA from their common ancestor.

Top comments (0)