5 ms·
Cool, I started working on something similar a while back but I didn't get past handling generics. Like if you have a node<T> with two T inputs and a T[] output
by negativegate 7y ago
Cool, I started working on something similar a while back but I didn't get past handling generics. Like if you have a node<T> with two T inputs and a T[] output, then when you attach a number to an input, the other input's type becomes number too and the output becomes number[]. That could need to propagate to connected nodes, too. Also when you disconnect a node, you would want to determine whether T must still be a number.
Is that something you're handling in your project? Do you have any pointers?
- tyleo 7y agoDevev is written in TypeScript and the TypeScript compiler is open source so I’m able to leverage it directly. That, in addition to the GitHub project ts-simple-type takes care of most of my difficulties. However, I don’t support generics as first class citizens in the node editor yet and probably won’t for V1. I can detect that an input/output is a generic but I convert it to any before use. If your project is based on an existing language I’d recommend taking a look at injesting compiler tools if they are open source.