FAQ
Hi,

Does anyone know if it is safe, for performance reasons to heavily use the
npm module: "node-weak" and similar libraries? Does it add significant
overhead?


Thanks in advance

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Search Discussions

  • Diogo Resende at Oct 22, 2012 at 4:52 pm
    You could use ES6 WeakMaps.

    https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/WeakMap

    --
    Diogo Resende

    On Monday, October 22, 2012 at 17:05 , Fredrik O wrote:

    Hi,

    Does anyone know if it is safe, for performance reasons to heavily use the npm module: "node-weak" and similar libraries? Does it add significant overhead?


    Thanks in advance
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com (mailto:nodejs@googlegroups.com)
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com (mailto:nodejs+unsubscribe@googlegroups.com)
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Nathan Rajlich at Oct 22, 2012 at 5:52 pm
    I've only really used it for testing and tracking down memory leaks,
    but I know that "hook.io" has used it as a dependency in the past, and
    that "dnode" does currently. What exactly is your use case?
    On Mon, Oct 22, 2012 at 9:52 AM, Diogo Resende wrote:
    You could use ES6 WeakMaps.

    https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/WeakMap

    --
    Diogo Resende

    On Monday, October 22, 2012 at 17:05 , Fredrik O wrote:

    Hi,

    Does anyone know if it is safe, for performance reasons to heavily use the
    npm module: "node-weak" and similar libraries? Does it add significant
    overhead?


    Thanks in advance

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en


    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Fedor Indutny at Oct 22, 2012 at 6:27 pm
    This actually depends on how much are you going to use them.

    Few thousands objects are probably ok, but millions will slow down GC
    significantly.

    Cheers,
    Fedor.


    On Mon, Oct 22, 2012 at 9:52 PM, Nathan Rajlich wrote:

    I've only really used it for testing and tracking down memory leaks,
    but I know that "hook.io" has used it as a dependency in the past, and
    that "dnode" does currently. What exactly is your use case?
    On Mon, Oct 22, 2012 at 9:52 AM, Diogo Resende wrote:
    You could use ES6 WeakMaps.

    https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/WeakMap
    --
    Diogo Resende

    On Monday, October 22, 2012 at 17:05 , Fredrik O wrote:

    Hi,

    Does anyone know if it is safe, for performance reasons to heavily use the
    npm module: "node-weak" and similar libraries? Does it add significant
    overhead?


    Thanks in advance

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en


    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Fredrik O at Oct 22, 2012 at 9:28 pm
    Thanks for your responses, all!

    I use it too support a simple (C++) RAII functionally, to reclaim
    resources, both external and internal resources. I believe it is good idea.
    It allows a resource, even if an exception get thrown be reclaimed. I
    simply code in mind that a exception can get thrown almost anywhere. For
    example this code is not safe:

    var obj = pool.create(); //may be a connection pool
    // code here which may throw an exception
    pool.release(obj); //may not ever be reached, if the code before thrown an
    exception, therefore not safe

    The regular exception handling will not be a solution, because of the
    asynchronous design of node.js. However, if I use weak references, I can
    ignore the call to "release" if I want too. This feature is specially
    useful for implementing multiple design patterns, for example flyweight:

    //copy of C++ boost.flyweight, but in JavaScript
    var obj = flyweight("This string will only exist once in memory, so even if
    I create thousands of them, will no memory increase significantly
    happen");//may be of any type
    console.log(obj); //we can treat the object just like the object we
    constructed it with: "string", with the exception it is read-only.

    When all references dies will the object be released automatically, and
    when we want to create a new instance will the library create a new cheap
    reference to the value already in memory. This would never be possible
    without weak references. I have actually created a module like this, which
    I plans to release to the public some time.

    So in conclusion, I have started to use it whenever there I believe it
    fits, in multiple places, but I wonder if I need to worry about any
    significant performance degradation?

    PS. How would weak maps be used to call a custom function on garbage
    collection?

    What are your thoughts?

    Thanks in advance!

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Rick Waldron at Oct 23, 2012 at 12:17 am

    On Monday, October 22, 2012 at 5:22 PM, Fredrik O wrote:



    PS. How would weak maps be used to call a custom function on garbage collection?
    I think you've misunderstood, WeakMaps don't facilitate this

    Rick

    What are your thoughts?

    Thanks in advance!

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Fredrik O at Oct 24, 2012 at 2:28 pm
    Thank you Rick, it was good to know.

    Just for curiosity, what do you people thought, to emulate RAII within
    JavaScript for those object which need some clean up? Am I doing it
    completely wrong? I mean, an exception can easily get thrown in JavaScript
    and try..catch cannot catch error within callbacks. And domains just feel
    wrong. For those who does not know what RAII is, it is an automatic way to
    invoke a destructor when the object get out of reach, by normal control
    flow or an exception get thrown. See wikipedia:
    http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization

    And Nathan (or if there is someone else which can do a serious guess),
    because you have not answered I assume it will be fine to use your library
    heavily. With heavily do I mean having around 10 000 concurrent weak
    objects alive. If you believe it would not be case, please let me know.

    Thanks in advance.

    Den tisdagen den 23:e oktober 2012 kl. 01:20:19 UTC+2 skrev Rick Waldron:

    On Monday, October 22, 2012 at 5:22 PM, Fredrik O wrote:



    PS. How would weak maps be used to call a custom function on garbage
    collection?


    I think you've misunderstood, WeakMaps don't facilitate this

    Rick





    What are your thoughts?

    Thanks in advance!

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nod...@googlegroups.com <javascript:>
    To unsubscribe from this group, send email to
    nodejs+un...@googlegroups.com <javascript:>
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Nathan Rajlich at Oct 24, 2012 at 3:11 pm
    I mean try it and find out :) If you run into problems, let us know!
    On Wed, Oct 24, 2012 at 7:28 AM, Fredrik O wrote:
    Thank you Rick, it was good to know.

    Just for curiosity, what do you people thought, to emulate RAII within
    JavaScript for those object which need some clean up? Am I doing it
    completely wrong? I mean, an exception can easily get thrown in JavaScript
    and try..catch cannot catch error within callbacks. And domains just feel
    wrong. For those who does not know what RAII is, it is an automatic way to
    invoke a destructor when the object get out of reach, by normal control flow
    or an exception get thrown. See wikipedia:
    http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization

    And Nathan (or if there is someone else which can do a serious guess),
    because you have not answered I assume it will be fine to use your library
    heavily. With heavily do I mean having around 10 000 concurrent weak objects
    alive. If you believe it would not be case, please let me know.

    Thanks in advance.

    Den tisdagen den 23:e oktober 2012 kl. 01:20:19 UTC+2 skrev Rick Waldron:

    On Monday, October 22, 2012 at 5:22 PM, Fredrik O wrote:



    PS. How would weak maps be used to call a custom function on garbage
    collection?


    I think you've misunderstood, WeakMaps don't facilitate this

    Rick





    What are your thoughts?

    Thanks in advance!

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nod...@googlegroups.com

    To unsubscribe from this group, send email to
    nodejs+un...@googlegroups.com

    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Marco Rogers at Oct 24, 2012 at 6:15 pm
    Can you elaborate on "domains just feel wrong". I'm interested in how the
    domains api comes across. I've expressed my concerns with it in the past.

    :Marco
    On Wednesday, October 24, 2012 7:28:06 AM UTC-7, Fredrik O wrote:

    Thank you Rick, it was good to know.

    Just for curiosity, what do you people thought, to emulate RAII within
    JavaScript for those object which need some clean up? Am I doing it
    completely wrong? I mean, an exception can easily get thrown in JavaScript
    and try..catch cannot catch error within callbacks. And domains just feel
    wrong. For those who does not know what RAII is, it is an automatic way to
    invoke a destructor when the object get out of reach, by normal control
    flow or an exception get thrown. See wikipedia:
    http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization

    And Nathan (or if there is someone else which can do a serious guess),
    because you have not answered I assume it will be fine to use your library
    heavily. With heavily do I mean having around 10 000 concurrent weak
    objects alive. If you believe it would not be case, please let me know.

    Thanks in advance.

    Den tisdagen den 23:e oktober 2012 kl. 01:20:19 UTC+2 skrev Rick Waldron:

    On Monday, October 22, 2012 at 5:22 PM, Fredrik O wrote:



    PS. How would weak maps be used to call a custom function on garbage
    collection?


    I think you've misunderstood, WeakMaps don't facilitate this

    Rick





    What are your thoughts?

    Thanks in advance!

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nod...@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+un...@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Bradley Meck at Oct 24, 2012 at 6:55 pm
    Take it to a different topic if it becomes unrelated also.
    On Wednesday, October 24, 2012 1:15:49 PM UTC-5, Marco Rogers wrote:

    Can you elaborate on "domains just feel wrong". I'm interested in how the
    domains api comes across. I've expressed my concerns with it in the past.

    :Marco
    On Wednesday, October 24, 2012 7:28:06 AM UTC-7, Fredrik O wrote:

    Thank you Rick, it was good to know.

    Just for curiosity, what do you people thought, to emulate RAII within
    JavaScript for those object which need some clean up? Am I doing it
    completely wrong? I mean, an exception can easily get thrown in JavaScript
    and try..catch cannot catch error within callbacks. And domains just feel
    wrong. For those who does not know what RAII is, it is an automatic way to
    invoke a destructor when the object get out of reach, by normal control
    flow or an exception get thrown. See wikipedia:
    http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization

    And Nathan (or if there is someone else which can do a serious guess),
    because you have not answered I assume it will be fine to use your library
    heavily. With heavily do I mean having around 10 000 concurrent weak
    objects alive. If you believe it would not be case, please let me know.

    Thanks in advance.

    Den tisdagen den 23:e oktober 2012 kl. 01:20:19 UTC+2 skrev Rick Waldron:

    On Monday, October 22, 2012 at 5:22 PM, Fredrik O wrote:



    PS. How would weak maps be used to call a custom function on garbage
    collection?


    I think you've misunderstood, WeakMaps don't facilitate this

    Rick





    What are your thoughts?

    Thanks in advance!

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nod...@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+un...@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Rick Waldron at Oct 24, 2012 at 7:38 pm
    WeakRefs are on the table for ES6... if someone here wants to write up a
    proposal (I'm looking at Nate) I will gladly champion it at the next TC39
    meeting.

    Rick
    On Wed, Oct 24, 2012 at 2:55 PM, Bradley Meck wrote:

    Take it to a different topic if it becomes unrelated also.

    On Wednesday, October 24, 2012 1:15:49 PM UTC-5, Marco Rogers wrote:

    Can you elaborate on "domains just feel wrong". I'm interested in how the
    domains api comes across. I've expressed my concerns with it in the past.

    :Marco
    On Wednesday, October 24, 2012 7:28:06 AM UTC-7, Fredrik O wrote:

    Thank you Rick, it was good to know.

    Just for curiosity, what do you people thought, to emulate RAII within
    JavaScript for those object which need some clean up? Am I doing it
    completely wrong? I mean, an exception can easily get thrown in JavaScript
    and try..catch cannot catch error within callbacks. And domains just feel
    wrong. For those who does not know what RAII is, it is an automatic way to
    invoke a destructor when the object get out of reach, by normal control
    flow or an exception get thrown. See wikipedia:
    http://en.wikipedia.org/wiki/**Resource_Acquisition_Is_**Initialization<http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization>

    And Nathan (or if there is someone else which can do a serious guess),
    because you have not answered I assume it will be fine to use your library
    heavily. With heavily do I mean having around 10 000 concurrent weak
    objects alive. If you believe it would not be case, please let me know.

    Thanks in advance.

    Den tisdagen den 23:e oktober 2012 kl. 01:20:19 UTC+2 skrev Rick Waldron:

    On Monday, October 22, 2012 at 5:22 PM, Fredrik O wrote:



    PS. How would weak maps be used to call a custom function on garbage
    collection?


    I think you've misunderstood, WeakMaps don't facilitate this

    Rick





    What are your thoughts?

    Thanks in advance!

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-
    **Posting-Guidelines<https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines>
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nod...@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+un...@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/**group/nodejs?hl=en?hl=en<http://groups.google.com/group/nodejs?hl=en?hl=en>


    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Nathan Rajlich at Oct 25, 2012 at 5:04 pm
    Rick, is there a template for proposals I should base it off of?
    On Wed, Oct 24, 2012 at 12:38 PM, Rick Waldron wrote:
    WeakRefs are on the table for ES6... if someone here wants to write up a
    proposal (I'm looking at Nate) I will gladly champion it at the next TC39
    meeting.

    Rick

    On Wed, Oct 24, 2012 at 2:55 PM, Bradley Meck wrote:

    Take it to a different topic if it becomes unrelated also.

    On Wednesday, October 24, 2012 1:15:49 PM UTC-5, Marco Rogers wrote:

    Can you elaborate on "domains just feel wrong". I'm interested in how the
    domains api comes across. I've expressed my concerns with it in the past.

    :Marco
    On Wednesday, October 24, 2012 7:28:06 AM UTC-7, Fredrik O wrote:

    Thank you Rick, it was good to know.

    Just for curiosity, what do you people thought, to emulate RAII within
    JavaScript for those object which need some clean up? Am I doing it
    completely wrong? I mean, an exception can easily get thrown in JavaScript
    and try..catch cannot catch error within callbacks. And domains just feel
    wrong. For those who does not know what RAII is, it is an automatic way to
    invoke a destructor when the object get out of reach, by normal control flow
    or an exception get thrown. See wikipedia:
    http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization

    And Nathan (or if there is someone else which can do a serious guess),
    because you have not answered I assume it will be fine to use your library
    heavily. With heavily do I mean having around 10 000 concurrent weak objects
    alive. If you believe it would not be case, please let me know.

    Thanks in advance.

    Den tisdagen den 23:e oktober 2012 kl. 01:20:19 UTC+2 skrev Rick
    Waldron:

    On Monday, October 22, 2012 at 5:22 PM, Fredrik O wrote:



    PS. How would weak maps be used to call a custom function on garbage
    collection?


    I think you've misunderstood, WeakMaps don't facilitate this

    Rick





    What are your thoughts?

    Thanks in advance!

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nod...@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+un...@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Rick Waldron at Oct 25, 2012 at 5:37 pm

    On Thu, Oct 25, 2012 at 1:03 PM, Nathan Rajlich wrote:

    Rick, is there a template for proposals I should base it off of?
    Not really, a gist in markdown will be more then sufficient.

    Include a rationale (this is probably the easiest part) and ideally a
    summary of your experience with weak refs, v8 and how you made the two work
    together (ie. anything valuable that you learned here:
    https://github.com/TooTallNate/node-weak/blob/master/src/weakref.cc).

    Then a rough outline of a "possible" API, keep in mind this sort of thing
    will be grilled and bikeshedding will happen. Finally, a composition of
    proposed semantics.


    Looking forward to seeing what you produce and I'll make sure its on the
    Nov meeting agenda

    Rick




    On Wed, Oct 24, 2012 at 12:38 PM, Rick Waldron wrote:
    WeakRefs are on the table for ES6... if someone here wants to write up a
    proposal (I'm looking at Nate) I will gladly champion it at the next TC39
    meeting.

    Rick


    On Wed, Oct 24, 2012 at 2:55 PM, Bradley Meck <bradley.meck@gmail.com>
    wrote:
    Take it to a different topic if it becomes unrelated also.

    On Wednesday, October 24, 2012 1:15:49 PM UTC-5, Marco Rogers wrote:

    Can you elaborate on "domains just feel wrong". I'm interested in how
    the
    domains api comes across. I've expressed my concerns with it in the
    past.
    :Marco
    On Wednesday, October 24, 2012 7:28:06 AM UTC-7, Fredrik O wrote:

    Thank you Rick, it was good to know.

    Just for curiosity, what do you people thought, to emulate RAII within
    JavaScript for those object which need some clean up? Am I doing it
    completely wrong? I mean, an exception can easily get thrown in
    JavaScript
    and try..catch cannot catch error within callbacks. And domains just
    feel
    wrong. For those who does not know what RAII is, it is an automatic
    way to
    invoke a destructor when the object get out of reach, by normal
    control flow
    or an exception get thrown. See wikipedia:
    http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization

    And Nathan (or if there is someone else which can do a serious guess),
    because you have not answered I assume it will be fine to use your
    library
    heavily. With heavily do I mean having around 10 000 concurrent weak
    objects
    alive. If you believe it would not be case, please let me know.

    Thanks in advance.

    Den tisdagen den 23:e oktober 2012 kl. 01:20:19 UTC+2 skrev Rick
    Waldron:

    On Monday, October 22, 2012 at 5:22 PM, Fredrik O wrote:



    PS. How would weak maps be used to call a custom function on garbage
    collection?


    I think you've misunderstood, WeakMaps don't facilitate this

    Rick





    What are your thoughts?

    Thanks in advance!

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nod...@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+un...@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Rick Waldron at Oct 25, 2012 at 5:45 pm
    Also, take a look at these...

    http://wiki.ecmascript.org/doku.php?id=strawman:weak_references
    http://wiki.ecmascript.org/doku.php?id=strawman:weak_refs

    Perhaps there is something that can built on top of, or an aspect you can
    prove/disprove?

    Rick
    On Thu, Oct 25, 2012 at 1:03 PM, Nathan Rajlich wrote:

    Rick, is there a template for proposals I should base it off of?
    On Wed, Oct 24, 2012 at 12:38 PM, Rick Waldron wrote:
    WeakRefs are on the table for ES6... if someone here wants to write up a
    proposal (I'm looking at Nate) I will gladly champion it at the next TC39
    meeting.

    Rick


    On Wed, Oct 24, 2012 at 2:55 PM, Bradley Meck <bradley.meck@gmail.com>
    wrote:
    Take it to a different topic if it becomes unrelated also.

    On Wednesday, October 24, 2012 1:15:49 PM UTC-5, Marco Rogers wrote:

    Can you elaborate on "domains just feel wrong". I'm interested in how
    the
    domains api comes across. I've expressed my concerns with it in the
    past.
    :Marco
    On Wednesday, October 24, 2012 7:28:06 AM UTC-7, Fredrik O wrote:

    Thank you Rick, it was good to know.

    Just for curiosity, what do you people thought, to emulate RAII within
    JavaScript for those object which need some clean up? Am I doing it
    completely wrong? I mean, an exception can easily get thrown in
    JavaScript
    and try..catch cannot catch error within callbacks. And domains just
    feel
    wrong. For those who does not know what RAII is, it is an automatic
    way to
    invoke a destructor when the object get out of reach, by normal
    control flow
    or an exception get thrown. See wikipedia:
    http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization

    And Nathan (or if there is someone else which can do a serious guess),
    because you have not answered I assume it will be fine to use your
    library
    heavily. With heavily do I mean having around 10 000 concurrent weak
    objects
    alive. If you believe it would not be case, please let me know.

    Thanks in advance.

    Den tisdagen den 23:e oktober 2012 kl. 01:20:19 UTC+2 skrev Rick
    Waldron:

    On Monday, October 22, 2012 at 5:22 PM, Fredrik O wrote:



    PS. How would weak maps be used to call a custom function on garbage
    collection?


    I think you've misunderstood, WeakMaps don't facilitate this

    Rick





    What are your thoughts?

    Thanks in advance!

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nod...@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+un...@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines:
    https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en
  • Fredrik O at Oct 25, 2012 at 3:43 pm
    I have created a new thread for this, see:
    https://groups.google.com/forum/?fromgroups=#!topic/nodejs/p7kfwcbJBxE

    Den onsdagen den 24:e oktober 2012 kl. 20:15:49 UTC+2 skrev Marco Rogers:
    Can you elaborate on "domains just feel wrong". I'm interested in how the
    domains api comes across. I've expressed my concerns with it in the past.
    --
    Job Board: http://jobs.nodejs.org/
    Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
    You received this message because you are subscribed to the Google
    Groups "nodejs" group.
    To post to this group, send email to nodejs@googlegroups.com
    To unsubscribe from this group, send email to
    nodejs+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/nodejs?hl=en?hl=en

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupnodejs @
categoriesnodejs
postedOct 22, '12 at 4:05p
activeOct 25, '12 at 5:45p
posts15
users7
websitenodejs.org
irc#node.js

People

Translate

site design / logo © 2022 Grokbase