Skip to content

Commit 98cb77a

Browse files
committed
N28: godot-rust
1 parent 70514a4 commit 98cb77a

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

Diff for: content/news/028/godot-rust-modules.png

59 KB
Loading

Diff for: content/news/028/godot-rust.png

3.22 KB
Loading

Diff for: content/news/028/index.md

+54
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,60 @@ If needed, a section can be split into subsections with a "------" delimiter.
7474

7575
## Library Updates
7676

77+
### [godot-rust](https://github.com/godot-rust/godot-rust)
78+
79+
![godot-rust logo](godot-rust.png)
80+
81+
godot-rust ([GitHub][gd-github], [Discord][gd-discord], [Twitter][gd-twitter])
82+
is a Rust library that provides bindings for the Godot game engine.
83+
84+
November has been a month of refactoring for godot-rust. The API was cleaned up
85+
across different locations, reducing confusion and making the library more accessible.
86+
87+
The module simplification ([#811][gd-811]) continued initial efforts on the
88+
module structure, such as shorter paths and avoidance of redundant re-exports.
89+
The improvements are best expressed as a picture -- these are differences
90+
between version v0.9.3 and now:
91+
92+
![module before/after](godot-rust-modules.png)
93+
94+
In a similar vein, several core symbols were renamed for consistency
95+
([#815][gd-815]). Examples include:
96+
97+
- `RefInstance` -> `TInstance`
98+
- `TypedArray` -> `PoolArray`
99+
- `ThreadAccess` -> `Ownership`
100+
- `RefKind` -> `Memory`
101+
102+
Another refactoring affects the `Variant` conversion methods ([#819][gd-819]).
103+
Instead of `Variant::to_i64()` which may silently fail and return a default
104+
value (Godot behavior), the recommended method is now `Variant::to<T>()`. This
105+
enables genericity and is more idiomatic in Rust, returning an `Option` to
106+
indicate success or failure.
107+
108+
As a binding to a C++ library, one topic godot-rust has to deal with is the use
109+
of `unsafe`, which sometimes boils down to a trade-off between safety and
110+
ease-of-use. Even though Rust provides basic guidelines, there are different
111+
philosophies on their execution, see [The CXX Debate][gd-cxx] for an example.
112+
To discuss how APIs interacting with Godot can as ergonomic as possible while
113+
preserving safety, [issue #808][gd-808] was opened.
114+
115+
Smaller changes include safety bugfixes ([#795][gd-795]) or a
116+
`GodotString::format()` method ([#816][gd-816]).
117+
118+
[gd-795]: https://github.com/godot-rust/godot-rust/pull/795
119+
[gd-808]: https://github.com/godot-rust/godot-rust/pull/808
120+
[gd-811]: https://github.com/godot-rust/godot-rust/pull/811
121+
[gd-815]: https://github.com/godot-rust/godot-rust/pull/815
122+
[gd-816]: https://github.com/godot-rust/godot-rust/pull/816
123+
[gd-819]: https://github.com/godot-rust/godot-rust/pull/819
124+
125+
[gd-cxx]: https://steveklabnik.com/writing/the-cxx-debate
126+
127+
[gd-github]: https://github.com/godot-rust/godot-rust
128+
[gd-discord]: https://discord.com/invite/FNudpBD
129+
[gd-twitter]: https://twitter.com/GodotRust
130+
77131
## Popular Workgroup Issues in Github
78132

79133
<!-- Up to 10 links to interesting issues -->

0 commit comments

Comments
 (0)