From: Yariv S. <ya...@gm...> - 2006-06-12 04:23:07
|
On 6/11/06, Roberto Saccon <rs...@gm...> wrote: > Hi all > > I just started porting a web app (currently in RubyOnRails for > serverside and dojo at clientside) to yaws. Well, it's my frist day > with Erlang and Yaws and I have some questions. It's always pleasing to see haXe <-> Erlang mailing lists cross pollination :) > > Does there exist for a web page a performance difference (beside of > the first access of that page) if I write it as static html without > any <erl> or if I write it as dynamic page just for the purpose of > using SSI for sharing common blocks (like footer) of that page ? I don't really know. I suggest you go with the most aesthetically pleasing option rather than worry about performance too much. > > I saw that the JSON exaple has its own Javascript framework. I am > using dojo. Anybody can share information, experience or an example > how to integrate dojo and yaws for JSON stuff ? I have a nice name for > that: DojoOnYaws ... I'm just learning myself... I'll probably skip Javascript altogether and go with haXe once I get that haXe remoting code for Yaws done... However, the JSON RPC mechanism described in previous mailing list emails looks very straighforward and you shouldn't have trouble calling Dojo functions when you get the RPC result. > > Is there somewhere an example of how to use the mnesia database with yaws ? To use Mnesia, you can simply call Mnesia functions inside <erl></erl> code blocks. However, it's probably better to refactor all persistence code into a separate .erl file and keep only minimal code inside .yaws files. This makes things easier to test. Don't forget to call mnesia:start() when Yaws starts up. There are no examples of this that I know of. I should let you know that I recently learned that Mnesia is mostly designed for RAM based databases, so if you want disk based storage, go with MySQL (google "Erlang MySQL" and you'll find APIs). > > btw. I am very impressed about how easy it was to set up erlang and > yaws on Linux and erlide on eclipse and get the basic examples > running. But what I did not like is the cryptic syntax of erlang, > which looks as unreadable for humans as PERL, especially after having > used ruby for my previous webapp. Erlang looks very different, but you'll get used to it. It'll probably take 2-3 weeks. Erlang code is often much more concise than code written in other languages. Google "erlang tutorial" and it'll give you a head start. Hope this helps. > > regards > -- > Roberto Saccon > > > _______________________________________________ > Erlyaws-list mailing list > Erl...@li... > https://lists.sourceforge.net/lists/listinfo/erlyaws-list > |