Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There were JITs back then?!


JIT taken on the face value is really old concept and when viewed from the right angle it was the original way how programming languages worked (in the sense that you brough stack of punch cards with your program to datacenter, it got compiled, resulting code was ran and the object file was simply thrown away).

There is then some marketing hype around JIT from late 90's that is mostly only relevant for Java, which implies that "true JIT" does things like hot spot detection, deoptimalization traps and trace-based program flow reconstruction. This is mostly only done in production only by JVM implementations and fallback interpreters in hypervisors and is based on 80's research projects.

Somewhat notably in early 90's there was HP Dynamo, which was userspace PA-RISC emulator that ran on PA-RISC host by means of trace based JIT which was able to agressively optimize the code to the extent that it was actually faster than running natively in not insignificant number of (real world!) cases.


JIT in today's sense is at least 50 years old (translating regexes to machine code at runtime).


Damn!


What's so surprising? Jit-like techniques are older than I am, and I am not that young anymore :-)


I guess I don't know what time period this was referring to exactly but it sounded like it'd have been the mid-1990s... is that correct? Idk I just didn't expect JITs to have existed back then for some reason.


JITs were far more important in the 1980s when people regularly used grossly different computing systems.

Think of the popular 1980s computers: IBM PC (Intel 8086), Amiga (Motorola 68000), Commodore 64 (MOS Technology 6510), TRS-80 (Zilog Z80), Apple II (WDC 65C02), Acorn Electron (Synertek SY6502A).

The solution at that time was to use p-code ("portable" code), such as https://en.wikipedia.org/wiki/UCSD_Pascal

In fact, Pascal's popularity in the 1980s was probably due to the large number of p-code interpreters and Pascal -> p-code compilers.

--------------

Ironically, we still use "p-code", now called Bytecode, today. But we really don't move between systems aside from ARM and x86. GPU assembly is special, since its an entirely different model so you can't really port Java or Python to the GPU.

I guess LLVM shows that the high-level translation to LLVM-intermediate language just simplifies compiler optimization, to the point that its useful even if you're making code for a specific machine.

EDIT: I think the modern CPU have more or less settled on the same features. They're all Multithreaded, cache-coherent Modified 64-bit Harvard machines with out-of-order execution, super-scalar front-end with speculative branch prediction, with ~6 uop dispatch per clock tick and roughly 2 or 3 load/store units with 64kB L1 cache and 64-byte cache lines with a dedicated 128-bit SIMD unit

The above lines describes ARM Cortex-A72, Intel Skylake, AMD Zen, and POWER9... except Skylake has 256-bit SIMD units I guess, and Apple's A12 has 96kB L1 cache. Not very big differences anymore between CPUs.


"By 1978, there existed over 80 distinct Pascal implementations on hosts ranging from the Intel 8080 microprocessor to the Cray-1 supercomputer. But Pascal’s usefulness was not restricted to educational institutions; by 1980 all four major manufacturers of workstations (Three Rivers, HP, Apollo, Tektronix) were using Pascal for system programming. Besides being the major agent for the spread of Pascal implementations, the P-system was significant in demonstrating how comprehensible, portable, and reliable a compiler and system program could be made. Many programmers learned much from the P-system, including implementors who did not base their work on the P-system, and others who had never before been able to study a compiler in detail. The fact that a compiler was available in source form caused the P-system to become an influential vehicle of extracurricular education." (Niklaus Wirth)

http://pascal.hansotten.com/niklaus-wirth/recollections-abou...


MIPS is still used in cheaper routers.

Was there a JIT compiler for p-code back in the day? I thought all implementations were interpreters or AOT compilers.


Hmmm, the 1980s was before I was born. But according to records, Smalltalk-80 was implemented with a JIT machine.

See the paper: "Efficient Implementation of the Smalltalk-80 System", which suggests that code was generated on the fly.


Oh, there were definitely JITs back there. I meant the Pascal p-code specifically. UCSD Pascal, at least, was an interpreter.


Most of the work over the past decade on dynamic language JITs (especially JS) really just builds on top of the work on the Self JIT in the mid-80s. JITs themselves are older still.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: