proposals icon indicating copy to clipboard operation
proposals copied to clipboard

Binary AST (Stage 1)

Open hzoo opened this issue 7 years ago • 9 comments

Champions: @syg, @vdjeric, @Yoric, @kannan-vijayan Spec Repo: https://github.com/syg/ecmascript-binary-ast/ First presented at the July 2017 meeting: https://github.com/tc39/agendas/blob/master/2017/07.md

Why is this relevant

Babel operates on an AST, and would be part of the toolchain that should be able to take advantage of this format. This would help consolidate tooling to use the same AST. Would be a breaking change, unless our AST is adopted (unlikely, and probably not desired).

hzoo avatar Jul 28 '17 04:07 hzoo

At this point, there's no particular implementation action to be taken. The binary format has not yet been fully designed.

littledan avatar Aug 03 '17 18:08 littledan

There's now an official early spec, it'd be cool if the parts of Babel could (optionally) use this format in future instead of the ESTree based one.

I'll give a shot at creating a tool that converts Babylon's (estree-like) ASTs into the format currently in the spec to see how difficult this might be.

Jamesernator avatar May 25 '18 11:05 Jamesernator

I am very happy by the reception but I think it’s still too early. There’s a lot of the corners of the spec that are just missing. I’ll make an effort to fill out the spec before the July meeting.

On May 25, 2018, at 07:48, James Browning [email protected] wrote:

There's now an official early spec, it'd be cool if the parts of Babel could (optionally) use this format in future instead of the ESTree based one.

I'll give a shot at creating a tool that converts Babylon's (estree-like) ASTs into the format currently in the spec to see how difficult this might be.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

syg avatar May 25 '18 13:05 syg

I don't really intend to publish anything per se other than maybe sharing a link to an interactive version until the spec is more stable. But I think trying to implement a Babel -> BinaryAST converter will give some good insights.

I've already found a couple of odd bits and pieces in the AST that I (personally) find odd so I'll open some issues on the binary AST repo itself.

Jamesernator avatar May 25 '18 15:05 Jamesernator

@Jamesernator, you might want to take a look at https://github.com/shapesecurity/shift-spidermonkey-converter-js, which does conversions between a format similar to the one in binast (i.e. shift) and a format similar to the one in babel (i.e. estree). It's a little out of date, but not too far off.

bakkot avatar May 25 '18 15:05 bakkot

Excellent, please file issues on the spec repo.

On May 25, 2018, at 11:23, James Browning [email protected] wrote:

I don't really intend to publish anything per se other than maybe sharing a link to an interactive version until the spec is more stable. But I think trying to implement a Babel -> BinaryAST converter will give some good insights.

I've already found a couple of odd bits and pieces in the AST that I (personally) find odd so I'll open some issues on the binary AST repo itself.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

syg avatar May 25 '18 15:05 syg

@Jamesernator, did you ever end up filing those issues? If you (remember them) and still think they're valid, I'd be interest in reading them.

bakkot avatar Jul 14 '18 06:07 bakkot

Dear all, is there any "compressed" AST algorithm available? My scenario is to ship sort-of compile code snapshot to live server, which trigger by github-hook (i.e. after source code pushed to github, using a hook to forward the code and compile and then ship to live server)....

mgttt avatar Sep 25 '19 04:09 mgttt

@wanjochan The latest versions of the Binary AST format use a compressed format, yes. It's still very experimental, though, and the details of the format will change.

Yoric avatar Sep 25 '19 12:09 Yoric