Code Monkey home page Code Monkey logo

mints's Introduction

mints: tiny typescript compiler

7.8kb

  • packages/mints: tiny typescript compiler
  • packages/pargen: parser generator
  • packages/pargen-tokenized: parser generator for tokens (mints use this)
  • packages/playground: mints web playground

Demo https://mints-playground.netlify.app/

LICENSE

MIT

mints's People

Contributors

mizchi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

naoki-tomita

mints's Issues

String Enums may wrong transform

Source

enum Keys {
  A = "Aaa",
}

console.log(`Keys.A: ${Keys.A}`);
console.log(`Keys.Aaa: ${Keys.Aaa}`);

Compare mints and Babel

Transformed with mints

const Keys={A:"Aaa","Aaa":"A",};console.log(`Keys.A: ${Keys.A}`);console.log(`Keys.Aaa: ${Keys.Aaa}`);

console output

Keys.A: Aaa
Keys.Aaa: A

Transformed with Babel

"use strict";

var Keys;

(function (Keys) {
  Keys["A"] = "Aaa";
})(Keys || (Keys = {}));

console.log(`Keys.A: ${Keys.A}`);
console.log(`Keys.Aaa: ${Keys.Aaa}`);

console output

Keys.A: Aaa
Keys.Aaa: undefined

What is this for?

Just wondering, what did you build this for?

I went looking for a tiny TS compiler that would be small and fast enough to run in the browser - perhaps in a service worker.

Is that what you're after as well?

I wonder, esbuild being the fastest thing out there, would it be possible to pull just the parser and transformer from it's libraries, build a WASM module using tinygo, and get something very fast and small?

With those compile times, and if it runs on a separate thread from the UI thread (in a service worker) it might not actually impact load times substantially.

You might not need to write an entirely new parser. Seems like a lot of work. So much hard work went into esbuild already, and expect it might be both small and fast if built with tinygo, as the parser itself is hand written and small.

What do you think?

The result of `!==` is wrong

I saw a parse failure, so I am reporting it.
If there is a !== or != in the code, the output will be incorrect.

when use !==

input

if(hoge !== null){
  return 0;
}

output

if(hoge == null){
  return 0;
}

when use !=

input

if(hoge != null){
  return 0;
}

output

if(hoge = null){
  return 0;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.