4 ms·
> So, if hello world is not trivial Note that the nontrivial C program I showed above was not "hello world". Emitting output is yet more complicated still. >
by wyldfire 2y ago
> So, if hello world is not trivial
Note that the nontrivial C program I showed above was not "hello world". Emitting output is yet more complicated still.
> you can easily generate e.g web assembly from your own lang input without linker
IIRC some things that generate wasm generate object files (e.g. C translation units). Those wasm objects require a linker to resolve symbol references to create the executable.
> it will run fine
...on a wasm virtual machine. IIRC Java doesn't have anything like a traditional linker either.
> Aint the same viable for x86?
I mean, you can do anything you want inventing a new compiler that does much more than traditional compilers. But consider perhaps that there's a lot of value in the status quo that you might appreciate more if you were more familiar with the design of a toolchain.
It's not that linkers are an absolute drop-dead necessity, it's that having one allows you to have distinct assembler and compiler functions that are much simpler to design by focusing on one kind of transformation.