Saturday 27 July 2019

Z: A new transpiled language

Z is a transpiled, dynamically typed, loosely object oriented (in other words, it allows creation of objects whenever and wherever, and it doesn't support class-based design), and very functional. It transpiles to node.js, and can leverage the entire javascript ecosystem. It uses JavaScript's APIs, so it can be picked up in around a day or so. It is still in the alpha stage: there may be bugs with the compiler, or incomplete features. However, Z's pace of development is rapid, so new features (including bug fixes!) should be rolled out daily or weekly. By switching from JavaScript to Z for small projects you get:Fast Transpilation Time (Z's compiler can transpile thousands of lines per second.)Shorthand functionsA small standard library (5 modules, and growing)You still have the entire JavaScript ecosystem for the backendExpression SafetyPattern Matching (It's structural, like TypeScript's type system)Metaprogramming galore:Z supports meta declarations, which are basically the equivalent of #define in C.Z erases meta declarations at runtime, but compile time functions called dollar directives allow for use of metadata.Dollar directives are passed ASTs of the following expression or statement, allowing for crazy metaprogramming concepts. (Writing a for loop using an array literal - who would have thought that was possible? - with dollar directives, it is.)Z's dollar directives are not yet well documented, and have not been tested thoroughly. Use with caution.Elegant control flow: Z's built-in control constructs don't require parens around their conditions, and Z's "constructs" library contains many other control flow structures.Symbolic Names: Z dosen't have operators: instead Z's names can have symbols in them.Where Z is:WebsiteSubredditGithub OrgCompiler on NPMCompiler SourceStdlib on NPMStdlib Source

Submitted July 27, 2019 at 11:36PM by N8Programs

No comments:

Post a Comment