Nu API Revamp + Coroutines! #1052
Closed
bryanedds
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This release features a very large Nu API revamp that makes interfacing with the engine and writing game code significantly more ergonomic and streamlined!
Previously, the World value had to be manually threaded through every API call that caused the world to change in any way. Because of how pervasive state transformation are in games - even immutable transformations! - this meant you often ended up having to write code in a much more verbose style. This release changes all that, making the World type just a handle to the underlying immutable new WorldState value. This is a very enabling thing, and not just for code ergonomics! Because of that change, we are now enabled to provide you a Unity-style coroutines programming model as well - https://github.com/bryanedds/Nu/wiki/Frame%E2%80%90Based-Behavior-with-Coroutines
Additionally, writing ImSim code becomes so much easier and to the point. In stead of having to user ternary if expressions and folds everywhere, ImSim code becomes composed of imperative style
ifs andforloops - almost like you're writing Python scripting code but with the power of declarative and functional programming!Here's some ImSim code from the Breakout ImSim project before this API change -
Certainly more succinct than imperative or OO code, but here it is after -
No longer to new users have to spend time learning the ropes of writing interwrited folds and babysitting the world value for reasons that are necessarily initially apparent. New users can now get up to speed on Nu game development both quickly and have more fun over the game dev process due to this significant reduction in development friction!
More and more benefits are being hatched based on the new API as well, which we'll surface as we discover and prove them out!
Also, special thanks @Happypig375 for the part of the discussion that led me to pull the trigger on these API-wide changes as well as helping to prototype and shape the new coroutines feature!
New Contributors
Full Changelog: v18.17.0...v19.0.0
This discussion was created from the release Nu API Revamp + Coroutines!.
Beta Was this translation helpful? Give feedback.
All reactions