11052 Commits

Author SHA1 Message Date
Andrew Kelley
1323ad58f0 sync 2025-07-02 11:18:12 -07:00
Andrew Kelley
665737d845 Merge remote-tracking branch 'origin/master' into wrangle-writer-buffering 2025-07-01 19:51:14 -07:00
Andrew Kelley
c9915e949e std: fix some compilation errors 2025-07-01 16:35:30 -07:00
Andrew Kelley
bc9db143c9 std.fs.File.Reader: fix wrong calculation when reading 2025-07-01 16:35:30 -07:00
Andrew Kelley
55d6341eab std.io.Writer: introduce flush
into the vtable

also break `drainTo` and `sendFileTo` into lower level primitives
`writeSplatHeader` and `sendFileHeader` respectively. these are easier
to reason about in drain implementations.
2025-07-01 16:35:30 -07:00
Andrew Kelley
5b5243b5b7 std: fix drain bugs in Writer.Allocating and net.Stream 2025-07-01 16:35:30 -07:00
Andrew Kelley
9f8486170c std.http compiling again 2025-07-01 16:35:30 -07:00
Andrew Kelley
d4545f216a std.io: start removing context from Reader/Writer
rely on the field parent pointer pattern
2025-07-01 16:35:30 -07:00
Andrew Kelley
7d6b5ed510 std.io: Reader and Writer check vtable ptr rather than context 2025-07-01 16:35:30 -07:00
Andrew Kelley
c27ab8b45d std: update zstd to new API 2025-07-01 16:35:30 -07:00
Andrew Kelley
743326f8e9 std.io.Reader.bufferContents -> buffered 2025-07-01 16:35:30 -07:00
Andrew Kelley
9d18e31fee std.fs.AtomicFile: don't forget to flush 2025-07-01 16:35:30 -07:00
Andrew Kelley
25a0648176 std: move copy_file_range, fcopyfile impls and usage 2025-07-01 16:35:30 -07:00
Andrew Kelley
7926081ec3 fix std.fs.File.Reader 2025-07-01 16:35:30 -07:00
Andrew Kelley
837f2bfc69 hello world compiling again 2025-07-01 16:35:30 -07:00
Andrew Kelley
af24e722fb update some stuff to std.io API 2025-07-01 16:35:29 -07:00
Andrew Kelley
52b3275eb2 readable -> reader / writable -> writer 2025-07-01 16:35:29 -07:00
Andrew Kelley
a249cc1c7e update std.io.AllocatingWriter to new API 2025-07-01 16:35:29 -07:00
Andrew Kelley
ef8d7aa251 std: fix a couple compilation errors 2025-07-01 16:35:29 -07:00
Andrew Kelley
f04bc71ed7 std.io.Reader: update readSliceShort to new API
no more readVec
2025-07-01 16:35:29 -07:00
Andrew Kelley
0027cc1b1a std.io.Writer: implement writableVectorIterator 2025-07-01 16:35:29 -07:00
Andrew Kelley
084e45fd86 std.io.Reader: implement readVec
and specify that data.len == 0 means "flush"
2025-07-01 16:35:29 -07:00
Andrew Kelley
b393112674 std: update uses of unbuffered_writer 2025-07-01 16:35:29 -07:00
Andrew Kelley
9d163c7ac3 std.net: update to new IO API 2025-07-01 16:35:29 -07:00
Andrew Kelley
1e2aab2f97 std: combine BufferedWriter into Writer 2025-07-01 16:35:29 -07:00
Andrew Kelley
3c98e2c826 std: combine BufferedReader into Reader 2025-07-01 16:35:29 -07:00
Andrew Kelley
2ed47f1ed8 std: update AtomicFile to new API 2025-07-01 16:35:29 -07:00
Andrew Kelley
ba684a18ca std: upgrade more API to use File.Reader 2025-07-01 16:35:29 -07:00
Andrew Kelley
2f5574ac08 std: finish renaming RwError to StreamError 2025-07-01 16:35:29 -07:00
Andrew Kelley
21df001001 std: remove fifo
bad API
2025-07-01 16:35:29 -07:00
Andrew Kelley
3650cd3e8e std.fs.File: update for new writeFile API 2025-07-01 16:35:29 -07:00
Andrew Kelley
7b417c6caf std: improve the discarding writer
by making the vtable use File.Reader instead of File and Offset
2025-07-01 16:35:29 -07:00
Andrew Kelley
74c56376ee std: update http.WebSocket to new API 2025-07-01 16:35:29 -07:00
Andrew Kelley
da303bdaf1 std: fix a bunch of compilation errors 2025-07-01 16:35:29 -07:00
Andrew Kelley
fd4fb10722 std.compress.flate: API reorg and reader/writer updates
A lot of this logic disappears in the face of the new buffered reader
and buffered writer interface.

This is passing ast-check only; semantic analysis to be solved next.
2025-07-01 16:35:29 -07:00
Andrew Kelley
06b44a0afa update git fetching logic to new reader/writer API
- flatten std.crypto.hash.Sha1 and give it a writable interface that
  optimizes splats
- flatten std.hash.crc and give it a writable interface that optimizes
  splats
- remove old writer impls from std.crypto
- add fs.File.Writer.moveToReader
- add fs.File.Writer.seekTo
- add std.io.Reader.Hashed and std.io.Writer.Hashed which are
  passthrough streams. Instead of passing through to null writer, use
  the writable interface implemented directly on hashers which doesn't
  have to account for passing through the data.
- add std.io.BufferedWriter.writeSplatAll
2025-07-01 16:35:29 -07:00
Andrew Kelley
d603121dc3 std.crypto.Certificate.Bundle.macos: rework
- use ArrayList strategically to reduce allocations
- use a BufferedReader to avoid unnecessary memcpy of the certs
- use for loops
- skip certs with invalid magic instead of asserting
2025-07-01 16:35:29 -07:00
Jacob Young
01b580e75d fix compile errors building the compiler 2025-07-01 16:35:29 -07:00
Andrew Kelley
4607770a57 std.debug.Dwarf.expression: partial rework
- use labeled continue
- avoid anytype
- avoid dependency on a "seeking" API
- simpler, more optimal VM interpreter loop
- progress decoupling from host machine
- type safety for opcodes. see #15556
2025-07-01 16:35:29 -07:00
Andrew Kelley
4512f27784 introduce std.math.addAny
I think this is generally more useful than the existing add function
because it doesn't unnecessarily rely on the types of the operands - the
error only occurs if the final mathematical result cannot be stored in
the desired result type.
2025-07-01 16:35:29 -07:00
Andrew Kelley
803215bb18 delete std.io.MultiWriter
instead this use case is better served with passthrough streams. For
instance, hashing writers should support being passed an underlying
writer, and the buffer can go in front of the hasher for optimal code.
2025-07-01 16:35:29 -07:00
Andrew Kelley
110af768bb remove std.io.BitWriter 2025-07-01 16:35:29 -07:00
Andrew Kelley
e76afef847 std.zip: operate on fs.File.Reader rather than anytype 2025-07-01 16:35:29 -07:00
Andrew Kelley
576702ca40 get autodocs wasm compiling again
it's triggering an error.EndOfStream error in the browser tho
2025-07-01 16:35:29 -07:00
Andrew Kelley
af4bb996f0 std.http.Client: fix redirects 2025-07-01 16:35:29 -07:00
Andrew Kelley
b3df9d4bf9 std.http.Client: sendBody flush by default; fix flushing
flushing must also flush TLS client if it exists
2025-07-01 16:35:28 -07:00
Andrew Kelley
d0b8392852 std.http fixes 2025-07-01 16:35:28 -07:00
Andrew Kelley
af7721d20f std.http.BodyWriter: fix end of transfer-encoding chunked
Looks like chunked transfers are supposed to always end with a length
zero chunk. This bug exists on master branch as well.
2025-07-01 16:35:28 -07:00
Andrew Kelley
42cc1bd76e std.io.BufferedReader: implement readVecLimit 2025-07-01 16:35:28 -07:00
Andrew Kelley
b78e375a2d std.http.Server: flush by default with respond 2025-07-01 16:35:28 -07:00