Dan Shafer
Dan Shafer

Reputation: 61

Amber Smalltalk JavaScript Output

I'm evaluating switching my Web App work to Amber Smalltalk and away from CoffeeScript. I like CS fine but I'm far more comfortable with Smalltalk.

I have had a lot of trouble finding sites that are deployed from Amber so that I can evaluate the quality (and maintainability) of the JavaScript code generated by Amber. Can anyone point me either to sample sites coded in Amber so I can examine the JS output source or to any online pieces making that assessment? I've searched pretty thoroughly here without success and I've also spent some time in Google without any helpful results as well (though I will keep trying there).

I'm asking the same question on Smalltalk forums but StackOverflow has always been so helpful and responsive, I figured I'd give this a shot as well.

Upvotes: 2

Views: 369

Answers (1)

MKroehnert
MKroehnert

Reputation: 3737

I'll copy most answers from the thread on the Amber Mailinglist:

Answers by Herby:

  • The Amber IDE is written in Amber itself so you can take a look at the generated JS output in js directory of the GitHub repo. However, the JS output changes over time and will become more efficient as the compiler evolves.
  • Amber is a little more heavyweight than CS because it needs to map Amber methods into JS methods (between:and: -> _between_and_) and maintain parallel inheritance (Amber String is subclass of Collection though JS String is not; in runtime both concepts are merged, Amber wraps JS String), so the output looks accordingly.
  • The code of a simple Todo demo application can be found here with a link to the online demo.

Answer from me was:

  • Take a look at the SmalltalkHub webinterface which is written in Amber (although a fairly old version). The SmalltalkHub code can be found on SmalltalkHub, too.

Answer by Matthias:

  • To browse the SmalltalkHub webfrontend code go to SmalltalkHub, open a JavaScript console and run amber.toggleIDE() to bring up the Smalltalk IDE. From there take a look at the packages starting with Hub. Or you can take a look at the JS files downloaded by the browser from the JS console.

Upvotes: 2

Related Questions