Most programming languages today fall into the paradigms of native machine code compiled ones like Rust, C, C++, etc or Bytecode compiled like Kotlin, Java, C#, etc. Even some interpreted languages like Python can be thought of as Bytecode compiled since the interpreter store the bytecode which is executed instead of the source file unless the source file is changed.
I think the main benefit of bytecode compiled programming languages is that they’re usually platform independent as long as there’s a runtime for the platform you want to use, but I also don’t know how much this matters anymore, or whether the inefficiencies of bytecode makes it worth it.
What do you think? Should new programming languages always be native machine code compiled, like Rust or C?
As you said, there are different paradigms, each one solves a particular problem. The most important thing is not to see these technologies as entities that repel each other, but as complementary. For example, an inventory system; the database management systems (mysql/mariadb, postgresql, etc.) are created with native machine code compiled languages, because it is necessary have a complete access to the physical resources of the computer, specially the memory, to manipulate/store the data; For the inventory, it is a good and recommended option create a simple CRUD program with a bytecode compiled language that interacts (interface/socket) with DBMS, because there is not need to worry about of memory consumption, low level hardware interaction, machine/processor architecture, portability, etc.; Your program is created and runs in a “safe environment”, the VM.
Why is the inventory program recommend to be written in a bytecode language? What would be the disadvantages of writing in a native language, like how the Lemmy backend compiles to a single native executable?
Basically for 3 main reasons
– In the case of Lemmy platform, it runs over Rust. This language/technology is quite special; it supports a wide range of programming paradigms, works to a hight and low level, it is compile, but runs on the fly. In some sense takes the best of the two worlds. Just beautiful.