Coder Social home page Coder Social logo

valval's People

Contributors

adlesh avatar dariotarantini avatar taojy123 avatar xucs007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

valval's Issues

Does it support async / sync calls ?

Hi,

I'm using ArangoDB and they have a HTTP Rest API to deal with. I'm also currently using Lua / openresty for my code. Lua has a nice feature called coroutine which allow you to write your code as simply as :

-- do anything here
http.simple({ url = url,  method = method, body = body, headers = headers })
-- do anything here

The code will not be a blocking code and the http response will be handled when the service respond.

Can we do that within VLang ?

一些建议

  • 老调重弹:去掉 register()。还没人用 V 和 valval,真没必要在这个阶段考虑向后兼容的问题。
  • route 的部分,是否将 http method 从 url 里剥离出来?现在将 http method 直接写进了 url 里,导致在处理的时候还要从字符串里剥离出 http method,多了一个字符串处理的工作。
app.route('POST:/book', function3)  // http://127.0.0.1/book by POST
app.route('DELETE:/book', function4)    // http://127.0.0.1/book by DELETE

也许增加个函数用于接收 http method?例如:

app.routeX('/book', function3, ['POST'])
app.routeX('/book', function4, ['DELETE'])
app.route_get('/book', function3)
app.route_delete('/book', function4)
  • App 能否扩展一下,直接传入一个 map,里面可以有参数:
    • static files 目录
    • debug: bool
    • listen address
    • listen port

例如:

struct Cfg {
        debug bool = false
        static_dirs map[string]string
        listen_address string = '127.0.0.1'
        listen_port int = 8012
}

fn main() {
        cfg := Cfg{debug: false, static_dirs: {'/dir1': '/opt/www/dir1'}, listen_address: '0.0.0.0', listen_port: 8012}
	mut app := valval.new_app(cfg)
	app.route('/', hello)
	valval.runserver()
}

lots of errors in newer version

I'm on version 0.1.29 of V and I'm getting lots of errors when trying to use valval.
Is there any progress on upgrading it to support a later version? Otherwise I'll give it a shot and might throw up a PR for it. Just wanna check first so I'm not doing work someone else already started.

Errors building valval example on CentOS 8/vlang V 0.1.30 1ee5764

Environment:
V 0.1.30 1ee5764
CentOS Linux release 8.2.2004 x86_64

V is compiled from sources.
When trying to run Valval example from https://github.com/valvalio/valval/blob/master/example/example.v

Getting plenty of errors. Among them:

~/.vmodules/valval/valval.v:200:2: error: unnecessary `()` in `if` condition, use `if expr {` instead of `if (expr) {`.
~/.vmodules/valval/valval.v:204:2: error: unnecessary `()` in `if` condition, use `if expr {` instead of `if (expr) {`.
~/.vmodules/valval/valval.v:233:22: error: unknown function: net.listen
~/.vmodules/valval/valval.v:234:29: error: unexpected `or` block, the function `accept` does not return an optional
~/.vmodules/valval/valval.v:235:20: error: unexpected `or` block, the function `close` does not return an optional
~/.vmodules/valval/valval.v:240:22: error: invalid argument 1 to `readall`: expected `net.Socket`, not `void`
~/.vmodules/valval/valval.v:243:26: error: unexpected `or` block, the function `write` does not return an optional
~/.vmodules/valval/valval.v:245:26: error: unexpected `or` block, the function `write` does not return an optional


etc

Is this Valval version functional/working? What V version does it support?

Full errors log is attached here:
valval_sample_errors.txt

Can not install valval using `v install`

C:\Users\Administrator>v install valval
Skipping module "valval", since it is missing name or url information.

Please update it if it is convenient for you ,thank you !

[Question] - What proves that it's the fastest?

Hi,
The current description of valval is "The fastest web framework in V language", but what proves that it's the fatest? Did you make any benchmark about it? I mean, there are some other V frameworks as vex, and nothing tell me that valval is fatest.

Maybe create a benchmark about it?

Thanks for your work, Olyno

Few ideas / suggestions

  • register() is used to register a route path, then why not make it clearer with route() directly?
  • How about shorten valval.Request and valval.Response to valval.Req, valval.Res? Shorter, but still clear.
  • Bound with Vue is cool, but will it limit valval to Vue users? How about people who don't use Vue at all? Python Jinja2-like template engine has high demand, it has clear syntax and powerful, easy to use.

Vue v- directives

Templating engine uses by valval has same syntax as vue...
is there a way to override the v- syntax to e.g. x-, coz i u use vue also in the template
that would be capture by valval templating engine instead of vue rendering it...

any benchmark?

Maybe you could do some web framework benchmark within valval and others.

Benchmarks?

The claim "Valval is the fastest web framework in V language." is a bit weird to say if there aren't any benchmarks to show for?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.