←back to thread

88 points BrainBacon | 3 comments | | HN request time: 0s | source

This project is inspired by some of the asserts in Unreal engine.

Due to reliance on core_intrinsics it is necessary to develop using nightly Rust, but there are stubs in place so a production build will not require nightly.

I recently released version 0.2 which includes no_std support and adds optional log message arguments to the ensure macro.

1. nathanwh ◴[] No.42198583[source]
Neat project! Maybe this decision is copied over from unreal engine, but instead of `ensure` and `ensure_always`, having names like `ensure_once` and `ensure` would have been more clear to me.
replies(1): >>42199257 #
2. BrainBacon ◴[] No.42199257[source]
I can understand where you're coming from, but when programming games you generally don't want a breakpoint to be hit more than once since you are running a loop over multiple frames. So in this case the concept of ensure_once is more common, so the shorter inverse is more convenient. Asserts should be enough to get your attention and not to annoy, so orienting it this way is a deliberate choice.
replies(1): >>42201274 #
3. nathanwh ◴[] No.42201274[source]
Ah makes sense, thank you