Re: iopipe v0.1.0 - now with Windows support!

2018-06-12 Thread DigitalDesigns via Digitalmars-d-announce
On Tuesday, 12 June 2018 at 13:51:56 UTC, Steven Schveighoffer 
wrote:

On 6/12/18 1:51 AM, DigitalDesigns wrote:


Could you explain some benefits specific to this 
implementation and a bit of the functional aspects for a 
proper overview of it's capabilities and why I should chose 
this method over others?


The things that I think make this approach better are:

1. Direct buffer access

Direct buffer access I have found is one of those ideas that 
doesn't seem like it's that impressive until you start using 
it. Many times, buffering is used in a generic library for 
optimization (basically amortizing reads) and is an 
implementation detail hidden from your view. Think of how FILE 
* keeps a large buffer of data inside itself, but only gives 
you access to one character at a time.


This forces you to create your *own* buffering scheme on top of 
that. What a waste! Iopipe allows you to use buffering for your 
purposes on top of the benefits of amortization. It's my belief 
that this is why iopipe's byline feature is 2x faster than 
Phobos'.


2. Using templates to their fullest

Iopipes are all templated on the buffer or iopipe underneath 
it. This makes tings easily swappable. It's really cool to be 
able to take your JSON or XML parser, and hook it onto an 
in-memory string in one line, and then hook it onto a socket, 
and everything is optimized for that situation. It takes the 
fun and flexibility of range programming and brings it to i/o.


This is why iopipe's byline handles all forms of UTF, compared 
to Phobos which only handles UTF8.


For example, I handle all forms of UTF with iopipe, with a 
decent set of utilities. Here is a complete program using 
iopipe that converts any type of UTF into another type, 
optimized for the specific situation:


https://github.com/schveiguy/iopipe/blob/master/examples/convert/convert.d

3. Compiler optimization for everything

All parts of iopipe, except for the low-level reads and writes 
(which ironically are not really part of iopipe) are visible to 
the compiler for inlining and optimization. I'm leveraging the 
power of the decades of optimization experience that the 
compiler can provide. This makes it easy to write code that 
performs well.


An anecdote: For my talk on iopipe in 2017 
(http://dconf.org/2017/talks/schveighoffer.html) I wanted to 
have a live demo showing the performance power. I literally was 
still working on it 2 or 3 days before, while at dconf. I had 
already written a JSON parser, which was part of my 
presentation, but when I was showing it to another D user 
(Daniel Murphy), I couldn't really answer the question "how 
does it perform?". So he gave me a challenge -- do pretty 
printing on a JSON file. Simple enough, with the parser I had 
already written, took me about 1 hour to write it. It performed 
poorly compared to what we would have expected, but tweaking a 
few things (almost all were due to using some algorithms 
incorrectly), I got it to go faster than RapidJson in certain 
use cases, and reasonably close in others. And I did nothing in 
terms of lookup tables or using any special instructions. All 
in all, it was probably 2 hours of work, and the code is 
beautiful IMO! 
https://github.com/schveiguy/jsoniopipe/blob/master/examples/formatjson/formatjson.d


I think anyone who is doing parsing should have a look at 
iopipe, it not only may make your code much simpler and easier 
to read and write, but it would help me tune iopipe to cater to 
parsers, which I think is its wheelhouse.


I plan to eventually finish the JSON parser for a releasable 
state, and eventually tackle XML and a few other things.


-Steve


Thanks!


Re: iopipe v0.1.0 - now with Windows support!

2018-06-11 Thread DigitalDesigns via Digitalmars-d-announce
On Sunday, 10 June 2018 at 20:10:31 UTC, Steven Schveighoffer 
wrote:

iopipe version 0.1.0 has been released.

iopipe is a high-performance pipe processing system that makes 
it easy to string together pipelines to process data with as 
little buffer copying as possible.


Nothing has really been changed, but it now has Windows i/o 
support. I will note at this time, however, that ring buffers 
are not yet supported on Windows.


This version deprecates the IODev type that I had included, in 
favor of a new io library that shows extreme promise.


This version ONLY builds on 2.080.1 or later (the bug fix that 
I submitted at dconf has been merged in that version, and so 
iopipe will now build against Martin Nowak's io library). In 
fact, iopipe development was kind of stalled due to this bug, 
so I'm super-happy to see it fixed and released!


Note that the new io library also supports sockets, which IODev 
did not have support for, AND has a pluggable driver system, so 
you could potentially use fiber-based async io without 
rebuilding. It just makes a lot of sense for D to have a 
standard low-level io library that everything can use without 
having to kludge together multiple types of io libraries.


Near future plans:

1. Utilize a CI to make sure it continues to work on all 
platforms.

2. Add RingBuffer support on Windows
3. Add more driver support for std.io.
4. Continue development of JSON library that depends on iopipe 
(not yet on code.dlang.org).


git - https://github.com/schveiguy/iopipe
dub - https://code.dlang.org/packages/iopipe
docs - http://schveiguy.github.io/iopipe/

-Steve


Could you explain some benefits specific to this implementation 
and a bit of the functional aspects for a proper overview of it's 
capabilities and why I should chose this method over others?


Re: GitHub could be acquired by Microsoft

2018-06-04 Thread DigitalDesigns via Digitalmars-d-announce

On Monday, 4 June 2018 at 19:26:23 UTC, Joakim wrote:

On Monday, 4 June 2018 at 19:06:52 UTC, Maksim Fomin wrote:

[...]


Unlikely, you don't spend $7.5 billion on a company because you 
want to send a message that you're a good dev tools company, 
then neglect it.


I suggest you look at their online slides linked from the 
Nadella blog post to see their stated plan, such as integrating 
github into VS Code more:


http://aka.ms/ms06042018

Of course, this is Microsoft: they probably won't execute that 
plan well, and likely vastly overpaid for an unprofitable 
company in the first place, but they emphasize that they intend 
to keep github open and independent.



Yeah, like they did codeplex!