Sourcemaps: the holy grale for Amber?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Sourcemaps: the holy grale for Amber?

Nicolas Petton
Hi guys,

With Manfred we talked about improving the debugger of Amber. The
obvious solution seems to be source maps:

http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/

It is currently supported by both Firefox and Chrome

The plan would be (in a first step) to:

- remove all context creation from Amber
- Generate maps for the .js files
- Maybe write the source code of each Smalltalk method in a dedicated
  file instead of using the chunk format
- then we could remove the sources from the .js files, and remove
  .deploy.js files too

The advantages:

- we get the speed of JavaScript as we would compile to straight JS
  (yeah!!)
- We could use the debugger of Chrome and Firefox, and thus get a 100%
  working debugger!
- It would be a lot simpler than writing and AST interpreter

Downsides:

- We rely on source mapping, and lose control over the debugger features
- For consistency purposes, the IDE of Amber could be an extension to
  the Chrome dev tools, as an additional tab.

What do you think?

Personnaly, I think this is very exciting. It could very well be the
best thing to happen to Amber since... Amber ;)

Cheers,
Nico
Reply | Threaded
Open this post in threaded view
|

Re: Sourcemaps: the holy grale for Amber?

Andy Burnett
I think adding the IDE to the chrome tab would be fantastic. It would
make development much easier.

How hard do you think it would be?

On 11 Dec 2012, at 08:41, Nicolas Petton <[hidden email]> wrote:

> Hi guys,
>
> With Manfred we talked about improving the debugger of Amber. The
> obvious solution seems to be source maps:
>
> http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
>
> It is currently supported by both Firefox and Chrome
>
> The plan would be (in a first step) to:
>
> - remove all context creation from Amber
> - Generate maps for the .js files
> - Maybe write the source code of each Smalltalk method in a dedicated
>  file instead of using the chunk format
> - then we could remove the sources from the .js files, and remove
>  .deploy.js files too
>
> The advantages:
>
> - we get the speed of JavaScript as we would compile to straight JS
>  (yeah!!)
> - We could use the debugger of Chrome and Firefox, and thus get a 100%
>  working debugger!
> - It would be a lot simpler than writing and AST interpreter
>
> Downsides:
>
> - We rely on source mapping, and lose control over the debugger features
> - For consistency purposes, the IDE of Amber could be an extension to
>  the Chrome dev tools, as an additional tab.
>
> What do you think?
>
> Personnaly, I think this is very exciting. It could very well be the
> best thing to happen to Amber since... Amber ;)
>
> Cheers,
> Nico
Reply | Threaded
Open this post in threaded view
|

Re: Sourcemaps: the holy grale for Amber?

Nicolas Petton

Andy Burnett <[hidden email]> writes:

> I think adding the IDE to the chrome tab would be fantastic. It would
> make development much easier.
>
> How hard do you think it would be?

Not much. Helios (the next IDE) is made to run remotely anyway :)

Cheers,
Nico


>
> On 11 Dec 2012, at 08:41, Nicolas Petton <[hidden email]> wrote:
>
>> Hi guys,
>>
>> With Manfred we talked about improving the debugger of Amber. The
>> obvious solution seems to be source maps:
>>
>> http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
>>
>> It is currently supported by both Firefox and Chrome
>>
>> The plan would be (in a first step) to:
>>
>> - remove all context creation from Amber
>> - Generate maps for the .js files
>> - Maybe write the source code of each Smalltalk method in a dedicated
>>  file instead of using the chunk format
>> - then we could remove the sources from the .js files, and remove
>>  .deploy.js files too
>>
>> The advantages:
>>
>> - we get the speed of JavaScript as we would compile to straight JS
>>  (yeah!!)
>> - We could use the debugger of Chrome and Firefox, and thus get a 100%
>>  working debugger!
>> - It would be a lot simpler than writing and AST interpreter
>>
>> Downsides:
>>
>> - We rely on source mapping, and lose control over the debugger features
>> - For consistency purposes, the IDE of Amber could be an extension to
>>  the Chrome dev tools, as an additional tab.
>>
>> What do you think?
>>
>> Personnaly, I think this is very exciting. It could very well be the
>> best thing to happen to Amber since... Amber ;)
>>
>> Cheers,
>> Nico

--
Nicolas Petton
http://nicolas-petton.fr
Reply | Threaded
Open this post in threaded view
|

Re: Sourcemaps: the holy grale for Amber?

Esteban A. Maringolo
In reply to this post by Nicolas Petton
That's a fantastic proposal.

I used source maps only with minified JavaScript and with some toylike tests with CoffeeScript.

I look forward to see it in action in Amber.

Will it be possible to "restart/drop" the execution from a particular stack frame? You can't do that in JS (at least I don't know how).

Regards!
Reply | Threaded
Open this post in threaded view
|

Re: Sourcemaps: the holy grale for Amber?

Herby Vojčík
In reply to this post by Nicolas Petton


Nicolas Petton wrote:

> Hi guys,
>
> With Manfred we talked about improving the debugger of Amber. The
> obvious solution seems to be source maps:
>
> http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
>
> It is currently supported by both Firefox and Chrome
>
> The plan would be (in a first step) to:
>
> - remove all context creation from Amber
> - Generate maps for the .js files
> - Maybe write the source code of each Smalltalk method in a dedicated
>    file instead of using the chunk format
> - then we could remove the sources from the .js files, and remove
>    .deploy.js files too

Looks good. Hopefully there isn't some hidden trap there.

> The advantages:
>
> - we get the speed of JavaScript as we would compile to straight JS
>    (yeah!!)
We sort-of do now. I don't get this.

> - We could use the debugger of Chrome and Firefox, and thus get a 100%
>    working debugger!
> - It would be a lot simpler than writing and AST interpreter
This either.

> Downsides:
>
> - We rely on source mapping, and lose control over the debugger features
Hm :-/
Maybe not, look below.
> - For consistency purposes, the IDE of Amber could be an extension to
>    the Chrome dev tools, as an additional tab.
In that case, the Smalltalk-savvy debugger (extensions) could be part of it.

> What do you think?
The bad thing is reliance on only a few browsers. But it is only for
development, the prodyuction code should work. But bye-bye amber web,
where you browse, click Class Browser and get in. Installing a browser
extension (not to mention different browser) is a barrier to adoption (I
remember myself how a "get a facebook app in 2 minutes" got me into
AppJet if someone remembers it yet :-) ).

> Personnaly, I think this is very exciting. It could very well be the
> best thing to happen to Amber since... Amber ;)
>
> Cheers,
> Nico

Herby
Reply | Threaded
Open this post in threaded view
|

Re: Sourcemaps: the holy grale for Amber?

Nicolas Petton

Herby Vojčík <[hidden email]> writes:
>> The advantages:
>>
>> - we get the speed of JavaScript as we would compile to straight JS
>>    (yeah!!)
> We sort-of do now. I don't get this.

the message_send branch is a step forward, yes. But the idea was to
remove SmalltalkContext completely. Then we would get the speed of JS.

> The bad thing is reliance on only a few browsers. But it is only for
> development, the prodyuction code should work. But bye-bye amber web,
> where you browse, click Class Browser and get in. Installing a browser
> extension (not to mention different browser) is a barrier to adoption (I
> remember myself how a "get a facebook app in 2 minutes" got me into
> AppJet if someone remembers it yet :-) ).

Well, not necessarily. We could use the debugger API of Chrome/Firefox
to write our own debugger on top of it. Now this means that debugging
would still be available for Firefox and Chrome, but the IDE would be
available everywhere.

I don't know yet how it should be done, but sourcemaps definitely looks
like the way to go.

Nico
Reply | Threaded
Open this post in threaded view
|

Re: Sourcemaps: the holy grale for Amber?

Denis Kudriashov
Hello

2012/12/11 Nicolas Petton <[hidden email]>

Herby Vojčík <[hidden email]> writes:
>> The advantages:
>>
>> - we get the speed of JavaScript as we would compile to straight JS
>>    (yeah!!)
> We sort-of do now. I don't get this.

the message_send branch is a step forward, yes. But the idea was to
remove SmalltalkContext completely. Then we would get the speed of JS.

Nico

Is it means that resumable exceptions, continuations and other thisContext stuff can't be implemented in Amber?

Is it possible to get SmalltakContext configurable? So code which is need it can be compiled specifically.

Reply | Threaded
Open this post in threaded view
|

Re: Sourcemaps: the holy grale for Amber?

Gerald Leeb-2
In reply to this post by Nicolas Petton
What I really like is the capability to change the code during runtime. I must not rebuild the whole codebase, reload the page, lose my context and state, but can make changes Smalltalk like :) 

I don't know sourcemap in detail, but will dynamic changes will be supported?
Reply | Threaded
Open this post in threaded view
|

Re: Sourcemaps: the holy grale for Amber?

Manfred Kröhnert
Hi Gerald,

On Fri, Dec 14, 2012 at 9:05 AM, Gerald Leeb <[hidden email]> wrote:
What I really like is the capability to change the code during runtime. I must not rebuild the whole codebase, reload the page, lose my context and state, but can make changes Smalltalk like :) 

I don't know sourcemap in detail, but will dynamic changes will be supported?

Currently we are not sure if dynamic SourceMaps are completely supported.
But we are investigating on it.

Anybody with more knowledge about SourceMaps is welcome to join the discussion :-)

Best,
Manfred
Reply | Threaded
Open this post in threaded view
|

Re: Sourcemaps: the holy grale for Amber?

Nicolas Petton
In reply to this post by Denis Kudriashov

Well, if we go this path, thisContext will for sure go away. We are
still thinking about it though, not sure yet which path we'll take :)

Nico

Denis Kudriashov <[hidden email]> writes:

> Hello
>
> 2012/12/11 Nicolas Petton <[hidden email]>
>
>>
>> Herby Vojčík <[hidden email]> writes:
>> >> The advantages:
>> >>
>> >> - we get the speed of JavaScript as we would compile to straight JS
>> >>    (yeah!!)
>> > We sort-of do now. I don't get this.
>>
>> the message_send branch is a step forward, yes. But the idea was to
>> remove SmalltalkContext completely. Then we would get the speed of JS.
>>
>> Nico
>>
>
> Is it means that resumable exceptions, continuations and other thisContext
> stuff can't be implemented in Amber?
>
> Is it possible to get SmalltakContext configurable? So code which is need
> it can be compiled specifically.

--
Nicolas Petton
http://nicolas-petton.fr
Reply | Threaded
Open this post in threaded view
|

Re: Sourcemaps: the holy grale for Amber?

xekoukou
It would be nice if the development of amber was more transparent to the users.
(for example, there is no information for helios anywhere)
Maybe have the amber-lang site point to a blog that talks about the future of amber.
Or use this list to inform users of changes that will happen in the future.

Most importantly, i would like to be informed of changes that could stop my code from working.

Apart from that, using sourcemap seems very promising.

2012/12/14 Nicolas Petton <[hidden email]>

Well, if we go this path, thisContext will for sure go away. We are
still thinking about it though, not sure yet which path we'll take :)

Nico

Denis Kudriashov <[hidden email]> writes:

> Hello
>
> 2012/12/11 Nicolas Petton <[hidden email]>
>
>>
>> Herby Vojčík <[hidden email]> writes:
>> >> The advantages:
>> >>
>> >> - we get the speed of JavaScript as we would compile to straight JS
>> >>    (yeah!!)
>> > We sort-of do now. I don't get this.
>>
>> the message_send branch is a step forward, yes. But the idea was to
>> remove SmalltalkContext completely. Then we would get the speed of JS.
>>
>> Nico
>>
>
> Is it means that resumable exceptions, continuations and other thisContext
> stuff can't be implemented in Amber?
>
> Is it possible to get SmalltakContext configurable? So code which is need
> it can be compiled specifically.

--
Nicolas Petton
http://nicolas-petton.fr



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

Reply | Threaded
Open this post in threaded view
|

Re: Sourcemaps: the holy grale for Amber?

Nicolas Petton

Apostolis Xekoukoulotakis <[hidden email]> writes:

> It would be nice if the development of amber was more transparent to the
> users.
> (for example, there is no information for helios anywhere)
> Maybe have the amber-lang site point to a blog that talks about the future
> of amber.
> Or use this list to inform users of changes that will happen in the
> future.

Indeed. I'll write an email with the current development of Amber. A
blog would be nice, but as always, writing blog posts takes time :/

>
> Most importantly, i would like to be informed of changes that could stop my
> code from working.

Sure. Until now we've kept Amber backward compatible, and when it was
not the case, there has always been infos on how to upgrade.

Nico

>
> Apart from that, using sourcemap seems very promising.
>
> 2012/12/14 Nicolas Petton <[hidden email]>
>
>>
>> Well, if we go this path, thisContext will for sure go away. We are
>> still thinking about it though, not sure yet which path we'll take :)
>>
>> Nico
>>
>> Denis Kudriashov <[hidden email]> writes:
>>
>> > Hello
>> >
>> > 2012/12/11 Nicolas Petton <[hidden email]>
>> >
>> >>
>> >> Herby Vojčík <[hidden email]> writes:
>> >> >> The advantages:
>> >> >>
>> >> >> - we get the speed of JavaScript as we would compile to straight JS
>> >> >>    (yeah!!)
>> >> > We sort-of do now. I don't get this.
>> >>
>> >> the message_send branch is a step forward, yes. But the idea was to
>> >> remove SmalltalkContext completely. Then we would get the speed of JS.
>> >>
>> >> Nico
>> >>
>> >
>> > Is it means that resumable exceptions, continuations and other
>> thisContext
>> > stuff can't be implemented in Amber?
>> >
>> > Is it possible to get SmalltakContext configurable? So code which is need
>> > it can be compiled specifically.
>>
>> --
>> Nicolas Petton
>> http://nicolas-petton.fr
>>
>
>
>
> --
>
>
> Sincerely yours,
>
>      Apostolis Xekoukoulotakis

--
Nicolas Petton
http://nicolas-petton.fr