Live data from Hacker News

What the hell is a target triple?

mcyoung.xyz

51–60 of 139 posts

Re: What the hell is a target triple?

#51

Offtopic, but I'm distracted by the opening example: > After all, you don’t want to be building your iPhone app on literal iPhone hardware. iPhones are impressively powerful, but you wouldn't know it from the software lockdown that Apple holds on it. Example: https://www.tomsguide.com/phones/iphones/iphone-16-is-actual... There's a reason people were clamoring for Apple to make ARM laptops/desktops for years before A…

[deleted]

Re: What the hell is a target triple?

#54
post #33

I like the code editor style preview on the right. Enough to forgive the slightly clunky scroll.

It looks nice, but I find the choppy scrolling (on an M1 MBP, no less!) to be distracting.

It also doesn't really tell me anything about the content, except where I'm going to see tables or code blocks, so I'm not sure what the benefit is.

Given the really janky scrolling, I'd like to have a way to hide it.

Re: What the hell is a target triple?

#55
post #38

This article should be ignored, since it disregards the canonical origin of target triples (and the fact that it's linked to `configure`): https://git.savannah.gnu.org/cgit/config.git/tree/ The `testsuite/` directory contains some data files with a fairly extensive list of known targets. The vendor field should be considered fully extensible, and new combinations of know machine/kernel/libc shouldn't be considered in…

This article is a very LLVM-centric view, and it does ignore the GNU idea of a target triple, which is essentially $(uname -a)-vendor-$(uname -s), with vendor determined (so far as I can tell) entirely from uname -s, the system name undergoing some amount of butchering, and version numbers sometimes being included and sometimes not, and Linux getting a LIBC tacked on.

But that doesn't mean the article should be ignored in its entirety. LLVM's target triple parsing is more relevant for several projects (especially given that the GNU target triple scheme doesn't include native Windows, which is one of the most common targets in practice!). Part of the problem is that for many people "what is a target triple" is actually a lead-in to the question "what are the valid targets?", and trying to read config.guess is not a good vehicle to discover the answer. config.guess isn't also a good way to find about target triples for systems that aren't designed to run general-purpose computing, like if you're trying to compile for a GPU architecture, or even a weird x86 context like UEFI.

Re: What the hell is a target triple?

#56
As a Go developer, I certainly find the complaints about the go conventions amusing. I guess if you have really invested so much into understanding all the details in the rest of this article you might be annoyed that it doesn't translate 1 to 1 to Go.

But for the rest of us, I'm so glad that I can just cross compile things in Go without thinking about it. The annoying thing with setting up cross compilation in GCC is not learning the naming conventions, it is getting the correct toolchains installed and wired up correctly in your build system. Go just ships that out of the box and it is so much more pleasant.

Its also one thing that is great about zig. Using Go+zig when I need to cross compile something that includes cgo in it is so much better than trying to get GCC toolchains setup properly.

Re: What the hell is a target triple?

#58

> Go originally wanted to not have to link any system libraries, something that does not actually work It does work on Linux, the only kernel that promises a stable binary interface to user space. https://www.matheusmoreira.com/articles/linux-system-calls

Does it really tho? I've had address resolution break more than once in go programs.

Re: What the hell is a target triple?

#59

Why does this person have such negative views of GCC and positive bias towards LLVM?

I have intense respect for the history of gcc, but everything about using it screams that it's stuck in the past. LLVM has a lot of problems, but it feels significantly more modern. I do wish we had a "new LLVM" doing to LLVM what it did to gcc. Just because it's better doesn't mean it's perfect. Basically, you can respect history while also being honest about the current state of things. But also, doing so requires…

Honestly, I love that both exist with their respective world views.

Re: What the hell is a target triple?

#60

Earlier quoted context omitted.

I have intense respect for the history of gcc, but everything about using it screams that it's stuck in the past. LLVM has a lot of problems, but it feels significantly more modern. I do wish we had a "new LLVM" doing to LLVM what it did to gcc. Just because it's better doesn't mean it's perfect. Basically, you can respect history while also being honest about the current state of things. But also, doing so requires…

Honestly, I love that both exist with their respective world views.

I for sure don't want to suggest that anyone who loves gcc shouldn't be working on what they love. More compilers are a good thing, generally. Just trying to say why I have a preference.
Post reply on HN