Re:Zig now has built-in HTTP server and client in std
by laserbeam on Thursday May 18, 2023 @04:17PM
(#35993507)
My understanding is http/2 is out of scope. The purpose is to have functional http to implement the package manager. I would expect a high performance http client/server to be a third party library, not std lib.
[ Parent
| on HN ]
Re:Zig now has built-in HTTP server and client in std
by EscapeFromNY on Thursday May 18, 2023 @04:41PM
(#35993762)
If that's the only purpose, why is there be an http server too? The package manager should only need an http client.
Re:Zig now has built-in HTTP server and client in std
by jsyolo on Thursday May 18, 2023 @05:02PM
(#35994015)
To host packages metadata?
Re:Zig now has built-in HTTP server and client in std
by squeek502 on Thursday May 18, 2023 @06:14PM
(#35994893)
My understanding is that it's there to allow for testing the client. Relevant issue: https://github.com/ziglang/zig/issues/910
Re:Zig now has built-in HTTP server and client in std
by synergy20 on Thursday May 18, 2023 @09:04PM
(#35996495)
is this true? i was excited that zig will provide a http server in its stdlib similar to what go does in fact.
Re:Zig now has built-in HTTP server and client in std
by brundolf on Thursday May 18, 2023 @04:20PM
(#35993543)
Does a package manager not benefit from high-performance parallel HTTP (for downloading a bunch of little files)?
Re:Zig now has built-in HTTP server and client in std
by laserbeam on Thursday May 18, 2023 @04:23PM
(#35993583)
Sure. But I wouldn't do that for 1.0 of the lang. It sounds quite feasible to add support for that in 1.x if the community needs it. There's a reasonable path to upgrade to http/2 while spending more effort into what's critical for the lang to get to 1.0.
[Edit] And it's quite feasible to decide later that http/2 was never needed for this usecase.
Re:Zig now has built-in HTTP server and client in std
by brundolf on Thursday May 18, 2023 @04:24PM
(#35993598)
Sure, but GP was saying "out of scope" in a way that sounded like "forever, for this use-case", not just "for 1.0". I may have misinterpreted
Re:Zig now has built-in HTTP server and client in std
by kcbanner on Thursday May 18, 2023 @04:23PM
(#35993581)
The package manager is designed to download archives (.tar.gz) of packages, not the composite files.
Re:Zig now has built-in HTTP server and client in std
by aseipp on Thursday May 18, 2023 @05:32PM
(#35994362)
Most source code packages, including their metadata, are generally small even as an aggregated compressed file, and it's very common to download a lot of them all at one time once you've resolved the necessary dependencies. It depends on several factors though -- including community ones (are lots of tiny packages encouraged?) and how things like the build system work when downloading things.
In practice, it's very much an appropriate use case for multiplexing, if you ask me. But not having it isn't a dealbreaker either, IMO. It's a bit more work to support HTTP/2 and can be done rather transparently later on anyway, since the underlying transport can be switched and has an upgrade path.
Re:Zig now has built-in HTTP server and client in std
by von_lohengramm on Thursday May 18, 2023 @06:21PM
(#35994991)
> are lots of tiny packages encouraged?
Very much the opposite