Live data from Hacker News

HolyJit: A New Hope

blog.mozilla.org

161–170 of 219 posts

Re: HolyJit: A New Hope

#161

Earlier quoted context omitted.

I think you must’ve taken my comment too seriously... I agree that Firefoxs success does not depend on the meaning behind the name holyjit lol. It was just a joke. The main point was that if they came up with this name without the intention of punning holy shit, I have low confidence in their abilities to succeed in general and with Firefox in particular. But also don’t take this too seriously.

Hopefully you can refrain from such "jokes" in the future. Look how little value this chain and your attempts to explain the joke provide the discussion.

Very frustrating/heartless reply you’ve given me. I’ve really started to lean in the side of “toxic communities (like this one) are bad” lately. Your behavior is awful. You would not say this to me in real life.

Here’s an alternative perspective; one person (or even many) not understanding a joke is irrelevant, and probably their fault. I am blameless.

The low value I generated is also irrelevant, I don’t exist or speak only to generate value.

Your attitude is rude, and toxic, and this bad behavior, and you should not repeat it.

Re: HolyJit: A New Hope

#162
post #55

Earlier quoted context omitted.

Me too. I wonder why they don't mention it.

Because it is obscure enough (outside HN) that they might even not have heard of it?

He hadn't. I just explained the Terry/HolyC thing to nbp (the author) this evening over coffee. He had never heard of it before.

Re: HolyJit: A New Hope

#163
post #53

"This means more time to implement JavaScript features" - yes, because JavaScript isn't getting enough features fast enough :-p Jokes aside, I love this kind of work from the Mozilla team. This and the bits going into Quantum are really amazing pieces of software engineering in my opinion.

I'm often overwhelmed by the size of the JavaScript language; it's a big language (and I'm coming from mostly working in Perl which is also a very big language...but it is dwarfed by modern JS in terms of TIMTOWTDI and in terms of core language features). But, every time I learn about a new feature, I can't fault them for adding it. It's usually a clear improvement in terms of readability and capability. And, because it's such a widely used language there tends to be a lot of input before new features are added. They are rarely half-baked once they reach the standard.

So, I agree it's overwhelming; books about JavaScript from two years ago are already out of date on a lot of fronts. But, it's also resulted in a really powerful and concise language.

Re: HolyJit: A New Hope

#164

For those wondering, it's a specializer, applied to an interpreter, to specialize the interpreter into a jit. This is a pretty well explored technique, it's rarely done these days because historically, people could not get good enough performance. (I am not trying to knock them, just put it in context) For more context on how you'd do something like this, read this: https://en.wikipedia.org/wiki/Partial_evaluation#Fu…

It also doesn't help that they're specializing an interpreter generated by a compiler. General-purpose compilers generate pretty bad code for interpreters. If the interpreter was written by hand and had some associated metadata, I think there would be a slightly higher chance of success here.

Are they using the generated IR, or using the AST of the interpreter code? The latter would probably be more amenable to JITification.

Re: HolyJit: A New Hope

#165

For those wondering, it's a specializer, applied to an interpreter, to specialize the interpreter into a jit. This is a pretty well explored technique, it's rarely done these days because historically, people could not get good enough performance. (I am not trying to knock them, just put it in context) For more context on how you'd do something like this, read this: https://en.wikipedia.org/wiki/Partial_evaluation#Fu…

The state of the art in jit compilation has advanced quite a bit since then, and another difference between the days of old and new is that this is being targeted at runtime code generation, which naturally trades off throughput of generated code for speed-of-generation. Especially for web pages, speed-of-generation, and the stability of the resulting code under polymorphism (so that jitcode with type assumptions doe…

"The state of the art in jit compilation has advanced quite a bit since then"

Since when? Since the 70's? Sure.

But since the 90's, not really in terms of techniques, only in terms of engineering and feasibility of advanced techniques. It's not that there is no research, mind you, but it's definitely more engineering than research. That also doesn't make it any less cool, exciting, etc.

"another difference between the days of old and new is that this is being targeted at runtime code generation, which naturally trades off throughput of generated code for speed-of-generation."

This actually was true then too, FWIW.

"These issues, as well as developer velocity in translating VM features into optimized VM features, figure more prominently in our problem set than I would expect it historically did."

While i'm not sure how much it matters, i guess i'd just point out these are not different concerns than history had

:)

I certainly hope you succeed, FWIW.

Re: HolyJit: A New Hope

#166
This is amazing! Write a regular old interpreter in a fully featured language, then just wrap it in a macro and poof you magically have a jit that will compile and execute your interpreted code on the fly.

Seriously. Look at the example for brainfuck [0], it's less than 70 lines of completely normal interpreter loop, including a one-line macro on the top. What the heck.

[0]: https://github.com/nbp/holyjit/blob/master/examples/brainfuc...

Re: HolyJit: A New Hope

#167
post #164

Earlier quoted context omitted.

It also doesn't help that they're specializing an interpreter generated by a compiler. General-purpose compilers generate pretty bad code for interpreters. If the interpreter was written by hand and had some associated metadata, I think there would be a slightly higher chance of success here.

Are they using the generated IR, or using the AST of the interpreter code? The latter would probably be more amenable to JITification.

Rust has several layers of IR: AST -> HIR -> MIR -> LLVM IR

This operates at the MIR layer. You can sort of think of MIR as "core Rust", in that it's the final, desugared form of everything.

This is why the non-lexical lifetime stuff has taken a while; the precursor to that is "port the borrow checker to MIR". MIR/HIR are also fairly new; using MIR is only a year old.

Re: HolyJit: A New Hope

#168

This is amazing! Write a regular old interpreter in a fully featured language, then just wrap it in a macro and poof you magically have a jit that will compile and execute your interpreted code on the fly. Seriously. Look at the example for brainfuck [0], it's less than 70 lines of completely normal interpreter loop, including a one-line macro on the top. What the heck. [0]: https://github.com/nbp/holyjit/blob/master…

The BF example was pretty cool and was sweet to see in action. That said, the language is extremely simple, and the real meat of the problem with most dynamic languages is not in the compilation per se, but the runtime type model and specializing code on the basis of type-input fed from that model.

I think a simple next step is to take a small toy language (there's a small rust scheme implementation written by another team member that might serve as a good candidate, if extended with js-style prototype-based objects), and prove this out for an actual type-driven specialization.

But yeah, the possibilities are certainly exciting.

Re: HolyJit: A New Hope

#169

Earlier quoted context omitted.

doesnt rustc rely on LLVM to generate its assembly. i watch the webrender repo and there have been several issues about poor codegen that LLVM could not properly handle. some were also related to absent optimizations at the MIR level. also would that mean that the asm snippets could change as llvm changes and possibly cause security bugs if not carefully hand-audited/tweaked anyhow?

Rustc does, but it doesn't appear to me that holyjit does, that is https://github.com/nbp/holyjit/blob/master/lib/src/compile.r... and https://github.com/nbp/holyjit/blob/master/lib/src/lib.rs#L1... Basically, it seems (and I haven't fully digested the code yet) that it uses https://crates.io/crates/dynasmrt for codegen.

Looks like dynasmrt was written for use in holyjit.

Re: HolyJit: A New Hope

#170
post #72

Earlier quoted context omitted.

I don't know, I'm a fan of the name to be honest, I wouldn't change it just because of the possibility of accidental association.

What about just avoiding needless offence to people who happen to regard the 'holy' morpheme as indicative of ... well ... something holy and not to be trifled with. I don't have religion, but given an essentially infinite number of alternatives to this not-very-funny one, why do this? People also have a right to be idiots in other ways, such as poking hornets' nests because it's funny.

This is a good point, despite the downvotes. (Although, on the subject of avoiding offensive terminology, I'd perhaps have avoided the "people also have a right to be idiots" part).

I've recently been reading Ogilvy on Advertising[1] by David Ogilvy, one of the most successful 20th-century figures in the industry, and while it's a bit dated (it was written 30 years ago) and, obviously, the subject matter is advertising, it's filled with excellent advice that's just as useful in all professional and personal contexts.

One aside that jumped out at me was "While we are on the subject of taste, I deplore the current fashion of using clergymen, monks and angels as comic figures in advertising. It may amuse you, but it shocks a lot of people."

I had honestly never really thought of it that way, but it's true. Religious people (that is, most people) find it hurtful and disturbing when you mock their religious faith. That might not be your intent, but it's kind of like 10 or 20 years ago when people used to explain that "by f-- I don't mean gay, just stupid." Just because you don't think or don't know what you're saying is hurtful does not mean that others aren't hurt by it.[2]

If Mozilla had used terminology in their software that was offensive to women, or gay people, or non-Western religions, I'm sure they would alter it, and rightly so. If they called a copy-on-write library HolyCOW, and Hindus said they were offended by this name because it mocks their religion, I'm sure Mozilla would, rightly, change it. And they probably know enough not to use such a name in the first place.

Of course, "holy" is not a specifically-Christian term, but a concept shared by all religions, Western and non-Western alike. A devout Catholic, Muslim, Buddhist or Jew is equally likely to feel hurt and excluded when they see you comparing their beliefs to shit.[3]

As for the other half of the name, the profanity ship has sailed in the broader culture and especially hacker culture, but it's also true that many people don't feel the same way, and nearly all of these people are deeply religious. I think it's reasonable to expect that religious people in the open-source community ought to accept that you or I will sometimes say "shit" for humor or emphasis, but it's also reasonable for them to expect we'll meet them halfway by not making them the butt of our jokes.

There are plenty of equally-funny "JIT" puns that don't come at anyone's expense; "GoodJIT," "JITHappens," "JIT'sTheBomb," and so on. I recommend using one of those.

I'm not a prude. I wouldn't scold you for saying "holy shit" (or "holy cow") in a conversation with me. I haven't scrubbed those phrases from my own casual vocabulary either. But, if someone told me I'd offended them, I would apologize and probably feel bad the rest of the day, just as I imagine almost any of us would. When you're participating in the open-source community, your audience is mainly strangers, with many different beliefs and backgrounds, whose first impression of you[4] is formed by what you've written on the internet. So it doesn't hurt to be a little more careful.

[1] https://smile.amazon.com/gp/product/039472903X/

[2] Hearing that speech a few hundred times, and maybe even giving it a couple, certainly didn't make high school easy for closeted me.

[3] Not that we shouldn't try our best to avoid needlessly causing offense whether it's to one group or many.

[4] And not only you, but the organizations, projects and communities you are involved with.

Post reply on HN