Comments (12)
So we actually use 3 versions:
- the original Traceur for transpiling our transpiler
- our transpiler that extends Traceur for JavaScript
- our transpiler that extends Traceur for Dart
I don't like inheritance and propose to continue just like we already did:
- use the same Parser for both JavaScript and Dart that extends the Traceur Parser
- have different Transformers for Dart and JavaScript that do special transformations for those two languages
- have different Writers for Dat and JavaScript
- 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.
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.
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.
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.
Ok, so we would have:
transpiler
+-- src
+-- syntax
+-- dart
+-- codegeneration
+-- outputgeneration
+--syntax
+-- js
+-- codegeneration
+-- outputgeneration
+--syntax
from angular.
This is how I see things for now
from angular.
+1
from angular.
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.
Wait,
this refactoring has not happened yet (i.e. the splitting into the js
and dart
folder).
from angular.
@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.
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.
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)
- Router Outlet won't work if router link is in ngTemplate HOT 2
- NullInjectorError: No provider for Firestore2! HOT 1
- angular.dev: youtube embeds are being blocked on firefox
- reading required signal input from effect causes error NG0950 when done inside structural directive creating an embedded view after promise resolves HOT 5
- withComponentInputBinding doesn't work as excepted with input signals HOT 1
- Angular 17 @for has memory leak HOT 1
- Reactive forms directives should be standalone HOT 1
- Rename Change detection "Default"
- `swPush.requestSubscription` never resolves on Arc browser (mac os) HOT 1
- AngularGPT
- Recursive template with @defer HOT 3
- The output-function page is not accessible https://angular.dev/guide/output-function
- developer preview features HOT 2
- toSignal causes the signal to not being lazy-evaluated HOT 6
- API for ngModule bootstrap for SSR? - `platformServer.bootstrapModule` vs `bootstrapApplication` of `@angular/platform-server`? HOT 2
- Renderer2 method that allows you to set signal inputs HOT 5
- Angular attributes produce HTML validation errors HOT 3
- Angular 15 - router.events are empty with nested router outlets on page refresh HOT 1
- The CSP nonce remains in the DOM after being read by Angular HOT 1
- API Reference search on angular.dev HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular.