News for hackers. Stuff that matters.
Re:Four years with Rust by vvanders on Wednesday December 21, 2016 @03:57PM (#13232560)
Have you tried VSCode with the Rust(racer,rustfmt) + lldb integration? I've been pretty impressed with it so far.

FWIW C# <-> Rust integration is really straightforward. You can actually pass delegates as C fn pointers and then treat them as a closures in Rust. Much less painful that I initially thought.

Re:Four years with Rust by pjmlp on Wednesday December 21, 2016 @04:50PM (#13232941)
It is not yet the same as Blend + Visual Studio (C#, F#, C++/CX, C++/CLI).

Yes, I do use VSCode, but only for dabbling on Rust during plane/train travels. The language is not yet at a level it just fits on MS stack and is requested by our customers on their Requests For Proposals.

Regarding C# <-> Rust interoperability, it is very badly documented. I gave up on searching for it, and just used C# <-> C++/CX <-> Rust instead.

Or I am very bad searching for it.

Re:Four years with Rust by dbaupp on Wednesday December 21, 2016 @05:54PM (#13233379)
Have you seen the FFI omnibus http://jakegoulding.com/rust-ffi-omnibus/ which includes C# examples?
Re:Four years with Rust by pjmlp on Wednesday December 21, 2016 @06:14PM (#13233493)
No, thanks for pointing it out.
Re:Four years with Rust by vvanders on Wednesday December 21, 2016 @05:53PM (#13233369)
C# <-> Rust is pretty straightforward. Just follow the C FFI side on Rust and C# has standard marshal mechanisms for calling C code.

extern/dllimport[1] Covers most of it. There's automatic conversion for CString/string and delegates as function pointers. If you need to go deeper than that there's the marshal namespace[2]. Going through C++/CX sounds really painful.

[1] - https://msdn.microsoft.com/en-us/library/e59b22c5.aspx

[2] - https://msdn.microsoft.com/en-us/library/system.runtime.inte...

Re:Four years with Rust by pjmlp on Wednesday December 21, 2016 @06:18PM (#13233511)
> C++/CX sounds really painful.

Not for someone that knows C++ since C++ARM. :)

I am pretty comfortable with C# and native interop, my issue was trying to map Rust strings with .NET UTF-16 ones, including passing ownership from Rust to .NET side.

Re:Four years with Rust by vvanders on Wednesday December 21, 2016 @06:48PM (#13233649)
If I remember right you can specify encoding as an attribute on the extern decl.