Skip to content

Commit 4869000

Browse files
committed
N28: godot-rust
1 parent 9922d8b commit 4869000

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed
59 KB
Loading

content/news/028/godot-rust.png

3.22 KB
Loading

content/news/028/index.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,60 @@ e.g. `Option<Entity>` will not consume additional space.
324324
[hecs]: https://github.com/Ralith/hecs
325325
[hecs-changelog]: https://github.com/Ralith/hecs/blob/master/CHANGELOG.md#071
326326

327+
### [godot-rust](https://github.com/godot-rust/godot-rust)
328+
329+
![godot-rust logo](godot-rust.png)
330+
331+
godot-rust ([GitHub][gd-github], [Discord][gd-discord], [Twitter][gd-twitter])
332+
is a Rust library that provides bindings for the Godot game engine.
333+
334+
November has been a month of refactoring for godot-rust. The API was cleaned up
335+
across different locations, reducing confusion and making the library more accessible.
336+
337+
The module simplification ([#811][gd-811]) continued initial efforts on the
338+
module structure, such as shorter paths and avoidance of redundant re-exports.
339+
The improvements are best expressed as a picture -- these are differences
340+
between version v0.9.3 and now:
341+
342+
![module before/after](godot-rust-modules.png)
343+
344+
In a similar vein, several core symbols were renamed for consistency
345+
([#815][gd-815]). Examples include:
346+
347+
- `RefInstance` -> `TInstance`
348+
- `TypedArray` -> `PoolArray`
349+
- `ThreadAccess` -> `Ownership`
350+
- `RefKind` -> `Memory`
351+
352+
Another refactoring affects the `Variant` conversion methods ([#819][gd-819]).
353+
Instead of `Variant::to_i64()` which may silently fail and return a default
354+
value (Godot behavior), the recommended method is now `Variant::to<T>()`. This
355+
enables genericity and is more idiomatic in Rust, returning an `Option` to
356+
indicate success or failure.
357+
358+
As a binding to a C++ library, one topic godot-rust has to deal with is the use
359+
of `unsafe`, which sometimes boils down to a trade-off between safety and
360+
ease-of-use. Even though Rust provides basic guidelines, there are different
361+
philosophies on their execution, see [The CXX Debate][gd-cxx] for an example.
362+
To discuss how APIs interacting with Godot can as ergonomic as possible while
363+
preserving safety, [issue #808][gd-808] was opened.
364+
365+
Smaller changes include safety bugfixes ([#795][gd-795]) or a
366+
`GodotString::format()` method ([#816][gd-816]).
367+
368+
[gd-795]: https://github.com/godot-rust/godot-rust/pull/795
369+
[gd-808]: https://github.com/godot-rust/godot-rust/pull/808
370+
[gd-811]: https://github.com/godot-rust/godot-rust/pull/811
371+
[gd-815]: https://github.com/godot-rust/godot-rust/pull/815
372+
[gd-816]: https://github.com/godot-rust/godot-rust/pull/816
373+
[gd-819]: https://github.com/godot-rust/godot-rust/pull/819
374+
375+
[gd-cxx]: https://steveklabnik.com/writing/the-cxx-debate
376+
377+
[gd-github]: https://github.com/godot-rust/godot-rust
378+
[gd-discord]: https://discord.com/invite/FNudpBD
379+
[gd-twitter]: https://twitter.com/GodotRust
380+
327381
## Popular Workgroup Issues in Github
328382

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

0 commit comments

Comments
 (0)