Skip to content

ULL-ESIT-PL/left-side-pablo

Repository files navigation

babel

The left-side extension for JavaScript

By Pablo Santana González

To run the project

Try the extension yourself by following the instructions in the package published in npm.

Introduction

This repository contains the source code of @PSantanaGlez13's TFG (Trabajo Fin de Grado/Bachellor's Degree Thesis).

Background

Originally, in my third year of my degree in CS I was on the subject Procesadores de Lenguajes (Language Processors) in which we (the students) developed a programming language throughout the course. In one of the labs, we implemented assignable functions in said language.

The concept of assignable functions consists in defining functions that, as the name implies, are later assigned to. This binds the signature of the function to a certain value, overriding the normal behaviour of the function, just as it can be seen in the following pseudocode example:

Example

fun foo(bar) {
  return bar
}
foo(20) // 20, default behaviour
foo(20) = "Other value"
foo(19) // 19
foo(20) // "Other value", overriden default behaviour
foo(21) // 21

About the project

This project is an implementation of the assignable functions in JavaScript. Implementing the assignable functions in a real-world programming language (as opposed to the one developed in class) like JavaScript, that has very active community and is constantly being reviewed, poses as a challenge from a language design point of view, since it has to take into consideration the many particularities of the language itself when defining the semantics of this construct. It is also a learning experience in other aspects, such as JavaScript projects and the tools used for their development and the way a programming language is updated.

It started out as a fork of the Babel compiler project. Because of the quantity of packages in the repo (Babel follows a monorepo structure), the build time of the project was long and unnecesary, since the project uses only the parser and the rest are new packages.

Examples

Check the directory packages/a-test/in to see various examples of the extension.

Follows the original README.md of the Babel project

The compiler for writing next generation JavaScript.

Gitpod ready-to-code

v7 npm Downloads v6 npm Downloads

Travis Status CircleCI Status Coverage Status Slack Status Follow on Twitter

Supporting Babel

Backers on Open Collective Sponsors on Open Collective Business Strategy Status

Babel (pronounced "babble") is a community-driven project used by many companies and projects, and is maintained by a group of volunteers. If you'd like to help support the future of the project, please consider:

Sponsors

Our top sponsors are shown below! [Become a sponsor]

Intro

Babel is a tool that helps you write code in the latest version of JavaScript. When your supported environments don't support certain features natively, Babel will help you compile those features down to a supported version.

In

// ES2015 arrow function
[1, 2, 3].map((n) => n + 1);

Out

[1, 2, 3].map(function(n) {
  return n + 1;
});

Try it out at our REPL.

FAQ

Who maintains Babel?

Mostly a handful of volunteers, funded by you! Please check out our team page!

Is there a Babel song?

I'm so glad you asked: Hallelujah —— In Praise of Babel by @angus-c, audio version by @swyx. Tweet us your recordings!

Looking for support?

For questions and support please join our Slack Community (you can sign-up here for an invite), ask a question on Stack Overflow, or ping us on Twitter.

Where are the docs?

Check out our website: babeljs.io, and report issues/features at babel/website.

Want to report a bug or request a feature?

Please read through our CONTRIBUTING.md and fill out the issue template at babel/issues!

Want to contribute to Babel?

Check out:

Some resources:

How is the repo structured?

The Babel repo is managed as a monorepo that is composed of many npm packages.

License

MIT

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published