An es2015+-isomorphic altjs language, with syntax inspired by CoffeeScript, Python, Ruby, and frappe, and architecture inspired by Babel.
TacoScript shares its Abstract Syntax Tree (AST) with JavaScript, using the same format as Babylon. This means that, for any valid JavaScript code, there is an exact, lossless version of that code in TacoScript, and vice versa: For all valid TacoScript code, there is an exact translated representation in JavaScript. Currently, whitespace will not always be preserved; eventually, whitespace will also be preserved.
Unlike CoffeeScript, TacoScript actually is, 100%, just JavaScript.
So, if it is just JavaScript, why does this exist? For the same reason that there are both British English and American English: Some people just prefer different conventions.
And also to experiment with new syntax that won't or can't be an ECMAScript proposal. (so Babel won't support them).
(In Progress)
Command line tools. Currently includes repl
, compose
, transpose
, compile
, and node
commands.
Parses TacoScript into an AST/CST. Uses the same tree format as Babylon, deviating where necessary.
import * as horchata from "horchata"
ast = horchata.parse(code, options)
Adds CST sourceElements
to an existing JavaScript / Babylon / estree CST.
(Previously tacoscript-generator
)
Generates TacoScript code from a Babylon AST/CST.
import generate from "tacotruck"
code = generate(ast, options, originalSourceCode)
(Not Implemented)
Converts a JavaScript AST with CST elements to a TacoScript CST, which preserves
whitespace. Inverse of alpastor
.
(In progress)
Converts a TacoScript AST's CST elements to JavaScript CST elements, which then
can be output as JavaScript code that preserves the whitespace present in the
TacoScript code. Inverse of taqueria
AST translator (transpiler / detranspiler) core.
comal (noun) /koˈmal/ - A flat, pan-like clay or metal griddle used to cook tortillas or other foods.
(Not Implemented)
Transforms a TacoScript AST so that it can be checked by ESLint.
(In Progress, needs generator and transforms)
AST transformations for implicitly returning functions ("sharp arrows").
(In Progress, needs generator and transforms)
AST transformations for this.
→ @
shorthand.
(In Progress, needs generator and transforms)
Parser & Generator plugins and AST transformations for and=
and or=
.
Could also include an acorn plugin for parsing ||=
and &&=
in javascript.
(Not Implemented)
Parser & Generator plugins for extern declarations. Required by any auto-const plugins, or if anyone creates an auto-let or CoffeeScript-style auto-var alternative plugin.
(Not Implemented)
AST transformations for automatic const variables when assignment is a statement. (Spec).
(Not Implemented)
AST transformations for automatic const variables in restricted expression forms. (Spec).
(Not Implemented)
AST transformations for automatic const variables anywhere forms. (Spec). May create ugly JavaScript code.
(In Progress, needs generator)
Parser & Generator and transformations for iife's created with the with
keyword syntax.
Example:
with= {bar: foo, boop: beep} > bar + boop
(Not Implemented)
Parser & Generator plugins and AST transformations for unless
and until
.
(Not Implemented)
Parser & Generator plugins and AST transformations for %%
.
(Not Implemented)
Parser & Generator plugins and AST transformations for a < b < c
, etc.
(Not Implemented)
Parser & Generator plugins and AST transformations for not instanceof
, not in
(, not of
).
(Parsing complete, generator and transformations ready to start)
AST transformations and verification for using the fat arrow (=>
) in any
function definition situation, for lexical binding of this
and arguments
.
Uses horchata's lexicallyBoundNamedFunctions
feature parsing option.
(Not Implemented)
Parser & Generator plugins and AST transformations for !!
(not not
) to
asbool
.
(Not Implemented)
Parser & Generator plugins and AST transformations for of
binary operator.
(Not Implemented)
Parser & Generator plugins and AST transformations for soak member expressions:
?.
and ?[
.
(Not Implemented)
Parser & Generator plugins and AST transformations for the null coalescing
operator: a ? b
.
(Not Implemented)
Combination of tacoscript-logical-assign and tacoscript-null-coalescing-op.
(Not Implemented)
Parser & Generator plugins and AST transformations so that in TacoScript,
typeof null === "null"
.
(Not Implemented)
Parser & Generator plugins and AST transformations for the non-fallthrough switch variant.
(Not Implemented)
Parser & Generator plugins and AST transformations for @@
shorthand operator.
(Not Implemented)
Allow super in any (i.e. non-class) function, and translate super()
to
this.constructor.super_.call(this)
and super.foo()
to
this.constructor.super_.prototype.foo.call(this)
The super_
convention is codified in util.inherits
.
(Not Implemented)
(Not Implemented)
(Not Implemented)
(Not Implemented)
(Not Implemented)
(Not Implemented)
Parser & Generator plugins and AST transformations for automatic labels for long
breaks: break for
, etc.
(Not Implemented)
Parser & Generator plugins and AST transformations for conditional catch clauses.
(Not Implemented)
Parser & Generator plugins and AST transformations for rescue
blocks for
functions, for simplified error handling.
(Not Implemented)
Combines tacoscript-conditional-catch and tacoscript-rescue.
(Not Implemented)
Parser & Generator plugins and AST transformations for upto
, below
, downto
, above
and by
in for loop headers
(Not Implemented)
Parser & Generator plugins for literate mode.
(Not Implemented)
(Not Implemented)
(Not Implemented)
(Not Implemented)
(Not Implemented)
(Not Implemented)
Git hooks to automatically create an equivalent history in git as if a JavaScript project was written in TacoScript, and to therefore seamlessly contribute to JavaScript projects by coding in TacoScript, and vice-versa.