5 ms·
Mir: A lightweight JIT compiler project (2020)
- tedunangst 3y agoI like how the page rescrolls to the top as I approach the middle. Very efficient means to generate tons of content.
- low_tech_punk 3y agoI noticed that they use JavaScript to modify the hash string in the URL. Here is the probably root cause: There is an H2 heading between "Lightweight JIT compiler project goals" and "The current state of the MIR project". That h2 contains the Hoover Dams image and has an id generated from empty content because the content is just image: <h2 id="-h2"></h2>. When you scroll near that image, the javascript tries to update the url but that broken ID caused it to set the empty ID ("#"), thus jumping to top. You can verify this by open the table of contents bar and see an untitled section. Whatever CMS they are using, it didn't handle the empty H2 correctly. Few additional considerations: 1. The article author should never produce an H2 with only an image in it. 2. The image should have an `alt` label to be accessible. 3. CMS should use `alt` label or file name to generate the ID when the H2 has no other textual content.
- low_tech_punk 3y agoThe w3c spec says valid hash fragment must starts with [a-zA-Z], so "-h2" is considered invalid. Ref: https://www.w3.org/TR/xhtml1/#C_8 https://www.w3.org/TR/xhtml1/#C_8
- gavinray 3y agoSome threads with previous discussion: - https://news.ycombinator.com/item?id=22098399 https://news.ycombinator.com/item?id=22098399 - https://news.ycombinator.com/item?id=25300225 https://news.ycombinator.com/item?id=25300225
- samsquire 3y agoThanks for this. I started a basic toy JIT compiler for a language that looks similar to JavaScript. It is incomplete. (jitcompiler.c) https://github.com/samsquire/compiler https://github.com/samsquire/compiler With these kinds of projects there is a lot of work to be done and I feel it's difficult to get started reading a codebase for a JIT compiler or gcc or LLVM.
- Andrex 3y agoDon't know if it's worth pointing out, but Mir is Canonical's competitor to Wayland for Ubuntu's display server.
- thaliaarchi 3y agoMIR for Ruby is in no way related to Canonical Mir.
- Andrex 3y agoIt's just weird to me, "Mir" is a pretty unique name, and there's two softwares out there using it.
- deadbeeves 3y agoConsidering it was first the name of a space station, and before that a Russian word, it's not such a unique name.
- taskforcegemini 3y agoalso a german word
- Conscat 3y agoWait till you hear that Rust and Zig's compilers both have their own "MIR".
- thaliaarchi 3y agoAdditionally, LLVM has MIR (Machine IR), which is what Zig's also stands for. There's a lot of M-starting compiler intermediate representations. This Ruby MIR is Medium Internal Representation. Rust's is Mid-level IR. Similarly, there's MLIR, which is usually expanded to Multi-Level Intermediate Representation.
- paulddraper 3y ago
- jhgb 3y ago> Simplicity is usually achieved by dividing tasks into small, manageable subtasks. There is even an extreme nanopass compiler design used for studying compiler topics in education. ...and production compilers: https://andykeep.com/pubs/dissertation.pdf https://andykeep.com/pubs/dissertation.pdf Definitely Chez 9 is based on it -- not sure about Chez 8.
- xwowsersx 3y agoThis page is taking me back to the top when I scroll to the bottom. It's infuriating.
- karteum 3y ago> "The implementation should be simple too at less than 10K C lines, because I want wider adoption of this tool. Simple code is easier to learn and maintain. I'd like also to avoid any external dependencies for this project. At the end of the article, you can see the actual results I have now. (...) As for the generated code performance, I decided that it should be at least 70% of GCC -O2 performance. The implementation should be simple too at less than 10K C lines, because I want wider adoption of this tool. Simple code is easier to learn and maintain. (...) The biggest cons of the existing projects were their size, the fact that it would be hard for me to achieve my goals using them, and that I can not control the projects. Also, the smaller source size of the MIR project makes studying the code easier for other people and reduces the effort required to maintain it." I can understand the point for LLVM, but I don't fully understand why QBE (https://c9x.me/compile/doc/llvm.html https://c9x.me/compile/doc/llvm.html, which is part of his assessment) didn't fit in what he is looking for.
- lostmsu 3y agoDoes it work like Graal or is it more of a classic JIT?