Hacker Newsnew | past | comments | ask | show | jobs | submit | hayley-patton's commentslogin

> What I can imagine is a purpose-built CPU that would make the JIT's job a lot easier and faster than compiling for x86 or ARM. Such a machine wouldn't execute raw Java bytecode, rather, something a tiny bit more low-level.

This is approximately exactly what Azul Systems did, doing a bog-standard RISC with hardware GC barriers and transactional memory. Cliff Click gave an excellent talk on it [0] and makes your argument around 20:14.

[0] https://www.youtube.com/watch?v=5uljtqyBLxI


I imagine that's where the request for finer grained virtualization comes from


That's a linear traversal of the heap, not a trace. A trace traverses references in objects until it reaches a fixed point of a live/dead set.



In the early 1990s, HP had a product called “SoftPC” that was used to emulate x86 on PA-RISC. IIRC, however, this was an OEM product written externally. My recollection of how it worked was similar to what is described in the Dynamo paper. I’m wondering if HP bought the technology and whether Dynamo was a later iteration of it? Essentially, it was a tracing JIT. Regardless, all these ideas ended up morphing into Rosetta (versions 1 and 2), though as I understand it, Rosetta also uses a couple hardware hooks to speed up some cases that would be slow if just performed in software.


That wasn’t an HP product. It was written by Insignia Solutions and ran on multiple platforms.

I had it on my Mac LCII in 1992. It barely ran well enough to run older DOS IDEs for college. Later I bought an accelerator (40Mhz 68030) and it ran better.

https://en.wikipedia.org/wiki/SoftPC


IIRC, I had that on my Atari ST as well, and it very slowly booted Dos 3.3 and a few basic programs.. enough for me to use turbo-C or Watcom C to compile a basic .c program to display a .pcx file.


Right, Insignia. That was it. But it was a product that HP resold in some fashion.


Apple Arm CPUs have some special tricks to make x86 sogtware emulation faster.

https://dougallj.wordpress.com/2022/11/09/why-is-rosetta-2-f...


> but JavaScript totally missed the boat on efficient compile-ability, which is the most interesting thing about Self

That's making much use of hindsight though: the creators of Self didn't think it would run fast, until it did [0]. The HOPL paper on Self [1] spends many words recounting the challenge of making Self fast.

[0] This is arguably a stronger claim than what appears in HOPL; I think it's from a talk by Dave Ungar, I'd have to check.

[1] https://dl.acm.org/doi/10.1145/1238844.1238853


[0] is Self and Self: Whys and Wherefores <https://youtu.be/3ka4KY7TMTU?si=Js_oG3MneCxBtEql&t=2378>

> And at the time, we thought it was impossible to make this language run efficiently, because it did all these things that were more abstract than languages of the time ...


> "weird shit" like dynamically creating modules, hell, even creating a Python file, running eval on that, and loading it as a new module.

Expect that you don't, and deoptimise when you do: https://bibliography.selflanguage.org/_static/dynamic-deopti...

It's really not that impossible.


If you want vectors, use vectors, elisp has them too as primitives. (I don't mean to suggest you don't know that, but still, you can just use vectors.)


I was writing from the aspect of an Lisp implementer, so that means it is not how I can just use vectors but about how existing code represents a sequence, and it is part of the job of the runtime to make it as fast as possible.

From what I see from existing ELisp code (at least in the Emacs codebase), the idiomatic representation of sequences (fixed-size or not) is using cons lists. And it is not surprising: Emacs vectors are fixed-size and that makes it very inflexible and only suitable for a few things. This matters because, for example, if you want Emacs to compete with VSCode in performance, you eventually compares how idiomatic code performs. Note that how cons lists affect performance in real-world ELisp code remains unknown because it is yet to be benchmarked, but exposing the internals of idiomatic lists as conses does pose some challenges for an implementer aiming for further optimizations.


Emacs Lisp vectors being fixed seems like an easily fixable problem. More functions can be defined to do useful things with vectors including mutations. If it is important to keep the existing type produced by make-vector immutable, a separate mutable variant can be introduced. The mutating functions blow up if applied to the immutable type.


The LC-3 has pretty odd addressing modes - in particular, you can do a doubly indirect load through a PC-relative word in the middle. But you still have to generate subtraction from negation, and negation from NOT and ADD ,,#-1. (I suppose NOT d,s = XOR d,s,#-1 would be a better use of the limited instruction encoding space too.)


"We changed the name to OTP." "Three of the trendiest names we could think of. Open. Telecom. Platform."

https://www.youtube.com/watch?v=rRbY3TMUcgQ


Lisp machines didn't have hardware GC, though they had hardware support for read/write barriers.


Kind of. A lot of the GC support in the Symbolics 3600 architecture is on the Microcode level (current CPUs usually don't have such operations in Microcode). The word size of the CPU is 36bit. The CPU operations don't deal with the type and gc tags on the instruction level, this is done on the Microcode level. Things like "invisible pointers" are also dealt on the Microcode level.

Ephemeral GC, concentrates on garbage collecting objects in RAM: For example every memory page has a page tag, which marks it modified or not. The ephemeral GC uses this to scan only over changed pages in memory. The virtual memory subsystem keeps a table of swapped-out pages pointing to ephemeral pages. The EGC can then use this information...


> But do that in an interactive environment when the rug can be pulled out of any of the assumption the compiler made, and things get messy quite quickly.

https://bibliography.selflanguage.org/_static/dynamic-deopti...


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

Search: