Better HN
topnewbestaskshowjobs
Log inSign up

nathansizemore

104 karma · joined May 10, 2016 (10y ago) · 15 submissions

Software Engineer
Submissions

1.

Show HN: Nkeep(nkeep.app ↗)

3 points · by nathansizemore · 1y ago · discuss

2.

Async Rust Isn't Bad: You Are(n8s.site ↗)

5 points · by nathansizemore · 2y ago · 2 comments

comment 10y ago · link · parent

I'd have to look into it, haven't checked out mio in months, but I don't see any reason why it couldn't be compatible with it. Any particular reason?

comment 10y ago · link · parent

> Why not X?

I wanted to use Rust and learn epoll through working with it directly.

> I was hoping Rust wouldn't head down this road.

To my knowledge, Rust does not have a std async story. I hope it will, and I believe libs like mio will help flush out platform agnostic ideas and a tested API.

> To preempt: a systems language shouldn't dictate these high-level matters

All of your cited example languages are _not_ systems language? Node.js isn't even a language? It could be listed above with the rest of your async I/O options across several languages.

comment 10y ago · link · parent

Yeah, learning a more safe way to program via the borrow checker can take some time to get ingrained. Bad habbits are hard to break ;) I do know that async-hyper is coming out soon (hyper built atop mio). Personally, I enjoy not having support libraries around for everything - it gives me a chance to implement myself and learn a ton along the way.

comment 10y ago · link · parent

Exactly. It is ideal for any type of high performance server that needs to handle many long lived concurrent connections.

comment 10y ago · link · parent

From briefly looking across the README, it looks like Ranch is more for maintaining a pool of connections, where this _also_ handles the marshalling of consumer defined I/O (Non-blocking read/writes) operations, and the workflow associated with non-blocking I/O.

comment 10y ago · link · parent

Bummertown. This is my first open source project I've really broadcast to the world and I should have taken more time to research the name instead of just going for the first one that came into my head. Thanks for pointing that out!

comment 10y ago · link · parent

TBQH, I do not have the slightest clue why I decided to implement that as a growable String type instead of a literal. Definitely warrants a change.

comment 10y ago · link · parent

Thanks for the feedback! This means I need better docs :)

So, the framework itself does not implement any of that, it is on the consumer. It just calls the proper methods on the trait object provided.

https://nathansizemore.github.io/hydrogen/hydrogen/trait.Str...

In the README example, I'm using it combined with another streaming crate I made, which does provide all of the internal buffering and state management for non-blocking I/O.

comment 10y ago · link · parent

Of course!

Well, hyper is a lib for dealing with the HTTP protocol. If being cross platform did not matter, hyper could be build atop of this.

I did not go the route of mio because I wanted to learn the entire process of working with epoll by doing it myself. I've learned a lot, and would not have that knowledge if I just built atop of mio. Mio must also provide a unified abstraction across platforms, where I was free to experiment and change at will during the building process.

comment 10y ago · link · parent

Thanks, but it only uses epoll :)

mio is a crate that offers more platform agnostic async I/O.

comment 10y ago · link · parent

Thanks! Yeah, only a few days into using emacs. I keep forgetting about those files.

comment 10y ago · link · parent

Thanks! Was lucky enough to be able to use Rust for a production application, and hope it can be useful to others in providing the tedious mundane parts of socket server building :)

15.

Show HN: Hydrogen, a multithread non-blocking Linux server framework in Rust(github.com ↗)

154 points · by nathansizemore · 10y ago · 46 comments