Rust Code in the Wild

Dylan Knutson tcdknutson at gmail.com
Wed Sep 4 20:46:39 PDT 2013


On Thursday, 5 September 2013 at 03:22:17 UTC, Meta wrote:
> While browsing Hacker News I came across this announcement of a 
> physics engine written in Rust. Just browsing through the code, 
> I noticed that it looks extremely arcane. I guess after awhile 
> it's something you could get used to, but it seems somewhat 
> ironic that the author says that C++ will die of ugliness, when 
> Rust already has syntactic monstrosities such as these:
>
> pub struct BodyWorld<N, LV, AV, M, II, CM> {
>     world: World<N, Body<N, LV, AV, M, II>, Constraint<N, LV, 
> AV, M, II>>,
>     forces: @mut BodyForceGenerator<N, LV, AV, M, II>,
>     integrator: @mut BodySmpEulerIntegrator<N, LV, AV, M, II>,
>     detector: @mut BodiesBodies<N, LV, AV, M, II, BF<N, LV, AV, 
> M, II>>,
>     sleep: @mut IslandActivationManager<N, LV, AV, M, II>,
>     ccd: @mut SweptBallMotionClamping<N, LV, AV, M, II, BF<N, 
> LV, AV, M, II>>,
>     joints: @mut JointManager<N, LV, AV, M, II>,
>     solver: @mut AccumulatedImpulseSolver<N, LV, AV, M, II, CM>
> }
>
> This stuff is downright arcane. I'd say that D is in a far 
> better situation right now in regard to being syntactically 
> easy to parse and understand for the average coder.

Somewhat related; just yesterday an individual on the rust-dev 
mailing list started a discussion on how to neatly format complex 
types:

https://mail.mozilla.org/pipermail/rust-dev/2013-September/005457.html


More information about the Digitalmars-d mailing list