You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by "Alan M. Carroll" <am...@apache.org> on 2021/10/13 15:08:55 UTC
[API] Integration of libswoc
Libswoc (https://github.com/solidwallofcode/libswoc), "Solid Wall Of C++" library, is a collection of C++ utility classes. They are based on existing ATS core classes, except for Lexicon. Documentation is available here - http://docs.solidwallofcode.com/libswoc.
The correspondence is
swoc_meta ts_meta
BufferWriter BufferWriter
Errata Errata
IntrusiveDList IntrusiveDList
IntrusiveHashMap IntrusiveHashMap
MemSpan MemSpan
MemArena MemArena
Scalar Scalar
swoc_file ts_file
TextView TextView
IPSpace IPMap
Lexicon *
A major issue is these have undergone roughly 2 years of intensive development and therefore can be significantly different from the ATS versions. In particular, IPSpace is a far more general IP address based container than IPMap. TextView, Errata, and BufferWriter are much improved and no longer source compatible (TextView especially as I took the opportunity to organize and structure the method names). Libswoc is also used by a couple of Yahoo! internal projects and may need to be maintained as a distinct library for that reason.
My recommendation is to treat libswoc the same way as libyaml-cpp. Drop it in to the source tree, update the version as needed. Libswoc development has wound down - the goal was to provide an updated version of some basic ATS utilities and that's done. There's a bit more work to do on BufferWriter but that's all internal (no API changes). Over time I would replace use of the existing core classes with the updated version. In some cases, such as MemSpan, this will be trivial. For others, such as TextView, it will be a bit more challenging. I hope to use Lexicon in a number of places - it is a bidirectional container of integral values to string views, designed to support translating between enumerations and names. This will help clean up some of the ugliness in the configuration parsing. I would also note the quality of the documentation for these core utilities is somewhat better than for the current core classes.
Re: [API] Integration of libswoc
Posted by Leif Hedstrom <zw...@apache.org>.
> On Oct 13, 2021, at 9:08 AM, Alan M. Carroll <am...@apache.org> wrote:
>
> Libswoc (https://github.com/solidwallofcode/libswoc), "Solid Wall Of C++" library, is a collection of C++ utility classes. They are based on existing ATS core classes, except for Lexicon. Documentation is available here - http://docs.solidwallofcode.com/libswoc.
>
>
>
> The correspondence is
>
>
>
> swoc_meta ts_meta
>
> BufferWriter BufferWriter
>
> Errata Errata
>
> IntrusiveDList IntrusiveDList
>
> IntrusiveHashMap IntrusiveHashMap
>
> MemSpan MemSpan
>
> MemArena MemArena
>
> Scalar Scalar
>
> swoc_file ts_file
>
> TextView TextView
>
> IPSpace IPMap
>
> Lexicon *
>
>
>
> A major issue is these have undergone roughly 2 years of intensive development and therefore can be significantly different from the ATS versions. In particular, IPSpace is a far more general IP address based container than IPMap. TextView, Errata, and BufferWriter are much improved and no longer source compatible (TextView especially as I took the opportunity to organize and structure the method names). Libswoc is also used by a couple of Yahoo! internal projects and may need to be maintained as a distinct library for that reason.
>
>
>
> My recommendation is to treat libswoc the same way as libyaml-cpp. Drop it in to the source tree, update the version as needed. Libswoc development has wound down - the goal was to provide an updated version of some basic ATS utilities and that's done. There's a bit more work to do on BufferWriter but that's all internal (no API changes). Over time I would replace use of the existing
I’m ok with all this, except the “update as needed” statement. We will need a much more rigid path:
1. Security and serious crash fixes in libswoc will be addressed with an LTS major release.
2. We *only* update libswoc with new features etc. on every major ATS Version.
Having had to work with autest as an external dependency has been rather painful both on the CI and on keeping the LTS trees updated and stable. So, as long as we can agree to treat libswoc like a stable, untouchable (except above) thing within each LTS version, I’m ok. This is exactly how we deal with other such dependencies as well.
— Leif
> core classes with the updated version. In some cases, such as MemSpan, this will be trivial. For others, such as TextView, it will be a bit more challenging. I hope to use Lexicon in a number of places - it is a bidirectional container of integral values to string views, designed to support translating between enumerations and names. This will help clean up some of the ugliness in the configuration parsing. I would also note the quality of the documentation for these core utilities is somewhat better than for the current core classes.
>
>
>
>
>