Although PICs are way.

 
Larocco: Workistoofun, by far the simplest is to add another style tag

Ferretti: Unreal-engine? like that unreal?

Hofstra: So for starters you’d need to compile the javascript to a vm and then produce native machine code right?

Kardas: Schaetzle:I’m trying to write an extensio that will hide certain page elements by id or cl*** but I’m having trouble getting it to run before the page is shown to the user

Gabbett: Workistoofun, if you put it at the end of body you should be fine

Payenda: You can query things and I believe it’s still in the first frame

Bordwell: MinusFour: well, you’d need to compile JS to machine code, and emit instructions that let you get feedback from running that code, if you’re interested in optimising further

Mesdaq: But it is straight forward? from JS to native code?

Femia: There’s no vm in between?

Wolfram: Schaetzle:by putting a specific .css script in, the css file would have to be hard coded though, which makes it hard for the user to add their own ids/cl***es they want taken out through settings/options

Geagan: MinusFour: code generation is relatively straight forward. A baseline compiler shouldn’t be “too hard,” if you’re familiar with compiler theory.

Safdeye: Workistoofun, you can use style in place of a link to generate dynamic css

Farrare: Well i guess i rather read about that before trying anything

Frazier: My revelation of the week. SVG + Firefox + Retina Screen + OSX = Slow as hell :

Economus: MinusFour: this is, more or less, what a baseline compiler does: https://github.com/mermaid-language/mermaid/blob/master/src/language/generation/codegen.sjs#L354-L454. The difference is that you want to generate machine code here, rather than JS code. And you’ll probably have your IR in SSA form, rather than a high-level AST.

Genga: Workistoofun, btw, you can do that already with adblock plug

Kudej: Actually, I think this one is easier to understand: https://gist.github.com/robotlolita/7f79f2daff9efd685bfc, even though it’s Haskell

Malden: Schaetzle:i’m actually trying to figure out how adblock takes out all the ads before they show up on the page

Tradup: Https://adblockplus.org/source

Kosty: Except that instead of generating strings, you’ll be going to generate a bunch of binary data that you’ll put in memory and mark that portion of memory as executable

Tetteh: Schaetzle:I want to do something similar but to divs/elements with certain ids/cl***es

Nathoo: And then you just jump to that portion of memory, and let the processor do its thing

Dilello: Say i p**** a line like: function a { return true; }; the symbol must be somehow registered, but it’s not compiled before i call it, right?

Kontogianis: Welp, I better look at compiler theory before anything

Winner: Hagb4rd: you can choose to compile everything ahead of time, or compile things when they’re used. The latter will possibly give you pauses during execution, the former will give you a bigger latency before you start running

Duckhorn: It would eventually find errors before runtime. which could be nice

Bowhall: MinusFour: a good book on the topic is “Modern Compiler Implementation in ML”. They have versions in Java and C too, but those are weird.

Zufelt: I wanted to check out the Dragon book

Bally: Because they’re really just ML written in Java/C

Lalich: Http://www.amazon.com/Compilers-Principles-Techniques-Tools-2nd/dp/0321486811

Beadell: I’m heard that the dragon book is old. and it shows.

Bellin: Would that be a good place to just start grasping compiler theory?

Vandermay: Well i know asm for a different architecture

Bussey: MinusFour: I haven’t read that one, so I dunno. It does seem that the second edition touches JIT, though. Might want to ask around in #compilers for better recommendations

Beady: Just never got into x86

Kuizinas: Although PICs are way simpler i suppose