JS is currently like the assembler / machine code of the internet for browsers or if we see WebASM as the actual assembler language of the Web, JS would be the equivalent of C. When C was developed, certain people continued to use C while others moved on to higher-level languages as they became available. As of today, I know very few people still developing in pure C.
In Delphi for example, you could mix Assembler in your Delphi code if you weren't happy with the performance of the built-in function:
<sarcasm>Doesn't these assembly instructions look like very maintainable code? </sarcasm>
function CountDigits(anInt: Cardinal): Cardinal; inline;
var
cmp: Cardinal;
begin
cmp := 10;
Result := 1;
while (Result < 10) and (cmp <= anInt) do
begin
cmp := cmp*10;
Inc(Result);
end;
end;
function CountDigitsAsm(anInt: Cardinal): Cardinal;
asm
mov ecx,$a // cmp := 10;
mov edx,$1 // Result := 1;
jmp @loop2
cmp eax,edx // while cmp <= anInt do
jb @done
@loop1:
add ecx,ecx // cmp := cmp*10;
lea ecx,[ecx+ecx*4]
inc edx // Inc(Result);
@loop2:
cmp edx,$0a // (Result < 10)
jnb @done
cmp eax,ecx
jnb @loop1
@done:
mov eax,edx
end;
begin
WriteLn(CountDigitsAsm(10));
WriteLn(CountDigitsAsm(99));
WriteLn(CountDigitsAsm(999));
WriteLn(CountDigitsAsm(9999));
WriteLn(CountDigitsAsm(99999));
ReadLn;
end.
Where do we see similar scenarios in the browser? GWT / Dart / Kotlin's JS interop which allows you to mix JavaScript into your higher level language.
Once proper web assembly becomes available in all browsers, I believe JS interop will start to disappear slowly and you'll just be working in the high-level language compiling it straight to WebASM.
Just like C, JavaScript will still hang around by a thread unless it gets a major overhaul and much needed improvements like C did when C++ was released.
Just my opinion ...