There certainly is a hard practical line, the build time / runtime line. And the hard line of publishing an app on the app store. No reason to get all hand-wavy or invoke Turing completeness. I'm not talking in the abstract here. I'm talking specifically about Unity3D, the il2cpp tool chain, and also the Apple app store, and specifically comparing them with V8 or whatever runtime JavaScript engine your favorite browser uses, and its runtime debugging tools. All the work that's been put into JavaScript that we all benefit from is the whole point.
C# and UnityScript are compiled at build time, not at runtime. JavaScript is interpreted or compiled at runtime. That line is very hard and crisp and well defined and practical, not a matter of principle of computer science pontification. Unity apps can NOT interpret or compile C# or UnityScript code at runtime, period.
And for many hard reasons, technical and not: It's a violation of Unity's licensing agreement to ship the il2cpp compiler with Unity apps, even if it were technically feasible (which it's not). It's a violation of Apple's app store policy to ship any kind of interpreter or compiler with an iOS app, other than their own JavaScript engine. None of those rules are going to change. You can't cross that hard crisp line.
You don't need to drop a JavaScript engine into your Unity3D WebGL app, because your WebGL app is already dropped into the JavaScript engine of the web browser itself. UnityJS simply uses that one. And iOS and Android have very fine web browser components that have perfectly modern JavaScript engines which are quite easy to drop into your app, and work quite well, which is what UnityJS uses on those platforms.
Show me a Unity3D app that runs on WebGL or iOS or Android, that compiles code at runtime. If you can link to a github repo so I can so how the code actually works, that would be even better. And I'd love to hear from the developer first-hand how they convinced Apple to bend their stringent app store rules just for them, but nobody else.
Now tell me honestly, how do Unity's C# and UnityScript debugging tools compare to Chrome's and Safari's JavaScript debugger? Do you actually use them yourself? Have you been able to use MonoDevelop to debug an app compiled with il2cpp on iOS or WebGL? What's your magic trick? It doesn't work for me. It's simply not supported. Where to I click to make it work? Please link to a youtube video with a tutorial.
And even if you used the Mono runtime, which is deprecated and not supported on iOS or WebGL, it is extremely buggy and unreliable even on platforms where it works, and absolutely and objectively sucks compared to the JavaScript debugging tools. It doesn't even let you interactively evaluate C# expressions, redefine functions, or edit and continue code, which the Chrome Debugger does quite well, and even Microsoft Visual C++ has let you do for decades.
So let me try to rephrase it for you: The position JavaScript occupies is great. No other language occupies that position, or will in the foreseeable future. It's such a great position, that in spite of all your disdain for it, you (and millions of other people) are using and writing JavaScript libraries yourself, even though you hate it. That's what I mean. JavaScript may not be great at making you happy, but it's great for solving common real world problems, in a way that no other language can.
This conversation has taken a very disappointing turn, and it just feels adversarial now. When you say something like,
> And no matter how bad it [JavaScript] is as a language, it still beats compiled languages as a dynamic extension and scripting language.
In a normal conversation, I can disagree, and we can argue all we like about the reasons we like or dislike various languages for dynamic extensions / scripting. Maybe I might learn something! But no, I'm just reading a monologue that you wrote about why JavaScript is better, filled with arguments that I've already heard.
C# and UnityScript are compiled at build time, not at runtime. JavaScript is interpreted or compiled at runtime. That line is very hard and crisp and well defined and practical, not a matter of principle of computer science pontification. Unity apps can NOT interpret or compile C# or UnityScript code at runtime, period.
And for many hard reasons, technical and not: It's a violation of Unity's licensing agreement to ship the il2cpp compiler with Unity apps, even if it were technically feasible (which it's not). It's a violation of Apple's app store policy to ship any kind of interpreter or compiler with an iOS app, other than their own JavaScript engine. None of those rules are going to change. You can't cross that hard crisp line.
You don't need to drop a JavaScript engine into your Unity3D WebGL app, because your WebGL app is already dropped into the JavaScript engine of the web browser itself. UnityJS simply uses that one. And iOS and Android have very fine web browser components that have perfectly modern JavaScript engines which are quite easy to drop into your app, and work quite well, which is what UnityJS uses on those platforms.
Show me a Unity3D app that runs on WebGL or iOS or Android, that compiles code at runtime. If you can link to a github repo so I can so how the code actually works, that would be even better. And I'd love to hear from the developer first-hand how they convinced Apple to bend their stringent app store rules just for them, but nobody else.
Now tell me honestly, how do Unity's C# and UnityScript debugging tools compare to Chrome's and Safari's JavaScript debugger? Do you actually use them yourself? Have you been able to use MonoDevelop to debug an app compiled with il2cpp on iOS or WebGL? What's your magic trick? It doesn't work for me. It's simply not supported. Where to I click to make it work? Please link to a youtube video with a tutorial.
And even if you used the Mono runtime, which is deprecated and not supported on iOS or WebGL, it is extremely buggy and unreliable even on platforms where it works, and absolutely and objectively sucks compared to the JavaScript debugging tools. It doesn't even let you interactively evaluate C# expressions, redefine functions, or edit and continue code, which the Chrome Debugger does quite well, and even Microsoft Visual C++ has let you do for decades.
So let me try to rephrase it for you: The position JavaScript occupies is great. No other language occupies that position, or will in the foreseeable future. It's such a great position, that in spite of all your disdain for it, you (and millions of other people) are using and writing JavaScript libraries yourself, even though you hate it. That's what I mean. JavaScript may not be great at making you happy, but it's great for solving common real world problems, in a way that no other language can.