Git Product home page Git Product logo

Comments (12)

tbosch avatar tbosch commented on April 19, 2024

So we actually use 3 versions:

  1. the original Traceur for transpiling our transpiler
  2. our transpiler that extends Traceur for JavaScript
  3. our transpiler that extends Traceur for Dart

I don't like inheritance and propose to continue just like we already did:

  1. use the same Parser for both JavaScript and Dart that extends the Traceur Parser
  2. have different Transformers for Dart and JavaScript that do special transformations for those two languages
  3. have different Writers for Dat and JavaScript
  4. have one Compiler that checks the outputLanguage flag and creates the parser, the right transformers and the right writer.

So I would propose the following structure:

transpiler
 +-- src
    +-- dart        
         +-- codegeneration
         +-- outputgeneration
    +-- js      
         +-- codegeneration
         +-- outputgeneration
     +-- syntax (shared for both)

from angular.

vicb avatar vicb commented on April 19, 2024

I mostly agree with your latest comment.
The only discutable point is the syntax folder. Some of the parse trees are dart specific. So I think there should be such a folder in both js and dart.
I was thinking about this when speaking of inheritance: the Js version would have the support for additional syntax and the dart version the additional code to deal with dart specificities. Not sure if they should litteraly inherit.
So the idea would be a mix of both the solution, the top level syntax folder would contain the common Parser.
At least this is my idea for now. Further discussions need to happen.

from angular.

tbosch avatar tbosch commented on April 19, 2024

Those Dart/Js specific parse trees would only be created from Dart/Js
specific transformers, and not from the Parser, right?

On Wednesday, October 8, 2014, Victor Berchet [email protected]
wrote:

I mostly agree with your latest comment.
The only discutable point is the syntax folder. Some of the parse trees
are dart specific. So I think there should be such a folder in both js and
dart.
I was thinking about this when speaking of inheritance: the Js version
would have the support for additional syntax and the dart version the
additional code to deal with dart specificities. Not sure if they should
litteraly inherit.
So the idea would be a mix of both the solution, the top level syntax
folder would contain the common Parser.
At least this is my idea for now. Further discussions need to happen.


Reply to this email directly or view it on GitHub
#69 (comment).

from angular.

vicb avatar vicb commented on April 19, 2024

That's exact. The output of the parser is always the same whatever the target language. Then specific transformers might create different pt for different language constructs.

from angular.

tbosch avatar tbosch commented on April 19, 2024

Ok, so we would have:

transpiler
 +-- src
    +-- syntax
    +-- dart        
         +-- codegeneration
         +-- outputgeneration
         +--syntax
    +-- js      
         +-- codegeneration
         +-- outputgeneration
         +--syntax

from angular.

vicb avatar vicb commented on April 19, 2024

This is how I see things for now

from angular.

tbosch avatar tbosch commented on April 19, 2024

+1

from angular.

naomiblack avatar naomiblack commented on April 19, 2024

I don't think there's any work to do here so I'm closing the issue. Let me know if there's something related to this that's work being done...

from angular.

tbosch avatar tbosch commented on April 19, 2024

Wait,
this refactoring has not happened yet (i.e. the splitting into the js and dart folder).

from angular.

vicb avatar vicb commented on April 19, 2024

@tbosch do you think this should be done pro-actively or that we can wait until we need it - I originally opened this issue because we planned to update the Parser to support class property declaration (which is not supported by Traceur as of now). However this feature might be integrated in Traceur.

from angular.

tbosch avatar tbosch commented on April 19, 2024

Ah right.
So you are saying we might not have any additions to JS at all but rather do them in traceur (or not at all)? Makes sense.

Ok, closing again, thanks for clarifying.

from angular.

angular-automatic-lock-bot avatar angular-automatic-lock-bot commented on April 19, 2024

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

from angular.

Related Issues (20)

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.