Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exorcise fmt from the library packages #364

Open
zenhack opened this issue Dec 4, 2022 · 0 comments
Open

Exorcise fmt from the library packages #364

zenhack opened this issue Dec 4, 2022 · 0 comments

Comments

@zenhack
Copy link
Contributor

zenhack commented Dec 4, 2022

We discussed this a while back on matrix: I'm doing some stuff where I'm compiling Go to webassembly and using capnp to communicate between a browser and a server. I'm using TinyGo to try to keep executable sizes down, but the fmt package in particular pulls in a lot of stuff. There's no good reason why we should need to pull it in as a dependency; I'd like to avoid its use in the library parts of this (tests and code generator are fine) so we can output smaller binaries where it matters.

zenhack added a commit to zenhack/go-capnp that referenced this issue Dec 4, 2022
Per capnproto#364, this is a first step on the road to eliminating usage of fmt
from the library; it removes most direct uses of it from the exc
package. The remaining bits are Failedf and friends. I'd like to just
remove these, but that requires changing every downstream call site, and

I wanted to keep this patch small for today; I can tackle that when I
have a bit more time. I don't think it will be too hard; from a quick
skim WrapError covers 99% of the use cases, and the rest won't be hard
to replace with things from strconv.
zenhack added a commit to zenhack/go-capnp that referenced this issue Dec 4, 2022
Per capnproto#364, this is a first step on the road to eliminating usage of fmt
from the library; it removes most direct uses of it from the exc
package. The remaining bits are Failedf and friends. I'd like to just
remove these, but that requires changing every downstream call site, and
I wanted to keep this patch small for today; I can tackle that when I
have a bit more time. I don't think it will be too hard; from a quick
skim WrapError covers 99% of the use cases, and the rest won't be hard
to replace with things from strconv.
zenhack added a commit to zenhack/go-capnp that referenced this issue Dec 31, 2022
Progress towards capnproto#364.

This gets all of the really "easy" cases in the main and rpc pacakges;
the remainder will require building a couple less trivial helpers.
zenhack added a commit to zenhack/go-capnp that referenced this issue Feb 19, 2023
This adds a String() method to ClientHook so we can avoid using fmt for
that, then removes the last use of fmt in the main package, per capnproto#364.

Before closing that issue, I think I'd still like to get it out of the
flowcontrol package hierarchy at least, and maybe elsewhere if
practical.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant