News for hackers. Stuff that matters.
Re:Cinder: Meta's internal performance-oriented production v... by staticassertion on Thursday September 22, 2022 @04:45AM (#32936302)
I'd be interested in hearing from others, but I wonder what differences there are for optimizing JS vs Python. A few things come to mind:

1. Python has a ton of C code in its libraries/stdlib, JS did not have that for the vast majority of its usage (browser). Optimizing across the FFI boundary seems unlikely to be a reasonable goal and may complicate optimization opportunity. Let's say you want to do some sort of optimization pass to make sure that `str.append` is not getting overridden - how are you going to handle native code?

2. Python is obscenely dynamic. Runtime generation of classes is not uncommon at all - for example, `@dataclass(slots=True)` creates an entirely new class.

You can overwrite methods, functions, there's heavy use of globals in libraries, no such thing as private implementations, hooks into everything, even importing code has side effects so you can't reorder or lazily import automatically, even reordering imports is unsafe in Python.

It seems really hard to optimize Python at all, and I wonder if we could ever reasonably expect to see a "V8-like" runtime, even assuming that there's funding, which I also doubt. Unless you're willing to break the language I just don't see a Python runtime overcoming these issues. Or introduce something like 'strict' where these things aren't possible.

Re:Cinder: Meta's internal performance-oriented production v... by pjmlp on Thursday September 22, 2022 @07:00AM (#32937217)
It isn't more dynamic than either Smalltalk or SELF, whose JIT research ended up on the JVM and JavaScript.

A a become: b message completely changes all instances of a to b, across the whole image, including code currently being executed.

Re:Cinder: Meta's internal performance-oriented production v... by lioeters on Thursday September 22, 2022 @10:13AM (#32939021)
> Smalltalk or SELF, whose JIT research ended up on the JVM and JavaScript

That makes me curious - would you have a link or hint where I could learn more on this topic?

Re:Cinder: Meta's internal performance-oriented production v... by pjmlp on Thursday September 22, 2022 @10:18AM (#32939099)
Re:Cinder: Meta's internal performance-oriented production v... by lioeters on Thursday September 22, 2022 @12:35PM (#32941307)
Good stuff! Much appreciated.