-
Notifications
You must be signed in to change notification settings - Fork 123
Getting started
To get started hacking on Amber you can basically take several routes, independent of your platform.
- Just try it out at http://www.amber-lang.net (click the "Class browser" button) - but you will not be able to save any code you write! Still, it works fine for looking at the IDE and playing around. Just don't press F5/reload - it will bring you back to zero.
- Set up your browser application with
bower init, thenbower install amber --save. You will have Amber installed as a dependency inbower_components. The Amber development server is accessible via./bower_components/amber/bin/amber serve. - Set up your project with
npm, thennpm install amber --save. You will have amber installed as a dependency innode_modules. A few Amber scripts will be added tonode_modules/.bin/. - Download an Amber zipball, install Node.js, fire up the Amber server and then open Amber from localhost - then you can save code. Detailed instructions are below!
- Amber Core Developer Mode (do this if you want to contribute to Amber itself): install Git first and get a proper clone from http://github.com/amber-smalltalk/amber instead of a zip/tarball. It requires installing Git first, which is left as an "exercise to the reader" (although being quite simple) :) Do not forget to get the dependencies: see below.
PLEASE NOTE: Amber core developers use a variety of operating systems.
Therefore, we do not want to introduce dependencies that are not cross platform compatible.
The amberc command line compiler and the build system have been rewritten based on Node.js instead of Bash scripts to support this.
Releases
-
numbered versions in github releases page
Unpack wherever you like, but we would advise you to rename the directory that is unpacked to something slightly shorter, e.g. "amber". With Amber 0.12.0 we refrained from managing the dependencies ourselves and use `bower instead. So please continue below with Getting dependencies :)
Node (for short) is simply the V8 Javascript VM from Google Chrome hooked together with some hardcore C++ libraries for doing "evented I/O". Basically, it's Javascript for the server - on async steroids. Amber runs fine in Node and we use it for several Amber tools, like amberc or the Amber server (see below). There are also several Amber-Node example to look at if you want to play with running Amber programs server-side. In short - you really want to install Nodejs. :)
- Installing Node on Linux can be done using your package tool of choice (
apt-get install nodejsfor example) or any other way described at the download page. - Installing Node on Mac OS X or Windows is probably done best by using the installers at download from Nodejs.org.
npm stands for 'node package manager' and is needed to load dependencies for the node projects.
Amber uses node-based projects for housekeeping, so npm is required to be present.
Depending on your platform, npm can be installed alongside with node (ie Windows).
If it is not (ie CentOS), you can install it using your OS's package tool.
Amber depends on a few of web libraries to work.
These dependencies are managed using bower, a package manager for web libraries.
If you do not have bower installed, install it with npm install -g bower.
If you got Amber itself from bower, bower dependencies are already installed with it.
If not, you should run bower install inside the Amber directory.
At this point you can double click the index.html file in the Amber directory to get the IDE up. However, you will not be able to save code. So please continue below :)
To be able to use Amber development tools (simple Amber development server, amberc compiler, or run grunt tasks), you must also install development dependencies.
If you got Amber itself from npm, development dependencies are already installed.
Otherwise, run npm install in the Amber directory.
Nicolas has written a minimal webDAV server that is the easiest way to get up and running Amber with the ability to save code. This little server is written in... Amber! And it runs on top of Node. So to start it up serving your brand new directory tree of sweet Amber you do:
cd amber (or whatever you called the directory you unpackaged)
./bin/amber serve (in windows you type `bin\amber serve` instead)
It should say it is listening on port 4000. If it does, hooray! That means both Node and Amber are good. On Windows you might get a question about opening that port in the local firewall - yep, do it!
The Amber IDE is written in... Amber. It uses JQuery and runs right in your browser as a ... well, a web page. We could open it up just using a file url - but the reason we performed the previous steps is so that we can load the IDE web page from a server that can handle PUTs (webDAV) of source code. According to web security Amber can only do PUT back to the same server it was loaded from. Thus we instead want to open it through our little server now listening on port 4000:
http://localhost:4000/index.html
Clicking the above link should get your Amber running.
To verify that you can indeed commit - just select a Package in the browser, like say "Examples" and press "Commit package" button. If all goes well nothing happens :). So in order to really know if it worked we can check the modified date on the files amber/st/Examples.st and amber/js/Examples.js - they should be brand new.
NOTE: We can use any webDAV server and Apache2 has been used earlier and works fine. But the Amber server is smaller and simpler to start.
Now, finally, you can proceed to Writing my first app