News for hackers. Stuff that matters.
Re:Firefox’s new streaming and tiering compiler by rcthompson on Wednesday January 17, 2018 @12:45PM (#16169999)
Is it actually a JIT? It's just compiling everything unconditionally. I guess the fact that the second tier replaces previously compiled functions with more optimized versions makes it a JIT? Or does the definition of JIT require recompiling in response to information about which code would benefit most?
Re:Firefox’s new streaming and tiering compiler by MaxBarraclough on Wednesday January 17, 2018 @05:07PM (#16172479)
> Is it actually a JIT? It's just compiling everything unconditionally.

Still counts as JIT in my book, but you're right that it's a bit subtle.

Unix-style configure/build/install isn't considered JIT.

Installing a .Net application is pretty similar, but we don't consider it JIT.

In the usual .Net model, what's distributed is IR rather than source-code. Compilation to native code happens at install time. The build-and-install process is less explicit than the Unix way, and it's less error-prone (fewer dependency issues and issues with the compiler not liking your source code).

Really it's a very similar model to the Unix one, but we call one JIT and not the other.

Oracle Java, of course, only ever compiles to native code at runtime, and never caches native code. 'Proper' JIT. (This may be set to change in the near future though.)

Interestingly, .Net seems to be moving in the direction of full static compilation, or they wouldn't be asking devs to rebuild UWP apps to incorporate framework fixes - https://aka.ms/sqfj4h/

Re:Firefox’s new streaming and tiering compiler by caf on Wednesday January 17, 2018 @10:05PM (#16174329)
It might be fun to make a source-based distribution where every binary in /usr/bin started off as a link to a script that built and installed the requested executable (over the top of the link), before executing it.
Re:Firefox’s new streaming and tiering compiler by MaxBarraclough on Thursday January 18, 2018 @05:17AM (#16175989)
Source-based distros essentially do that, they just cache the binaries.

Various research OSs are JIT-based, of course. It looks like JX (a Java operating system) caches its native code, so it's not 'pure JIT' https://github.com/mczero80/jx/blob/5fbeae79/libs/compiler_e...

It looks like Cosmos (a C# operating system) does the same https://en.wikipedia.org/wiki/IL2CPU

Re:Firefox’s new streaming and tiering compiler by uep on Wednesday January 17, 2018 @11:28PM (#16174708)
Or how about a fuser filesystem on Linux to do the same? That sounds like an interesting idea. Just don't make the mistake of accidentally typing some obscenely large binary like firefox, chrome, or clang...

I think it would need to be integrated into the package management system pretty tightly (or have one of its own) to get all of the shared library dependencies.

Re:Firefox’s new streaming and tiering compiler by _jal on Wednesday January 17, 2018 @10:19PM (#16174394)
Wouldn't be difficult to modify FreeBSD to do that. /usr/ports is just a little more than one indirection away.
Re:Firefox’s new streaming and tiering compiler by chrisseaton on Wednesday January 17, 2018 @01:31PM (#16170418)
Do you think for something to be a JIT it must only compile code immediately before it's used?

In that case the only real JIT I know of is basic-block-versioning. I think almost all JITs will compile branches or methods to some extent before they are actually needed.

Yours is probably not a reasonable definition therefore. I think a JIT is just a compiler that can compile as the program is running.

Re:Firefox’s new streaming and tiering compiler by rcthompson on Wednesday January 17, 2018 @02:54PM (#16171184)
> Do you think for something to be a JIT it must only compile code immediately before it's used?

I mean, that's more or less what the name "just-in-time compiler" implies. I'm aware that the name is not necessarily a precise definition, but I'm not sure how far the definition stretches. Does JIT have a precise agreed-upon definition, or is it somewhat more vaguely defined?

Re:Firefox’s new streaming and tiering compiler by chrisseaton on Wednesday January 17, 2018 @02:58PM (#16171216)
No these terms never have precise meanings, and trying to debate them too much doesn't achieve much. But if your definition doesn't actually work for any examples of the thing you're defining at all except one then it's probably wrong.
Re:Firefox’s new streaming and tiering compiler by rcthompson on Wednesday January 17, 2018 @03:06PM (#16171293)
Ok, fair enough. I was worried that there was some precise definition I had missed, but if that's not the case, I agree there's no point in debating it.
Re:Firefox’s new streaming and tiering compiler by emn13 on Wednesday January 17, 2018 @04:42PM (#16172202)
Well, there's at least one definition that's pretty noncontroversial, if not terribly satisfying or precise: it's not a JIT if you compile well in advance of any indication the program needs to be run.

Whether that lazy-compilation strategy is fine-grained or not isn't clearcut, I believe. I think if you distribute a C program with a bash bootstrapper calling plain old gcc to compile and run the C code only when needed, even gcc might be considered a (coarse-grained, rather rudimentary) JIT in that context.

Re:Firefox’s new streaming and tiering compiler by kybernetikos on Wednesday January 17, 2018 @05:24PM (#16172605)
Re:Firefox’s new streaming and tiering compiler by didibus on Thursday January 18, 2018 @01:03AM (#16175052)
To me it's a JIT if the compiler is needed to run the code.

If it means compile on start, it still requires the compiler to be used at load time.

Non JIT would mean you can distribute the code without the compiler. If you can't do that, its JITTED or interpreted, if instead of requiring a compiler to be present you require an interpreter.

Re:Firefox’s new streaming and tiering compiler by MaxBarraclough on Thursday January 18, 2018 @10:11AM (#16177603)
I like this definition.