Re: [Chicken-users] How to bootstrap developing a CHICKEN application?

2015-02-01 Thread Mario Domenech Goulart
Hi Bahman,

On Sun, 01 Feb 2015 03:57:40 +0330 Bahman Movaqar bah...@bahmanm.com wrote:

 A naive question but suppose I want to write an application (not an
 egg); an application in the sense that it will not be installed in
 CHICKEN repository.
 What is the recommended directory structure? How can I run the tests
 (like 'chicken-install -test')? How can I express dependencies? Or is it
 just *my* conception of application and in CHICKEN there is no
 difference between this and an egg?

It's totally up to your preferences.  Technically, it can be structured
as an egg, and that's probably the most convenient way.

.setup files can contain arbritrary CHICKEN code.  You don't even need
to use setup-api stuff (e.g., install-extension, install-program,
compile etc).  So, you can use a .setup file to build your application
only.  It doesn't automatically install it, unless you use something
like `install-extension'.  You can even have a regular Makefile and just
put `(system make)' into your .setup file (or you can use the make
egg).

.meta files can be used to specify dependencies.  It can also contain
arbitrary _data_ that your application may use.  chicken-install won't
bother if you put there things that it doesn't know.

I'd recommend a flat directory layout for the source code.  CHICKEN is
quite limited with regard to search paths, so if you have dependencies
among your application's modules, you'll probably want a flat directory
layout (I mean all source files under the same directory).  You can,
however, use a subdirectory for Scheme source.  Example:

app
├── app.meta
├── app.setup
├── COPYING
├── locale
│   └── en_US
├── README
├── src
│   ├── bar.scm
│   ├── baz.scm
│   └── foo.scm
└── tests
└── run.scm

In this case, you can use something like (change-directory src) in
your .setup file and build your app normally.  That's not very usual for
eggs, but I sometimes use this approach not to clutter the app source
root directory much (e.g., https://github.com/mario-goulart/awful-picman).

For tests, if you want to run chicken-install -test (or salmonella),
you'll have to follow chicken-install's convention: a tests directory
which contains a run.scm script.  run.scm is just the entry point for
the tests.  It can include files, load files and run arbitrary code.
Again, it's up to you to decide how to organize tests.

The nice thing about structuring your application as an egg is that you
get some interesting things for free.  For example, cross-compilation
support and the availability of egg-related tools (e.g., salmonella).

Best wishes.
Mario
-- 
http://parenteses.org/mario

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] How to bootstrap developing a CHICKEN application?

2015-02-01 Thread Peter Bex
On Sun, Feb 01, 2015 at 03:57:40AM +0330, Bahman Movaqar wrote:
 A naive question but suppose I want to write an application (not an
 egg); an application in the sense that it will not be installed in
 CHICKEN repository.
 What is the recommended directory structure? How can I run the tests
 (like 'chicken-install -test')? How can I express dependencies? Or is it
 just *my* conception of application and in CHICKEN there is no
 difference between this and an egg?

An egg is an extension (package), that can be installed via
chicken-install.  What exactly it provides is completely up to
the egg's author.

You could write an application and distribute it separately,
then tell people what eggs to install, but you could also write
an egg that installs a binary or a script.  This has the benefit
of using chicken-install's dependency management (however flawed
as it may be).  This is very similar to for example the situation
in Python where some applications are distributed as tarballs and
some are installable via Pip, or in NodeJS using Npm, or in Ruby
using rubygems.

Some examples of eggs that install binaries are: hyde, awful,
slatex, {svn-,git-,}egg-author, chicken-belt.

In the end it's up to you to decide what works best for you and
what is easiest for your users.

Cheers,
Peter


signature.asc
Description: Digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] How to bootstrap developing a CHICKEN application?

2015-02-01 Thread Bahman Movaqar
On 02/01/2015 03:57 AM, Bahman Movaqar wrote:
 A naive question but suppose I want to write an application (not an
 egg); an application in the sense that it will not be installed in
 CHICKEN repository.
 What is the recommended directory structure? How can I run the tests
 (like 'chicken-install -test')? How can I express dependencies? Or is it
 just *my* conception of application and in CHICKEN there is no
 difference between this and an egg?

 I'd appreciate any help or a pointer to a relevant documentation.


Thank you very much Peter and Mario for the detailed answers.
Considering what you said, I believe I'll go with the egg approach.

-- 
Bahman Movaqar

http://BahmanM.com - https://twitter.com/bahman__m
https://github.com/bahmanm - https://gist.github.com/bahmanm
PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)



signature.asc
Description: OpenPGP digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] How to bootstrap developing a CHICKEN application?

2015-02-01 Thread Peter Bex
On Sun, Feb 01, 2015 at 11:21:47AM +0100, Peter Bex wrote:
 Some examples of eggs that install binaries are: hyde, awful,
 slatex, {svn-,git-,}egg-author, chicken-belt.

Correction: egg-author is not an egg but a Mercurial extension.
The other two *-egg-author are programs distributed as eggs, though.

Cheers,
Peter


signature.asc
Description: Digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users