What's more important: compiler safety or long workflows? (SwiftUI) #112
-
As it stands now you can get 8 Fundamentally this is because the compiler is having to do a lot of work to understand the type we're creating, it's no joke when it gets large. Opaque types are actually designed to solve this problem. That's why so many things are First OptionWe keep things as they are, we enjoy the fact that Option 2:We use our own opaque types. I've tested this out and proven that it allows for very large workflows (potentially infinite, I gave up before hitting an upper bound, but I was also partially hampered by our new API, so I only got to about 150 items). The downside of this is that you're erasing necessary information to create the safety we like on The big questionGiven this information what is more important to @wwt/workflow-developers? Would you rather be able to create arbitrarily large workflows, or have the somewhat pathetic limitation of 9 items but keep all our juicy type safety? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
I'm thinking that a lot more potential users will be hurt by only allowing ~8 |
Beta Was this translation helpful? Give feedback.
-
Is there something we can do to have disjointed Workflows so that the compiler has to determine subsets and then connections between workflows? I'm thinking Workflow A starts with Int ends with String and Workflow B starts with String and ends with Boolean and they are each 8 workflows long inside. Essentially: |
Beta Was this translation helpful? Give feedback.
-
As we continue down this path and embrace the ideas of opaque types I discovered a new Swift compiler constraint. Turns out with our the Swift compiler only allows nesting up to 256 items. So with our new API opaque types may not even be strictly necessary |
Beta Was this translation helpful? Give feedback.
-
Ultimately we removed compile-time safety for the validity of the Workflow and opted for a run-time check whenever the workflow is created to ensure it is valid. This allows for workflows longer than 9 items long, and provides feedback on initialization (avoiding having to run through the entire workflow). |
Beta Was this translation helpful? Give feedback.
Ultimately we removed compile-time safety for the validity of the Workflow and opted for a run-time check whenever the workflow is created to ensure it is valid. This allows for workflows longer than 9 items long, and provides feedback on initialization (avoiding having to run through the entire workflow).