GithubHelp home page GithubHelp logo

Abstracting Data Types about api HOT 9 CLOSED

obastemur avatar obastemur commented on May 12, 2024
Abstracting Data Types

from api.

Comments (9)

cjihrig avatar cjihrig commented on May 12, 2024

This seems logical. Could you go into more detail about:

There are alternative solutions (including the one we use with jxcore native interface).

from api.

trevnorris avatar trevnorris commented on May 12, 2024

If you'd like, make the file native/data_types.md and write out how you think this should be implemented. Then throw it up in a PR.

For now we'll be pretty loose with merging stuff in. Then once there are more opinions, discussions can be had about the existing docs and what changes should be made.

from api.

trevnorris avatar trevnorris commented on May 12, 2024

Or if you'd like just throw it in a gist and I'll land it for you.

from api.

obastemur avatar obastemur commented on May 12, 2024

@cjihrig @trevnorris Okay. I'm working on it.

from api.

mhdawson avatar mhdawson commented on May 12, 2024

Looking at the initial types in https://github.com/nodejs/api/blob/master/native/data_types.md and in particular:

struct JSValue {
  void* env_;
  void* data_;
  uintptr_t flags_;
};

We may find that we need to bundle the env_ into more than just the JSValue and possibly extend beyond a single pointer, so pulling out its definition into its own struct might make sense.

I also think making the structures opaque, and limiting access through helper methods would leave as more flexibility to change under the covers.

from api.

trevnorris avatar trevnorris commented on May 12, 2024

pulling out its definition into its own struct might make sense.

Have an idea what would go into that struct, or should there simply be a placeholder?

from api.

mhdawson avatar mhdawson commented on May 12, 2024

I think for now it would just be void* _env.

As to what might go there later some things that come to mind
1) the original description of _env sounds like it would point to java script engine (ex v8) structures. We might also need something at the Node or libuv level
2) It might be the place to add function pointers for the API (less sure on this front)

from api.

obastemur avatar obastemur commented on May 12, 2024
  1. the original description of _env sounds like it would point to java script engine (ex v8) structures. We might also need something at the Node or libuv level

@mhdawson Why JSValue is related to other parts of the Node?

from api.

mhdawson avatar mhdawson commented on May 12, 2024

@obastemur I think this work is going to be pulled into the work that @stefanmb and @ianwjhalliday are pushing forward. Do you think we still need this issue.

from api.

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.