When macros will get in, will the core get slimmed in favour of macro-definitions?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

When macros will get in, will the core get slimmed in favour of macro-definitions?

Herby Vojčík
Hello,

in fact, I am just interested on the answer to the question placed in
the subject, in the light of recent discussion emphasizing minimality.

Thanks,
Herby
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: When macros will get in, will the core get slimmed in favour of macro-definitions?

C. Scott Ananian
I think you will note that many of the "built in" methods in the spec are already implemented in JavaScript code in many implementations (v8, firefox).   Similarly the ability to implement more fundamental features in terms of macro definitions may well be pursued by the implementations.  But note that the spec does not *mandate* that these built-ins are defined 'natively' in JavaScript (the spec does not use JavaScript to define the required behavior), and I would expect that macros would be treated similarly: that is, the spec definitions will not be written as applications of macros, but implementations are free to use macros to implement them were appropriate.

I would certainly expect a macro proposal to be evaluated more favorably if it were powerful enough to allow some implementation refactoring of this sort.  And in fact, I wouldn't be surprised for a successful macro proposal to have been prototyped in the implementation of one of the major engines.

This is not an official position, of course.  But I believe you can use history as a guide.
  --scott

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: When macros will get in, will the core get slimmed in favour of macro-definitions?

Brendan Eich-5
In reply to this post by Herby Vojčík
Sure, we'd want that. And sweet.js can handle a lot (it handled classes,
destructuring, and other ES6 features before they were implemented in
popular engines). This may take a while. Best way to ensure this
outcome: more people learning, using, and helping improve sweet.js.

/be
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: When macros will get in, will the core get slimmed in favour of macro-definitions?

Andreas Rossberg-4
I doubt this will be possible in a backwards compatible manner. With ES6, we missed the opportunity to take more of a desugaring approach for new features. As a consequence, there now is a fair amount of micro variation between seemingly related features that is only describable in terms of lower-level spec language.

/Andreas


On 22 June 2015 at 06:23, Brendan Eich <[hidden email]> wrote:
Sure, we'd want that. And sweet.js can handle a lot (it handled classes, destructuring, and other ES6 features before they were implemented in popular engines). This may take a while. Best way to ensure this outcome: more people learning, using, and helping improve sweet.js.

/be

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss