Stream: general

Topic: use rustc as backend?

Keith Yeung (Apr 05 2019 at 22:39, on Zulip):

is it possible for me to write a lexer and parser, and then lower it to MIR, and have rustc start compiling it as if it was a rust program? I know miri can accomplish this, but it's interpreted.

centril (Apr 05 2019 at 22:40, on Zulip):

@Keith Yeung there's nothing preventing that afaik; however, everything in rustc's internals is ofc highly unstable.

Keith Yeung (Apr 05 2019 at 22:40, on Zulip):

ok, if so, is there a guide lying around that describes how one might be able to do so?

Keith Yeung (Apr 05 2019 at 22:41, on Zulip):

or if there's a source file in particular that i should look at?

centril (Apr 05 2019 at 22:42, on Zulip):

maybe has something; the rustc driver infrastructure is beyond my expertise, maybe @Zoxc can help

Zoxc (Apr 05 2019 at 22:44, on Zulip):

Using rustc as a backend sounds like a terrible idea =P

Keith Yeung (Apr 05 2019 at 22:48, on Zulip):

huh, perhaps i should be asking whether there are good crates out there that provides good rust bindings to LLVM instead

Last update: Jan 20 2020 at 21:30UTC