Live data from Hacker News

crustc: entirety of `rustc`, translated to C

github.com

41–50 of 99 posts

Re: crustc: entirety of `rustc`, translated to C

#41
post #26
post #3

> I put my left hand in a blender. The blender won. (Still have all my fingers, just some stitches). I will not elaborate further. What a shame. I would've read an article about this.

I mean I get confused every time I use blender too but not to the point of losing fingers...

[deleted]

Re: crustc: entirety of `rustc`, translated to C

#43

Wait, I thought LLVM had a C backend which could be used for the purpose of transpiling Rust to C? Turns out not for a long time, but now maybe again: https://discourse.llvm.org/t/re-ann-llvm-c-backend-still-abl...

This approach is harder than you might imagine. LLVM can do a lot of things that don't map to C language constructs. You cannot generally roundtrip arbitrary LLVM IR through some C representation. You can emulate most things, but you won't necessarily get the same LLVM IR in the other end.

Re: crustc: entirety of `rustc`, translated to C

#45
post #40
post #37

The most interesting part of this to me is not “Rust to C” by itself, but the fact that it widens the pool of people who can help debug portability problems. There are relatively few people who understand Rust’s compiler internals, LLVM backends, and obscure target support deeply. But there are many engineers who understand C compilers, ABIs, linkers, makefiles, cross-compilation, old operating systems, and weird pla…

Guideline: > Don't post generated text or AI-edited text. HN is for conversation between humans.

I saw the reply, and it's not GenAI text. It's just that in the process of translation, people usually use machine translation or LLM translation. The problem is the vocabulary we East Asians use. I experience this issue too.

Probably because in East Asia, we tend to emphasize things with things like "xx" a lot.

Re: crustc: entirety of `rustc`, translated to C

#46
post #37

The most interesting part of this to me is not “Rust to C” by itself, but the fact that it widens the pool of people who can help debug portability problems. There are relatively few people who understand Rust’s compiler internals, LLVM backends, and obscure target support deeply. But there are many engineers who understand C compilers, ABIs, linkers, makefiles, cross-compilation, old operating systems, and weird pla…

I think you're probably using DeepL or some other AI translation. When you use DeepL, most sentences become flat and end up being judged as GenAI. I also used DeepL to communicate on Hacker News in the early days.I had a similar problem

Re: crustc: entirety of `rustc`, translated to C

#48
post #45
post #40

Earlier quoted context omitted.

Guideline: > Don't post generated text or AI-edited text. HN is for conversation between humans.

I saw the reply, and it's not GenAI text. It's just that in the process of translation, people usually use machine translation or LLM translation. The problem is the vocabulary we East Asians use. I experience this issue too. Probably because in East Asia, we tend to emphasize things with things like "xx" a lot.

I thought that may be the case. I shared the guideline so they'd know the likely reason all their comments die immediately.

However, their comments are consistently long, so it may be GenAI after all. Their last comment in particular...

https://news.ycombinator.com/item?id=48771339

Re: crustc: entirety of `rustc`, translated to C

#49
post #48
post #45

Earlier quoted context omitted.

I saw the reply, and it's not GenAI text. It's just that in the process of translation, people usually use machine translation or LLM translation. The problem is the vocabulary we East Asians use. I experience this issue too. Probably because in East Asia, we tend to emphasize things with things like "xx" a lot.

I thought that may be the case. I shared the guideline so they'd know the likely reason all their comments die immediately. However, their comments are consistently long, so it may be GenAI after all. Their last comment in particular... https://news.ycombinator.com/item?id=48771339

You may be right. It's a really difficult problem.

Re: crustc: entirety of `rustc`, translated to C

#50

Wait, I thought LLVM had a C backend which could be used for the purpose of transpiling Rust to C? Turns out not for a long time, but now maybe again: https://discourse.llvm.org/t/re-ann-llvm-c-backend-still-abl...

This approach is harder than you might imagine. LLVM can do a lot of things that don't map to C language constructs. You cannot generally roundtrip arbitrary LLVM IR through some C representation. You can emulate most things, but you won't necessarily get the same LLVM IR in the other end.

FWIW, Rust can also do a lot of things that do not easily map to C (at least standard C) constructs. For example:

- You can compare any two pointers, while in C they must point to the same allocation. This is possible to solve by converting to integers first.

- Signed integer overflow is UB in C, defined to wrap/panic in Rust.

- Type-based alias analysis is a big one, does not exist in Rust.

Post reply on HN