Amber packaging and loading (was: Re: [amber-lang] How to organize Amber extensions/addons)

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

Amber packaging and loading (was: Re: [amber-lang] How to organize Amber extensions/addons)

Herby Vojčík
Hi,

very good topic.

I myself struggle with this, even in a simple scenario. When writing
library for Amber, I'd like to have Amber itself, the library and also
test/example/demo code available.

For now, I could have two pretty easily (library plus Amber itself), but
it is hard to have more. Not to mention the possibility that my library
would depend on another library.

So I think the loader should be updated, to somehow allow loading
packages from more locations (and maybe store them as well, though
generally it would be sufficient if only one of the tier would be
writable, but we need the ability to have more of them for reading).

I personally think the loader should allow to put Amber libraries into
npm (thus, dependencies solved on server / deploy side), and have the
possinility to load them from the npm structure.

A fairly easy, general solution could be instead:

   loadAmber({
     packages: ['Foo', 'Bar'],
     packageHome: '../lib'
   });

to be able to use:

   loadAmber({
     packages: {
       '../lib': ['Foo', 'Bar', { './relative': 'Baz' }],
       '/another/path': [ 'Quux' ]
     }
   });

IOW, to put free structure in packages and its subelements where:
   - if it is a string, it is the package name itself ('Baz')
   - if it is an array, it is list of elements
   - if it is an object (aka hash), it maps paths, relative to actual
path, to subelements.

But anything other would do as well.

Herby

P.S.: Sorry for occassional b changed to n, I've got fresh natural
keyboard and must relearn that b should be typed by left hand. ;-)

Sebastian Heidbrink wrote:

> Hi all,
>
> I started Amber last autumn and I started to share some of the basic
> stuff I successfully extended Amber with on Github.
>
> I'll soon have some more things to share and I was wondering which way
> might be best.
>
> Could we setup "one" general kind of "solution" to provide Amber
> extensions?
>
> I'm not too sure if I should use, Github, Git submodules, an examples
> folder subfolder on github, Smalltalkhub with Kaliningrad, ss3 with
> Kaliningrad,... pull requests to the general Amber repository to add
> stuff to the examples folder directly,...
> Will there soon be a solution which might be included in Pharo?...
>
> What are your preferences? How do you share? Who's to ask and who's to
> blame? ;-)
>
> Cheers!
> Sebastian
Reply | Threaded
Open this post in threaded view
|

Re: Amber packaging and loading (was: Re: [amber-lang] How to organize Amber extensions/addons)

Tom Rake
When I added Google Charts example I found that Google Charts is various packages loaded by Google Loader https://developers.google.com/loader/ .

I would prefer a generic loader interface design that can be subclassing to various concrete types such as GoogleLoader and NodeLoader. This is the only way we can hope to do a one size fits all mechanism. Pharo/Squeak has the Monticello package loader which is based on various load types, local disk, internet sites http and ftp, database sources and internal smalltalk image storage. Package dependencies are handled by Metacello which allows the developer to specify specific load configurations for their package to compile and load.

As for Sebastian's issues on how to share, when I released my Google Charts examples I used the git submodule mechaniics as my final solution. The fit best with my intentions since I am on a slow release/update cycle.

-Tom Rake
On Tuesday, January 15, 2013 1:19:41 PM UTC-5, Herby wrote:
Hi,

very good topic.

I myself struggle with this, even in a simple scenario. When writing
library for Amber, I'd like to have Amber itself, the library and also
test/example/demo code available.

For now, I could have two pretty easily (library plus Amber itself), but
it is hard to have more. Not to mention the possibility that my library
would depend on another library.

So I think the loader should be updated, to somehow allow loading
packages from more locations (and maybe store them as well, though
generally it would be sufficient if only one of the tier would be
writable, but we need the ability to have more of them for reading).

I personally think the loader should allow to put Amber libraries into
npm (thus, dependencies solved on server / deploy side), and have the
possinility to load them from the npm structure.

A fairly easy, general solution could be instead:

   loadAmber({
     packages: ['Foo', 'Bar'],
     packageHome: '../lib'
   });

to be able to use:

   loadAmber({
     packages: {
       '../lib': ['Foo', 'Bar', { './relative': 'Baz' }],
       '/another/path': [ 'Quux' ]
     }
   });

IOW, to put free structure in packages and its subelements where:
   - if it is a string, it is the package name itself ('Baz')
   - if it is an array, it is list of elements
   - if it is an object (aka hash), it maps paths, relative to actual
path, to subelements.

But anything other would do as well.

Herby

P.S.: Sorry for occassional b changed to n, I've got fresh natural
keyboard and must relearn that b should be typed by left hand. ;-)

Sebastian Heidbrink wrote:

> Hi all,
>
> I started Amber last autumn and I started to share some of the basic
> stuff I successfully extended Amber with on Github.
>
> I'll soon have some more things to share and I was wondering which way
> might be best.
>
> Could we setup "one" general kind of "solution" to provide Amber
> extensions?
>
> I'm not too sure if I should use, Github, Git submodules, an examples
> folder subfolder on github, Smalltalkhub with Kaliningrad, ss3 with
> Kaliningrad,... pull requests to the general Amber repository to add
> stuff to the examples folder directly,...
> Will there soon be a solution which might be included in Pharo?...
>
> What are your preferences? How do you share? Who's to ask and who's to
> blame? ;-)
>
> Cheers!
> Sebastian
Reply | Threaded
Open this post in threaded view
|

Re: Amber packaging and loading (was: Re: [amber-lang] How to organize Amber extensions/addons)

Nicolas Petton
In reply to this post by Herby Vojčík
A good start would be to write ideas on a package loader on the wiki of
Amber on github.

Herby, do you want to start it? I like your ideas :)

Nico

Herby Vojčík <[hidden email]> writes:

> Hi,
>
> very good topic.
>
> I myself struggle with this, even in a simple scenario. When writing
> library for Amber, I'd like to have Amber itself, the library and also
> test/example/demo code available.
>
> For now, I could have two pretty easily (library plus Amber itself), but
> it is hard to have more. Not to mention the possibility that my library
> would depend on another library.
>
> So I think the loader should be updated, to somehow allow loading
> packages from more locations (and maybe store them as well, though
> generally it would be sufficient if only one of the tier would be
> writable, but we need the ability to have more of them for reading).
>
> I personally think the loader should allow to put Amber libraries into
> npm (thus, dependencies solved on server / deploy side), and have the
> possinility to load them from the npm structure.
>
> A fairly easy, general solution could be instead:
>
>    loadAmber({
>      packages: ['Foo', 'Bar'],
>      packageHome: '../lib'
>    });
>
> to be able to use:
>
>    loadAmber({
>      packages: {
>        '../lib': ['Foo', 'Bar', { './relative': 'Baz' }],
>        '/another/path': [ 'Quux' ]
>      }
>    });
>
> IOW, to put free structure in packages and its subelements where:
>    - if it is a string, it is the package name itself ('Baz')
>    - if it is an array, it is list of elements
>    - if it is an object (aka hash), it maps paths, relative to actual
> path, to subelements.
>
> But anything other would do as well.
>
> Herby
>
> P.S.: Sorry for occassional b changed to n, I've got fresh natural
> keyboard and must relearn that b should be typed by left hand. ;-)
>
> Sebastian Heidbrink wrote:
>> Hi all,
>>
>> I started Amber last autumn and I started to share some of the basic
>> stuff I successfully extended Amber with on Github.
>>
>> I'll soon have some more things to share and I was wondering which way
>> might be best.
>>
>> Could we setup "one" general kind of "solution" to provide Amber
>> extensions?
>>
>> I'm not too sure if I should use, Github, Git submodules, an examples
>> folder subfolder on github, Smalltalkhub with Kaliningrad, ss3 with
>> Kaliningrad,... pull requests to the general Amber repository to add
>> stuff to the examples folder directly,...
>> Will there soon be a solution which might be included in Pharo?...
>>
>> What are your preferences? How do you share? Who's to ask and who's to
>> blame? ;-)
>>
>> Cheers!
>> Sebastian

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

Re: Amber packaging and loading (was: Re: [amber-lang] How to organize Amber extensions/addons)

Herby Vojčík
I did.

Nicolas Petton wrote:
> A good start would be to write ideas on a package loader on the wiki of
> Amber on github.
>
> Herby, do you want to start it? I like your ideas :)
>
> Nico

Reply | Threaded
Open this post in threaded view
|

Re: Amber packaging and loading (was: Re: [amber-lang] How to organize Amber extensions/addons)

Nicolas Petton

Thanks!

Nico

Herby Vojčík <[hidden email]> writes:

> I did.
>
> Nicolas Petton wrote:
>> A good start would be to write ideas on a package loader on the wiki of
>> Amber on github.
>>
>> Herby, do you want to start it? I like your ideas :)
>>
>> Nico
>

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