Why implement `Buffer` and `Memory`?

オープン
#125 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

@vtjnash がすでに取り組んでいます。

2024年2月2日 から。

  • #167 @vtjnash による — オープン

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
リファクタリング
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
julia
領域
backend

調査の方向性

まず TranscodingStream と Buffer、Memory、Error の抽象化を追跡し、次にそれらの責務を Julia の IOBuffer および codec インターフェースと比較します。この issue ではファイルやテストが指定されていません。完了には、合意された設計と、パッケージのバッファリングおよびエラー処理の動作に対する対応する更新が必要です。

索引モデルが issue の本文から書いたものです。

説明

Hey I've just been poking around this package and it seems overly complex. Can someone more familiar with it make sure I haven't just missed Chesterton's fence 😛 Happy to work on this if people agree it makes sense

AFAICT, TranscodingStream manages an input and output Buffer; data is read from the input stream into the input Buffer. This is passed to a codec via Memory (which is just an abstraction over the "used" and "free" parts of a Buffer). The codec writes to the output Buffer, and that's given to the user via an output stream when requested.

  • Remove Memory. I can't figure out why this is useful, aside from just making things slightly easier for downstream codecs that are C-based and need pointers. If that's the case, we could views instead.
  • Remove Buffer. We really don't need our own implementation; I think IOBuffer should work. Fundamentally, we just want to load data from the input stream into some input array, let a codec convert part of that to an output array, and send it to the user via a stream.

Less importantly:

  • Remove Error. Why not just try/catch instead of passing yet another variable around as state?
主要言語
Julia
スター
90
フォーク
26
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JuliaIO/TranscodingStreams.jl のほかの issue

JuliaIO/TranscodingStreams.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。