Skip to content
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

Why two code bases? #11

Closed
unicomp21 opened this issue Nov 24, 2022 · 3 comments
Closed

Why two code bases? #11

unicomp21 opened this issue Nov 24, 2022 · 3 comments

Comments

@unicomp21
Copy link

unicomp21 commented Nov 24, 2022

Why not stick w/ golang, compile it to webassembly for running in the browser using what's available in pion, and then create an event bus to wrap the whole thing? Then the typescript wrapper can make calls via the event bus?

@unicomp21 unicomp21 changed the title Why two code bases Why two code bases? Nov 24, 2022
@achingbrain
Copy link
Member

What we want to encourage is multiple implementations of IPFS in multiple languages targeting specific use-cases.

Having a modular, composable stack allows developers to pick and choose the components they want which enables new and interesting implementations like Elastic IPFS (built on JS). Kubo targets different use cases and is not flexible like this so it's not a great fit.

It's also important to note that WASM is not a magic bullet, compiling go code to WASM typically results in a large binary which isn't great for browser users and for JS developers in general it's a completely black box which harms their ability to debug problems and otherwise be productive. There's also no guarantee of performance since you'll be copying lots of data in and out of the runtime.

There are also about 7x the number of JS vs Go developers in the world - it's important to meet them where they are. Saying "just use the go version" effectively excludes them from contributing to the IPFS projects and fails to leverage their massive amount of collective experience in deploying browser and Node.js apps at scale.

@unicomp21
Copy link
Author

What about the overhead of maintaining the same implementation in multiple languages? Doesn't experience tell us this will result in some sort of "synchronization hell" between code bases? At a minimum, would it make sense to "generate" the multiple language implementations in a way similar to protocol buffers? Maybe look at something like Haxe? Developer's could then "learn" what's going on in the language of their choice? From here they could make the jump to the Haxe implementation? Which then generates all the other implementations? Apologies for being a "stick in the mud", but feels like I've seen this argument play out multiple times before, never seems to end well? Lots of pain?

Or maybe we should pick a language, like javascript, and say this will be the core implementation? And then use something like grpc stubs to wrap that implementation? And make it usable from other languages?

@achingbrain
Copy link
Member

We're not attempting to maintain feature parity between the different implementations at the API level. For example there are lots of Kubo APIs we don't want to carry forward, like the object API and specialised APIs like bootstrap, most of the config ones, etc.

Implementations should be compatible on the wire though, that's incredibly important, but each implementation should have the freedom to innovate at the API level as they see fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants