The Speed of JavaScript Compared to C
JavaScript, often abbreviated as JS, is a popular programming language that is widely used for web development. It is known for its versatility and ease of use, however, it is often criticized for being slower compared to other programming languages such as C. In this article, we will explore the speed of JavaScript compared to C and the various factors that contribute to these differences.
Understanding JavaScript
JavaScript is an interpreted language, meaning that it is executed line by line by a program called an interpreter. This makes it easier to write and debug code, as the programmer does not need to compile the code before running it. However, this also means that JavaScript can be slower than compiled languages like C, which are translated into machine code before being executed.
Comparing JavaScript to C
C is a compiled language, meaning that it is translated into machine code before being executed. This makes C much faster than JavaScript, as the machine code can be executed directly by the computer’s processor, without the need for an interpreter. As a result, C is often used for performance-critical applications such as system software, device drivers, and game development.
Improving JavaScript Performance
Although JavaScript may be slower than C, there are several techniques that can be used to improve its performance. For example, using modern JavaScript engines such as V8, which is used in the popular Chrome browser, can greatly improve the speed of JavaScript code. Additionally, writing efficient and optimized code, using caching and memoization, and minimizing DOM manipulation can also help improve JavaScript performance.
Conclusion
While JavaScript may be slower than compiled languages like C, it is still a powerful and versatile language that is widely used for web development. By understanding the factors that contribute to JavaScript’s speed and implementing best practices for improving performance, developers can ensure that their JavaScript code runs efficiently and effectively.
I have 5 years experience in react native,always argue that RN better than Flutter ,and then i joined a new company and should work in flutter and unity , then its blowed me up, Flutter is better 😂 eventhough the code looks a mess
Cool vid Theo. JavaScript all the things. The idea of fullstack developer will never be the same. Love the idea of faster JS though, I imagine Web Assembly is similar for the web (although perhaps they're not static/AOT compilation)? How much will the web take from this?
The Amazon and Meta dick and balls was top tier 🤣🤣🤣
The effort that a js dev puts to keep using js is insane.
Why wouldn't this exist in the first place, coders are silly.
Building desktop apps with JS, and using a library like Sharp for image manipulation!
man these thumbnails…
My first langauge was C/C++ when I was 6. I am used to low level optizations.
"Is it possible to transpile js to static language?" Js wouldn't be able to run if it was not possible. (sorry for capital j in js)
Not gon lie when I saw the title I assumed the C was the speed of light constant 😂💀
The lengths that people will go to not learn anything but JS, me included
Javascript is the worst programming language. I hope it was never invented.
I'm curious how it compare with AssemblyScript. I know it target WASM but hey, you can compile module.wasm into C code.
What if we just didnt use js for backends tho? Or is this some wasm magic that runs in the browser?
Is it just me or is it hard to looks that this guys face
Kind of crazy to think, Amazon helped RN devs in integrating Microsoft's Typescript onto Meta's Software.
Maybe not so much crazy, cuz Typescript itself is crazy good.
It just feels strange how much energy and effort people are willing to invest, instead of just using a truly native language. I mean if I can crash the system with JS like i can with c++, i need to be at the same level as the c++ developer. At that point I could just learn the syntax of c++ and be done with it. But! What really excites me is what this can mean for the web in general. When JS gets so performant, that you can realistically program demanding games on it.
Could it happen for the browser as well in the future?
That would be crazy
It’s pronounced Her-mees, like the Greek god. “Ehr-mehz” is how you pronounce the fashion label.
That sounds like what Chris Lattner is doing with Mojo, to make Python code faster (different approach, but the static typing to make it faster is similar)