www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - hunt library 1.0.0 released!

reply Brian <zoujiaqing gmail.com> writes:
A refined core library for D programming language.

Core modules:

     hunt.concurrency
     hunt.collection
     hunt.event
     hunt.io
     hunt.logging
     hunt.text
     hunt.util

Supported platforms:

     FreeBSD
     Windows
     macOS
     Linux

Example for hunt.io echo server:

```D
void main()
{
     auto loop = new EventLoop();
     auto listener = new TcpListener(loop, AddressFamily.INET, 
512);

     
listener.bind(8080).listen(1024).onConnectionAccepted((TcpListener sender,
TcpStream client) {

         client.onDataReceived((in ubyte[] data) {
             const(ubyte)[] sentData = data;
             client.write(sentData, (in ubyte[] wdata, size_t 
nBytes) {
                 debug writefln("thread: %s, sent bytes: %d", 
getTid(), nBytes);

                 if (sentData.length > nBytes)
                     writefln("remaining bytes: ", sentData.length 
- nBytes);
             });

         });
     }).start();

     writeln("Listening on: ", listener.bindingAddress.toString());
     loop.run();
}
```
sample code link: 
https://github.com/huntlabs/hunt/blob/master/examples/TcpDemo/source/server.d


Example for HashMap:
```D
void main()
{

         HashMap!(string, string) hm = new HashMap!(string, 
string)();

         //add key-value pair to hashmap
         hm.put("first", "FIRST INSERTED");
         hm.put("second", "SECOND INSERTED");
         hm.put("third","THIRD INSERTED");

         writeln(hm);
}
```


About for performance VS rust / golang you can look this pictrue, 
have benchmark result:
https://raw.githubusercontent.com/huntlabs/hunt/master/docs/images/benchmark.png

You can find more information in github repo:

https://github.com/huntlabs/hunt
Jan 15 2019
next sibling parent reply Aldo <aldocd4 outlook.com> writes:
On Tuesday, 15 January 2019 at 14:58:01 UTC, Brian wrote:
 A refined core library for D programming language.

 Core modules:

 [...]
Hello Brian, thats a good lib, thanks for the work.
Jan 15 2019
parent Brian <zoujiaqing gmail.com> writes:
On Tuesday, 15 January 2019 at 16:12:24 UTC, Aldo wrote:
 On Tuesday, 15 January 2019 at 14:58:01 UTC, Brian wrote:
 A refined core library for D programming language.

 Core modules:

 [...]
Hello Brian, thats a good lib, thanks for the work.
Thank you for supported :)
Jan 15 2019
prev sibling next sibling parent reply WebFreak001 <d.forum webfreak.org> writes:
On Tuesday, 15 January 2019 at 14:58:01 UTC, Brian wrote:
 A refined core library for D programming language.

 Core modules:

 [...]
nice! Always cool seeing new frameworks for existing stuff. How does this compare to vibe.d?
Jan 15 2019
next sibling parent Heromyth <bitworld qq.com> writes:
On Tuesday, 15 January 2019 at 16:25:04 UTC, WebFreak001 wrote:
 On Tuesday, 15 January 2019 at 14:58:01 UTC, Brian wrote:
 A refined core library for D programming language.

 Core modules:

 [...]
nice! Always cool seeing new frameworks for existing stuff. How does this compare to vibe.d?
Here are some web frameworks including vibe.d, fasthttp, etc. : https://www.techempower.com/benchmarks/#section=data-r17&hw=ph&test=plaintext It's so regretful that the Hunt has not been listed on it yet. The hunt just a core library for web development. We are activly developping the Hunt-Framework lib (https://github.com/huntlabs/hunt-framework), which is a full-stack web framework, and based on the Hunt.
Jan 15 2019
prev sibling parent reply Brian <zoujiaqing gmail.com> writes:
On Tuesday, 15 January 2019 at 16:25:04 UTC, WebFreak001 wrote:
 On Tuesday, 15 January 2019 at 14:58:01 UTC, Brian wrote:
 A refined core library for D programming language.

 Core modules:

 [...]
nice! Always cool seeing new frameworks for existing stuff. How does this compare to vibe.d?
We need to compare this with other popular programming languages, examples are rust and golang. There is no comparison with vibed, which is popluar in D. In other tests, we found that the performance of vibed was not as good as that of other programming languages.
Jan 15 2019
parent reply bauss <jj_1337 live.dk> writes:
On Wednesday, 16 January 2019 at 06:57:13 UTC, Brian wrote:
 we found that the performance of vibed was not as good as that 
 of other programming languages.
Chances are you've used it wrong then. To me at least it performs better than any alternatives.
Jan 16 2019
parent Brian <zoujiaqing gmail.com> writes:
On Wednesday, 16 January 2019 at 15:04:55 UTC, bauss wrote:
 On Wednesday, 16 January 2019 at 06:57:13 UTC, Brian wrote:
 we found that the performance of vibed was not as good as that 
 of other programming languages.
Chances are you've used it wrong then. To me at least it performs better than any alternatives.
We will not compare with vibed, because vibed cannot meet our use needs.
Jan 16 2019
prev sibling parent reply Johannes Loher <johannes.loher fg4f.de> writes:
On Tuesday, 15 January 2019 at 14:58:01 UTC, Brian wrote:
 [...]
Thanks for the great work! I had already been planning on playing around with hunt for a bit. What has been holding me back until now is the fact that part of the documentation still is only available in Chinese, which I unfortunately am not able to read. Are there any plans on translating the remaining parts of the documentation?
Jan 15 2019
next sibling parent Brian <zoujiaqing gmail.com> writes:
On Tuesday, 15 January 2019 at 18:57:55 UTC, Johannes Loher wrote:
 On Tuesday, 15 January 2019 at 14:58:01 UTC, Brian wrote:
 [...]
Thanks for the great work! I had already been planning on playing around with hunt for a bit. What has been holding me back until now is the fact that part of the documentation still is only available in Chinese, which I unfortunately am not able to read. Are there any plans on translating the remaining parts of the documentation?
We will write the documenation for hunt library :) Please look forward to it!
Jan 15 2019
prev sibling parent Heromyth <bitworld qq.com> writes:
On Tuesday, 15 January 2019 at 18:57:55 UTC, Johannes Loher wrote:
 On Tuesday, 15 January 2019 at 14:58:01 UTC, Brian wrote:
 [...]
Thanks for the great work! I had already been planning on playing around with hunt for a bit. What has been holding me back until now is the fact that part of the documentation still is only available in Chinese, which I unfortunately am not able to read. Are there any plans on translating the remaining parts of the documentation?
We are writting the documents for Hunt in English.
Jan 15 2019