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



From: Guillaume Poirier-Morency <guillaumepoiriermorency gmail com>
Sent: Tuesday, 30 June 2015, 17:22
Subject: Re: [Vala] Need some feedback for Valum, a web micro-framework!

-framework/valum/blob/master/examples/app/main.gs ).
 > The Genie example is broken
 [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.

That would be great. Thanks.

In my example:
    - remove the 'namespace' from the beginning, init can't be in a namespace, my mistake
    - the command line arguments are available in 'args', this is automatically available in 'init'
    - 'uses' is the equivalent of 'using' in Vala, so 'uses VSGI.FastCGI' for example
    - I was unsure how the response got passed back, so used 'ref', same as Vala

Also, I think that waf plugin for Vala does not support Genie. 

I don't know Waf, but see:
https://github.com/waf-project/waf/blob/master/waflib/Tools/vala.py#L203  

This line lists both .vala and .gs extensions. 

Confirmation Waf works for Genie would be good.

All the best,

Al


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