Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
rui314
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
61.
▲
by
rui314
6y ago
Are you asking if mold can link an executable file and its depending .so files into a single binary? If so, neither mold nor other major linkers can't do that.
62.
▲
by
rui314
6y ago
I chose mmap based on benchmarking. Writing a 2 GiB memory buffer to a file using write(2) was slower than directly constructing file contents to mmap'ed memory region. What is more interesting is the real bottleneck was not about mmap
63.
▲
by
rui314
6y ago
I got an impression that (so take it with a grain of salt), for incremental linking, Zig emits code that always uses PLT and GOT to access global functions and variables. Later, in order to replace functions or variables, Zig rewrites only
64.
▲
by
rui314
6y ago
mold uses only mmap for file IO. Not only input files but also an output file are mapped to memory using mmap(2).
65.
▲
by
rui314
6y ago
Author here. Haha, that's perhaps true. But at the same time, it seems like a tradition to give a silly name (e.g. "git") to a tool, and I actually like that name and the image to show that I'm not too serious. This is a
66.
▲
by
rui314
6y ago
Another classic example is Apache's memory pool. In Apache, you allocate memory from memory pools associated with the current request or connection. Memory pools are freed as a whole when a request or a connection is complete. mold
67.
▲
by
rui314
6y ago
I believe the Rust compiler can use an alternative linker, but I'm pretty sure that mold can't link Rust programs because it lacks lots of features. It's so experimental that I didn't even think about trying to link a Ru
68.
▲
by
rui314
6y ago
Author here. Good point. I ended up not using fork() without exec(), so that should be fine now, but here is my original plan to use fork(): I wanted to keep a linker process running as a daemon so that it doesn't read the same files o
69.
▲
by
rui314
6y ago
It is very likely that this symbol is added for baseball. It's not from the Japanese national standard but from a character set for Japanese TV sets called ARIB charset (1). According to Wikipedia (2), ↉ is actually used for baseball s
70.
▲
by
rui314
6y ago
It produces a .S file if `-S` flag was given. By default, it produces a .S file in a temporary and assemble it with `as` and write its output object file (an .o) file is produced as an output from the compiler.
71.
▲
by
rui314
6y ago
Nothing in particular has happened to me, but producing a high quality podcast episodes takes time, and I didn't have enough time for doing that.
72.
▲
by
rui314
6y ago
Yes, it is.
73.
▲
by
rui314
6y ago
Author here. No publishing date has been set yet. At least a half-written Japanese version of the book is available online for free ( https://www.sigbus.info/compilerbook ), and I'll probably translate this to English an
74.
▲
by
rui314
6y ago
Related discussions on Reddit: https://www.reddit.com/r/programming/comments/j35w0i/im_writ... https://www.reddit.com/r/C_Programming/comments/j2wjyp/chibi... https:
75.
▲
Show HN: Chibicc – A Small C Compiler
(github.com)
22 points
by
rui314
6y ago
|
3 comments
76.
▲
by
rui314
7y ago
I will translate it to English. Be wary of the machine translation -- using the neural network they learned how to write surprisingly natural sentences but that doesn't mean their translation is correct.
77.
▲
by
rui314
7y ago
I can disable gc, but reflog is really messy that I think no one can get any info from it. Even I can't, even though I know exactly what I did to the repo.
78.
▲
by
rui314
7y ago
I will translate it to English myself once it's complete.
79.
▲
by
rui314
7y ago
https://www.spinellis.gr/blog/20060626/cpp.algo.pdf was actually very useful. With that doc, I could implement a preprocessor without thinking too much about how it should work in details. In that sense, even afte
80.
▲
by
rui314
7y ago
I haven't considered that but I think that's hard to do for technical reasons. New commits are made on top of a clean history, so there's no single history of "raw" commits but they are intermingled.
81.
▲
by
rui314
7y ago
Author here. These days I'm writing a new C compiler ( https://github.com/rui314/chibicc ) from scratch again to write a book about compilers. Since I'll be using the new one as a reference implementation for a
82.
▲
by
rui314
7y ago
I'm writing a new one ( https://github.com/rui314/chibicc ) and also writing a book about how to write a C compiler using my new compiler as a reference implementation.
83.
▲
Minigo: A self-hosting Go compiler written from scratch
(github.com)
2 points
by
rui314
7y ago
|
0 comments
84.
▲
by
rui314
8y ago
Quote from 6.7.6.3.14 of the C++11 spec ( http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf ): > An identifier list declares only the identifiers of the parameters of the function. An empty
85.
▲
LLVM/lld linker and its "User-Agent" compatibility problem
(sigbus.info)
7 points
by
rui314
9y ago
|
0 comments
86.
▲
by
rui314
9y ago
> ./configure scripts generated by GNU autoconf determines whether a linker supports modern GNU-compatible features or not by searching for "GNU" in the --help message. To be compatible with the scripts, we decided to add
87.
▲
by
rui314
10y ago
It is on an SSD.
88.
▲
by
rui314
10y ago
LLD supports LTO natively. Unlike gold it doesn't need a plugin.
89.
▲
by
rui314
10y ago
Linkers have to copy large amount of data from object files to an output file, and that is inevitably slow. But LLD is not that bad if you pass -O0 (which disables string merging, which is computationally expensive). For example, LLD takes
90.
▲
by
rui314
10y ago
I shouldn't be bad, although I didn't actually measure its heap usage. Allocating memory and copying data is slow, so in LLD we mmap input object files and use the files directly as much as possible. This increases process virtual
More ›