View mode: basic / threaded / horizontal-split · Log in · Help
April 27, 2012
Re: Introducing vibe.d!
Sönke Ludwig wrote:
> During the last few months, we have been working on a new
> framework for general I/O and especially for building
> extremely fast web apps. It combines asynchronous I/O with
> core.thread's great fibers to build a convenient, blocking
> API which can handle insane amounts of connections due to
> the low memory and computational overhead.
>
> Some of its key fatures are:
> ...

vibe.d looks great! Looking through the docs, it feels clean and 
"hip" like node.js

However, there are a couple refactoring choices I think would 
have made it even more "hip", consider the home page example:

    import vibe.d;

    void handleRequest(HttpServerRequest req,
                       HttpServerResponse res)
    {
        res.writeBody("Hello, World!", "text/plain");
    }

    static this()
    {
        auto settings = new HttpServerSettings;
        settings.port = 8080;

        listenHttp(settings, &handleRequest);
    }

"vibe.d" as the project name is great, but why have module vibe.d 
and not simply vibe? Or, why prefix all the types with 
"HttpServer" when you could separate those objects into a new 
module and drop the prefix. I think those simple changes would 
make an already polished library shine a bit brighter:

    import vibe.http;

    void handleRequest(Request req, Response res) {
        res.writeBody("Hellow, World!", "text/plain");
    }

    static this() {
        auto settings = new Settings;
        settings.port = 8080;

        listen(settings, &handleRequest);
    }

the echo server would look like:

    import vibe.tcp;

    static this()
    {
        listen(7, (conn){ conn.write(conn) });
    }

Also, it's great to see MongoDB support built in :D, but isn't 
there a way to trim down the query object from:

    BSON({"name": BSON("Peter")})

to:

    BSON({"name":"Peter"})

by writing a generic AssosiativeArrayToBSON function? That way 
you could overload MongoDB's find/save/etc functions to accept 
arbitrary AAs as queries, which would end up looking a lot 
slicker in the docs I think. Plus, through CTFE it's possible 
this conversion could happen at both compile-time and run-time:

    auto db = new MongoDB;
    auto col = db["test.collection"];

    foreach (doc; col.ctFind!(["name":"Peter"])) {

        ...
    }

Just some ideas in case you haven't thought of them already :)


Overall vibe.d looks like a fantastic library. Thank you and 
Congrats!
April 27, 2012
Re: Introducing vibe.d!
On Friday, 27 April 2012 at 19:40:53 UTC, F i L wrote:
> "vibe.d" as the project name is great, but why have module 
> vibe.d and not simply vibe? Or, why prefix all the types with

More complicated projects/frameworks ontop of vibe which 
implements it's own main is free to use vibe.all.

But I think...
  import vibe.d;
... makes perfect sense because it contains main()!
April 27, 2012
Re: Introducing vibe.d!
Le 26/04/2012 22:46, Sönke Ludwig a écrit :
> During the last few months, we have been working on a new
> framework for general I/O and especially for building
> extremely fast web apps. It combines asynchronous I/O with
> core.thread's great fibers to build a convenient, blocking
> API which can handle insane amounts of connections due to
> the low memory and computational overhead.
>
> Some of its key fatures are:
>
> - Very fast but no endless callback chains as in node.js
> and similar frameworks
> - Concise API that tries to be as efficient and intuitive
> as possible
> - Built-in HTTP server and client with support for HTTPS,
> chunked and compressed transfers, keep-alive connections,
> Apache-style logging, a reverse-proxy, url routing and
> more
> - Jade based HTML/XML template system with compile-time
> code generation for the fastest dynamic page generation
> times possible
> - Built-in support for MongoDB and Redis databases
> - WebSocket support
> - Natural Json and Bson handling
> - A package manager for seemless use of extension libraries
>
> See http://vibed.org/ for more information and some example
> applications (there are some things in the works such as an
> etherpad clone and an NNTP server).
>
> vibe.d is in a working state and enters its first beta-phase
> now to stabilize the current feature set. After that, a
> small list of additional features is planned before the 1.0
> release.
>
> The framework can be downloaded or GIT cloned from
> http://vibed.org/ and is distributed under the terms of the
> MIT license.
>
> Note that the website including the blog is fully written
> in vibe and provides the first stress test for the
> implementation.
>
> Regards,
> Sönke

It is awesome. I think some part of this could be integrated into phobos 
after some refactoring. I think about databases for instance, or some 
http libraries.
April 27, 2012
Re: Introducing vibe.d!
On 4/27/12 1:42 PM, deadalnix wrote:
> It is awesome. I think some part of this could be integrated into phobos
> after some refactoring. I think about databases for instance, or some
> http libraries.

This is an ignorant question, but why not the async IO stuff?  It seems 
like it could be widely useful.  Or is it only designed for this kind of 
use?
April 27, 2012
Re: Introducing vibe.d!
On Friday, 27 April 2012 at 20:15:05 UTC, Tove wrote:
> On Friday, 27 April 2012 at 19:40:53 UTC, F i L wrote:
>> "vibe.d" as the project name is great, but why have module 
>> vibe.d and not simply vibe? Or, why prefix all the types with
>
> More complicated projects/frameworks ontop of vibe which 
> implements it's own main is free to use vibe.all.
>
> But I think...
>   import vibe.d;
> ... makes perfect sense because it contains main()!

Ah I see, I was thinking the example wasn't the full code. Still, 
I think doing something like:

    import vibe, vibe.html;

where vibe has main() and vibe.html has html is still better 
semantics.
April 27, 2012
Re: Introducing vibe.d!
Le 27/04/2012 22:42, David Gileadi a écrit :
> On 4/27/12 1:42 PM, deadalnix wrote:
>> It is awesome. I think some part of this could be integrated into phobos
>> after some refactoring. I think about databases for instance, or some
>> http libraries.
>
> This is an ignorant question, but why not the async IO stuff? It seems
> like it could be widely useful. Or is it only designed for this kind of
> use?

This is an ignorant answer, because I didn't looked at the source code, 
but I guess most of it is highly dependent on vide itself.
April 28, 2012
Re: Introducing vibe.d!
On 4/27/12 4:46 AM, Sönke Ludwig wrote:
> During the last few months, we have been working on a new
> framework for general I/O and especially for building
> extremely fast web apps. It combines asynchronous I/O with
> core.thread's great fibers to build a convenient, blocking
> API which can handle insane amounts of connections due to
> the low memory and computational overhead.
>
> Some of its key fatures are:

Impressive. The website also looks really nice, and it's very fast.

I'll definitely play with it and slowly try to make it into my 
workplace, hehe.
April 28, 2012
Re: Introducing vibe.d!
On 4/27/12 2:50 PM, Brad Anderson wrote:
> On Thursday, 26 April 2012 at 20:46:41 UTC, Sönke Ludwig wrote:
>> During the last few months, we have been working on a new
>> framework for general I/O and especially for building
>> extremely fast web apps. It combines asynchronous I/O with
>> core.thread's great fibers to build a convenient, blocking
>> API which can handle insane amounts of connections due to
>> the low memory and computational overhead.
>>
>> Some of its key fatures are:
>>
>> - Very fast but no endless callback chains as in node.js
>> and similar frameworks
>> - Concise API that tries to be as efficient and intuitive
>> as possible
>> - Built-in HTTP server and client with support for HTTPS,
>> chunked and compressed transfers, keep-alive connections,
>> Apache-style logging, a reverse-proxy, url routing and
>> more
>> - Jade based HTML/XML template system with compile-time
>> code generation for the fastest dynamic page generation
>> times possible
>> - Built-in support for MongoDB and Redis databases
>> - WebSocket support
>> - Natural Json and Bson handling
>> - A package manager for seemless use of extension libraries
>>
>> See http://vibed.org/ for more information and some example
>> applications (there are some things in the works such as an
>> etherpad clone and an NNTP server).
>>
>> vibe.d is in a working state and enters its first beta-phase
>> now to stabilize the current feature set. After that, a
>> small list of additional features is planned before the 1.0
>> release.
>>
>> The framework can be downloaded or GIT cloned from
>> http://vibed.org/ and is distributed under the terms of the
>> MIT license.
>>
>> Note that the website including the blog is fully written
>> in vibe and provides the first stress test for the
>> implementation.
>>
>> Regards,
>> Sönke
>
> I had to copy the included .lib files into bin in order to build the
> examples but so far, so good. This is awesome.

How did you install it? I can't find the install.sh script anywhere...
April 28, 2012
Re: Introducing vibe.d!
On 4/28/12 8:12 AM, Ary Manzana wrote:
> On 4/27/12 4:46 AM, Sönke Ludwig wrote:
>> During the last few months, we have been working on a new
>> framework for general I/O and especially for building
>> extremely fast web apps. It combines asynchronous I/O with
>> core.thread's great fibers to build a convenient, blocking
>> API which can handle insane amounts of connections due to
>> the low memory and computational overhead.
>>
>> Some of its key fatures are:
>
> Impressive. The website also looks really nice, and it's very fast.
>
> I'll definitely play with it and slowly try to make it into my
> workplace, hehe.

How to use it?

> ./bin/vibe
usage: dirname path
sh: /vpm.d.deps: Permission denied
Failed: 'dmd' '-g' '-w' '-property' '-I/../source' '-L-levent' 
'-L-levent_openssl' '-L-lssl' '-L-lcrypto' '-Jviews' '-Isource' '-v' 
'-o-' '/vpm.d' '-I/'
Error: cannot read file source/app.d
Failed: 'dmd' '-g' '-w' '-property' '-I/../source' '-L-levent' 
'-L-levent_openssl' '-L-lssl' '-L-lcrypto' '-Jviews' '-Isource' '-v' 
'-o-' 'source/app.d' '-Isource'

I also can't find the install.sh script...
April 28, 2012
Re: Introducing vibe.d!
Am 28.04.2012 06:16, schrieb Ary Manzana:
> On 4/28/12 8:12 AM, Ary Manzana wrote:
>> On 4/27/12 4:46 AM, Sönke Ludwig wrote:
>>> During the last few months, we have been working on a new
>>> framework for general I/O and especially for building
>>> extremely fast web apps. It combines asynchronous I/O with
>>> core.thread's great fibers to build a convenient, blocking
>>> API which can handle insane amounts of connections due to
>>> the low memory and computational overhead.
>>>
>>> Some of its key fatures are:
>>
>> Impressive. The website also looks really nice, and it's very fast.
>>
>> I'll definitely play with it and slowly try to make it into my
>> workplace, hehe.
>
> How to use it?
>
>  > ./bin/vibe
> usage: dirname path
> sh: /vpm.d.deps: Permission denied
> Failed: 'dmd' '-g' '-w' '-property' '-I/../source' '-L-levent'
> '-L-levent_openssl' '-L-lssl' '-L-lcrypto' '-Jviews' '-Isource' '-v'
> '-o-' '/vpm.d' '-I/'
> Error: cannot read file source/app.d
> Failed: 'dmd' '-g' '-w' '-property' '-I/../source' '-L-levent'
> '-L-levent_openssl' '-L-lssl' '-L-lcrypto' '-Jviews' '-Isource' '-v'
> '-o-' 'source/app.d' '-Isource'
>
> I also can't find the install.sh script...

Making the installation more automated is planned next, and the 
install.sh was unfortunately documented before it was written. For now I 
would recommend to create a symlink to the vibe script in /usr/bin and 
then create a new project along the lines of the 'first steps' section 
(http://vibed.org/docs#first-steps). In particular, there should be a 
source/app.d file.

It's possible that bin directory also needs to be writable because of 
how rdmd stores its .deps file, which is a bug that will get fixed. 
Sorry for the slightly bumpy start.
2 3 4 5 6 7 8 9 10
Top | Discussion index | About this forum | D home