rusty seems needlessly verbose... never tried to read any code in it before this post... which I fail to see the purpose...
static mut base: uint = 0x200000;
pub extern "C" fn malloc(len: uint) -> *mut u8 {
base as *mut u8
}
(I'll admit the second can be reduced less, since it's actually doing real work: basically just dropping the `: uint` on the `let ret`, dropping the `return` and associated `;`, and removing the () on the if condition.)I guess the major source of verbosity is the `extern "C"`, which, fortunately, is only necessary when one requires a function uses the C ABI/calling-convention; in the overwhelmingly common case one writes `pub fn foo(...)` which will use the Rust ABI (and it gets reduced to just `fn foo(...)` if the function can be private to a module).
Tl;dr - it's worth it, IMO :)
let ret = base;
...was instead written as: let ret: uint = base;
...with all the additional verbosity that entails.