473,320 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

.NET competes with java-script

That's all we are expecting from programs written in the managed code;
Though a MVP advised not to say that, because after JIT compilation the
code runs in the native! Funny, isn't? That means scripting languages run in
the Host code and never in the native? That means scripting languages
are poorer than .NET in speed just because they are hosted by an
interpreter? What about .Net run time libraries? Can any one tell me the
differences? (my JavaScript loops are some times as fast as their C#
or VB.NET counterparts under IE6!, just not mentioning their GDI
performance....)
What is the difference between an interpreter and a VM ?
( If you call .NET VM NOT an interpreter after all).


Jul 21 '05 #1
3 1769
Pragma,

You should have a look too the operaration codes of a (micro) processor.

It is inefficient to use those because mostly they will repeatedly be used.
(Think for that too a simple decimal Add while the processor does not have a
decimal add), and because of that productivity programs would be much to big
when they where all used every time again.

Therefore is already in the 70's decided to use intermidiate languages
(whatever name is given to that)..
Those are between the processorcommands and the compiled/builded source.

The less operations that the intermidiate needs to come to the real process
and the most efficient code that is created means how productive the
programs are.

Therefore that step between human and computer what an intermidiate program
in fact is, does a good job too increase speed.

I hope this clears it a little bit?

Cor
"#pragma once" <it**********@e2hotmails.com>
That's all we are expecting from programs written in the managed code;
Though a MVP advised not to say that, because after JIT compilation the
code runs in the native! Funny, isn't? That means scripting languages run
in
the Host code and never in the native? That means scripting languages
are poorer than .NET in speed just because they are hosted by an
interpreter? What about .Net run time libraries? Can any one tell me the
differences? (my JavaScript loops are some times as fast as their C#
or VB.NET counterparts under IE6!, just not mentioning their GDI
performance....)
What is the difference between an interpreter and a VM ?
( If you call .NET VM NOT an interpreter after all).

Jul 21 '05 #2
I think that what you are talking about has more to do with the conception
of speed rather than real speed. The number of operations a CPU can deal
with in the time it takes to do the transfer of a page from a web site is
such that it is the number of trips between the client and the server which
is important.

Given this Javascript has a place since if all you want to do is now show
more information on the page you can write Javascript to hide/show
information without needing the server. If you write server code to do the
same it will take longer (clock time).

This is true with PHP/JSP/ASP ... etc. The technology is simple in that it
builds HTML and sends it to the client. A developer may decide that it is
more efficient to send more information in the page and have Javascript deal
with it until it has to be posted back to the server or if they don't know
Javascript then every event will be handled on the server end.

It is the mix of server and client code that can give the user a rich GUI
experience and the better the mix the faster the display and hopefully a
more enjoyable time interacting with a web site.

Lloyd Sheen

"#pragma once" <it**********@e2hotmails.com> wrote in message
news:eS**************@TK2MSFTNGP12.phx.gbl...
That's all we are expecting from programs written in the managed code;
Though a MVP advised not to say that, because after JIT compilation the
code runs in the native! Funny, isn't? That means scripting languages run
in
the Host code and never in the native? That means scripting languages
are poorer than .NET in speed just because they are hosted by an
interpreter? What about .Net run time libraries? Can any one tell me the
differences? (my JavaScript loops are some times as fast as their C#
or VB.NET counterparts under IE6!, just not mentioning their GDI
performance....)
What is the difference between an interpreter and a VM ?
( If you call .NET VM NOT an interpreter after all).

Jul 21 '05 #3

"#pragma once" <it**********@e2hotmails.com> wrote in message
news:eS**************@TK2MSFTNGP12.phx.gbl...
That's all we are expecting from programs written in the managed code;
Though a MVP advised not to say that, because after JIT compilation the
code runs in the native! Funny, isn't? That means scripting languages run
in
the Host code and never in the native? That means scripting languages
are poorer than .NET in speed just because they are hosted by an
interpreter? What about .Net run time libraries? Can any one tell me the
differences? (my JavaScript loops are some times as fast as their C#
or VB.NET counterparts under IE6!, just not mentioning their GDI
performance....)
What is the difference between an interpreter and a VM ?
( If you call .NET VM NOT an interpreter after all).


The primary difference between an interpreter and a VM is considerable, and
I don't think its the question you actually meant to ask.

A VM is a virtual machine, and in this context is an abstraction of memory
model, execution model, and potentially other bits like port IO and devices,
depending on the complexity of the machine, that is designed to allow
programs to run across multiple platforms without recompilation or
re-writing. An interpreter is a piece of code that reads and executes code
(usually a script, but it can be compiled machine code as well).

What you mean, I think, is the difference between an interpreter and a JIT.
A VM can execute code using either an interpreter or a JIT compiler. Java,
..NET and I think javascript all have a VM(and they aren't the only
languages\runtimes). The primary difference is how they execute code.

The Microsoft .NET VM doesn't have an interpreter(atleast that I can think
of off hand), it, like modern java, uses a JIT compiler. Mono provides one
and I believe older java versions were interpreted.

To my knowledge, javascript is interpreted in a web browser as JIT
compilation is pretty useless for script that is going to change that often.
Thus most simple scripts are not JIT'd, but a scripting language is not
precluded from being JIT compiled if the script executer supports it

Now, the difference betwee the two is simple. An interpreter reads and
executes instructions directly. For example it would read a command out of
the script file, determine what it says to do and execute it, generally by
calling functions within the interpreter itself(1+2 may result in a Add(1,2)
call in the interpreter for example). A JIT compiler takes the script file
or encoded instructions(usually encoded instructions), analyzes them, and
emits normal machine code which the processor executes directly.

There are tradeoffs between the two, interpretation is potentially easier to
write(I'd be unwilling(and probably unable) to do a script code to native
JIT, although I have written scripting code to MSIL JIT before), it is also
considerably faster for short scripts like much javascript code as JIT has a
longer startup time(in general atleast an entire method has to be compiled
before execution, while scripts execute line by line).

JIT's will produce faster code in many to most cases(especially mathematics
or memory access heavy code), with a slower startup and more memory
required(uncompiled code, compiled code, and transition structures have to
be stored for atleast a period in time). JIT'd code doesn't have the call
overhead of the interpreter, making execution pretty close to machine speed
once JIT compiled.

In theory, also, a JIT can emit instructions and instruction sequences that
are highly optimized for a specific machine that will significantly outrun
interpreted code, but not all JIT's are at that level.
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michael | last post by:
Hello I am trying to write a Java-Program which converts a XML-file in a HTML. It should take the Transformation-file from the XML-file itself. Below find a possible XML-file: <?xml...
0
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
1
by: ptaz | last post by:
Hi I'm trying to run a web page but I get the following error. Ca anyone please tell me a solution to this. Thanks Ptaz HTTP Status 500 - type Exception report
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
0
by: Markus Wollny | last post by:
Hello! When I try to run ./configure --with-java, it complains that ant doesn't work. However ant is installed, as is the latest Java SDK 1.4.2 from sun, PATH and JAVA_HOME are set correctly; ...
0
by: mailkhurana | last post by:
Hii , I am trying to use a type 2 driver to connect to DB2 0n AIX 5 I have a small java test to class to establish a conneciton with the db .. I am NOT using WAS or any appserver When I try to...
5
by: TZESENG | last post by:
DECEMBER 13, 2005 . Editions: N. America | Europe | Asia | Edition Preference News Analysis By Steve Hamm Source: http://www.businessweek.com/technology/content/dec2005/tc20051213_042973.htm...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
12
by: Mark Fink | last post by:
I wrote a Jython class that inherits from a Java class and (thats the plan) overrides one method. Everything should stay the same. If I run this nothing happens whereas if I run the Java class it...
0
oll3i
by: oll3i | last post by:
package library.common; import java.sql.ResultSet; public interface LibraryInterface { public ResultSet getBookByAuthor(String author); public ResultSet getBookByName(String name);
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.