[gwt-contrib] Checkstyle for tests
Hi, Is it intentional that tests are not checked by checkstyle? Does it mean that code in tests doesn't need to follow GWT style guide? -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [ANN] Scala+GWT 0.1-M3 released
Hello, I'm excited to announce second milestone of Scala+GWT project. Download (and then follow README instructions) from here: http://goo.gl/RZdVT Release notes (included below) can be found here: http://goo.gl/H8san Scala+GWT 0.1-M3 The third official milestone release from the Scala+GWT project. You can check release notes for previous release [here]( http://scalagwt.github.com/releasenotes). This release consists of just samples packaged along with snapshot of jars needed to build them. Those jars include our own version of both GWT and Scala. This release doesn't come with any official artifacts apart from the tarball you can download from [ http://github.com/scalagwt/scalagwt-sample](http://github.com/scalagwt/scalagwt-sample) . ### Changes since last release * Eclipse support for development mode ### Eclipse support We've integrated [Scala IDE](http://www.scala-ide.org/) so you can develop GWT applications in Scala using Eclipse. Development mode is supported. ### Known issues * many patterns in pattern matching logic are not supported (should be fixed in next release) examples include * pattern alternatives (`|`) * guard patterns (`if` guard) * in some cases (like gwtdlx sample) optimizations enabled in gwt lead to broken JS code ### Reporting issues We appreciate feedback. If you find something that doesn't work (e.g. crashes either Scala or GWT compiler) or JavaScript gives you weird results we'd love to hear about it. The most effective way of reporting issues is to modify `Hello World` sample to show your problem. Exact steps are: 1. Fork `scalagwt-sample` repo from here: http://github.com/scalagwt/scalagwt-sample 2. Clone it: `git clone git:// github.com/YOUR_USER_NAME/scalagwt-sample.git` 3. Modify hello world sample located in `src/com/google/gwt/sample/jribble/client` 4. Commit and publish your example. 5. File a ticket here: http://github.com/scalagwt/scalagwt-sample and mention your fork while explaining your issue. If you want to discuss your problem before reporting it, join [scala...@googlegroups.com](http://groups.google.com/group/scalagwt). ### What if I don't know GWT? That shouldn't be a big problem. You've got Scala source code for samples that show basic functionality and provides basic setup. You may want to start with changing hello world sample, recompiling it and testing in a browser. ### What if I don't know Scala? You might still want to check out samples to see how they might look in a language other than Java. We'll be cutting a lot more of the boilerplate code once GWT libraries and APIs receive enough of Scala's [pimp-love](http://www.artima.com/weblogs/viewpost.jsp?thread=179766). ### Need help? Want to discuss something? Join us here: [scala...@googlegroups.com]( http://groups.google.com/group/scalagwt). Happy playing! *Scala+GWT team* -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [ANN] Scala+GWT 0.1-M2 released
Hello, I'm excited to announce second milestone of Scala+GWT project. Download (and then follow README instructions) from here: http://goo.gl/93hsR Release notes (included below) can be found here: http://goo.gl/H8san Scala+GWT 0.1-M2 The second official milestone release from the Scala+GWT project. You can check release notes for Scala+GWT 0.1-M1 [here]( http://scalagwt.github.com/releasenotes). This release consists of just samples packaged along with snapshot of jars needed to build them. Those jars include our own version of both GWT and Scala. This release doesn't come with any official artifacts apart from the tarball you can download from [ http://github.com/scalagwt/scalagwt-sample](http://github.com/scalagwt/scalagwt-sample) . ### Changes since last release * Vastly improved compilation speed * No more issues with GWT classpath thus build process for samples got simplified * Development mode works ### Development mode GWT's development mode is supported for Scala project now. You can get simple version of development mode by running `ant devmode`. Then load your application using the url GWT provides. Change edit source code for Hello world sample and then type `ant scalac` in second terminal. Refresh your page in browser. You should see your changes. Read more about [development mode]( http://code.google.com/webtoolkit/doc/latest/DevGuideCompilingAndDebugging.html#DevGuideDevMode ). Watch [video](http://www.youtube.com/watch?v=w1nluQmkE8g) showing full-blown development mode for Scala. ### Known issues * many patterns in pattern matching logic are not supported (tough issue) examples include * pattern alternatives (`|`) * guard patterns (`if` guard) * in some cases (like gwtdlx sample) optimizations enabled in gwt lead to broken JS code ### Reporting issues We appreciate feedback. If you find something that doesn't work (e.g. crashes either Scala or GWT compiler) or JavaScript gives you weird results we'd love to hear about it. The most effective way of reporting issues is to modify `Hello World` sample to show your problem. Exact steps are: 1. Fork `scalagwt-sample` repo from here: http://github.com/scalagwt/scalagwt-sample 2. Clone it: `git clone git:// github.com/YOUR_USER_NAME/scalagwt-sample.git` 3. Modify hello world sample located in `src/com/google/gwt/sample/jribble/client` 4. Commit and publish your example. 5. File a ticket here: http://github.com/scalagwt/scalagwt-sample and mention your fork while explaining your issue. If you want to discuss your problem before reporting it, join [scala...@googlegroups.com](http://groups.google.com/group/scalagwt). ### What if I don't know GWT? That shouldn't be a big problem. You've got Scala source code for samples that show basic functionality and provides basic setup. You may want to start with channging hello world sample, recompiling it and testing in a browser. ### What if I don't know Scala? You might still want to check out samples to see how they might look like in other language than Java. We'll be cutting a lot more of boilerplate code once GWT libraries and APIs receive enough of Scala's [pimp-love](http://www.artima.com/weblogs/viewpost.jsp?thread=179766). ### Need help? Want to discuss something? Join us here: [scala...@googlegroups.com]( http://groups.google.com/group/scalagwt). Happy playing! *Scala+GWT team* -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [ANN] Scala+GWT 0.1-M1 released
Hello, I'm excited to announce first milestone of Scala+GWT project. Download (and then follow README instructions) from here: http://goo.gl/Ym3xU Release notes (included below) can be found here: http://goo.gl/H8san Scala+GWT 0.1-M1 The first official milestone release from the Scala+GWT project. This release consists of just samples packaged along with snapshot of jars needed to build them. Those jars include our own version of both GWT and Scala. This release doesn't come with any official artifacts apart from the tarball you can download from http://github.com/scalagwt/scalagwt-sample. ### What works Samples show it the best. Here are some highlights: * Mixed Scala/Java projects work very well (for GWT-supported Java subset) * Most of Scala language constructs are supported * Most of Scala library code that makes sense in a browser context is supported, including Scala collections It's fair to say that we are not sure how far one can go with this release. It might be that you can already build something useful with what we already have. The only way to be sure is start hacking! ### Known issues * Compilation is very, very slow. * `scala.immutable.{TreeMap, TreeSet}` are not supported due to various bugs (thus sorted collections don't work) * many patterns in pattern matching logic are not supported (tough issue) examples include * pattern alternatives (`|`) * guard patterns (`if` guard) * GWT's development mode is broken * We are compiling with all optimizations turned off. This results in a slow and very large JavaScript code. ### Reporting issues We appreciate feedback. If you find something that doesn't work (e.g. crashes either Scala or GWT compiler) or JavaScript gives you weird results we'd love to hear about it. The most effective way of reporting issues is to modify `Hello World` sample to show your problem. Exact steps are: 1. Fork `scalagwt-sample` repo from here: http://github.com/scalagwt/scalagwt-sample 2. Clone it: `git clone git:// github.com/YOUR_USER_NAME/scalagwt-sample.git`http://github.com/YOUR_USER_NAME/scalagwt-sample.git 3. Modify hello world sample located in `src/com/google/gwt/sample/jribble/client` 4. Commit and publish your example. 5. File a ticket here: http://github.com/scalagwt/scalagwt-sample and mention your fork while explaining your issue. If you want to discuss your problem before reporting it, join [scala...@googlegroups.com](http://groups.google.com/group/scalagwt). ### What if I don't know GWT? That shouldn't be a big problem. You've got Scala source code for samples that show basic functionality and provides basic setup. You may want to start with channging hello world sample, recompiling it and testing in a browser. ### What if I don't know Scala? You might still want to check out samples to see how they might look like in other language than Java. We'll be cutting a lot more of boilerplate code once GWT libraries and APIs receive enough of Scala's [pimp-love](http://www.artima.com/weblogs/viewpost.jsp?thread=179766). ### Need help? Want to discuss something? Join us here: [scala...@googlegroups.com]( http://groups.google.com/group/scalagwt). Happy playing! -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] less name mangling
On 1 September 2011 20:52, Stephen Haberman stephen.haber...@gmail.comwrote: So, in summary, yeah, this is a lot of changes. But a lot of name mangling is gone and we've been using this in scalagwt with more success than we had before. I'd be glad to answer any questions, comments, concerns about the approach. Obviously I'd really like to get it to the point of being acceptable to GWT upstream (either the name cleanup by itself or eventually with the rest of scalagwt). I'd prefer this problem to be addressed in separate CL independent from of our effort. At the time I was looking into this problem I was coming to similar conclusions as Stephen did. They never materialized into clean patches, though. This time it seems like we have a chance to fix it which would be great. -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] Dollar sign and binary types
2011/5/29 Scott Blum sco...@google.com On Sat, May 28, 2011 at 3:41 PM, Grzegorz Kossakowski grzegorz.kossakow...@gmail.com wrote: I cannot comment on your proposals because I don't know gwt internals enough. I decided to add a method to TypeOracle that allows me to ask if given type comes from Java or Jribble. If it's Jribble I don't try to do any conversions. This is ugly and fragile method but seems to be the only viable strategy for now. If you guys can come up with systematic solution to this problem it would be awesome. Use an annotation. You mean putting annotation to every Jribble type? How that would help? Also, I thought you'd enjoy this question: http://stackoverflow.com/questions/6167326/java-class-name-containing-dollar-sign Seems like javac can confuse itself about dollar sign, sigh. -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] Dollar sign and binary types
2011/5/29 Scott Blum sco...@google.com You wouldn't have to hack TypeOracle. You could just look for your particular annotation to see what was a Jribble type. The problem is that TypeOracle itself doesn't work well with types containing dollar sign so I truly need to hack it. Also, there seem to be other places in GWT code (Rebindings come to my mind) where dollar signs are problematic. What I'm doing right now is pure experimentation and hacks I'm introducing won't be kept even temporarily. I'm just trying to get bigger picture of what kind of changes will need to be applied in order to fully support Jribble. Once I gather enough of information I'll try to write some report and let you comment on it as I expect many things to be misunderstood on my side. This won't happen sonner than in two weeks, though. -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] Dollar sign and binary types
2011/5/27 Scott Blum sco...@google.com The compiler internals could be coded to use binary names. Obviously, generators would do something sensible. For example, I know that rebind rules in gwt.xml are tracked by source name. Well, those could get looked up in TypeOracle and translated to the appropriate binary name and tracked that way. You would always to one-way conversions from source-binary and never back. I cannot comment on your proposals because I don't know gwt internals enough. I decided to add a method to TypeOracle that allows me to ask if given type comes from Java or Jribble. If it's Jribble I don't try to do any conversions. This is ugly and fragile method but seems to be the only viable strategy for now. If you guys can come up with systematic solution to this problem it would be awesome. -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] Dollar sign and binary types
2011/5/26 Eric Ayers zun...@google.com: Unfortunately, I tried removing the replace('$',.) and it failed miserably. Looking at it in the debugger, those really are binary names. e.g.: com.google.gwt.core.client.impl.AsyncFragmentLoader$LoadingStrategy Thanks guys for you answers. I moved on with my work-around. It would be great if those binary names were converted to source names as soon as possible so number of places in gwt code where we have to consider both options is minimized. -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] Dollar sign and binary types
2011/5/26 Grzegorz Kossakowski grzegorz.kossakow...@gmail.com: 2011/5/26 Eric Ayers zun...@google.com: Hi again, Can you point out any of places where you saw this assumption? The last time I was mucking around with binary type names I was told not to assume that $ could not appear in source names, so it might be unintentional. Hi Eric, The problematic place for me is ReplaceBindings.java, lines 154-155: // Rebinds are always on a source type name. String reqType = type.getName().replace('$', '.'); Any comment on that one? Working-around it is possible but quite involved. I'd love to know if I need some solid work-around or just hack to keep me going because this will be removed upstream. -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Dollar sign and binary types
Hi, Poking around a bit more I found that gwtc seems to assume internally that whenever type name contains '$' it's in binary form and if it doesn't contain dollar sign then it can be considered to be in source form. It's worth noting (and it's admitted in gwtc's internals) that this condition doesn't split of all type names into disjoint union of two respective sets. Anyway, my question is: how much of gwt internals rely on this distinction? I noticed that gwtc is doing handful number of conversions between those two forms. This is particularly problematic for my work because jribble can have dollar sign in it's type name and this would be extremely hard to change. Also, it looks like Java allows type names containing dollar sign: mac-grek:javajunk grek$ echo 'class A$B {}' A\$B.java mac-grek:javajunk grek$ javac 'A$B.java' mac-grek:javajunk grek$ javap 'A$B' Compiled from A$B.java class A$B extends java.lang.Object{ A$B(); } Is gwtc handling those cases in pure java environment properly? -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] gwtc classpath
2011/5/24 Eric Ayers zun...@google.com: Hi Grzegorz, You mentioned the compiled classes in the class path are used to populate the type orace. For the most part, the type oracle types are compiled from source. Types that don't have source are then checked to see if they are binary annotations and then a type oracle reference is entered. I have addNewTypes method in mind: http://www.google.com/codesearch/p?hl=en#A1edwVHBClQ/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.javal=380 It reads class file data and uses it to populate TypeOracle, right? Could it be true that scala-library.jar contains both libraries to use with the GWT compiler and some sort of runtime environment (sources) to compile with your app? If so, maybe the solution is to split scala-library.jar into the equivalent of 'dev' and 'user' components, such that 'user' is not needed for running the compiler and 'dev' is not needed for the app to link against. I think the answer is no. Let me explain the issue a little bit more. The scala-library.jar contains the whole scala runtime library including things like scala collections, etc. Those classes are used by gwtc itself to handle jribble input (alternative to java input). Now, application written in Scala is going to use the same classes (e.g. collections) but of different version. Thus we need two versions of .class files on the classpath: one (call it A) used by gwtc implementation and one (call it B) used for application itself. We need B version of .class files on a classpath because JDT needs those classes in order to properly resolve references to Scala code (application code) from Java code. We also need B in order to populate TypeOracle in addNewTypes method. Does this explain the issue a bit better now? -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] gwtc classpath
2011/5/24 Eric Ayers zun...@google.com: Yes, that class does read bytecode, but the source of the bytecode isn't usually compiled .class files from the classpath, its the result of running JDT on the sources. I think it might be confusing because I worked on a project to try to build type oracle from bytecode from any compiler, but we have kind of abandoned that effort in favor of creating an equivalent to javac that spits out more than just bytecode with each compiled class. Do you want to say that gwtc doesn't read .class files from classpath at all? Or if it does in what cases and what for? I think I see why you are having the problem, yes. But since the collections in B are only needed at the source level (Type Oracle does not need .class files), your dev jar could just contain .class files and a separate runtime jar could just contain .java sources and not .class files. I think this would fix your build woes, but it might make debugging the collections a bit tricky. The problem is that I don't have .java files for scala-library (it's written in scala but compiled to jribble[1]). If I have java class J referring to scala class S (that we have .jribble for) then in order to run JDT for J we need information about S. The idea was to use .class file corresponding to S so JDT can correctly resolve references to S from J and build it's AST. Then JDT could build AST nodes for Java files that would get converted to GWT nodes and for jribble we have our own logic that converts jribble directly to GWT nodes without JDT involved in a process. We would need to populate TypeOracle with data corresponding jribble classes but we could use the same .class files that JDT was using for Scala (jribble) code. To sum up: * version A of scala-library is needed by gwtc itself and we need (and have) only .class files for it * version B of scala-library is in two forms: .jribble files and .class files. Class files are needed by JDT in order to resolve references to scala-library from Java sources of application we are compiling and by special logic that populates TypeOracle for that application for .jribble files. We need .jribble files to build GWT AST nodes. Now the question is how can I make version B of .class files visible only to JDT and special logic in TypeOracleMediator? Sounds I need custom classloader but I fear that gwtc reads .class files somewhere else for whatever purpose and I would get some nasty inconsistencies that would be extremely hard to debug. If it's not a case how can I plug my own classes that would be visible to JDT? Is AbstractCompiler. INameEnvironmentImpl what I should be looking at? [1] jribble contains similar information as java code but jdt doesn't know about it, obviously. -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] gwtc classpath
2011/5/24 Eric Ayers zun...@google.com: If you are in the guts of the compiler and want to populate the type oracle form byte code, you can build a list of TypeOracleMediator.TypeData objects from any bytecode you like (doesn't have to be on classpath). This won't feed into the building of the AST - that has to build from source. Thanks Eric and John for your reply. This solves only one problem - populating TypeOracle with data that is not coming from JDT. Other problem is with running JDT. How can I add specific classes to JDT's classpath and make it not inherit classpath of gwtc in order to avoid two different versions of the same .class files? -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] gwtc classpath
2011/5/24 John Tamplin j...@google.com: For user code (that which will be compiled by GWT), it only looks for class files from the classpath for annotations that it doesn't have the source to. In DevMode, it will also load user classes from the classpath if the visible source file is annotated with @GwtScriptOnly. John, There's one thing worrisome: mac-grek:google grek$ pwd /Users/grek/tmp/gwt-trunk/dev/core/src/com/google mac-grek:google grek$ find . -name *.java | xargs grep 'get[a-zA-Z]*ClassLoader' | wc -l 63 I'm not sure if this means anything but I wanted let you know that there are quite a few places in the code that are asking for a classloader. -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] gwtc classpath
Hello, I run into a case when I want to have different classpath for running gwtc (through com.google.gwt.dev.Compiler class) from classpath containing source code that gwtc would compile. Let me give you a specific scenario. My fork of gwt is using scala-library.jar of some version A for implementing internals of gwtc. Now application that gwtc should compile uses different version B of scala-library.jar that is binary incompatible with A. Is it possible to run gwtc so it uses A for it's own execution but uses B for JDT execution, populating TypeOracle, etc.? One thing that's worth mentioning: I'm talking here about compiled classes in classpath because they are used to populate TypeOracle. Source code (used for constructing GWT AST nodes) is in one copy corresponding to version B. -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] Are there any docs describing internals of gwtc?
2011/3/15 Scott Blum sco...@google.com: That *may* be true but you'd have to try it and find out. I know we use TypeOracle for a couple of other purposes in dev mode, but I don't *think* we use it for anything else in web mode.. It seems to work fine in simple cases in web mode. Is there one class that is dealing specifically with emulating object orientation or it's scattered around many classes? I'm asking because toString() call get's translated to toString_2() javascript call and this method is not being defined anywhere in js source code. I'm trying to pinpoint location where this stuff is handled to understand why I get a call to non-existing place. Hmm, I'm not completely sure what you're asking. GenerateJavaScriptAST is the place to look for how precisely the Java AST is transformed into JavaScript. Yes, after taking more closer look at GenerateJavaScriptAST code I found the logic I was interested in. The problem I described above (broken polymorphic calls) was caused by superClass field being equal to null for nodes representing interfaces. That would lead to broken overrides calculations for an interface containing method called toString (that overrides one from java.lang.Object) and thus to broken JS output. That was fairly non-trivial to find because you need toString being called through an interface to trigger that behaviour. Now, I'm wondering if it wouldn't make sense to have an assertion in some place checking that whether interfaces have java.lang.Object as their superClass as it seems to be invariant for GWT. I've got another question. Do you have any tool for checking correctness of GWT's ASTs or a tool that allows one to dump ASTs and compare them? The scenario I have in mind is like this: 1. I have minimal jribble example that exhibits some obscure problem like with toString described above and I fail to find a bug but I suspect that GWT ASTs I get out of Jribble are broken. 2. I prepare corresponding Java code that imitate code from jribble. This should work (or I found a bug in gwtc itself but this is highly unlikely). Now I'd like to compare those two ASTs. Such comparison should immediately reveal the source of my problems. You can always call toSource() on any GWT AST node to get the source representation. GwtAstBuilderTest utilizes this to verify that the new GwtAstBuilder is mostly source-compatible with the old translator. We also have a bunch of unit tests derived from JJSTestBase that all generally verify that a certain input source + certain transformations turns into expected output. Other that that, we use JUnit / GWTTestCase to actually execute the compiled output and verify correctness JUnit style. Thanks for pointer to JJSTestBase that will be useful for me, too. -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] Are there any docs describing internals of gwtc?
2011/3/21 Scott Blum sco...@google.com: I seem to recall at one point we actually put some thought into not having super interfaces have a superClass field at all, and just always have the compiler implicitly assume Object. Not sure where that idea went, or why we ended up not doing that. That was exactly the behaviour I was expecting from GWT. It's not something I'll be pushing any further but if that idea brought again you've got another reason to implement it. As for now I'll remember to always check my assumptions using automated tests. -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Are there any docs describing internals of gwtc?
Hi, More and more often I find myself lacking the big picture of gwtc's internals. I'd like to find answers (or hints where to look for answers) for questions like: 1. What's the difference between TypeMap and TypeOracle and why they seem to have overlapping functionality? 2. Why TypeOracleMediator operates on bytecode whereas gwtc is supposed to work with java source, or jdt's asts? 3. How emulation of object orientation is implemented in gwt? 4. What are main phases in gwtc's execution. What are dependencies? I'd like to know where TypeMpa is being built and why it's done twice. Also, TypeOracle seems to be highly mutable data structure. When it gets updated and why? Do you guys have anything (slides, blog posts, discussions, etc.) that would help me to better understand those matters? -- Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] Are there any docs describing internals of gwtc?
Hi Scott! Thanks for speedy and seriously awesome response! :-) Some questions inline. 2011/3/14 Scott Blum sco...@google.com: On Mon, Mar 14, 2011 at 3:03 PM, Grzegorz Kossakowski grzegorz.kossakow...@gmail.com wrote: 1. What's the difference between TypeMap and TypeOracle and why they seem to have overlapping functionality? In GWT, there are two major pieces of infrastructure that deal with representing Java language input. 1) A reflection of the user's type model for the purposes of running generators. Approximately equivalent to the kind of information you can get via Java reflection. Models types, fields, and methods, but not method bodies. The entire machinery around this can be loosely referred to as TypeOracle, which is the primary interface for accessing this type model. Generators use this type model to generate code. This infrastructure is used in both dev mode and web mode, as Generators run in both contexts. So, if my GWT app doesn't have any generators exact contents of TypeOracle doesn't matter? I'm asking because I'm thinking of creating some stub data structures for jribble units and just move on to fixing some other issues and come back only once I want to support Generators written in Scala or Generators referring Scala. I'm asking because I don't want to create more problems than I solve at the time. 2) The GWT AST, which is essentially a source-level representation of the user's Java code, including method bodies, which is optimized and translated into JavaScript. May be referred to as GWTC, the compiler, the web-mode compiler, etc. Mostly lives in com.google.gwt.dev.jjs (which stands for 'Java to JavaScript'). TypeMap is a small implementation detail that's only useful for the JDT AST - GWT AST translation. I see. It happens that TypeMap is quite interesting from my point of view because I'm translating Jribble AST to GWT AST by following JDT AST - GWT AST translation (more or less). It's good to know that it's not being used anywhere else, though. 2. Why TypeOracleMediator operates on bytecode whereas gwtc is supposed to work with java source, or jdt's asts? Historically, we've run JDT twice. Once to build TypeOracle, and once to build the GWT AST. Efforts have been made to transition TypeOracle to be built from bytecode, which would eliminate one of these JDT runs in favor of using external (presumably IDE-built) class files. I see. Thanks for clarification. 3. How emulation of object orientation is implemented in gwt? Using JavaScript prototype chains, and mangling method signatures such that any given override of a method has a globally unique name in the compiled output. Try compiling with -style PRETTY or DETAILED and inspect the output. Is there one class that is dealing specifically with emulating object orientation or it's scattered around many classes? I'm asking because toString() call get's translated to toString_2() javascript call and this method is not being defined anywhere in js source code. I'm trying to pinpoint location where this stuff is handled to understand why I get a call to non-existing place. 4. What are main phases in gwtc's execution. What are dependencies? JavaToJavaScriptCompiler .precompile() is what I would consider the main high-level algorithm. But here's a text overview. 1) Build TypeOracle from the initial set of available source units (CompilationStateBuilder). 2) Begin running the web mode compile (WebModeCompilerFrontEnd). 3) As the web mode compile runs, we encounter GWT.create() calls (FindDeferredBindingSitesVisitor). 4) Use the rebind infrastructure to resolve rebind requests. This may entail running Generators, which generate new code. 5) Newly-generated types get added to CompilationState + TypeOracle in a bit of a loop-back process. 6) Newly-generated types may themselves contain GWT.create() calls, looping back through step 4. 7) Eventually, all our code is generated. Get rid of TypeOracle, we don't need it anymore. 8) GenerateJavaAST turns the JDT AST into the GWT AST. 9) Normalize certain difficult constructs. 10) Optimize. 11) Post-optimization normalizes to turn high-level Java constructs into JS-specific implementation details (but still Java AST). 12) GenerateJavaScriptAST 13) Optimize JS AST 14) Produce JS source text. That looks great. Thanks! Do you guys have anything (slides, blog posts, discussions, etc.) that would help me to better understand those matters? Here's wiki entries for TypeOracle / CompilationState. The first is outdated by useful to understand the second one. http://code.google.com/p/google-web-toolkit/wiki/CompilationUnit_1_5 http://code.google.com/p/google-web-toolkit/wiki/CompilationUnit Thanks. This helps to understand another bit of GWT's architecture. I've got another question. Do you have any tool for checking correctness of GWT's ASTs or a tool that allows one to dump ASTs and compare them
Re: [gwt-contrib] Re: Adds accessibility to certain GWT AST nodes (issue1304802)
Thanks for reply. This is in line with my schedule. I'll be watching your progress with great interest. -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Adds accessibility to certain GWT AST nodes (issue1304802)
It looks like you are working on something that might be interesting to me. Is there any place I can find more information on this change? -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] Re: Adds accessibility to certain GWT AST nodes (issue1304802)
Thanks Scott for this. It's enough for me to understand motivation and (at least some) implications of this change. This is something which is certainly within my interest. Actually, what you described is exactly what I wanted to see for a long time. I parse jribble nodes twice for exactly the same reason you are running jdt twice. When do you plan to finish work on this? It looks like it's a time for me to catch up with GWT's trunk in my scalagwt fork. -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
Re: [gwt-contrib] Has anyone heard what is happening with Scala support using Jribble?
2010/5/20 oatkinson oatkin...@gmail.com I heard some rumblings about creating a new vm language that was basically a puddle of java called jribble. It was supposed to allows support for making GWT work on scala code. I have not seen much more about it. Has anyone heard anything? I would really love to be able to write GWT client side code in scala. I'm not sure what you mean by saying jribble is really a new vm language. Anyway, I'll be working on this during my internship at Google (starting on 12th of July) and my host will be Lex Spoon. There will be more people involved in this effort but I don't want to speak for them. We'll be publishing more details once some basic stuff is set up. -- Best regards, Grzegorz Kossakowski -- http://groups.google.com/group/Google-Web-Toolkit-Contributors