News for hackers. Stuff that matters.
Re:The Witchcraft Compiler Collection by 20yrs_no_equity on Saturday August 13, 2016 @05:48PM (#12283240)
Could this be used to combine the output of projects written in incompatible languages? EG: say I have a rust program and a go program, both are open source, but I want to call them from a swift program. Could I compile the rust and go programs into ELFs then use WCC to break them out into "libraries" and then call them from swift?

Is there a better way to do this? Right now the alternative I'm thinking about is creating opening sockets from the Rust and GO side and talking to them via TCP.

But the end result I want is a single binary for the target platform and no install complications other than putting the binary on a stock unix machine.

I'm sure there's a better way.

Re:The Witchcraft Compiler Collection by Nullabillity on Saturday August 13, 2016 @06:43PM (#12283439)
You can build native C-compatible libraries from Rust, see https://doc.rust-lang.org/book/ffi.html#calling-rust-code-fr...
Re:The Witchcraft Compiler Collection by csl on Saturday August 13, 2016 @06:42PM (#12283435)
There is indeed a much easier way: Just create `.so` libraries (with a C interface, for example) from go or rust, as they compile to native code anyway.

I wouldn't use wcc for that ever, only for reverse engineering and similar things.

Re:The Witchcraft Compiler Collection by pjmlp on Sunday August 14, 2016 @02:17AM (#12284482)
Nowadays Go compilers also support creating libraries to be consumed by C, just not on all OSes as this is WIP.

https://golang.org/cmd/go/#hdr-Description_of_build_modes

    go build -buildmode=c-archive
or

    go build -buildmode=c-shared