- Has someone already used this title somewhere else? Seems familiar
TLDR
-
Here’s where Demergent Labs stands on Candid vs JSON at the moment: https://x.com/lastmjs/status/1735690729723195808
-
We would love feedback on our choice
-
Should we as a community begin the process of deprioritizing Candid and replacing it with a more well-known serialization stack e.g. JSON and JSON schema?
IMO It really isn’t about what the technically superior solution is alone, but about barriers to adoption.
Deprioritizing Candid at Demergent Labs
At Demergent Labs we’ve been building a TypeScript/JavaScript and Python CDK since 2022. Both projects are functional, one is about to leave beta and the other is in a good beta state.
We’ve also been engaged in documentation around these CDKs and generally figuring out the best way to educate people/devs about ICP, and to get them started with canister development.
As we see it, Candid and the tooling around it provide a large barrier to learning how to develop canisters on ICP. Even with good abstractions, the concept of RPC with query and update methods, needing to generate bindings to hook up a front-end, and dealing with restricted non-native data structures (like records that can’t have dynamic field names) causes significant hurdles for newcomers.
This is our observation over time as we engage in education, and especially at in-person hackathons with relatively young web developers (and completely new to ICP). It is especially difficult for a dev to figure out how to hook up their frontend to their backend, as they must generate bindings, hook up an agent, and engage in RPC calls, as opposed to just using regular HTTP with window.fetch and JSON.
It’s also taken a significant amount (perhaps most) of our development time at Demergent Labs to properly integrate Candid into the CDKs, providing a proper level of abstraction that is a good developer experience, and dealing with bugs or misunderstandings in the spec or implementations. And Candid in JS is not very performant, so we’ve had to deprioritize its use in StableBTreeMap, opting for JSON instead. I would guess the general consensus is that Candid serde is not very performant relative to other choices.
So at Demergent Labs we have decided to deprioritize education and tooling around Candid and the query/update RPC paradigm. We can’t remove it yet, and it’s still very important to the ecosystem and thus the CDKs, but we will first be introducing interacting with canisters using regular HTTP REST APIs that use JSON as the serialization format.
This aligns with our general thesis: developer adoption is best facilitated by removing as many barriers to development as possible, and new concepts should be kept to a minimum and introduced as late as possible in the developer journey.
Thus, our goal is to provide first-class support and education around building JSON HTTP APIs using TypeScript, JavaScript, and Python. This will result in a more familiar server environment for new developers, and allow them to get started very quickly with minimal ICP-specific tooling.
What do you think?
I would love comments and opinions on our decision.
I would also like to open up the discussion on Candid itself and its usefulness to the ecosystem. I suggest that we should consider if it would be better to embrace a more well-known and adopted serialization format, I suggest JSON and maybe JSON schema.
Candid is not a requirement at the protocol level, and as canister developers we can choose to expose our canister endpoints as we please. Though Candid is the preferred method now, it is not necessary.
We should discuss moving away from Candid as a community. I would like to dig into its merits and drawbacks to see if this would be appropriate.