Announce: derail - A simple web framework

14 views
Skip to first unread message

Torbjorn Tornkvist

unread,
May 21, 2008, 3:54:57 PM5/21/08
to erlware-dev
Hi foks,

I just published a first working version of a little web framework of
mine, named: derail.

It is very basic so far but it can already produce a simple
web app that we will put in production at work. It is a
Visitor registration web app., completely generated from
~10 lines of spec (see the docs).

I haven't published a release yet, so one need to
run the generator from the erlang shell at the moment.
It will generate an Erlware ready directory structure with
lots of code, etc, ready to be built by sinan. It is probably
as bug-ridden as a stray dog is full of fleas....

Cheers, Tobbe

Martin Logan

unread,
May 21, 2008, 5:18:58 PM5/21/08
to erlwa...@googlegroups.com
I look forward to seeing it, might I suggest a different name though.
If there is one thing I have seen in my time it is that erlang
engenders a lot of animosity from adherents to other programming
philosophies. It is quite strange, but I have seen it time and time
again. I would suggest, to avoid being the butt of a bunch of nasty
catty blog entries by rails enthusiasts that you call the project
something bearing no relation to any web framework out there. After
all, I fully expect yours to be revolutionary and not a clone or
reaction to anything currently on the scene!

My two cents,
Martin

Dave Peticolas

unread,
May 21, 2008, 10:58:32 PM5/21/08
to erlwa...@googlegroups.com
Cool! I'm going to check this out this weekend.

dave

Torbjorn Tornkvist

unread,
May 22, 2008, 5:14:53 AM5/22/08
to erlware-dev

Gee...for once I thought I had come up with a good name... :-)

Usually I have no fantasy as 'eldap', 'eradius', 'esmb', 'ex11', etc
are good (bad?) examples of. So if you can come up with a better
name then I will happily switch to it.

Cheers, Tobbe

On May 21, 11:18 pm, "Martin Logan" <martinjlo...@gmail.com> wrote:
> I look forward to seeing it, might I suggest a different name though.
> If there is one thing I have seen in my time it is that erlang
> engenders a lot of animosity from adherents to other programming
> philosophies.  It is quite strange, but I have seen it time and time
> again. I would suggest, to avoid being the butt of a bunch of nasty
> catty blog entries by rails enthusiasts that you call the project
> something bearing no relation to any web framework out there.  After
> all, I fully expect yours to be revolutionary and not a clone or
> reaction to anything currently on the scene!
>
> My two cents,
> Martin
>
> On Wed, May 21, 2008 at 1:54 PM, Torbjorn Tornkvist
>

Torbjorn Tornkvist

unread,
May 22, 2008, 5:15:19 AM5/22/08
to erlware-dev

Nice, I suggest you try to get the visitor example to work first.

1. Put the spec. from the docs into a file, e.g: visitor.derail
2. From an erlang shell, run: derail:gen("...path/visitor.derail",
"/tmp/visitor").
3. cd /tmp/visitor;sinan build;sinan release

Now the easiest way forward would be to install it as a release.
I use my little mk_release script to produce a proper directory
(attached).

4. cd /tmp/visitor; ..../mk_release (will create a visitor-0.1.0
dir)

Then install it as:

5. faxien install-release visitor-0.1.0

Then initiate the DB:

6. /usr/local/erlware/bin/visitor -visitor init_db "'true'"

Finally, start the thing:

7. /usr/local/erlware/bin/visitor

Point your prowser to: http://localhost:9899/

DB and logs ends up under the 'root_dir' which per
default is /tmp/visitor. See the visitor.app file.
This can be overridden on the command line as:

-visitor root_dir "/tmp/visitor_other_dir"

Cheers, Tobbe
(Ps. Lots of work remains to be done, I have ideas on
adding easy-to-use session state handling, authentication,
query support via the dsl_engine, etc....)

Anders Nygren

unread,
May 22, 2008, 8:10:50 AM5/22/08
to erlwa...@googlegroups.com
On Thu, May 22, 2008 at 4:15 AM, Torbjorn Tornkvist
<torbjorn....@gmail.com> wrote:
>
>
> Nice, I suggest you try to get the visitor example to work first.
>
> 1. Put the spec. from the docs into a file, e.g: visitor.derail
> 2. From an erlang shell, run: derail:gen("...path/visitor.derail",
> "/tmp/visitor").
> 3. cd /tmp/visitor;sinan build;sinan release

Build fails with

[build] /tmp/derailed/tmp/derailed/lib/visitor/src/visitor_control.erl:167:error:head
mismatch
/tmp/derailed/tmp/derailed/lib/visitor/src/visitor_control.erl:143:error:function
to_visitor/2 undefined

Last clause of to_visitor ends with ; instead of .

>
> Now the easiest way forward would be to install it as a release.
> I use my little mk_release script to produce a proper directory
> (attached).
>

Actually mk_release was not attached

> 4. cd /tmp/visitor; ..../mk_release (will create a visitor-0.1.0
> dir)
>
> Then install it as:
>
> 5. faxien install-release visitor-0.1.0
>
> Then initiate the DB:
>
> 6. /usr/local/erlware/bin/visitor -visitor init_db "'true'"

bin/visitor is not included in the release

adding

dist : {
include_dirs : ["bin"]
}

in _build.cfg
repeate steps 4-5

retry step 6
no visible result

>
> Finally, start the thing:
>
> 7. /usr/local/erlware/bin/visitor
>

generates erl_crash.dump

I think the sys.config is missing, at least I can not find it.

giving up

/Anders

Torbjorn Tornkvist

unread,
May 22, 2008, 8:55:16 AM5/22/08
to erlware-dev
Ok, I have fixed some bugs and published 0.1.1:
Instruction:

mkdir /home/tobbe/xxx
erl
derail:gen("/home/tobbe/git/visitor/visitor.derail", "/home/tobbe/
xxx").
%exit erl
cd /home/tobbe/xxx
sinan build; sinan release
%run the mk_release script (included below)
sudo /usr/local/erlware/bin/faxien install-release visitor-0.1.0
mkdir /home/tobbe/xxx_dir
/usr/local/erlware/bin/visitor -visitor root_dir \"/home/tobbe/xxx_dir
\" -visitor init_db "'true'"
ls /home/tobbe/xxx_dir/db % should see files here!
/usr/local/erlware/bin/visitor -visitor root_dir \"/home/tobbe/xxx_dir
\" -visitor init_db "'false'"

Point browser to localhost:9899

--Tobbe
(Ps. mk_release script follows:

#!/bin/sh
#
# Prepare an Erlware release directory
#

NAME=`grep name _build.cfg | awk -F: '{print $2}' | sed -e 's/"//g' -e
's/ //g'`
VSN=`grep vsn _build.cfg | awk -F: '{print $2}' | sed -e 's/"//g' -e
's/ //g'`
REL="${NAME}-${VSN}"

mkdir ${REL}
cp -Pr bin ${REL}
cp -Pr cmds ${REL}
cp -Pr _build/development/releases ${REL}
mkdir ${REL}/lib
cp -Pr _build/development/apps/${REL} ${REL}/lib

CMD=`which faxien`

echo
echo "Now run: sudo ${CMD} install-release ${REL}"
echo
echo "To publish: sudo ${CMD} publish ${REL}/lib/${REL}"
echo " sudo ${CMD} publish ${REL}"
echo






On May 22, 2:10 pm, "Anders Nygren" <anders.nyg...@gmail.com> wrote:
> On Thu, May 22, 2008 at 4:15 AM, Torbjorn Tornkvist
>

Scott Parish

unread,
May 22, 2008, 9:31:48 AM5/22/08
to erlwa...@googlegroups.com
I loved the name, but i can see where it might not be great
politically. <g>

sRp

Martin Logan

unread,
May 22, 2008, 10:41:54 AM5/22/08
to erlwa...@googlegroups.com
Sure, I can come up with some names. Can you give me some idea as to
the "personality" of the project? What are the design principles it
rests on? I will use that to help me come up with a name.

Torbjorn Tornkvist

unread,
May 22, 2008, 5:34:49 PM5/22/08
to erlware-dev
Hm...tough questions.
I guess the whole idea is to:

1. Based on an initial DB table design. Quickly produce
a web- and DB-interface to be able to manipulate those tables.

2. Make it easy to hook into the generated code base to
extend and replace the functionality as needed.

The generated code assumes the use of Mnesia and preferably
(but not necessarily) jQuery. The code is organized in a MVC fashion,
and with Sgte as the template engine of choice. The code is structured
according to the OTP principles and is tailored for the Erlware
framework.

Not sure if that was a good answer... :-)

--Tobbe

On May 22, 4:41 pm, "Martin Logan" <martinjlo...@gmail.com> wrote:
> Sure, I can come up with some names. Can you give me some idea as to
> the "personality" of the project? What are the design principles it
> rests on? I will use that to help me come up with a name.
>
> On Thu, May 22, 2008 at 4:14 AM, Torbjorn Tornkvist
>

Martin Logan

unread,
May 22, 2008, 5:55:34 PM5/22/08
to erlwa...@googlegroups.com
That is good, I will iterate on this

Martin Logan

unread,
May 22, 2008, 6:23:19 PM5/22/08
to erlwa...@googlegroups.com
Ok, this just popped into my head

Mannequin because it is "model" driven.

Roberto Saccon

unread,
May 23, 2008, 2:35:07 PM5/23/08
to erlware-dev
about the name, there is already a different project with nearly
identical name:

http://code.google.com/p/d-rails/

where the 'd' is for dojo replacing prototype

(and I don't have a better name suggestion, only an even worse one:
erails)

regards
Roberto


On May 22, 7:23 pm, "Martin Logan" <martinjlo...@gmail.com> wrote:
> Ok, this just popped into my head
>
> Mannequin because it is "model" driven.
>
> On Thu, May 22, 2008 at 4:34 PM, Torbjorn Tornkvist
>

Torbjorn Tornkvist

unread,
May 24, 2008, 12:48:41 AM5/24/08
to erlware-dev

Thanx, I'll consider it. I don't like long names though
so perhaps you can come up with a shorter alternative?

Cheers, Tobbe

On May 23, 12:23 am, "Martin Logan" <martinjlo...@gmail.com> wrote:
> Ok, this just popped into my head
>
> Mannequin because it is "model" driven.
>
> On Thu, May 22, 2008 at 4:34 PM, Torbjorn Tornkvist
>

Martin Logan

unread,
May 24, 2008, 1:20:19 AM5/24/08
to erlwa...@googlegroups.com
How about "Dart" after Joseph Dart the inventor of the grain elevator.
Grain elevators are all about taking raw grain (data) storing it, and
efficiently presenting to the mechanisms that will render it useable
for a consumer. It is kind of like a grain mvc framework ;-)

from wiki pedia:

Grain elevators are buildings or complexes of buildings for storage
and shipment of grain. They were invented in 1842 in Buffalo, New York
by Joseph Dart, who first developed a steam-powered mechanism, called
a marine leg, for scooping grain out of the hulls of ships directly
into storage silos. Older grain elevators and bins often were
constructed of framed or cribbed wood and were prone to fire. Grain
elevator bins, tanks and silos are now usually constructed of steel or
reinforced concrete. Bucket elevators are used to lift grain to a
distributor or consignor where it flows by gravity through spouts or
conveyors and into one of a number of bins, silos or tanks in a
facility. When desired, the elevator's silos, bins and tanks are then
emptied by gravity flow, sweep augers and conveyors. As grain is
emptied from the elevator's bins, tanks and silos it is conveyed,
blended and weighted into trucks, railroad cars, or barges and shipped
to end users of grains (mills, ethanol plants, etc.)

Torbjorn Tornkvist

unread,
May 24, 2008, 1:49:30 AM5/24/08
to erlware-dev
Excellent!
I will rename derail and publish it with the new name: dart

Thanx a lot!
--Tobbe


On May 24, 7:20 am, "Martin Logan" <martinjlo...@gmail.com> wrote:
> How about "Dart" after Joseph Dart the inventor of the grain elevator.
>  Grain elevators are all about taking raw grain (data) storing it, and
> efficiently presenting to the mechanisms that will render it useable
> for a consumer.  It is kind of like a grain mvc framework ;-)
>
> from wiki pedia:
>
> Grain elevators are buildings or complexes of buildings for storage
> and shipment of grain. They were invented in 1842 in Buffalo, New York
> by Joseph Dart, who first developed a steam-powered mechanism, called
> a marine leg, for scooping grain out of the hulls of ships directly
> into storage silos. Older grain elevators and bins often were
> constructed of framed or cribbed wood and were prone to fire. Grain
> elevator bins, tanks and silos are now usually constructed of steel or
> reinforced concrete. Bucket elevators are used to lift grain to a
> distributor or consignor where it flows by gravity through spouts or
> conveyors and into one of a number of bins, silos or tanks in a
> facility. When desired, the elevator's silos, bins and tanks are then
> emptied by gravity flow, sweep augers and conveyors. As grain is
> emptied from the elevator's bins, tanks and silos it is conveyed,
> blended and weighted into trucks, railroad cars, or barges and shipped
> to end users of grains (mills, ethanol plants, etc.)
>
> On Fri, May 23, 2008 at 11:48 PM, Torbjorn Tornkvist
>

walrus

unread,
May 24, 2008, 9:32:53 AM5/24/08
to erlware-dev
Sounds like Darth Vader from startwars

On 24 май, 07:49, Torbjorn Tornkvist <torbjorn.tornkv...@gmail.com>
wrote:

Martin Logan

unread,
May 24, 2008, 10:46:21 AM5/24/08
to erlwa...@googlegroups.com
Glad to be of help :)

Dave Peticolas

unread,
Jun 21, 2008, 12:46:39 PM6/21/08
to erlwa...@googlegroups.com
Hey Tobbe, I'm just now trying to check this out,
finally got some free time. Where can I find the
source for the visitor.derail (now visitor.dart?)
example?

Torbjorn Tornkvist

unread,
Jun 23, 2008, 4:21:36 AM6/23/08
to erlware-dev
Hi,

Here is the content of my visitor.dart file:

{appname, visitor}.
{appdesc, "A visitor registration tool."}. % optional
{vsn, "0.1.0"}. % optional
{cbmod, visitor}. % optional
{tabdef,
{visitor, "Table that store information about visitors.",
[{key, int, [key, auto], "Auto generated key"},
{company, string, [index], "Company name"},
{fname, string, [index], "First name"},
{lname, string, [index], "Last name"},
{arrival, gsec, [auto], "Arrival time"},
{departure, gsec, [optional], "Departure time"},
{ref, string, [{short, "Contact"}], "Contact person or other
reference."}
]}
}.

I'm in the progress of releasing 0.2.0 of dart where I have reworked
the
internals of dart to make use of 'ewgi' . There will also be a nice
bash
script to make it easy to generate the visitor example.

Cheers, Tobbe

Torbjorn Tornkvist

unread,
Jun 27, 2008, 3:42:06 PM6/27/08
to erlware-dev
Hi,

dart 0.2.0 is released and I'm off on vacation...

--Tobbe

On Jun 23, 10:21 am, Torbjorn Tornkvist <torbjorn.tornkv...@gmail.com>
wrote:

Dave Peticolas

unread,
Aug 8, 2008, 10:20:04 PM8/8/08
to erlwa...@googlegroups.com
Hey Tobbe, could you publish dart for 5.6.3?

thanks,
dave

Reply all
Reply to author
Forward
0 new messages