AndroidCoding is my Dreams

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
TI-994A
Addict
Addict
Posts: 2698
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: AndroidCoding is my Dreams

Post by TI-994A »

the.weavster wrote:...V8 does not "act as an interpreter".
Yes it does. And since you've amply illustrated that you have absolutely no command whatsoever on the topic, I'll tell you why, dunce.

On Android, even though the V8 engine compiles JavaScript source code directly into machine code, it does not run that compiled code. Instead, it only creates shared object files that can be called by the Java environment through the Java Native Interface (JNI).

As I had said in my original statement, the JavaScript engine acts as an interpreter to the Java environment.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
the.weavster
Addict
Addict
Posts: 1576
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: AndroidCoding is my Dreams

Post by the.weavster »

TI-994A wrote:
the.weavster wrote:...V8 does not "act as an interpreter".
Yes it does. And since you've amply illustrated that you have absolutely no command whatsoever on the topic, I'll tell you why, dunce.

On Android, even though the V8 engine compiles JavaScript source code directly into machine code, it does not run that compiled code. Instead, it only creates shared object files that can be called by the Java environment through the Java Native Interface (JNI).

As I had said in my original statement, the JavaScript engine acts as an interpreter to the Java environment.
So we categorically know that V8 is not an interpreter, it compiles JavaScript to machine code, we've got that direct from Google's developers. So once V8 has compiled the JavaScript to machine code we have machine code, we have the JVM and we have the JNI. So where is the "JavaScript engine [that] acts as an interpreter to the Java environment"? Who made it, what's it called and why do we need it?
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: AndroidCoding is my Dreams

Post by Danilo »

Never ending story... :lol: :wink:
User avatar
TI-994A
Addict
Addict
Posts: 2698
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: AndroidCoding is my Dreams

Post by TI-994A »

the.weavster wrote:So we categorically know that V8 is not an interpreter, it compiles JavaScript to machine code, we've got that direct from Google's developers. So once V8 has compiled the JavaScript to machine code we have machine code, we have the JVM and we have the JNI.
Yes; and the JVM and JNI are only pertinent insofar as Java development is concerned.
the.weavster wrote:So where is the "JavaScript engine [that] acts as an interpreter to the Java environment"? Who made it, what's it called and why do we need it?
Fair questions. I'll address them in three parts.

1. The compiled codes of the V8 JavaScript engine execute independently only when run through an instance or a context of its integrated web browser.

2. In all other cases, they are compiled only as shared objects that would be linked to the code of other languages, to be called and executed therefrom.

3. It's the same with Java, but since their code has to run on their platform-dependent JVMs, the JNI is also required.

And lastly, let's not lose sight of the topic that sparked off this discussion; DroidScript. On the Android platform, instead of the JVM, the DVM is utilised. This VM is integral to any app, meaning that no code could be executed without being run through it (with the exception of web apps and the experimental ART model).

Even with the V8 engine, this Android model renders it impossible for DroidScript apps from being compiled to machine code for direct execution; they still have to be run through the DVM.

So, since the JavaScript engine generates this specific object-model code in order to be utilised by these other languages, it technically acts as an interpreter to their programming environments, Java included.

This has been my sole contention all the while, although I'm not expecting your consensus on the matter.

I've elaborated my position for the benefit of other readers whom I hope would find it useful.

Additionally, if there's been any perceived abrasion on my part that has caused yours, my apologies. Sincerely. In all honesty, I usually restrict my comments to the contents of the posts, and not to the poster. But in light of the continuous bombardment of personal attacks thrown my way, the gloves just came off.

Only human, right. :lol:
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
the.weavster
Addict
Addict
Posts: 1576
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: AndroidCoding is my Dreams

Post by the.weavster »

Thanks for that.
I'm still not convinced though.

V8 compiles JavaScript to native machine code that interacts with Android's JVM using the Java Native Interface (JNI), so where is the "JavaScript engine [that] acts as an interpreter to the Java environment"? I still don't see any JavaScript engine doing any interpreting in this scenario.
TI-994A wrote:Additionally, if there's been any perceived abrasion on my part that has caused yours, my apologies. Sincerely.
Hey, I'm sorry I got snarky too. You can sometimes be a little pompous though, I shouldn't have allowed this:
TI-994A wrote:I'm pretty sure that there's a point that's going to be torn to shreds in that post of yours. :lol:
to get on my thruppeny-bits but once you'd said that and I knew you'd confused two different projects I couldn't resist poking at you with a stick.
User avatar
TI-994A
Addict
Addict
Posts: 2698
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: AndroidCoding is my Dreams

Post by TI-994A »

the.weavster wrote:I'm still not convinced though.

V8 compiles JavaScript to native machine code that interacts with Android's JVM using the Java Native Interface (JNI), so where is the "JavaScript engine [that] acts as an interpreter to the Java environment"? I still don't see any JavaScript engine doing any interpreting in this scenario.
Hi weavster. The V8 JavaScript engine works in two modes; standalone and embedded.

Standalone Mode:
1. The JavaScript code is compiled and executed through the web browser. However, the JavaScript code is not interpreted, but is instead compiled and run as native binaries.

2. The JavaScript code is compiled by the V8 engine into shared object (.so) files, which are then called and executed from within another language environment (eg. C/C++, Java, etc.).

Embedded Mode:
1. The JavaScript code is included inline in another language environment (eg. C/C++, Java, etc), through the implementation of a web view context that is instantiated via API calls to the V8 engine.

As you can see, unless it is run in the conventional method, that is through a web browser, the JavaScript code needs to be interpreted into shared object files, or interpreted through an embedded web view context, before it can be utilised by the executing environment.

Best I could do, so please correct me if I'm wrong.
the.weavster wrote:You can sometimes be a little pompous though...
No arguments there. Don't know why though. :lol:

Perhaps Karellen was on the money with this little comic:

Image

I'll try to be right in a more civil manner in future. :lol:
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
Post Reply