sccn / liblsl

C++ lsl library for multi-modal time-synched data transmission over the local network
Other
107 stars 63 forks source link

Investigate replacing boost::asio with regular asio #143

Closed cboulay closed 2 years ago

cboulay commented 2 years ago

asio is the boost::asio upstream. http://think-async.com/Asio/AsioAndBoostAsio.html

It should be pretty easy to replace boost::asio this way. I don't think we'll get any advantages beyond further removing dependencies on boost, but I think that's a long term goal anyway.

dmedine commented 2 years ago

This came onto my radar just today, actually. My devil's advocate question is why bother? It is simply getting rid of one header-only dependency in favor of another. If it ain't broke don't fix it, right?

tstenner commented 2 years ago

I already started adding type aliases for asio so the code can be switched to plain asio without too many changes in the source code. You're both right that it won't matter (after all, Boost.Asio already uses only C++11 constructs and the error class from Boost.System), but bcp (the tool used to construct a boost subset) also pulls in 1545 boost headers that are mentioned but never included. Not a big deal (Boost.Archive is way worse), but once the remaining Boost usages have been replaced it's something that should be tackled.

cboulay commented 2 years ago

@dmedine - mostly just a maintenance thing. It's much easier to copy-paste a folder than it is to do whatever unholy incantation it is that @tstenner does to update boost. Also asio is usually a few versions ahead of boost::asio, in case there are any features that we need.

I don't think we need to rush to make this change, but next time we need to touch something in boost, whether that's to fix a name conflict, or change a compiler flag or whatever, we should take that opportunity to drop-in-replace asio because it will almost certainly be easier than fixing boost::asio.

tstenner commented 2 years ago

do whatever unholy incantation it is that @tstenner does to update boost.

cd /tmp;
wget https://boostorg.jfrog.io/native/main/release/1.77.0/source/boost_1_77_0.tar.bz2
tar -xf boost_1_77_0.tar.bz2
cd ~/lsl/LSL/liblsl
vim update_lslboost.sh # replace the path
./update_lslboost.sh
git add lslboost; git commit -m'update Boost'

So far I didn't need the exorcist, but I keep him close. Just in case.

Also asio is usually a few versions ahead of boost::asio, in case there are any features that we need.

Boost 1.76 has Asio 1.18.2, Boost 1.77 has Asio 1.19.2(?). New Asio releases are a bit faster, but not that much and usually don't include that many features we actually use (I think the last was an optimization for send operations on Linux).

cboulay commented 2 years ago

And there's also maintaining update_lslboost.sh. Maybe to you it's not that much, but it is for me, and IMO for an open source community-driven project we should get rid of as much maintenance burden as possible.