-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All of an op's code should live together #2180
Comments
Is a sub folder for each op is revelant? Due to the number of ops it could become a mess. Just an idea.
Also making each op in a crate would be a bit overkill and time consuming for any update no? |
It might be a bit more manageable if we group ops together I.E. read, write, copy, etc.. in one crate. I still think the following things are going to be the most problematic: Generating snapshots at compile time.Exposing a list of required resources and respective source code would be easy to achieve after compile time I.E. some_op::code = include_bytes!("source/file.ts"). Exposing a complete list before compiling would be more difficult if we want to avoid arbitrary external definitions for these things. In an ideal world including a op would be simple I.E. Avoiding circular dependency structures when defining the dispatch function for a op.I.E. I'm not sure how rust handles circular dependencies, but if other languages are anything to go by it will be messy if it works at all. We may need other crates to define capability specific traits for dispatch contexts and implement them for
This would make deno more modular for embedding. Maintaining type safety in the compiler.This is really just a result of the first one. Getting what we need to generate types at compile will be harder without resorting to some arbitrary include list. I figure it's already been thought about, but I figured I would mention how much this change looks like the stepping stones to modular bindings like node. @ry Any insight what you want to avoid in a binding system? |
This is very dated and we have been through several iterations of approach. As it stands, this issue is generally un-actionable, so closing. |
After we've replaced flatbuffers (#2121), I want to refactor how we define ops. Ideally the javascript and rust code would live next to each other. Example dir structure:
Currently adding an op means touching a lot of files spread around the tree.
An extreme case of this design would make each op into a standalone crate which could be installed separately, so an embedder could pick and choose the functionality they wanted.
The text was updated successfully, but these errors were encountered: