News for hackers. Stuff that matters.
Re:Objective-Rust by cornstalks on Friday August 28, 2020 @06:24PM (#24310930)
Yeah, it supports ivars just fine. Computing byte offsets for each ivar was a pain the butt. By default it will use the field's name as the ivar name. You can rename the ivar by using #[objrs(ivar, name = "whatever")] on the ivar. You can also pass an expression to be used to construct the ivar and give it a default value.

Documentation for the various macros is at [1], which includes a number of small examples. There's a larger demo[2] that uses Metal to render an interactive image. There are also framework bindings for some common frameworks (I want to add bindings for all of Apple's frameworks, but I need finish the rewrite first). Those bindings include some uses of ivars on extern classes too[3].

[1]: https://gitlab.com/objrs/objrs/blob/master/DOCUMENTATION.md

[2]: https://gitlab.com/objrs/objrs/-/tree/master/demo

[3]: https://gitlab.com/objrs/objrs/-/blob/master/frameworks/foun...

There are no comments on this comment yet.