npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bitloops/bl-transpiler

v0.7.5

Published

The one and only Bitloops Language transpiler

Downloads

36

Readme

npm version FOSSA Status

Bitloops Language Transpiler

What is a transpiler?

A transpiler is a type of translator that takes the source code of a program written in a programming language as its input and produces an equivalent source code in the same or a different programming language.

Structure

Transpiler is composed by the following building blocks:

The transpilation follows the flow mentioned below:

Architecture of a transpiler

  1. The code in the original (bitloops) language is parsed by a language parser which is ANTLR in our case, in order to create an AST. Specifically in ANTLR's implementation in order for ANTLR to be able to parse the original language, two files are needed, to specify the language grammar in order for ANTLR to create the AST (we specifically use ANTLR's visitor functionality):

    • The Lexer file (e.g. BitloopsLexer.g4)
    • The Parser file (e.g. BitloopsParser.g4)
  2. After the AST is created there is a step to create an intermediate model. The intermediate model is a data tree structure model which will be used to generate the AST target language tree. In this step validation logic for this tree could be added.

  3. Then the intermediate tree can be used as base to generate the AST target language tree which will have the characteristics needed to create the actual code for the target language. <<This step has not been implemented yet in our case.>>

  4. The final step is to create the actual code in the target language.

Transpiler Folder structure

The transpiler folder structure can be found at transpiler/src. More specifically:

  • Folder transpiler/src/parser contains all the logic concerning the ANTLR parsing from the original bitloops language to AST of original language. Here the ANTLR grammar is defined via the lexer and parser g4 files. Currently we have two different grammars for the setup and for all the other elements which can be found at transpiler/src/parser/setup and transpiler/src/parser/core respectively.

  • Folder transpiler/src/ast contains the implementation for the part AST -> Intermediate Model. The setup functionality may be found at the transpiler/src/ast/setup. All the others elements of the language, which can be found in the transpiler/src/ast/core

  • Folder transpiler/src/target contains the implementation from the intermediate model to the target language. Currently only implementation for typescript as a target language exists.