- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13.9k
 
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
Converting the runtime to a Rust crate appears to be an interesting and useful thing to do.
Benefits:
- It would have the same linkage rules as most of our libraries
 - Lets us exercise bindgen
 - It gives us the opportunity to use rustdoc and other tools with it
 - It would either simplify the makefiles or not make them worse
 
Cons:
- Possible porting complications (I haven't considered it)
 
Guide to success:
- Create a bindgen pass (Add a bindgen pass #2124)
 - Add src/rt/rt.rc with a directive to auto-generate runtime bindings
 - Statically link the rt crate to the native runtime library
 - (Optional) Have rustc build the runtime (rustc should support compiling C code #1862)
 - Change the snapshot rules
 
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.