Library repository within the playground

I would suggest a rather complex System that is invoking changes on the IDE (breaking maybe the compatibilit with Processing - yet with 1.0 this could be considered!) as well as on the main website.

Change 1:
-Adding a source code repository to the Playground-
As the playground is basically a WIKI this is easy to add - if it is not already available. THough i would love to suggest a change: No more code in the text but links to full code files or at least pages more or less being blank except for the code file. Maybe in a standartized format so that it is readable by machinary (See below).

Change 2:
-Changes to the IDE-
The IDE should be able to read, in real time, when a library is added to the source code by reading the include lines.
In that case the library should be checked in two ways:

  1. Is it compiled or not (new)
    This is an old suggestion, i think it doesnt need much saying
  2. If it is a recent version
    This one is rather new. I would suggest adding either a metadata file to libraries that are in the playground or adding a header with metadata to every file. I would suggest the first as it is easier. It should give only very limited information like
    NAME: name of the Library
    AUTHOR: should be self explainatory
    VERSION: version of Library
    DESCRIPTION: Short description of the library (Maybe limited to 200 letters or so)
    HARDWARE: A list of the hardware versions of Arduino that the library is compatible with.
    Maybe a simple comma seperated list of the constants that are used all over the place to decide what aruino is in use. Also the IDE should be able to check wether the Target hardware is compatible to what is written in the metadata.
    URL: A URL to the Playground page
    This one is crucial. The IDE should be able to follow the URL and check wether the metadata in the file complies with the one on the playground or not. In the latter case it should download the newer version (or at least ask the user). For this we need the standartized format in the playground.. but this could be done the way some projects in the OSM project do by hiding certain data from view in the wiki yet making it available for robots to read.

This whole stuff wouldnt take much overhead for communications - especially if we'd hoist certain parts of the playground on an opensource development page as Sourceforge. If we'd just had an header like this:

/*
@NAME = Testlib
@AUTHOR = Nachtwind
@VERSION = 1.0.0.0
@DESCRIPTION = Just some Example Metadata.
@HARDWARE = m168,m328
@URL = http://www.arduino.cc/playground/Code/Testlib
*/

So a PHP file could be written that'd take the GET arguments like
check.php?a=Testlib&b=b=1.0.0.0 and look up the URL by itself (i would rather prefer that) but that would mean that every Lib has to have its very own name - the other option would to check the the URL and read, with the IDE, the supplied Metadata. The first way would be easier since a php (or similar) script would be much easier and faster for this.

So to sum up the proposed workfow:

  1. User enters "include ("testlib.h");"
  2. IDE checks wether the HARDWARE metadata complies with the target hardware
    2a) If compatible simply go to 3.
    2b) If not - tell the user.
  3. Query the URL supplied with the metadata if there is a newer version of the library or not.
    3a) If there is go to 4
    3b) If there is no new version check if it is already compiled
    3ba) If it is everything is ok
    3bb) If it is not, then compile it.
  4. Download the library and compile it

I hope many of you will see the benefits of these changes. Of course they are a lot of work, but it will benefit all users - especially if we can think ahead like adding an inIDE window to browse available libraries..

Thanks for reading :0)

There has been suggestions like these before, but it did not draw any attention then. Maybe we could seriously request something like this for 1.0

I know I'd be glad if maintaining libraries for the playground was a bit (read:very much) simpler.