FAQ
Hey people,

Let me introduce you The Spoon: https://github.com/indutny/spoon

It's a JavaScript to CFG (Control-Flow Graph) transpiler and additionally a
CPS (Continuation Passing Style) transpiler too.

Basically, it lets you to rewrite code like this:

var data = 'prefix: ' + fs.read('file')

To this:

var data;
fs.read('file', function(err, result) {
data = 'prefix: ' + result;
});

Please check the readme, if you're interested.

Cheers,
Fedor.

--
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

  • Marcel Laverdet at Oct 1, 2012 at 9:43 pm
    You have no idea what you've done.
    On Mon, Oct 1, 2012 at 2:11 PM, Fedor Indutny wrote:

    Hey people,

    Let me introduce you The Spoon: https://github.com/indutny/spoon

    It's a JavaScript to CFG (Control-Flow Graph) transpiler and additionally
    a CPS (Continuation Passing Style) transpiler too.

    Basically, it lets you to rewrite code like this:

    var data = 'prefix: ' + fs.read('file')

    To this:

    var data;
    fs.read('file', function(err, result) {
    data = 'prefix: ' + result;
    });

    Please check the readme, if you're interested.

    Cheers,
    Fedor.

    --
    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
  • Mark Hahn at Oct 1, 2012 at 9:55 pm
    @Marcel just meant that you have started an infinite discussion thread. He
    wasn't insulting your module.
    On Mon, Oct 1, 2012 at 2:42 PM, Marcel Laverdet wrote:

    You have no idea what you've done.
    On Mon, Oct 1, 2012 at 2:11 PM, Fedor Indutny wrote:

    Hey people,

    Let me introduce you The Spoon: https://github.com/indutny/spoon

    It's a JavaScript to CFG (Control-Flow Graph) transpiler and additionally
    a CPS (Continuation Passing Style) transpiler too.

    Basically, it lets you to rewrite code like this:

    var data = 'prefix: ' + fs.read('file')

    To this:

    var data;
    fs.read('file', function(err, result) {
    data = 'prefix: ' + result;
    });

    Please check the readme, if you're interested.

    Cheers,
    Fedor.

    --
    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 2, 2012 at 6:28 am
    "I'm just doing my job".

    On Tue, Oct 2, 2012 at 1:55 AM, Mark Hahn wrote:

    @Marcel just meant that you have started an infinite discussion thread.
    He wasn't insulting your module.

    On Mon, Oct 1, 2012 at 2:42 PM, Marcel Laverdet wrote:

    You have no idea what you've done.
    On Mon, Oct 1, 2012 at 2:11 PM, Fedor Indutny wrote:

    Hey people,

    Let me introduce you The Spoon: https://github.com/indutny/spoon

    It's a JavaScript to CFG (Control-Flow Graph) transpiler and
    additionally a CPS (Continuation Passing Style) transpiler too.

    Basically, it lets you to rewrite code like this:

    var data = 'prefix: ' + fs.read('file')

    To this:

    var data;
    fs.read('file', function(err, result) {
    data = 'prefix: ' + result;
    });

    Please check the readme, if you're interested.

    Cheers,
    Fedor.

    --
    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
  • Ted Young at Oct 2, 2012 at 6:43 pm
    Just wondering, what were your use cases when writing spoon? Was it to solve production problems you were facing? Are you using it at nodejitsu?

    Cheers,
    Ted
    On Oct 1, 2012, at 11:28 PM, Fedor Indutny wrote:

    "I'm just doing my job".


    On Tue, Oct 2, 2012 at 1:55 AM, Mark Hahn wrote:
    @Marcel just meant that you have started an infinite discussion thread. He wasn't insulting your module.


    On Mon, Oct 1, 2012 at 2:42 PM, Marcel Laverdet wrote:
    You have no idea what you've done.

    On Mon, Oct 1, 2012 at 2:11 PM, Fedor Indutny wrote:
    Hey people,

    Let me introduce you The Spoon: https://github.com/indutny/spoon

    It's a JavaScript to CFG (Control-Flow Graph) transpiler and additionally a CPS (Continuation Passing Style) transpiler too.

    Basically, it lets you to rewrite code like this:

    var data = 'prefix: ' + fs.read('file')

    To this:

    var data;
    fs.read('file', function(err, result) {
    data = 'prefix: ' + result;
    });

    Please check the readme, if you're interested.

    Cheers,
    Fedor.


    --
    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
    --
    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 2, 2012 at 6:49 pm
    No, we ain't using this at nodejitsu.

    I'm coauthor of xjst module, which is compiling templates to a
    highly-recursive javascript code. However some javascript VMs like
    Spidermonkey doesn't support that recursion well, and here comes spoon! It
    can translate any recursive calls into fake asynchronous ones. And then
    using tricky dispatch function I can run those calls one-by-one without any
    recursion at all:
    https://github.com/veged/xjst/blob/master/lib/xjst/utils.js#L68

    On Tue, Oct 2, 2012 at 10:43 PM, Ted Young wrote:

    Just wondering, what were your use cases when writing spoon? Was it to
    solve production problems you were facing? Are you using it at nodejitsu?

    Cheers,
    Ted

    On Oct 1, 2012, at 11:28 PM, Fedor Indutny wrote:

    "I'm just doing my job".

    On Tue, Oct 2, 2012 at 1:55 AM, Mark Hahn wrote:

    @Marcel just meant that you have started an infinite discussion thread.
    He wasn't insulting your module.

    On Mon, Oct 1, 2012 at 2:42 PM, Marcel Laverdet wrote:

    You have no idea what you've done.
    On Mon, Oct 1, 2012 at 2:11 PM, Fedor Indutny wrote:

    Hey people,

    Let me introduce you The Spoon: https://github.com/indutny/spoon

    It's a JavaScript to CFG (Control-Flow Graph) transpiler and
    additionally a CPS (Continuation Passing Style) transpiler too.

    Basically, it lets you to rewrite code like this:

    var data = 'prefix: ' + fs.read('file')

    To this:

    var data;
    fs.read('file', function(err, result) {
    data = 'prefix: ' + result;
    });

    Please check the readme, if you're interested.

    Cheers,
    Fedor.


    --
    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


    --
    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 2, 2012 at 7:03 pm
    I'll write a blog post about it on http://blog.indutny.com/ soon,
    describing everything in details.

    On Tue, Oct 2, 2012 at 10:49 PM, Fedor Indutny wrote:

    No, we ain't using this at nodejitsu.

    I'm coauthor of xjst module, which is compiling templates to a
    highly-recursive javascript code. However some javascript VMs like
    Spidermonkey doesn't support that recursion well, and here comes spoon! It
    can translate any recursive calls into fake asynchronous ones. And then
    using tricky dispatch function I can run those calls one-by-one without any
    recursion at all:
    https://github.com/veged/xjst/blob/master/lib/xjst/utils.js#L68


    On Tue, Oct 2, 2012 at 10:43 PM, Ted Young wrote:

    Just wondering, what were your use cases when writing spoon? Was it to
    solve production problems you were facing? Are you using it at nodejitsu?

    Cheers,
    Ted

    On Oct 1, 2012, at 11:28 PM, Fedor Indutny wrote:

    "I'm just doing my job".

    On Tue, Oct 2, 2012 at 1:55 AM, Mark Hahn wrote:

    @Marcel just meant that you have started an infinite discussion thread.
    He wasn't insulting your module.

    On Mon, Oct 1, 2012 at 2:42 PM, Marcel Laverdet wrote:

    You have no idea what you've done.
    On Mon, Oct 1, 2012 at 2:11 PM, Fedor Indutny wrote:

    Hey people,

    Let me introduce you The Spoon: https://github.com/indutny/spoon

    It's a JavaScript to CFG (Control-Flow Graph) transpiler and
    additionally a CPS (Continuation Passing Style) transpiler too.

    Basically, it lets you to rewrite code like this:

    var data = 'prefix: ' + fs.read('file')

    To this:

    var data;
    fs.read('file', function(err, result) {
    data = 'prefix: ' + result;
    });

    Please check the readme, if you're interested.

    Cheers,
    Fedor.


    --
    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


    --
    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 2, 2012 at 7:04 pm
    Fedor,

    Is xjst meant to run in a browser at all? I ask because I see code where
    objects with a property named "default" are accessing like...

    obj["default"]

    which isn't necessary in runtimes that correctly implement ES5.1. "default"
    is a reserved word, but property names are IdentifierNames, not
    Identifiers, so "default" is valid when used like...

    obj.default;

    eg.

    $ node
    var o = {default: "hi!"} undefined
    o.default
    'hi!'
    >


    Anyway, no big deal, I just happened to notice it and figured I'd mention.

    Rick
    On Tue, Oct 2, 2012 at 2:56 PM, Fedor Indutny wrote:

    I'll write a blog post about it on http://blog.indutny.com/ soon,
    describing everything in details.

    On Tue, Oct 2, 2012 at 10:49 PM, Fedor Indutny wrote:

    No, we ain't using this at nodejitsu.

    I'm coauthor of xjst module, which is compiling templates to a
    highly-recursive javascript code. However some javascript VMs like
    Spidermonkey doesn't support that recursion well, and here comes spoon! It
    can translate any recursive calls into fake asynchronous ones. And then
    using tricky dispatch function I can run those calls one-by-one without any
    recursion at all:
    https://github.com/veged/xjst/blob/master/lib/xjst/utils.js#L68


    On Tue, Oct 2, 2012 at 10:43 PM, Ted Young wrote:

    Just wondering, what were your use cases when writing spoon? Was it to
    solve production problems you were facing? Are you using it at nodejitsu?

    Cheers,
    Ted

    On Oct 1, 2012, at 11:28 PM, Fedor Indutny wrote:

    "I'm just doing my job".

    On Tue, Oct 2, 2012 at 1:55 AM, Mark Hahn wrote:

    @Marcel just meant that you have started an infinite discussion
    thread. He wasn't insulting your module.

    On Mon, Oct 1, 2012 at 2:42 PM, Marcel Laverdet wrote:

    You have no idea what you've done.
    On Mon, Oct 1, 2012 at 2:11 PM, Fedor Indutny wrote:

    Hey people,

    Let me introduce you The Spoon: https://github.com/indutny/spoon

    It's a JavaScript to CFG (Control-Flow Graph) transpiler and
    additionally a CPS (Continuation Passing Style) transpiler too.

    Basically, it lets you to rewrite code like this:

    var data = 'prefix: ' + fs.read('file')

    To this:

    var data;
    fs.read('file', function(err, result) {
    data = 'prefix: ' + result;
    });

    Please check the readme, if you're interested.

    Cheers,
    Fedor.


    --
    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


    --
    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 2, 2012 at 7:14 pm
    Well, it supposed to work in all browsers, and it supposed to be
    optimizable by all optimizers including uglifyjs, closure compiler and yui
    compressor (that's why I'm using "escaped" property names sometimes).

    On Tue, Oct 2, 2012 at 11:03 PM, Rick Waldron wrote:

    Fedor,

    Is xjst meant to run in a browser at all? I ask because I see code where
    objects with a property named "default" are accessing like...

    obj["default"]

    which isn't necessary in runtimes that correctly implement ES5.1.
    "default" is a reserved word, but property names are IdentifierNames, not
    Identifiers, so "default" is valid when used like...

    obj.default;

    eg.

    $ node
    var o = {default: "hi!"} undefined
    o.default 'hi!'

    Anyway, no big deal, I just happened to notice it and figured I'd mention.

    Rick

    On Tue, Oct 2, 2012 at 2:56 PM, Fedor Indutny wrote:

    I'll write a blog post about it on http://blog.indutny.com/ soon,
    describing everything in details.

    On Tue, Oct 2, 2012 at 10:49 PM, Fedor Indutny wrote:

    No, we ain't using this at nodejitsu.

    I'm coauthor of xjst module, which is compiling templates to a
    highly-recursive javascript code. However some javascript VMs like
    Spidermonkey doesn't support that recursion well, and here comes spoon! It
    can translate any recursive calls into fake asynchronous ones. And then
    using tricky dispatch function I can run those calls one-by-one without any
    recursion at all:
    https://github.com/veged/xjst/blob/master/lib/xjst/utils.js#L68


    On Tue, Oct 2, 2012 at 10:43 PM, Ted Young wrote:

    Just wondering, what were your use cases when writing spoon? Was it to
    solve production problems you were facing? Are you using it at nodejitsu?

    Cheers,
    Ted

    On Oct 1, 2012, at 11:28 PM, Fedor Indutny wrote:

    "I'm just doing my job".

    On Tue, Oct 2, 2012 at 1:55 AM, Mark Hahn wrote:

    @Marcel just meant that you have started an infinite discussion
    thread. He wasn't insulting your module.

    On Mon, Oct 1, 2012 at 2:42 PM, Marcel Laverdet wrote:

    You have no idea what you've done.
    On Mon, Oct 1, 2012 at 2:11 PM, Fedor Indutny wrote:

    Hey people,

    Let me introduce you The Spoon: https://github.com/indutny/spoon

    It's a JavaScript to CFG (Control-Flow Graph) transpiler and
    additionally a CPS (Continuation Passing Style) transpiler too.

    Basically, it lets you to rewrite code like this:

    var data = 'prefix: ' + fs.read('file')

    To this:

    var data;
    fs.read('file', function(err, result) {
    data = 'prefix: ' + result;
    });

    Please check the readme, if you're interested.

    Cheers,
    Fedor.


    --
    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


    --
    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 2, 2012 at 7:41 pm

    On Tue, Oct 2, 2012 at 3:07 PM, Fedor Indutny wrote:

    Well, it supposed to work in all browsers, and it supposed to be
    optimizable by all optimizers including uglifyjs, closure compiler and yui
    compressor (that's why I'm using "escaped" property names sometimes).

    Ah, got it, this makes sense :)

    Rick


    On Tue, Oct 2, 2012 at 11:03 PM, Rick Waldron wrote:

    Fedor,

    Is xjst meant to run in a browser at all? I ask because I see code where
    objects with a property named "default" are accessing like...

    obj["default"]

    which isn't necessary in runtimes that correctly implement ES5.1.
    "default" is a reserved word, but property names are IdentifierNames, not
    Identifiers, so "default" is valid when used like...

    obj.default;

    eg.

    $ node
    var o = {default: "hi!"} undefined
    o.default 'hi!'

    Anyway, no big deal, I just happened to notice it and figured I'd mention.

    Rick

    On Tue, Oct 2, 2012 at 2:56 PM, Fedor Indutny wrote:

    I'll write a blog post about it on http://blog.indutny.com/ soon,
    describing everything in details.

    On Tue, Oct 2, 2012 at 10:49 PM, Fedor Indutny wrote:

    No, we ain't using this at nodejitsu.

    I'm coauthor of xjst module, which is compiling templates to a
    highly-recursive javascript code. However some javascript VMs like
    Spidermonkey doesn't support that recursion well, and here comes spoon! It
    can translate any recursive calls into fake asynchronous ones. And then
    using tricky dispatch function I can run those calls one-by-one without any
    recursion at all:
    https://github.com/veged/xjst/blob/master/lib/xjst/utils.js#L68


    On Tue, Oct 2, 2012 at 10:43 PM, Ted Young wrote:

    Just wondering, what were your use cases when writing spoon? Was it to
    solve production problems you were facing? Are you using it at nodejitsu?

    Cheers,
    Ted

    On Oct 1, 2012, at 11:28 PM, Fedor Indutny wrote:

    "I'm just doing my job".

    On Tue, Oct 2, 2012 at 1:55 AM, Mark Hahn wrote:

    @Marcel just meant that you have started an infinite discussion
    thread. He wasn't insulting your module.

    On Mon, Oct 1, 2012 at 2:42 PM, Marcel Laverdet wrote:

    You have no idea what you've done.
    On Mon, Oct 1, 2012 at 2:11 PM, Fedor Indutny wrote:

    Hey people,

    Let me introduce you The Spoon: https://github.com/indutny/spoon

    It's a JavaScript to CFG (Control-Flow Graph) transpiler and
    additionally a CPS (Continuation Passing Style) transpiler too.

    Basically, it lets you to rewrite code like this:

    var data = 'prefix: ' + fs.read('file')

    To this:

    var data;
    fs.read('file', function(err, result) {
    data = 'prefix: ' + result;
    });

    Please check the readme, if you're interested.

    Cheers,
    Fedor.


    --
    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


    --
    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
    --
    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
  • Bruno Jouhier at Oct 3, 2012 at 8:14 pm
    Hi Fedor,

    This looks really promising.

    I tried to integrate it as an alternate transformation engine for
    streamline (a fourth one) and the first results are encouraging: I got the
    first diskUsage example running.

    I had to make a few changes to align spoon on the node.js callback format
    (error as first callback parameter + testing for err in callback and
    propagating it through __$callback).

    My unit test suite is not running yet because of some unimplemented
    features: switch, try/finally, labelled statement. But I like the approach.
    The CGG intermediate representation is cool and can probably produce more
    efficent code than my pattern based approach.

    My changes are here:
    https://github.com/bjouhier/spoon/commit/83910ee1a4b4036fa1ca38b4f19736b136ace513

    Bruno
    On Monday, October 1, 2012 9:11:57 PM UTC+2, Fedor Indutny wrote:

    Hey people,

    Let me introduce you The Spoon: https://github.com/indutny/spoon

    It's a JavaScript to CFG (Control-Flow Graph) transpiler and additionally
    a CPS (Continuation Passing Style) transpiler too.

    Basically, it lets you to rewrite code like this:

    var data = 'prefix: ' + fs.read('file')

    To this:

    var data;
    fs.read('file', function(err, result) {
    data = 'prefix: ' + result;
    });

    Please check the readme, if you're interested.

    Cheers,
    Fedor.
    --
    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
  • Bruno Jouhier at Oct 3, 2012 at 8:16 pm
    s/CGG/CFG/
    On Wednesday, October 3, 2012 10:14:03 PM UTC+2, Bruno Jouhier wrote:

    Hi Fedor,

    This looks really promising.

    I tried to integrate it as an alternate transformation engine for
    streamline (a fourth one) and the first results are encouraging: I got the
    first diskUsage example running.

    I had to make a few changes to align spoon on the node.js callback format
    (error as first callback parameter + testing for err in callback and
    propagating it through __$callback).

    My unit test suite is not running yet because of some unimplemented
    features: switch, try/finally, labelled statement. But I like the approach.
    The CGG intermediate representation is cool and can probably produce more
    efficent code than my pattern based approach.

    My changes are here:
    https://github.com/bjouhier/spoon/commit/83910ee1a4b4036fa1ca38b4f19736b136ace513

    Bruno
    On Monday, October 1, 2012 9:11:57 PM UTC+2, Fedor Indutny wrote:

    Hey people,

    Let me introduce you The Spoon: https://github.com/indutny/spoon

    It's a JavaScript to CFG (Control-Flow Graph) transpiler and additionally
    a CPS (Continuation Passing Style) transpiler too.

    Basically, it lets you to rewrite code like this:

    var data = 'prefix: ' + fs.read('file')

    To this:

    var data;
    fs.read('file', function(err, result) {
    data = 'prefix: ' + result;
    });

    Please check the readme, if you're interested.

    Cheers,
    Fedor.
    --
    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 3, 2012 at 8:44 pm
    Very nice, Bruno!

    Looking forward for getting this back into main repo!


    On Thu, Oct 4, 2012 at 12:16 AM, Bruno Jouhier wrote:

    s/CGG/CFG/

    On Wednesday, October 3, 2012 10:14:03 PM UTC+2, Bruno Jouhier wrote:

    Hi Fedor,

    This looks really promising.

    I tried to integrate it as an alternate transformation engine for
    streamline (a fourth one) and the first results are encouraging: I got the
    first diskUsage example running.

    I had to make a few changes to align spoon on the node.js callback format
    (error as first callback parameter + testing for err in callback and
    propagating it through __$callback).

    My unit test suite is not running yet because of some unimplemented
    features: switch, try/finally, labelled statement. But I like the approach.
    The CGG intermediate representation is cool and can probably produce more
    efficent code than my pattern based approach.

    My changes are here: https://github.com/bjouhier/**spoon/commit/**
    83910ee1a4b4036fa1ca38b4f19736**b136ace513<https://github.com/bjouhier/spoon/commit/83910ee1a4b4036fa1ca38b4f19736b136ace513>

    Bruno
    On Monday, October 1, 2012 9:11:57 PM UTC+2, Fedor Indutny wrote:

    Hey people,

    Let me introduce you The Spoon: https://github.com/**indutny/spoon<https://github.com/indutny/spoon>

    It's a JavaScript to CFG (Control-Flow Graph) transpiler and
    additionally a CPS (Continuation Passing Style) transpiler too.

    Basically, it lets you to rewrite code like this:

    var data = 'prefix: ' + fs.read('file')

    To this:

    var data;
    fs.read('file', function(err, result) {
    data = 'prefix: ' + result;
    });

    Please check the readme, if you're interested.

    Cheers,
    Fedor.
    --
    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 1, '12 at 7:16p
activeOct 3, '12 at 8:44p
posts13
users6
websitenodejs.org
irc#node.js

People

Translate

site design / logo © 2022 Grokbase