DEV Community

brsnumget
brsnumget

Posted on

if javascript only needs the browser to compile why can't other languages do it

because moving away from the native compiler would be a good step for software development. would be a good improvement to switch from physical machines completely to the internet

Top comments (10)

Collapse
 
sfleroy profile image
Leroy

I think the short answer is that all languages need some kind of runtime. For js this ships with all browsers, for dotnet it ships with windows, for C, C++ this ships with all operating systems.

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

C doesn't really need a runtime.

Collapse
 
brsnumget profile image
brsnumget

This answer has been very informative. and I learned a lot. what I'm aiming for is codes that don't need to convert to 0 and 1 :). because I think right now the whole software ecosystem is still in the formation phase, I asked this question because I think that there may be a eugenics in the software ecosystem in the future, for example, a language can be very good in more than one field, such as the fact that a language that is not like this will fall into the dusty shelves of history. In this world we have built, similar things happen without us realizing it, and in my opinion, we are going to the eugenics phase. I read an article called the features that a perfect programming language should have. A triangle had 1st side: performance 2nd side: safety
3rd edge: save time (easy to write)
He said that since there is no programming language that has these 3 features at the same time, there is no perfect language, and therefore there cannot be a perfect application and the best developer. Library and framework development by communities is actually like a help for languages ​​to be perfect languages. so: having a language open source and community support means a lot to the future of the language. And this competition between languages ​​(there is a big competition even if we don't see it) takes the software ecosystem to the stage of eugenics. That's why I don't think that current technologies will survive in the future, for example php, c, c#, ruby
but there will definitely be these languages
javascript, python, go, rust
and this phase will definitely be on the ecosystem running entirely on the cloud (totally my opinion)

 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

You don't need a separate runtime environment though. Depending on what system you're compiling for, your compiler could easily just turn argc and argv into two globals, one being 0 and the other an empty array, or add some boilerplate code that reads them from somewhere else, like some external sensor. One could get creative with that.

 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

But that's not what we're talking about; it doesn't need a runtime, regardless of whether it usually has one.

Collapse
 
_genjudev profile image
Larson

Why would it be good to get away from native compiler? The browser is native compiled too. All interpreter are native compiled.

In the end you need one part natively compiled.