Another milestone reached (sort of)

125 views
Skip to first unread message

Grzegorz Kossakowski

unread,
Jan 25, 2011, 8:20:16 PM1/25/11
to scalagwt
Hi,

I thought you'd be pleased to see following code:

class Hello extends EntryPoint {

  def onModuleLoad() {
    val numbers = List(1, 2, 3, 4) 
    val strings = numbers map (_.toString + "...")
    val s = strings mkString ","
    val b = new Button("Click me", (_: ClickEvent) => Window.alert("Hello, AJAX, said Scala\nThose numbers are coming from list!\n" + s));

    RootPanel.get().add(b);
  }
  
  implicit def clickHandler(f: ClickEvent => Unit): ClickHandler = new ClickHandler {
    def onClick(event: ClickEvent) = f(event)
  }
}

and screenshot (attached) showing this stuff works. So what works, really? Lot's of stuff actually. This little code shows that collections (List in this case) and lambas are being supported. If you vivisect this code carefully enough you'll notice, that I had to make following things working:

  * calling java code from scala code and conversely (in GWT). This is because mkString uses, foreach method and thus is pulling in BoxedUnit that Scala's standard library defines in Java (surprisingly enough)
  * Arrays. If you look analyze what's happening to evaluate "List(1, 2, 3, 4) " expressions you'll notice that there quite a lot of things going on including creation of an array containing those numbers.
  * all sort of constructs used by collections including loops, switches (as in java) and many, many other little things.

I'll tell you that: I literally started to dance when I saw that little message message box in Firefox! :-)

Before you start dancing too I have to say that I had to introduce lots of hacks in order to achieve what I described. It means it will take me a while before I'll be able to commit this stuff so you can reproduce it. Anyway, I'm really happy because I'm over with really painful period of this project where there was absolutely no progress to be observed. Moreover, I have much better idea what to do next now.

I've got some more good news but it's really late over here so I'll wait with them. It's worth mentioning that during next week I'll be super busy with passing my exams but I'd like to get this stuff committed in 2 weeks.

--
Grzegorz Kossakowski

scalagwt-list.png

Rob Heittman

unread,
Jan 25, 2011, 8:26:50 PM1/25/11
to scal...@googlegroups.com
Awesome! Seriously awesome!

Aaron Novstrup

unread,
Jan 25, 2011, 8:27:51 PM1/25/11
to scal...@googlegroups.com
Exciting! Looking forward to those commits!

Arthur Kalmenson

unread,
Jan 25, 2011, 8:29:37 PM1/25/11
to scal...@googlegroups.com
Great work! Very interesting project.

--
Arthur Kalmenson

Maxime Lévesque

unread,
Jan 25, 2011, 10:21:36 PM1/25/11
to scal...@googlegroups.com

 I am impressed, the project looks highly non trivial, my main problem with GWT is it's verbosity
and non declarativeness for defining UIs (unless you use XML, but that is too big of a
price to pay in my opinion), your project has the potential to allow the definition of GWT UIs
that are both declarative *and* strongly typed....

Keep up the awesome work !

Grzegorz Kossakowski

unread,
Jan 26, 2011, 8:47:47 AM1/26/11
to scal...@googlegroups.com
2011/1/26 Maxime Lévesque <maxime....@gmail.com>


 I am impressed, the project looks highly non trivial, my main problem with GWT is it's verbosity
and non declarativeness for defining UIs (unless you use XML, but that is too big of a
price to pay in my opinion), your project has the potential to allow the definition of GWT UIs
that are both declarative *and* strongly typed....

Keep up the awesome work !

Thanks guys for word of encouragement.

Yes, I would to see you exploring possibilities Scala brings to GWT development techniques. Some straightforward examples can be seen in great work of Aaron on GWT's Showcase sample but I'm sure there is much more. Also, I'm sure there are more qualified people than me to explore that ground.

Actually, I would love others to get involved and once I'm done with cleaning up my current work I'll move my focus on developing tools so you can contribute without diving deep into compilers. Ideally, I'd like to make it possible that one can start contributing after one evening of playing around assuming the person have reasonable understanding of Scala's standard library and GWT (from user's point of view).

-- 
Best regards,
Grzegorz Kossakowski

Lex Spoon

unread,
Jan 26, 2011, 8:48:53 PM1/26/11
to scal...@googlegroups.com
Very nice!! -Lex


Lex Spoon

unread,
Jan 26, 2011, 8:51:40 PM1/26/11
to scal...@googlegroups.com
On Tue, Jan 25, 2011 at 8:20 PM, Grzegorz Kossakowski <grzegorz.k...@gmail.com> wrote:
    val b = new Button("Click me", (_: ClickEvent) => Window.alert("Hello, AJAX, said Scala\nThose numbers are coming from list!\n" + s));
[...] 
  
  implicit def clickHandler(f: ClickEvent => Unit): ClickHandler = new ClickHandler {
    def onClick(event: ClickEvent) = f(event)
  }

I have to say, this bit is especially cute. That idiom can cut loads of boilerplate.  -Lex


Rob Heittman

unread,
Jan 26, 2011, 8:58:41 PM1/26/11
to scal...@googlegroups.com
Seriously. The potential is immense, though so is the remaining work
:-( Grzegorz, you should come over for Google I/O in May! I would
love to at least see/hear an Ignite talk on your experience so far,
and maybe try to schedule a little hackathon. If it fits with your
academic calendar, and people have interest, I would be happy to try
to help drum up donations to get you transported.

Aaron Novstrup

unread,
Jan 26, 2011, 9:03:49 PM1/26/11
to scal...@googlegroups.com
That implicit looks like the one from the Showcase (which will hopefully make it into some library where it can be reused).  There probably should be another one to handle the (fairly common, I think) case in which the event is ignored:

implicit def clickHandler2(thunk: => Unit): ClickHandler = new ClickHandler {
   def onClick(event: ClickEvent) = thunk

Grzegorz Kossakowski

unread,
Jan 27, 2011, 5:21:46 AM1/27/11
to scal...@googlegroups.com
2011/1/27 Rob Heittman <rob.he...@solertium.com>

Seriously.  The potential is immense, though so is the remaining work
:-(  Grzegorz, you should come over for Google I/O in May!  I would
love to at least see/hear an Ignite talk on your experience so far,
and maybe try to schedule a little hackathon.  If it fits with your
academic calendar, and people have interest, I would be happy to try
to help drum up donations to get you transported.

Rob,

Unfortunately I won't be able to come but I really appreciate your offer! In parallel to working on this project I study both CS and math at the same time and I do research in computational molecular biology (using lots of cool Scala code, btw.). This makes my calendar packed for a while :-/

Anyway there are many more good news coming in a few weeks but I don't think I'm allowed to say anything more at this point. Stay tuned! :-)

Grzegorz Kossakowski

unread,
Jan 27, 2011, 5:27:15 AM1/27/11
to scal...@googlegroups.com
2011/1/27 Aaron Novstrup <aaron.n...@gmail.com>

That implicit looks like the one from the Showcase (which will hopefully make it into some library where it can be reused).  There probably should be another one to handle the (fairly common, I think) case in which the event is ignored:

implicit def clickHandler2(thunk: => Unit): ClickHandler = new ClickHandler {
   def onClick(event: ClickEvent) = thunk
}

Yes, I shamelessly copied that bit from your work on Showcase demo. Actually, I constantly test my work against Showcase in Scala and I must say that latest progress looks promising for that demo too.

PS. The link I posted to compiled sample points at compilation result with -draftCompile option which makes it bigger (in size) than it's probably necessary. This will be an interesting exercise to see how gwtc deals with scalac output.

--
Grzegorz Kossakowski

Grzegorz Kossakowski

unread,
Jan 28, 2011, 6:20:37 AM1/28/11
to scalagwt
2011/1/26 Grzegorz Kossakowski <grzegorz.k...@gmail.com>

Hi,

I thought you'd be pleased to see following code:

class Hello extends EntryPoint {

  def onModuleLoad() {
    val numbers = List(1, 2, 3, 4) 
    val strings = numbers map (_.toString + "...")
    val s = strings mkString ","
    val b = new Button("Click me", (_: ClickEvent) => Window.alert("Hello, AJAX, said Scala\nThose numbers are coming from list!\n" + s));

    RootPanel.get().add(b);
  }
  
  implicit def clickHandler(f: ClickEvent => Unit): ClickHandler = new ClickHandler {
    def onClick(event: ClickEvent) = f(event)
  }
}

and screenshot (attached) showing this stuff works. 

Actually, I thought you might want to see it yourself ;) 


Compiled with draftCompile option so not very optimized.

--
Grzegorz Kossakowski

Grzegorz Kossakowski

unread,
Feb 27, 2011, 5:30:33 PM2/27/11
to scalagwt
2011/1/26 Grzegorz Kossakowski <grzegorz.k...@gmail.com>

Hi,

I thought you'd be pleased to see following code:

class Hello extends EntryPoint {

  def onModuleLoad() {
    val numbers = List(1, 2, 3, 4) 
    val strings = numbers map (_.toString + "...")
    val s = strings mkString ","
    val b = new Button("Click me", (_: ClickEvent) => Window.alert("Hello, AJAX, said Scala\nThose numbers are coming from list!\n" + s));

    RootPanel.get().add(b);
  }
  
  implicit def clickHandler(f: ClickEvent => Unit): ClickHandler = new ClickHandler {
    def onClick(event: ClickEvent) = f(event)
  }
}

Ok, all that stuff is published and you can try it yourself. Just grab


and run "ant" command. You'll have to wait quite long (5-7 minutes) because of very slow parser that has to parse scala's standard library and build a cache. The cache itself is slow too but still helps a lot so any subsequent run will be faster (1-2 minutes).

While building the sample you'll notice quite a few stack traces being printed. These are obvious bugs that have to be fixed either on gwtc or scalac side.

It took me quite long to publish all of my work but I had to fix some bugs I discovered while preparing changes for review. Good news are that number of bugs got reduced and I managed to remove almost all hacks I introduced previously so the whole stack got more stable and reliable.

Thanks to Lex's time spent on reviewing my changes we managed to submit almost all changes. That made review queue very short and I hope that we'll be able to keep it like that in a future.

I'd be grateful if you could check latest sample and confirm that I didn't forget about anything. Also, it's a chance for you to play around and see how much you can do before you run into problems that will make compilation impossible.

--
Grzegorz Kossakowski

Johann Borck

unread,
Feb 28, 2011, 10:22:13 AM2/28/11
to scal...@googlegroups.com
On 02/27/2011 11:30 PM, Grzegorz Kossakowski wrote:
>
> Ok, all that stuff is published and you can try it yourself. Just grab
>
Wow, great news, Grzegorz!
thanks so much for your work, this is as awsome as it gets in terms of
bits and bytes! I did a few tests modifying the example, does it make
sense to give you feedback on problems I encountered or is it unlikely
that such information will be news to you?

all the best,
Johann

Grzegorz Kossakowski

unread,
Feb 28, 2011, 10:31:05 AM2/28/11
to scal...@googlegroups.com
2011/2/28 Johann Borck <johann...@densedata.com>
Hi Johann,

I think your feedback might turn to be useful. I try to collect as much information about failures as possible because very often they give me a hint how to fix some subtle bug that manifests itself in different contexts.

Let's start with few examples and I'll let you if I knew them before or this is something completely new to me.

--
Grzegorz Kossakowski

Johann Borck

unread,
Feb 28, 2011, 12:23:07 PM2/28/11
to scal...@googlegroups.com
On 02/28/2011 04:31 PM, Grzegorz Kossakowski wrote:
>
> Let's start with few examples and I'll let you if I knew them before
> or this is something completely new to me.
>
Nice, first let's make sure I set things up correctly, these were the
steps I took:

git clone http://review.source.gogoego.com/p/projects/scalagwt-sample
cd scalagwt-sample
git fetch http://review.source.gogoego.com/p/projects/scalagwt-sample
refs/changes/20/2120/1 && git checkout FETCH_HEAD

and then I run `ant` and `ant devmode` after each modification.

===

I got an error from ant devmode:
devmode:
[java] Unknown argument: -draftCompile

The devmode target seemed to use gwtc-specific arguments unknown to
DevMode, I commented (line 74) <arg line="${gwt.args}"/> out, to get
things running.

===

So far the most severe problem I encountered is that basic pattern
matching on `Int` doesn't work:

def tMatch0(i:Int) : Unit = i match {
case 0 => trace("tm 0")
case 1 => trace("tm 1")
case 2 => trace("tm 2")
case _ => trace("tm _")
}
produces this in the resulting JS:

function $tMatch0(i){
var temp1;
temp1 = i;
temp1;
}
I tried several variations, and matching `Int`s never worked.
OTOH, I had no obvious problems with pattern matching with case classes,
both my own and Option[T]s Some/None.

Another thing I noticed is that .toString in some cases is not
implemented, but I'm sure you're aware of that.

regards,
Johann

Grzegorz Kossakowski

unread,
Feb 28, 2011, 12:38:00 PM2/28/11
to scal...@googlegroups.com
2011/2/28 Johann Borck <johann...@densedata.com>

On 02/28/2011 04:31 PM, Grzegorz Kossakowski wrote:

Let's start with few examples and I'll let you if I knew them before or this is something completely new to me.

Nice, first let's make sure I set things up correctly, these were the steps I took:

git clone http://review.source.gogoego.com/p/projects/scalagwt-sample
cd scalagwt-sample
git fetch http://review.source.gogoego.com/p/projects/scalagwt-sample refs/changes/20/2120/1 && git checkout FETCH_HEAD

That's correct.
 
and then I run `ant` and `ant devmode` after each modification.

Hmmm, I just run `ant` and open war/Hello.html file. I'm not sure if devmode can work properly by any chance.

 
===

I got an error from ant devmode:
devmode:
    [java] Unknown argument: -draftCompile

The devmode target seemed to use gwtc-specific arguments unknown to DevMode, I commented (line 74) <arg line="${gwt.args}"/> out, to get things running.

===

So far the most severe problem I encountered is that basic pattern matching on `Int` doesn't work:

def tMatch0(i:Int) : Unit = i match {
     case 0 => trace("tm 0")
     case 1 => trace("tm 1")
     case 2 => trace("tm 2")
     case _ => trace("tm _")
 }
produces this in the resulting JS:

function $tMatch0(i){
 var temp1;
 temp1 = i;
 temp1;
}
I tried several variations, and matching `Int`s never worked.

That's interesting. Can you verify if gwtc reports any crash for a class that contains this code? If so, what's the stack trace?
 
OTOH, I had no obvious problems with pattern matching with case classes, both my own and Option[T]s Some/None.

That's good to hear. I expect that complicated matches may fail but I have no systematic categorization of them.
 
Another thing I noticed is that .toString in some cases is not implemented, but I'm sure you're aware of that.

No, this is something I haven't seen. Can you shed some light on this? 

I think our experiment worked pretty well - I wasn't aware of both problems. :)

--
Grzegorz Kossakowski

Lex Spoon

unread,
Feb 28, 2011, 12:38:23 PM2/28/11
to scal...@googlegroups.com, Johann Borck
On Mon, Feb 28, 2011 at 12:23 PM, Johann Borck
<johann...@densedata.com> wrote:
> def tMatch0(i:Int) : Unit = i match {
>      case 0 => trace("tm 0")
>      case 1 => trace("tm 1")
>      case 2 => trace("tm 2")
>      case _ => trace("tm _")
>  }
> produces this in the resulting JS:
>
> function $tMatch0(i){
>  var temp1;
>  temp1 = i;
>  temp1;
> }
> I tried several variations, and matching `Int`s never worked.
> OTOH, I had no obvious problems with pattern matching with case classes,
> both my own and Option[T]s Some/None.

That looks like the discarded LabelDef problem that Grzegorz put in a
patch for over the weekend. The pattern-matching code has simply
disappeared.


Lex

Lex Spoon

unread,
Feb 28, 2011, 12:39:47 PM2/28/11
to scal...@googlegroups.com, Johann Borck

Oh, I just realized you posted JavaScript there, not Jribble. Do you
think you can dig out the Jribble file that is created for your
example? -Lex

Grzegorz Kossakowski

unread,
Feb 28, 2011, 12:41:11 PM2/28/11
to scal...@googlegroups.com
2011/2/28 Lex Spoon <l...@lexspoon.org>

Yep, that would be very helpful. I believe that sample is using latest version of a compiler but I could mess up something.

--
Grzegorz Kossakowski

Grzegorz Kossakowski

unread,
Feb 28, 2011, 12:50:28 PM2/28/11
to scal...@googlegroups.com
2011/2/28 Grzegorz Kossakowski <grzegorz.k...@gmail.com>
Yep, that would be very helpful. I believe that sample is using latest version of a compiler but I could mess up something.

Forgot to say that you can find jribble files in

  war/WEB-INF/jribble 

directory.

--
Grzegorz Kossakowski

Johann Borck

unread,
Feb 28, 2011, 1:04:59 PM2/28/11
to scal...@googlegroups.com

Of course, this is the resulting jribble for that function:

  public V; tMatch0(I; i) {
    I; temp16 = i;
    I; $13$ = temp16;
    switch ($13$) {
      0: {
        this.(Lcom/google/gwt/sample/jribble/client/Hello;::trace(Ljava/lang/String;)V;)("tm 0");
        break;
      }
     
      1: {
        this.(Lcom/google/gwt/sample/jribble/client/Hello;::trace(Ljava/lang/String;)V;)("tm 1");
        break;
      }
     
      2: {
        this.(Lcom/google/gwt/sample/jribble/client/Hello;::trace(Ljava/lang/String;)V;)("tm 2");
        break;
      }
     
      default: {
        this.(Lcom/google/gwt/sample/jribble/client/Hello;::trace(Ljava/lang/String;)V;)("tm _");
        break;
      }
     
    }
  }

regards,
Johann
 

 

Grzegorz Kossakowski

unread,
Feb 28, 2011, 1:51:37 PM2/28/11
to scal...@googlegroups.com
2011/2/28 Johann Borck <johann...@densedata.com>


Of course, this is the resulting jribble for that function:

[...]

This jribble source looks correct. It must be a problem on GWT's side. I already reproduced the problem and will have a quick look into that.

--
Grzegorz Kossakowski

Grzegorz Kossakowski

unread,
Feb 28, 2011, 2:27:14 PM2/28/11
to scal...@googlegroups.com
2011/2/28 Grzegorz Kossakowski <grzegorz.k...@gmail.com>

Fixed:


you can check it out and build a new version using `ant dist-dev`. Then just copy new version of gwt-dev.jar to sample project and you'll have the fix incorporated.

I'd love to hear about toString issue, too.

--
Grzegorz Kossakowski

Malvolio

unread,
Feb 28, 2011, 2:57:46 PM2/28/11
to scal...@googlegroups.com
You know what would be a huge help for me?  If you built a single jar that would just, zap, turn all the Scala code into Javascript.  Like this:

$ java -jar scalagwt.0.8.jar -o myprogram.js FirstThing.scala SecondThing.scala

Something like that.

M.

Johann Borck

unread,
Feb 28, 2011, 3:03:56 PM2/28/11
to scal...@googlegroups.com
On 02/28/2011 08:27 PM, Grzegorz Kossakowski wrote:
> [...]

>
> Fixed:
>
> http://review.source.gogoego.com/#change,2128
>
> you can check it out and build a new version using `ant dist-dev`.
> Then just copy new version of gwt-dev.jar to sample project and you'll
> have the fix incorporated.
>
Again, wow, the magic of open source: report a bug and have it fixed a
negligible amount of minutes later :) . Now I think I have all the
preliminaries to start rewriting an existing project that'll put quite
some of Scalas language features into use, I'm optimistic that I'll be
able to help identify more problems ( if any ;) ) in the course of it.

> I'd love to hear about toString issue, too.
>

to reproduce this, simply put

trace(numbers.toString)

in onModuleLoad(), the Exception is this:
Uncaught TypeError: Object List(1, 2, 3, 4) has no method 'toString_1'
which is somewhat funny, since it very much looks like there *is* a
working toString somewhere.


Thanks a lot!

regards,
Johann

Grzegorz Kossakowski

unread,
Feb 28, 2011, 3:48:30 PM2/28/11
to scal...@googlegroups.com
2011/2/28 Johann Borck <johann...@densedata.com>

On 02/28/2011 08:27 PM, Grzegorz Kossakowski wrote:
Again, wow, the magic of open source: report a bug and have it fixed a negligible amount of minutes later :) . Now I think I have all the preliminaries to start rewriting an existing project that'll put quite some of Scalas language features into use, I'm optimistic that I'll be able to help identify more problems ( if any ;) ) in the course of it.

I'm sure you'll find lots of problems but reports with reproducible examples would be a huge help. Before you start hacking bear in mind that jirbble doesn't support annotations at all yet so if you happen to use them in your project you'll have to wait until they are implemented.
 
to reproduce this, simply put

trace(numbers.toString)

in onModuleLoad(), the Exception is this:
   Uncaught TypeError: Object List(1, 2, 3, 4) has no method 'toString_1'
which is somewhat funny, since it very much looks like there *is* a working toString somewhere.

I reproduced it but I don't understand it yet. This will require some longer debugging session so it has to wait until the end of the week. Now I have to dive into world of categories of abstract algebras...

--
Grzegorz Kossakowski

Grzegorz Kossakowski

unread,
Feb 28, 2011, 3:50:47 PM2/28/11
to scal...@googlegroups.com
2011/2/28 Malvolio <malvo...@gmail.com>

You know what would be a huge help for me?  If you built a single jar that would just, zap, turn all the Scala code into Javascript.  Like this:

$ java -jar scalagwt.0.8.jar -o myprogram.js FirstThing.scala SecondThing.scala

Something like that.

Malvolio,

Something like that (or even better) will be provided once the whole stack gets more stable. At this point I need to focus on fixing bugs, I think.

--
Grzegorz Kossakowski

Johann Borck

unread,
Feb 28, 2011, 4:33:16 PM2/28/11
to scal...@googlegroups.com
On 02/28/2011 09:48 PM, Grzegorz Kossakowski wrote:
>
> I'm sure you'll find lots of problems but reports with reproducible
> examples would be a huge help. [..]
Yep, if you have any preferences WRT the format of the examples
(methods/classes/modified-hello-example-file/other), let me know.

regards,
Johann

Grzegorz Kossakowski

unread,
Feb 28, 2011, 4:38:24 PM2/28/11
to scal...@googlegroups.com
2011/2/28 Johann Borck <johann...@densedata.com>

On 02/28/2011 09:48 PM, Grzegorz Kossakowski wrote:

I'm sure you'll find lots of problems but reports with reproducible examples would be a huge help. [..]
Yep, if you have any preferences WRT the format of the examples (methods/classes/modified-hello-example-file/other), let me know.

The best would be that each problem gets it's own modified sample posted to github so I can just do `git fetch $url && git checkout $branch && ant` and have quick look. I think such approach is the easiest one and should work well for now.

--
Grzegorz Kossakowski

Malvolio

unread,
Mar 2, 2011, 3:21:33 PM3/2/11
to scal...@googlegroups.com
While you have a good long list of bugs, that's a good idea, of course, but once you get that whittled down, my honest (if not disinterested) advice would be make it convenient for people like me -- who have no knowledge of, or interest in, things like Jribble or ASTs or compiler design -- to actually try it out, because we represent your audience, the vast majority who really need your product without necessarily understanding it.

Let me propose two (wholly hypothetical) bugs:

1. the compiler doesn't handle eta expansion inside a comprehension
2. the compiled code cannot call document.createElement when run in a browser

The first bug (if it were to exist) would I think be noticed, discussed, and fixed by the kind of people who want to download and build the whole Scala-GWT package; the second bug would be something kind of minor that would nonetheless make Scala-GWT pretty useless to the average programmer.

Like I said, just my opinion, and I really like what you've done so far.

Yours,
M.

Grzegorz Kossakowski

unread,
Mar 2, 2011, 4:03:17 PM3/2/11
to scal...@googlegroups.com
2011/3/2 Malvolio <malvo...@gmail.com>

While you have a good long list of bugs, that's a good idea, of course, but once you get that whittled down, my honest (if not disinterested) advice would be make it convenient for people like me -- who have no knowledge of, or interest in, things like Jribble or ASTs or compiler design -- to actually try it out, because we represent your audience, the vast majority who really need your product without necessarily understanding it.

Malvolio, thanks for your comments. I certainly do understand that users of my project will be absolutely not interested in things like jribble or compiler design.

However, I think you are being too optimistic about the maturity of my work. It's very slow, unstable and full of bugs. I don't want to package it nicely at this point because that would create a false impression. Once all major problems are being addressed I'll certainly make it far easier to test with real applications and code constructs that people use on daily basis.


Let me propose two (wholly hypothetical) bugs:

1. the compiler doesn't handle eta expansion inside a comprehension
2. the compiled code cannot call document.createElement when run in a browser

The first bug (if it were to exist) would I think be noticed, discussed, and fixed by the kind of people who want to download and build the whole Scala-GWT package; the second bug would be something kind of minor that would nonetheless make Scala-GWT pretty useless to the average programmer.

As I said above, I'm certainly interested in seeing my work being tested against real GWT applications and I'll work with people to support their needs. It's simply too early. At this point you could see document.createElement not working (or working in a strange way) just because I'm feeding GWT with a corrupt data that GWT has no chance to defend itself against.

Simply put: I believe that exposing my work at current state would bring more confusion, frustration and harm than good in terms of testing because most of bug reports would be very misleading anyway.

As I said earlier I'll get commercial support in a summer and the goal is to make ScalaGWT project ready to use by commercial users that simply want their job get done. This will come, I just need more time.

--
Grzegorz Kossakowski

Johann Borck

unread,
Mar 2, 2011, 4:31:27 PM3/2/11
to scal...@googlegroups.com
On 03/02/2011 09:21 PM, Malvolio wrote:
While you have a good long list of bugs, that's a good idea, of course, but once you get that whittled down, my honest (if not disinterested) advice would be make it convenient for people like me -- who have no knowledge of, or interest in, things like Jribble or ASTs or compiler design -- to actually try it out, because we represent your audience, the vast majority who really need your product without necessarily understanding it.

Hi,
well, keep in mind that this project targets GWT, which doesn't simply produce JS, but rather a set of html and js files, dynamically loaded depending on browsers and whatnot. What you can do is checkout the sample repo, build it (two simple commands), open your browser and there it is, so the "try it out" part is actually covered already. I'd also want to be able to produce JS independent of the GWT framework, which is quite biased towards Rich Apps, and I hope that this feature will be added sometime, but it would have to be implemented on the output side of gwtc and this very project currently "only" (that word feels really misplaced here) covers translating scala->jribble->internal-gwtc-AST, everything else is just the way it works in GWT. If you want to produce a single JS file the way you demonstrated, you probably should make the GWT guys address that.

(Note that I'm just another interested guy, and could easily be mistaken, though I'm fairly convinced I'm not)

regards,
Johann

Malvolio

unread,
Mar 2, 2011, 8:19:04 PM3/2/11
to scal...@googlegroups.com
On Wed, Mar 2, 2011 at 1:03 PM, Grzegorz Kossakowski <grzegorz.k...@gmail.com> wrote:
2011/3/2 Malvolio <malvo...@gmail.com>

While you have a good long list of bugs, that's a good idea, of course, but once you get that whittled down, my honest (if not disinterested) advice would be make it convenient for people like me -- who have no knowledge of, or interest in, things like Jribble or ASTs or compiler design -- to actually try it out, because we represent your audience, the vast majority who really need your product without necessarily understanding it.

Malvolio, thanks for your comments. I certainly do understand that users of my project will be absolutely not interested in things like jribble or compiler design.

Please don't think I am demeaning these things -- they're just not in my area of expertise. 

However, I think you are being too optimistic about the maturity of my work. It's very slow, unstable and full of bugs. I don't want to package it nicely at this point because that would create a false impression. Once all major problems are being addressed I'll certainly make it far easier to test with real applications and code constructs that people use on daily basis.


Slow, unstable and full of bugs?  Ship it! 

I'm only partly joking.  You ever see a guy waiting in line for the restroom, and he's nervously shifting from one foot to the other?  That's me, waiting for this to work.


Johan writes:

well, keep in mind that this project targets GWT, which doesn't simply produce JS, but rather a set of html and js files, dynamically loaded depending on browsers and whatnot.

Did not know that.  I just read about GWT, oh, a year ago, and thought: that's what we need, a strongly-typed language for the browser.  Then I learned about Scala and realized it was in so many ways superior to Java, and I wanted that to be my strongly-typed browser language.

I hate to be one of those guys who starts every sentence with "I remember when...", but I remember when software tool developers took pride in how little any given tool did -- it just sorted or filtered or whatever -- and you hooked several tools together to make it work.  When did this style -- every project is a Parallel Universe you have to teleport yourself into to use -- become popular? 
 
What you can do is checkout the sample repo, build it (two simple commands), open your browser and there it is, so the "try it out" part is actually covered already. I'd also want to be able to produce JS independent of the GWT framework, which is quite biased towards Rich Apps, and I hope that this feature will be added sometime, but it would have to be implemented on the output side of gwtc and this very project currently "only" (that word feels really misplaced here) covers translating scala->jribble->internal-gwtc-AST, everything else is just the way it works in GWT. 

Yeah, I spent about 6 hours last week trying to use a Scala-based ORM, just trying to get the "hello, world" to work.  It turned out that it required Maven3 (which is still in beta) to work.  When I complained about that on their mailing list, one of the authors wrote, "Maybe you should consider using something else"  -- a perfectly sensible solution but I was in a bad mood and wrote back, "That should be on your website: 'Use something else' "

Once bitten, I'm a little wary of spending a lot of time trying to build someone else's project, especially if it's Maven based.  Maven is incredibly state-ful, there's all sorts of settings and resources that are particular to the computer and the user, not to the project.  I've never had one build cleanly.

Johann Borck

unread,
Mar 2, 2011, 11:29:27 PM3/2/11
to scal...@googlegroups.com
On 03/03/2011 02:19 AM, Malvolio wrote:
Johan writes:

well, keep in mind that this project targets GWT, which doesn't simply produce JS, but rather a set of html and js files, dynamically loaded depending on browsers and whatnot.

Did not know that.  I just read about GWT, oh, a year ago, and thought: that's what we need, a strongly-typed language for the browser.  Then I learned about Scala and realized it was in so many ways superior to Java, and I wanted that to be my strongly-typed browser language.

Maybe you're interested in haxe (haxe.org). The typesystem is not as sophisticated as scalas, but haxe is strongly typed, has type inference, parameterized types, higher-order functions, compiles to JS (just as in your use-case), AS3, flash/AVM2 bytecode and other targets. It's mature and has a fast compiler (not just compared to GWT) which makes development a charm, it has also some IDE (eclipse and others) support. Not that I'm suggesting you turn away from scalagwt, it's just that haxe is usable today.
[..]
Once bitten, I'm a little wary of spending a lot of time trying to build someone else's project, especially if it's Maven based.  Maven is incredibly state-ful, there's all sorts of settings and resources that are particular to the computer and the user, not to the project.  I've never had one build cleanly.

In this case it's just a git repository, just git clone the repo, run ant and you're done.

regards,
Johann

Grzegorz Kossakowski

unread,
Mar 6, 2011, 9:51:20 AM3/6/11
to scal...@googlegroups.com
2011/2/28 Grzegorz Kossakowski <grzegorz.k...@gmail.com>


to reproduce this, simply put

trace(numbers.toString)

in onModuleLoad(), the Exception is this:
   Uncaught TypeError: Object List(1, 2, 3, 4) has no method 'toString_1'
which is somewhat funny, since it very much looks like there *is* a working toString somewhere.

I reproduced it but I don't understand it yet. This will require some longer debugging session so it has to wait until the end of the week. Now I have to dive into world of categories of abstract algebras...

I spent a bit more time on this and I came to conclusion that polymorphic method calls are broken in certain cases. Still don't know how to fix it. I'll start another thread on that.

--
Grzegorz Kossakowski

Grzegorz Kossakowski

unread,
Mar 18, 2011, 1:52:30 PM3/18/11
to scal...@googlegroups.com
2011/3/6 Grzegorz Kossakowski <grzegorz.k...@gmail.com>:

> I spent a bit more time on this and I came to conclusion that polymorphic
> method calls are broken in certain cases. Still don't know how to fix it.
> I'll start another thread on that.

Ok, fixed is waiting for review here:

http://review.source.gogoego.com/#change,2215

Johann, could you give it a try with your sample and verify that it
works for you?

--
Grzegorz Kossakowski

Johann Borck

unread,
Mar 18, 2011, 2:39:13 PM3/18/11
to scal...@googlegroups.com
Yep, seems to work now.

Grzegorz Kossakowski

unread,
Mar 19, 2011, 8:08:01 AM3/19/11
to scal...@googlegroups.com, Johann Borck
2011/3/18 Johann Borck <johann...@densedata.com>:

>
> Yep, seems to work now.

Thanks. I'll merge it once Lex have a look at it.

--
Grzegorz Kossakowski

Lex Spoon

unread,
Mar 19, 2011, 4:18:54 PM3/19/11
to scal...@googlegroups.com, Johann Borck


Good find, Grzeg!! -Lex

Reply all
Reply to author
Forward
0 new messages