Coder Social home page Coder Social logo

Comments (2)

Robbepop avatar Robbepop commented on July 26, 2024

We could make the path representable as builtin which is only allowed from within the scale-info crate. So user defined types cannot have a builtin path. The set of types with a builtin path must be fixed and known upfront - e.g. Option<T>, Result<T, E>, Range, ... This way we avoid another huge set of ever growing enum variants for every builtin type but third party tools have a simple and efficient way of detecting an actually builtin type and differentiating one from a user defined type.
This kinda is possible nowadays with the prelude path if we were able to stop users from defining types with such a path.

Instead of making path more complex by introducing a builtin path we could also simply use a bool flag is_builtin that defaults to false and is not serialized therefore for all non-builtin types.

from scale-info.

ascjones avatar ascjones commented on July 26, 2024

At the moment all those types are in the "prelude" namespace (i.e. no namespace in the path), but there is nothing at the moment to stop a custom type being constructed with an empty namespace.

Anyway I have already released 1.0 now so added this to the 2.0 milestone. It's not a showstopper but we can certainly improve the experience here.

from scale-info.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.