[Coco] Happy Birthday BASIC!

Gregory Law glaw at live.com
Tue May 2 23:45:35 EDT 2017


It's kind of funny I suppose, but these days I consider C++ to be more 
along the lines of the modern-day assembly language when compared to 
languages like C#, Visual Basic, Java, etc. My perspective here is that 
any time I have to drop into C++ to do anything in Windows, it feels as 
if I'm spending 90% of my time doing low-level window manipulation or 
COM code for controls that's abstracted away by other languages and 
frameworks (e.g. libraries).

The advantage to compiling to an intermediate language and then 
just-in-time compiling at run-time is that the JIT code can take 
advantage of the very specific hardware available to it. Generally when 
you compile a C++ application to machine code, the machine code is 
optimized for a generic hardware -- say a generic Intel/AMD processor 
with SSE depending on the optimization switches set in the IDE. When JIT 
compiles the code to machine language, it knows you have an I7-7770 with 
SSE 4.1/4.2, AVX 2.0 and optimizes the code for this specific hardware. 
A JIT engine may also analyze the code as it runs to inline certain 
methods or further optimize the code based on this analysis.

Having said all this, JIT and underlying frameworks still have more 
overhead and use a heap more memory than statically-compiled C++ code so 
C++ is still king -- even if I think C++ is more like a modern assembler 
compared to C# and Java. :-)

On 5/2/2017 7:54:06 PM, "James Ross" <jrosslist at outlook.com> wrote:

>Slight correction.  They are both compiled to “Intermediate Language” 
>IL or MSIL.  This is very similar in concept to Java bytecode.
>
>The IL (even though it could theoretically be interpreted) then is 
>converted to native machine code at the time the code is executed 
>through a process called JIT (Just-In-Time compile) on the platform you 
>are running it on.  Same thing w/ modern Java.  I think early on Java 
>bytecode was interpreted, but not these days.
>
>Speaking in general terms and depending on the code, JIT can produce 
>executable code that rivals C/C++ in speed (with C/C++ having the edge 
>for sure, but when talking GHz speeds, the difference is usually 
>negligible) – that is the reason you just don’t see business code 
>written in C/C++ anymore.
>
>As pointed out in another message, JavaScript, Perl, Python, Php, Ruby 
>out-of-the-box are indeed interpreted – but even w/ those there are 
>trends of moving towards JIT’ing systems …
>
>James
>
>--
>Coco mailing list
>Coco at maltedmedia.com
>https://pairlist5.pair.net/mailman/listinfo/coco



More information about the Coco mailing list