Re: [Vala] mod_vala (was Removal of Mono)



On Tue, 30 Jun 2009, Arto Karppinen wrote:

Michael B. Trausch wrote:
On Tue, 30 Jun 2009, Jeremy wrote:
Maybe mod_mono (for apache) is an example of the sort of dependency I
was thinking of:
http://ibbie.xanga.com/686874553/item/
  That would be my blog post. I do still think a "mod_vala" would be a
*great* idea. Unfortunately, I feel it best to suggest that focusing on
improving the documentation might be a better goal. Both flavors of
syntax are great; but anyone coming in, either knowing another language
or just new to programming, will be discouraged when they can't find the
answers. After all, it's really difficult to RTFM when there's no
(finished) FM.  I mean, imagine if you did "man sbrk",  and at "RETURN
VALUE" it just said "To be completed..." (;

Hrm. A "mod_vala" might be okay, but it would be necessarily non-portable.

Why?

Because such a module by definition would be specific to the Web server in which it runs; presumably in this case we are talking about Apache here.

How about this, sites using mod_vala would save their pages in source code form to somewhere. When page is called, mod_vala runs it trough valac, and places the binary to some cache dir and executes the binary.

Someone could create a setup with a FastCGI server that does something along the same lines, providing a framework for Web development in Vala. There are two ways to do this, really:

 * Have a FastCGI library that a Vala application can use which enables any
   Vala application to be a FastCGI-enabled application server.  The
   application server would then handle requests and issue responses.

 * Have a single-purpose FastCGI server module that manages an application
   with pages, with each page having a Vala source file, managing compilation
   automatically for each page and only compiling each page the first time it
   is hit after a modification.

Either way, using FastCGI, one can use such a system with any Web server that supports FastCGI, which includes (at least) Apache, lighttpd, Cherokee, and others.

See the Wikipedia article on FastCGI for more information:

  http://en.wikipedia.org/wiki/FastCGI

Next time mod_vala simply calls the existing binary.

This would allow PHP like easy editing of pages and provide access to all the nice bits and pieces of code and libraries that PHP cannot access.

The only downside would be that first time a page is called would be rather slow.

I am working on a FastCGI library for Vala at the moment; I have the basic skeleton done and am currently working on the library (which I will be releasing under the LGPL v3.0). If there is interest, I can post a link to the source repository when I've uploaded it and created the base implementation.

It will not provide an entire framework, but it will be enough that one can write software that uses it. If someone were interested in creating a framework that would compile Vala sources into pages (likely with some sort of templating mechanism), that could be built on top of the FastCGI library; all it would require is parsing input files, fully converting them in a .vala source file, and compiling the result. There are an infinite number of ways that this process could be handled. I may even create a basic framework, depending on what my needs are---I am currently already looking at an application that would be done in Vala as a Web application, though the original idea I had would be to not depend on having a Vala compiler present on the server (that is, building the entire thing as a single binary that runs in the form of an application server itself). It shouldn't be terribly difficult to derive something more generic from that at some point, though.

        --- Mike



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]