23 ms·
HolyJit: A New Hope
- deleted 9y ago[deleted]
- immutable_ai 9y agoIs this basically the same transition as V8 did with crankshaft to ignition+turbofan?
- chrisseaton 9y agoI think that was the exact opposite - they generated an interpreter from their JIT. This generates a JIT from their interpreter, like PyPy and Truffle do.
- _old_dude_ 9y agoIt seems to be to generate JIT snippets from the Rust compiler, not an interpreter.
- Sean1708 9y agoAs I understand it you write an interpreter in Rust then you generate a JIT compiler from that interpreter.
- lettergram 9y agoFirst thought was: "Is this another Terry Davis language/framework?"[1] No, no it is not. I would suggest changing the name from HolyJit to anything else. [1] https://en.m.wikipedia.org/wiki/TempleOS https://en.m.wikipedia.org/wiki/TempleOS
- bitwalker 9y agoI 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.
- DamonHD 9y agoWhat 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.
- pcunite 9y agoExactly, the name is not funny at all. Is the author still 15 years old?
- DamonHD 9y agoInterestingly my comment above is still being voted down! I find it a bit sad that avoiding this sort of needless annoyance is apparently a minority sport. Maybe that's why as a start-up, though I have very much done the 'disruptive' thing in the past when needed, I didn't do it to be 'disruptive' for the sake of it, and I always try to find a gentle path to what I want to achieve...
- smitherfield 9y agoThis 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/ 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.
- bananicorn 9y agoI'm wondering if Terry Davis is aware of the potential double-entendre (HolyJit->HolyShit)? which was probably the reason this name was chosen for the mozilla project. Holy jit, that JS is running quickly. (Is it fast in that case? Quickly doesn't feel right...)
- matt4077 9y agoWell, now that you know you were mistaken, it won't happen again, and the rest of us can safely enjoy this rather excellent pun.
- Traubenfuchs 9y agoI am absolutely convinced that the god of Terry A. Davis. does not approve of JIT compilation.
- yipopov 9y agoI haven't looked closely at the architecture, but isn't JIT compilation pretty much how Holy C works?
- Traubenfuchs 9y agoI was making an uninformed joke. You are right, it's right there in the wikipedia article: "Code can be compiled JIT.". Let me repeat: God approves of JIT compilation.
- thesmallestcat 9y agoBut it sounds like "holy shit" LOL. You know what else is funny? Farts!
- skocznymroczny 9y agoCan we just drop the JS VM and embed some nicer VM (JVM, DartVM) instead?
- sanxiyn 9y agoI agree this would be better, but backward compatibility constraint makes it impossible. WebAssembly is an attempt to add a nicer VM in addition to JS VM.
- steveklabnik 9y agoI thought one of the points of WebAssembly was to not create a second VM. https://developer.mozilla.org/en-US/docs/WebAssembly/Concepts https://developer.mozilla.org/en-US/docs/WebAssembly/Concept... > With the advent of WebAssembly appearing in browsers, the virtual machine that we talked about earlier will now load and run two types of code — JavaScript AND WebAssembly.
- gilrain 9y agoYes, once you convince everyone to drop the thing we have that works and implement the thing we don't have that doesn't work. In short: you complain as though it were an easy change to make.
- pjmlp 9y agoHe/she is right though, just wait when WebAssembly gets more mature. I bet all those plugins will be back.
- coldtea 9y agoWebAssembly has no good story for the DOM.
- moocowtruck 9y agoi feel like that's on purpose...we can engineer all these crazy things, but getting good DOM access? naw not possible
- bananicorn 9y agoI'm not sure as to what is fundamentally different about this JIT-compiler (except for the awesome name of course) Is it basically just a Rust rewrite which also tries to reduce the complexity of their current just-in-time compiler? Edit: By calling it "just" a Rust rewrite, I'm not implying that's a simple undertaking, even moreso considering the complexity of modern JS engines.
- minxomat 9y agoName reminds me of TempleOs's HolyC language...
- mabynogy 9y agoMe too. I wonder why they don't mention it.
- romanows 9y agos/J/Sh/
- coldtea 9y agoBecause it is obscure enough (outside HN) that they might even not have heard of it?
- deleted 9y ago[deleted]
- kannanvijayan 9y agoHe hadn't. I just explained the Terry/HolyC thing to nbp (the author) this evening over coffee. He had never heard of it before.
- flamedoge 9y agoInb4 HolyOS, HolyBrowser, HolyKernel
- 9y ago
- CryptoFascist 9y agonigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger
- imron 9y agoChecking other comments, it seems like this account has been hacked and used to post offensive comments.
- icebraining 9y agoThen the original owner should send an email to hn@ycombinator.com to get it back.
- imron 9y agoI guess the mods know about it already now and have removed the offending comments. The profile page could also do with some scrubbing however.
- CryptoFascist 9y agonigger nigger nigger nigger nigger niggernigger nigger nigger nigger nigger niggernigger nigger nigger nigger nigger niggernigger nigger nigger nigger nigger niggernigger nigger nigger nigger nigger niggernigger nigger nigger nigger nigger niggernigger nigger nigger nigger nigger niggernigger nigger nigger nigger nigger niggernigger nigger nigger nigger nigger nigger
- CryptoFascist 9y agostupid dumb oink oink oink
- CryptoFascist 9y agoha ha ha hahahahahahhahah ahha hah
- CryptoFascist 9y agohaxord hcked winning
- koolba 9y agoWhy does the Cargo.toml[1] file in the source repo for HolyJit have the word "brainfuck"[2] in it? Does that have some significance to Rust or Mozilla? Or is this a case of copy pasta? [1]: https://github.com/nbp/holyjit/blob/master/Cargo.toml https://github.com/nbp/holyjit/blob/master/Cargo.toml [2]: Permanent link to line: https://github.com/nbp/holyjit/blob/1f20eb41de2dae14179815c7d5ebb8780051e13c/Cargo.toml#L17 https://github.com/nbp/holyjit/blob/1f20eb41de2dae14179815c7...
- ewillbefull 9y agohttps://en.wikipedia.org/wiki/Brainfuck https://en.wikipedia.org/wiki/Brainfuck The HolyJit repo has a brainfuck jit example in the repository: https://github.com/nbp/holyjit/blob/master/examples/brainfuck.rs https://github.com/nbp/holyjit/blob/master/examples/brainfuc...
- deleted 9y ago[deleted]
- steveklabnik 9y agoBecause it has an example that JITs Brainfuck: https://github.com/nbp/holyjit/blob/master/examples/brainfuck.rs https://github.com/nbp/holyjit/blob/master/examples/brainfuc... (They actually don’t even need that line, as Cargo already infers this via convention)
- padenot 9y agoBecause the first example that uses holyjit is an implementation [1] of the brainfuck [0] language. [0]: https://en.wikipedia.org/wiki/Brainfuck https://en.wikipedia.org/wiki/Brainfuck [1]: https://github.com/nbp/holyjit/blob/master/examples/brainfuck.rs https://github.com/nbp/holyjit/blob/master/examples/brainfuc...
- bnjbvr 9y agoThere's a brainfuck [1] interpreter example in the examples/ directory, which I assume is the reason for this allegedly temporary name. [1] https://en.wikipedia.org/wiki/Brainfuck https://en.wikipedia.org/wiki/Brainfuck
- 9y ago
- nimish 9y agoSmells like Graal/Truffle
- bnjbvr 9y agoFor what it's worth, the name is obviously a pun and a small wink to the Graal VM [1]. Not sure there's any intention to reference TempleOS's HolyC. [1] https://github.com/graalvm/ https://github.com/graalvm/
- nerdponx 9y agoHate to be a downer but I don't get the pun at all.
- aardvark179 9y agoGraal is an archaic spelling of grail.
- steveklabnik 9y agohttps://en.wikipedia.org/wiki/Holy_Grail https://en.wikipedia.org/wiki/Holy_Grail , "Graal" is an archaic spelling of "Grail".
- glandium 9y agoFWIW, it's the current spelling in some languages (e.g. French).
- steveklabnik 9y agoAh interesting, thanks! I'll be more explicit about "in English" next time.
- ccozan 9y agoActually it is speculated that the the origin ist "Sang(re) Real" ( royal blood ) which metamorphosed into San Graal. Looking for it meant to search for the ( possible) lost blood line of Jesus, I think.
- evincarofautumn 9y ago
- jarym 9y ago"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.
- masklinn 9y ago> "This means more time to implement JavaScript features" - yes, because JavaScript isn't getting enough features fast enough :-p AFAIK Mozilla does not drive the evolution of ECMAScript (not on their own anyway), so it would be a way to provide new features faster, providing better feedback during phase 3 (and possibly even phase 2) and providing time to implement features they could not so far (e.g. ES6 TCO)
- tmzt 9y agoIf they did we might have something closer to AS3 with optional typing and had it years earlier than the ES6/7 route has taken us.
- SwellJoe 9y agoI'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.
- dannyw 9y agoWell, except WebAudio. That standard omits some essential low level audio primitives while featuring an incomplete scatter of high level APIs.
- bitL 9y agoSo Mozilla continues the tradition of terrible names in software engineering - HolySh*t is just wonderful. At least if they were as autistic as Terry and were inspired by HolyC...
- sctb 9y agoThis is not a civil comment by Hacker News' standards. Please don't post like this. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- readittwice 9y agoNo offense, but the blog post is seriously missing a better (or any?) explanation of what's the new JIT all about. At first I even thought my browser loaded only half the page...
- bzbarsky 9y agoIt does link to https://github.com/nbp/holyjit https://github.com/nbp/holyjit which explains pretty much everything there is to explain so far...
- jcadam 9y agoThat's all well and good, but github is blocked where I work.
- pirocks 9y agoIf you don't mind me asking, why is github blocked?
- deleted 9y ago[deleted]
- kayoone 9y agoin a lot of places (if you are not a developer) everything non-work related is blocked. It's stupid, but i've seen this often with friends.
- Koshkin 9y ago> everything non-work related is blocked. It's stupid Why is it stupid?
- wojonatior 9y agoBecause trying to enumerate everything that could possibly be relevant to your work probably misses some valuable and relevant things.
- jkabrg 9y agoHow is this different from Pypy, other than the fact that ones uses RPython and the other uses Rust?
- masklinn 9y agoHolyJIT seems to be similar to RPython rather than Pypy: RPython is both the restricted language and the tooling around it, Pypy is a Python interpreter implemented using RPython.
- ris 9y agoPyPy is a tracing JIT and mozilla abandoned their tracing JIT efforts (TraceMonkey) a few years ago.
- agounaris 9y agoI admire how mozilla is so passionate about what they develop but still, in 2017, firefox needs restart every couple of hours for performance reasons. I kinda of feel like they have the proof of concept working but its never good enough for the wider audience.
- swsieber 9y agoHave you tried the 57 beta?
- lucb1e 9y agoIn class there are at least 30 out of 40 people using Firefox on Ubuntu with no such issues. On my laptop I use Firefox on Debian with no such issues. Also previously on Windows XP, 7 or 8, both in virtual machines and on hardware, I never had such issues, but that's a while ago so not really applicable anymore. You might want to submit a bug with your specific hardware to see if anyone can identify the cause, because that's not normal.
- baby 9y agoDo they use tree style tabs though?
- icebraining 9y agoI do. Works fine.
- philjr 9y agoGet Quantum. Serious improvement
- baby 9y agoIn the mean time, the performance for Firefox' Tree Style Tabs plugin have gone downhill. I'd be interested to know more about new browsers that put tabs on the side by default.
- kodablah 9y agoOn a similar note, I have been watching this[0] project which provides an IR to target and optional optimizations. But I like the idea that the only difference between a JIT and an AOT compiler is optimization choice (assuming we don't include tracing as part of the JIT features). Also, this[1] blog series is a must-read for interested beginners. 0 - https://github.com/stoklund/cretonne/ https://github.com/stoklund/cretonne/ 1 - https://eli.thegreenplace.net/2017/adventures-in-jit-compilation-part-1-an-interpreter/ https://eli.thegreenplace.net/2017/adventures-in-jit-compila...
- nbpname 9y agoIt sounds more than likely that HolyJit will use Cretonne as a backend. For the moment it uses dynasm, just to get the prototype working, but I expect to change that in the upcoming months. (I am the author of HolyJit)
- MrZipf 9y ago36000 lines of handwritten assembler in v8? Not since the transition to ignition and turbofan... $ git clone https://github.com/v8/v8.git https://github.com/v8/v8.git $ cd v8 $ find . -name '*.S' There's still some macro assembler in the built-in's but it's emitted rather than being assembler.
- nbpname 9y agoFor both SpiderMonkey and v8, this is counting the number of calls to the MacroAssembler. SpiderMonkey commonly use the prefix "masm", while v8 uses the macro "__ " to alias the MacroAssembler. The MacroAssembler, is basically what is used to produce assembly code in both JavaScript engines.
- deleted 9y ago[deleted]
- nathcd 9y agoThis seems really cool! I know it's been mentioned before that there are no plans to rewrite SpiderMonkey in Rust, but this sort of feels like a tiny first step in that direction? Almost reminds me of early on in Servo's history: https://news.ycombinator.com/item?id=6268521 https://news.ycombinator.com/item?id=6268521 (Although I may just be projecting what I want to hear :) it's exciting hearing about new Rust projects, especially new stuff going into Firefox.)
- kibwen 9y agoYes, I think it's safe to compare this to the early days of Servo for now, in that one should not necessarily expect to see this in Firefox for the next decade, though the research and expertise gained from creating it might work its way in before then. Still exciting nonetheless!
- unkown-unknowns 9y agoWhen I first saw the name "HolyJit" On Reddit I thought it was going to be something new from the TempleOS guy.
- DannyBee 9y agoFor 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#Futamura_projections https://en.wikipedia.org/wiki/Partial_evaluation#Futamura_pr... and http://blog.sigfpe.com/2009/05/three-projections-of-doctor-futamura.html http://blog.sigfpe.com/2009/05/three-projections-of-doctor-f...
- stefano 9y agoIsn't this what pypy does? pypy does the specialization at runtime, maybe this does it at (interpreter) compile time?
- steveklabnik 9y agoGiven how HolyJIT is implemented (with compiler plugins etc), I believe that it does this work at compile time, yes. I haven't actually confirmed this though.
- nbpname 9y agoThe goal is to optimize the code both at compile-time and at run-time. We need to optimize it at compile time to prevent slow start-up, and we need to optimize it at run-time to benefit from profile guided optimizations.
- bjt 9y agoIt sounds very similar to what RPython and Pypy do. You can even use RPython to create a VM for a language besides Python. I read a good blog post from an author who had done that 5 years ago. http://tratt.net/laurie/blog/entries/fast_enough_vms_in_fast_enough_time.html http://tratt.net/laurie/blog/entries/fast_enough_vms_in_fast...
- kannanvijayan 9y ago
- pcunite 9y agoIt's fun to mock God ... until he judges you for it. Daniel 5
- XR0CSWV3h3kZWg 9y agoBy my understanding HolyJit:Rust::Rpython (toolkit):Rpython (language) Rpython being the language and toolkit that is used to create pypy.
- infogulch 9y agoThis 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/brainfuck.rs https://github.com/nbp/holyjit/blob/master/examples/brainfuc...
- kannanvijayan 9y agoThe 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.
- beached_whale 9y agoI was expecting TempleOS getting a new jit
- KGIII 9y agoI confess, I actually chuckled out loud. I haven't seen any of their posts for a while. I hope they are okay.
- beached_whale 9y agoI find it amazing what he has done. I did say new jit as HolyC is compiled on the fly and has some amazing features that no other system has(embedded images). Yeah there are some esoteric features, but that is the benefit of DIY.
- KGIII 9y agoYou have inspired me. I'll torrent his most recent ISO and spin it up in a VM over the weekend. I will give it an honest look and be objective. I should set a blog up before that.
- beached_whale 9y agoYou will need to ignore anything non-technical. He suffers from mental illness and says offensive things.
- KGIII 9y agoI was online in the 80s. I have an account on voat. I visit Slashdot. I should be ok. ;-)
- beached_whale 9y agoAh Slashdot. I was there when it was cool :) I do have a 5 digit id, so there is that. How is voat, like is the programming/tech comments worthy?
- benjismith 9y agoGotta say... this is pretty badass.
- explodingcamera 9y agoKinda reminds me of holyC ;)
- TomMarius 9y agoFor a moment I hoped this had something to do with HolyC
- TheSpecialist 9y agoWhat?! Does Terry finally decide to use Rust for his browser development?
- bradknowles 9y agoWhat is a jit? Why would you want one? Can it help you write in a jot? Can it help you write in a dot? Why do I feel like I’m trapped in The Land of Doctor Seuss?
- jrcii 9y agoWhatever Mozilla. I'll care what you have to say in 10 years when I eventually get over how badly you are screwing me over by disabling all of the extensions that I rely on on a daily basis.