Re: [Vala] Need some feedback for Valum, a web micro-framework!



Le lundi 29 juin 2015 à 22:37 +0000, Al Thomas a écrit :
From: Guillaume Poirier-Morency <guillaumepoiriermorency gmail com>
Sent: Saturday, 27 June 2015, 16:35
Subject: Re: [Vala] Need some feedback for Valum, a web micro
-framework!

Modules is just a pattern to simplify and decouple an application 
in
reusable pieces, so I have never thought about hot plugging them.

There is GModule or probably better, libpeas. The idea of being able
to create loadable modules, for example for authorization, menus, 
pagination, etc., seems useful to me. 


The only idea of making loadable applications looks promising,
especially as they could be embedded directly into a VSGI
implementation rather than being compiled alongside. It might just
allow us to implement live reloading.

I do not think that Valum will ever support plugins if we try to keep
it like a micro-framework. 

-framework/valum/blob/master/examples/app/main.gs ).
The Genie example is broken...

Ah yes, Genie support for anonymous functions is very limited at the 
moment.
If you are feeling adventurous download this patch
https://bug746704.bugzilla
-attachments.gnome.org/attachment.cgi?id=306096
for valac and change

var handler = def (req, res)
  res.append(lua.eval("print 'hi from lua string'"))

to

handler:VSGI.ApplicationCallback = def (req, res)
  res.append(lua.eval("print 'hi from lua string'"))

More practically:
[indent=2]
namespace ValumGenie.TestApp
  init
    var app = new Valum.Router()
    app.get("/", handler)
       var server = new Valum.FastCGI.Server( app.handle )
    server.run( args )


  def handler (req:VSGI.FastCGI.Request, ref 
res:VSGI.FastCGI.Response)

    var lua = new Valum.Script.Lua()
    res.append(lua.eval("print 'hi from lua string'"))


should get a little closer to working (untested)

I will make an example specifically for Genie. The language looks
pretty nice to describe simple web apps and I think that it's a good
thing to push it forward. I'll gently pick some of your changes as I am
not too familiar with the language.

Also, I think that waf plugin for Vala does not support Genie. 
I'll look into this.

There's also Python bindings that can be generated effortlessly with
typelib. It would be great to combine Valum stack with some Python
libraries. I'm just stuck because CTPL does not provide GObject
instrospection data and it is required to generate the full bindings.

.

As an aside, if anyone is interested in making constructive comments 
on
support for anonymous functions in Genie, please take a look at
https://bugzilla.gnome.org/show_bug.cgi?id=746704



Finally how flexible is CTPL as the templating engine?>CTPL can 
do certain things like passing variables, looping and
branching, but it lacks some features like filters, maps and
inheritence (or just embedding).

It's not even comparable to Twig or Jinja2, but it works and it can 
do
some of the job.

I plan to write a Mustache implementation, but for now I think that 
the
best thing the framework should focus on is its ability to describe 
web
services. The code will be hosted here: 
https://github.com/valum-framework/mustache-glib


OK, seems like Valum is more web services focussed at the moment.
Mustache seems interesting. Looks as thought some form of inheritance
may be possible

It's okay to focus on services for now and it is a field where Valum
can perform very well. 

I firmly believe that a decent templating engines is all it takes to
make a framework like Valum usable for web application development and
Mustache can be that one.

http://stackoverflow.com/questions/7925931/can-mustache-templates-do
-template-extension
This is useful for the reasons:

https://github.com/mustache/spec/pull/75

Thanks for the JSON examples,

json-glib is really nicely done and GObject serialization is a real
kicker feature. I tried to cover as much as I could.

I am using that and MySQL bindings to implement the TechEmpower
Framework Benchmarks (
https://github.com/valum-framework/FrameworkBenchmarks). I hope I'll
have a stable release by the next round so that we can see how it
compares!



Al
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list

-- 
Guillaume Poirier-Morency <guillaumepoiriermorency gmail com>

Attachment: signature.asc
Description: This is a digitally signed message part



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