Nathan Vegdahl nathanvegdahl
  • Amsterdam, Netherlands
  • https://cessen.com
  • Animator, rigger, and software developer. Currently working at the Blender Institute as a developer on Blender's animation system.

    Been using Blender since 1998, and worked on Big Buck Bunny and Sintel (two of Blender's open movie projects).

  • Joined on 2003-03-21
Nathan Vegdahl commented on pull request blender/blender#124733 2024-07-16 17:07:12 +02:00
WIP: Result type for return-value-based error handling

Ah, thanks! Yeah, that makes sense. So then the semantics around the call in various situations would be like this(?):

// `s` is either a new string "hello" or a full copy of the string…
Nathan Vegdahl pushed to result at nathanvegdahl/blender 2024-07-16 16:29:38 +02:00
660045087e Remove unneeded constructors
Nathan Vegdahl pushed to main at nathanvegdahl/.profile 2024-07-16 16:17:39 +02:00
aedf644c65 Update reports/2024.md
Nathan Vegdahl pushed to main at nathanvegdahl/.profile 2024-07-16 16:17:04 +02:00
4a623b39c7 Update reports/2024.md
Nathan Vegdahl commented on pull request blender/blender#124733 2024-07-16 15:43:05 +02:00
WIP: Result type for return-value-based error handling

It looks like I can get rid of Result(V &&value) : data{std::move(value)} {}, at least.

On Err, however, if I remove Result(Err<E> &error) : data{error} {} then the unit tests fail to…

Nathan Vegdahl pushed to result at nathanvegdahl/blender 2024-07-16 15:29:11 +02:00
fd35c691c2 Use const for construction by reference
Nathan Vegdahl pushed to result at nathanvegdahl/blender 2024-07-16 15:23:37 +02:00
7e62024100 Use trailing underscore for private data
Nathan Vegdahl pushed to result at nathanvegdahl/blender 2024-07-16 15:20:05 +02:00
c68597eb6e Use std::holds_alternative() and std::get()
77eba8fa4d Merge branch 'main' into result
5a60e3f439 Fix #124297: GPv3: Build modifier natural drawing speed fix
c3f79ee250 Geometry Nodes: support simulating and baking grease pencil geometry
81de8f388e Fix: Geometry Nodes: Field inferencing takes dangling reroutes into account
Compare 815 commits »
Nathan Vegdahl pushed to main at nathanvegdahl/.profile 2024-07-16 15:12:25 +02:00
ae144ae904 Update reports/2024.md
Nathan Vegdahl pushed to main at nathanvegdahl/.profile 2024-07-16 15:12:12 +02:00
100cb53ed2 Update reports/2024.md
Nathan Vegdahl commented on pull request blender/blender#124733 2024-07-16 13:59:42 +02:00
WIP: Result type for return-value-based error handling

Ah, and so to be clear: I still personally prefer Err, but I'm happy to change it if others prefer Error or if you feel strongly about it.

Nathan Vegdahl commented on pull request blender/blender#124733 2024-07-16 13:50:25 +02:00
WIP: Result type for return-value-based error handling

Ah, good point. In an earlier iteration I just stored E directly (not wrapped in Err), so this was needed to address the corner case of V and E being the same type. But now with E

Nathan Vegdahl commented on pull request blender/blender#124733 2024-07-16 13:36:48 +02:00
WIP: Result type for return-value-based error handling

That's fair. I guess it comes down to how namespaces are used.

I'm again coming from a Rust perspective where modules (more-or-less the equivalent of namespaces in C++ in this context) are…

Nathan Vegdahl commented on pull request blender/blender#124733 2024-07-16 12:59:06 +02:00
WIP: Result type for return-value-based error handling

And because it's in blender, that means that you could still use module_namespace::Error without conflict.

The full namespace path is blender::module_namespace::Error, though, so there's a…

Nathan Vegdahl commented on pull request blender/blender#124733 2024-07-16 12:50:13 +02:00
WIP: Result type for return-value-based error handling

I suppose another point is that "err" itself is also a word, meaning to make an error or mistake, so it kind of fits. It's not as common a word as "error", but I certainly have used it and see it…

Nathan Vegdahl pushed to main at nathanvegdahl/.profile 2024-07-16 11:59:07 +02:00
7781dd6d8f Update reports/2024.md
Nathan Vegdahl commented on pull request blender/blender#124733 2024-07-16 11:57:14 +02:00
WIP: Result type for return-value-based error handling

In general, I agree. My rationale for going with Err in this case is:

  • In theory, this should end up getting used a lot, so it will become familiar to people working in Blender's code base…
Nathan Vegdahl commented on pull request blender/blender#124733 2024-07-16 11:44:03 +02:00
WIP: Result type for return-value-based error handling

Yeah, that's a good point. For now I'll leave it in the PR (to get feedback on the docs at the same time as the Result type itself continues to iterate), but I'll leave this comment unresolved…