Babel finished?

This commit is contained in:
Rolf Martin Glomsrud 2024-05-29 19:41:31 +02:00
parent a717faece2
commit 234feb757c
3 changed files with 39 additions and 10 deletions

Binary file not shown.

View file

@ -11,6 +11,8 @@ Technical Committee 39 (abbreviated as TC39) is a group within ECMA internationa
This section will contain what is a proposal, and how proposals are developed in TC39 for the ECMA-262 language standard.
A proposal in this context is a suggested change to the ECMA-262 language standard. These additions to the standard have to solve some form of problem with the current version of ECMAScript. Such problems can come in many forms, and can apply to any part of the language. A problem can be, features that are not present in the language, inconsistent parts of the language, simplification of common patterns, etc etc. The proposal development process is defined in the document TC39 Process.
\subsection*{TC39 Process}
The TC39 process~\cite{TC39Process}, is a process document describing how the extension ECMA-262 is performed. A suggested change to the ECMA-262 standard is in the form of a \emph{proposal}. This process documents describes the stages a proposal has to pass through to be accepted into the ECMA-262 standard.
@ -27,20 +29,21 @@ Stage 3, proposal is recommended for implementation. Once a proposal has been su
Stage 4, the proposal is completed and included in the standard.
At this point, the committee will devote time to examine the problem space, and discuss possible solutions.
Proposals - what is a proposal (has to include motivation, prior art --- see what we had in the JavaZone talk about proposals)
\section{AST and Babel}
\subsection*{Abstract Syntax Tree}
Abstract Syntax Trees (AST) is one of the most common representations used to represent source code of programming languages~\cite{AST3}. It allows for the storage of structured text into a tree, this is used in applications that work with source code, as source code is a form of structured text.
Abstract Syntax Trees, Babel, AST traversal
\subsection*{Babel}
Babel is a JavaScript toolchain, its main usage is converting ECMASCript 2015 and newer into backwards older versions of JavaScript. The conversion to older versions is done to increase compatibility of JavaScript in older environments such as older browsers.
Babel has a suite of libraries used to work with JavaScript source code, each library relies on Babels AST definition~\cite{BabelAST}. The AST specification Babel uses tries to stay as true to the ECMAScript standard as possible~\cite{BabelSpecCompliant}, which has made it a recommended parser to use for proposal transpiler implementations~\cite{TC39RecommendBabel}.
Babel's mission is to transpile newer version of JavaScript into older versions that are more compatible with different environments. It has a rich plugin system to allow a myriad of features to be enabled or disabled. This makes the parser very versatile to fit different ways of working with JavaScript source code.
Babels main feature is \texttt{@babel/parse}~\cite{BabelParser} and its plugins. This library allows parsing of JavaScript experimental features. These features are usually proposals that are under development by TC39, and the development of these plugins are a part of the proposal deliberation process. Some examples of proposals that were first supported by Babels plugin system are "Do Expression"~\cite{Proposal:DoProposal} and "Pipeline"~\cite{Pipeline}.
\section{Source code Querying}

View file

@ -385,3 +385,29 @@
note = {[Online; accessed 28. May 2024]},
url = {https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md}
}
@misc{AST3,
title = {Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?},
author = {Weisong Sun and Chunrong Fang and Yun Miao and Yudu You and Mengzhe Yuan and Yuchen Chen and Quanjun Zhang and An Guo and Xiang Chen and Yang Liu and Zhenyu Chen},
year = {2023},
eprint = {2312.00413},
archiveprefix = {arXiv},
primaryclass = {cs.SE}
}
@misc{BabelSpecCompliant,
title = {{What is Babel? {$\cdot$} Babel}},
year = {2024},
month = may,
urldate = {2024-05-29},
note = {[Online; accessed 29. May 2024]},
url = {https://babeljs.io/docs/#spec-compliant}
}
@misc{TC39RecommendBabel,
title = {{how-we-work/implement.md at main {$\cdot$} tc39/how-we-work}},
year = {2024},
month = may,
urldate = {2024-05-29},
note = {[Online; accessed 29. May 2024]},
url = {https://github.com/tc39/how-we-work/blob/main/implement.md#transpiler-implementations}
}