Another one:
const cast: <A, B> (a: A) => B = function <B> (): B {
return arguments[0]
}
const n: string = cast(1)164 karma · joined January 4, 2022
const cast: <A, B> (a: A) => B = function <B> (): B {
return arguments[0]
}
const n: string = cast(1)C printf: MT-Safe locale.
C++ std::cout: safe, unless you call sync_with_stdio(false).
JVM System.out.println: safe in common JVMs.
C# Console.WriteLine: safe.
Go fmt.Printf: safe.
Rust println!: safe.
Ruby puts: safe.
So it seems that Python is the outlier here.
In fact the source language is likely to be JS itself; a JS-to-some-sort-of-vm-bytecode-to-JS compiler is made. I know that Tencent has a similar VM; an interesting aspect of that VM is that the instruction set is dependent on the code being compiled (and the opcodes are dynamically generated and shuffled when compiling), so unused instructions are not generated.