3 ms·
> Sounds like it has the equivalent of a few make rules written for you No. It sounds like the `go` tool is aware of how to compile different pieces of code fo
by burntsushi 14y ago
> Sounds like it has the equivalent of a few make rules written for you
No. It sounds like the `go` tool is aware of how to compile different pieces of code for different architectures.
> but you could do exactly the same thing in C - and you can also inline assembly in your C source file.
Why does this make C easier? Does C automatically choose the correct target architecture for every piece of Assembly you write?
- lmm 14y ago>Why does this make C easier? It gives you more options. It makes it more practical to interleave C and assembly at a very granular level, whereas it sounds like you can only do it at the function level or coarser in go. >Does C automatically choose the correct target architecture for every piece of Assembly you write? No. I won't deny that go has a good build system, but I'm more interested in the language.
- azakai 14y ago> Why does this make C easier? Inlining some assembly where you need it - interacting with C variables, etc. - is definitely the most convenient thing. Of course, if you don't want that, you can just put the assembly code in a separate function, also very easy to do with C.