Language Bindings for Erlang Again

Joe Armstrong (AL/EAB) <>
Wed Jun 7 11:41:50 CEST 2006


Interesting - I heard a talk about RonR and afterwards asked the
speaker why RonR was so popular.

He thought for a bit and said something like:

"it's because the tight integration with a data base. 
The RonR view of a web application is that the web application
is always driven by a data-base, so tight integration with a DB is
essential. Using RonR you get a lot for free - given a data base
schema you can automatically generate a lot of goodies"

Now I have no experience that can verify if this statement was true or
not
but it did sound like a good idea.

So the question is given a database schema, how much could we generate
from the schema alone?

I guess forms for data entry, and data table interrogation + queries
should come for free.

If we add a meta-language for layout and validation, we could generate a

lot for free. Suppose we were to say that
	
-record(foo, {x,y,z}).

generated HTML forms with CSS selectors that were (say)

	<form>
	<div class="foo.x">
		... x entry ...
	</div>
	<div class="foo.y">
		... y entry ...
	</div>
	</form>
	  
And suppose we added meta-data describing who can read/write what data
base
fields with/without authentication, and how the fields are typed then I
think we could get
a lot of mileage from little effort.

Just describing the mnesia tables in some declarative language, and then
being able to
automatically generate a load of forms to manipulate this data would be
a
great start.

/Joe
	

> -----Original Message-----
> From:  
> [mailto:] On Behalf Of Yariv Sadan
> Sent: den 3 juni 2006 00:15
> To: Michel Urvoy
> Cc: 
> Subject: Re: Language Bindings for Erlang Again
> 
> > The other point of view is to open Erlang to other 
> language, because 
> > what is to notice about Erlang? Everybody says that it's a very 
> > attractive language, but as far as I can see, it is very few used.
> > This is the paradox of Erlang.
> > For example, there is now millions of web site, but who 
> knows one site 
> > written in Erlang?
> 
> I know of a site: http://yaws.hyber.org/ :)
> 
> Seriously, though, I have wondered about the same question. 
> If Erlang is so well suited for distributed applications 
> (which are most non-trivial web applications), why is it not 
> more popular? My theory is that the barrier to entry is too 
> high. If you're a PHP programmer, there just isn't an easy 
> way for you to hit the ground running if you want to create a 
> web app in Erlang. You have to invest quite a lot of time 
> into learning Erlang, OTP, Mnesia and Yaws, and all together 
> this is quite intimidating.
> 
> I think Erlang would get much more popular if it had a 
> framework similar to Ruby on Rails. Before Ruby on Rails, 
> relatively few programmers have used Ruby, but the success of 
> Ruby on Rails  has made the Ruby language quite popular. I 
> think the same can happen with Erlang if Erlang had such a framework.
> 
> As a first step towards such a framework, I thought about 
> writing a script that would take a .hrl file, parse its 
> record definitions (representing database objects), and then 
> generate all the code required to set up a simple web app 
> using Mnesia and Yaws. This would help newcomers overcome the 
> initial barrier to entry for Erlang web development.
> 
> That's my 2c :)
> 
> Yariv
> 



More information about the erlang-questions mailing list