Click here to Skip to main content
15,888,461 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: What's a "real" programming language? Pin
honey the codewitch27-Dec-23 7:02
mvahoney the codewitch27-Dec-23 7:02 
GeneralRe: What's a "real" programming language? Pin
jschell28-Dec-23 4:57
jschell28-Dec-23 4:57 
GeneralRe: What's a "real" programming language? Pin
PIEBALDconsult27-Dec-23 7:31
mvePIEBALDconsult27-Dec-23 7:31 
GeneralRe: What's a "real" programming language? Pin
Daniel Pfeffer27-Dec-23 7:44
professionalDaniel Pfeffer27-Dec-23 7:44 
GeneralRe: What's a "real" programming language? Pin
PIEBALDconsult27-Dec-23 8:10
mvePIEBALDconsult27-Dec-23 8:10 
GeneralRe: What's a "real" programming language? Pin
jschell28-Dec-23 5:15
jschell28-Dec-23 5:15 
GeneralRe: What's a "real" programming language? Pin
Daniel Pfeffer28-Dec-23 9:17
professionalDaniel Pfeffer28-Dec-23 9:17 
GeneralRe: What's a "real" programming language? Pin
trønderen28-Dec-23 6:52
trønderen28-Dec-23 6:52 
Daniel Pfeffer wrote:
There is no technical reason why one could not build hardware which has the Java bytecode as its machine language. Ditto for C#.
If you with C# mean to refer to dotNET Intermediate Language (IL), you are comparing two languages at approximately the same abstraction level, but very different in form.

Java bytecode, like lots of other P-code formats (strongly inspired by the P4 code of the original ETH Pascal compiler) are intended to be complete, ready for execution, with no loose ends (except for those defined by the language to be, e.g. late binding), similar to 'real' binary machine code - but for a virtual machine. The instructions (i.e. bytecodes) are executed one by one, independent of each other.

IL, on the other hand, has a lot of loose ends that must be tied up before execution. It contains lots of metadata that are not the machine instructions, but indicates how instructions should be generated. Although you in principle could try to 'interpret' the IL, you would have to construct fairly large runtime data structures to know how to generate the interpretation, similar to those structures built by the jitter to compile the IL to machine code. So you are really doing the full compilation, except that you are sending binary instructions to the execution unit rather than to the executable image.

The line between compilaton (followed by execution) and interpretation is fuzzy.

If you with C# refer to direct source code interpretation, you have a huge task to solve. Here, you would have to build a lot more complex runtime data structures to support the interpreter. Building these would be going a long way to making a full parse tree of the source code, and then you have done a significant part of the compilation job.

Compilers are so fast nowadays that I see no practical advantages in interpreting program code.

For building dedicated hardware:

USCD Pascal, one of the better known Pascal interpreters for PCs, used the P4 bytecode. It also ran on the PDP-11, such as the single-chip LSI-11. For this was written microcode to run P4 directly (rather than PDP-11 instruction set). It turned out to be significantly slower than running the PDP-11 software interpreter.

There are lots of similar stories of hardware implementations not living up to expectations. Intel's object oriented CPU, the 432, was simulated on an 8086. The first 432 implementation turned out to be slower than the simulator.

Yet another example: I worked on a 'supermini' (i.e. VAX class) machine that provided instructions for trigonometric functions. The Fortran compiler/libraries didn't use them; they were too slow. Calculating the functions the traditional way turned out to be faster. I talked to the designers of the CPU, asking why the instructions couldn't do it the same way as the libraries. They just mumbled a lot about having to be prepared for interrupts in the middle of the instruction. But the library sequence of instructions can be interrupted midway, right? Well, that is a different situation ... In other words, I never got a decent answer.
Religious freedom is the freedom to say that two plus two make five.

GeneralRe: What's a "real" programming language? Pin
Daniel Pfeffer28-Dec-23 9:15
professionalDaniel Pfeffer28-Dec-23 9:15 
GeneralRe: What's a "real" programming language? Pin
jschell29-Dec-23 6:17
jschell29-Dec-23 6:17 
GeneralRe: What's a "real" programming language? Pin
MSBassSinger28-Dec-23 4:21
professionalMSBassSinger28-Dec-23 4:21 
GeneralRe: What's a "real" programming language? Pin
jschell28-Dec-23 5:16
jschell28-Dec-23 5:16 
GeneralRe: What's a "real" programming language? Pin
jschell28-Dec-23 5:14
jschell28-Dec-23 5:14 
GeneralRe: What's a "real" programming language? Pin
trønderen27-Dec-23 8:14
trønderen27-Dec-23 8:14 
JokeRe: What's a "real" programming language? Pin
trønderen27-Dec-23 6:59
trønderen27-Dec-23 6:59 
JokeRe: What's a "real" programming language? Pin
honey the codewitch27-Dec-23 7:00
mvahoney the codewitch27-Dec-23 7:00 
GeneralRe: What's a "real" programming language? Pin
trønderen28-Dec-23 6:54
trønderen28-Dec-23 6:54 
GeneralRe: What's a "real" programming language? Pin
PIEBALDconsult27-Dec-23 8:10
mvePIEBALDconsult27-Dec-23 8:10 
GeneralRe: What's a "real" programming language? Pin
jmaida27-Dec-23 16:22
jmaida27-Dec-23 16:22 
GeneralRe: What's a "real" programming language? Pin
honey the codewitch28-Dec-23 4:04
mvahoney the codewitch28-Dec-23 4:04 
GeneralRe: What's a "real" programming language? Pin
snorkie27-Dec-23 8:18
professionalsnorkie27-Dec-23 8:18 
GeneralRe: What's a "real" programming language? Pin
honey the codewitch27-Dec-23 9:44
mvahoney the codewitch27-Dec-23 9:44 
GeneralRe: What's a "real" programming language? Pin
MSBassSinger28-Dec-23 4:01
professionalMSBassSinger28-Dec-23 4:01 
GeneralRe: What's a "real" programming language? Pin
honey the codewitch28-Dec-23 4:02
mvahoney the codewitch28-Dec-23 4:02 
GeneralRe: What's a "real" programming language? Pin
MSBassSinger28-Dec-23 4:31
professionalMSBassSinger28-Dec-23 4:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.