r/cpp • • Mar 23 '26

a vcpkg browser written in c++

this vcpkg browser itched a scratch - it is running on a box next to my desktop at home so don't share it too widely ;-)

the interface is a bit dodgy but it fulfills my basic curiosity. i was mainly interested in looking at new packages (last month check box), sorting by last update, getting readme summaries (done with an llm offline), looking at repo versions vs vcpkg versions. written in c++ and imgui fwiw.

the similar packages info is a bit dodgy. you're better off using the search. it's a desktop app layout. it won't work on your phone unless your phone is a bit unusual.

https://vcpkg.tunapri.com/

43 Upvotes

13 comments sorted by

6

u/eidetic0 Mar 23 '26 edited Mar 23 '26

nice one! this is very snappy

did you have to do much to ensure it works in the web browser? how about any lib other than imgui to create the main window?

4

u/_malfeasance_ Mar 23 '26

it is a pretty simple app that took about a day to build, but about a week to get the pesky readme tabs with images to be a bit crap rather than utter crap. I only have linux systems, so it wasn't really tested widely. a few friends said it worked for them and they are not all linux. the layout doesn't work on a phone size screen but it does, nevertheless, work quite badly in an unusable way on my android phone. someone here reported it doesn't work on iOS.

the images required an alternate image server (python) in the background so that the multitude of sites that, reasonably, prevent robots grabbing images worked a little better. the readme tab is functional but not great. the app uses a 2 thread thread pool to keep things off the main render thread, so it only works in modern browsers. By modern, it should be most since about 2021 when pthread was more globally supported in wasm mainstream I believe.

cmake and clang++21 cross compiled with emscripten. libraries used:

LibrarySourceLinked into WASM buildPurpose
Dear ImGuiFetchContent from ocornut/imguiYesCore immediate-mode UI framework
ImGui Test EngineFetchContent from ocornut/imgui_test_engineYesTest hooks and automation support
ImPlotFetchContent from epezent/implotYes2D plotting/charts
ImPlot3DFetchContent from brenocq/implot3dYes3D plotting
PCRE2 8-bitFetchContent from PCRE2Project/pcre2YesRuntime regex engine for search
fmtvcpkg / CMake packageYesFormatting utilities
Boost headersvcpkg / CMake packageYesGeneral Boost utilities
Boost.JSONvcpkg / CMake packageYesJSON parsing/serialization
GLFW (Emscripten port)Emscripten builtin via -sUSE_GLFW=3YesWindow/input shim for ImGui backend
Emscripten OpenGL ES 3 / WebGL 2 supportEmscripten builtin via -sFULL_ES3=1YesGraphics backend support

i'm not a webby guy, so the foreign bit for me was the small bit of js required to serve up the app. the c++ in the native app and wasm app are unchanged though a small design tweak for sharded std::vector stuff had to happen which is the same for both the native and wasm app.

the data is somewhat sharded in the c++ build (mainly just std::array and std::vector stuff) to speed up launch. some of that is codegen'd from a python scrape of a local git repo of vcpkg.

the data is a bit over 40MB, but compresses well as it is mainly cached readmes.

ComponentRaw bytesRaw MiB.gz bytes.gz MiB.br bytes.br MiB
vcpkg_browser_wasm.html8,4310.01n/an/an/an/a
vcpkg_browser_wasm.js204,4500.1951,2480.0549,0050.05
vcpkg_browser_wasm.wasm4,244,2824.052,084,3441.991,886,3081.80
sw.js3,1430.001,1730.001,0490.00
sidecars/packages.bin1,726,2281.65777,9430.74703,6150.67
sidecars/tfidf_index.bin312,2960.30188,2700.18170,7950.16
sidecars/bm25_index.bin409,5820.39118,5230.11109,0290.10
sidecars/versions.bin2,369,5672.261,197,3561.141,093,1961.04
sidecars/readmes.bin38,212,00036.4410,302,5439.837,998,7497.63
Total47,489,97945.2914,721,40014.0412,011,74611.46

8

u/ZealousidealPlate190 Mar 23 '26

Sadly doesn’t work on iOS:(

0

u/[deleted] Mar 23 '26

[deleted] — view deleted comment

3

u/eidetic0 Mar 23 '26

working for me on Firefox 148 Linux

-1

u/_malfeasance_ Mar 23 '26

Firefox 148.0.2 linux also here works and google chrome.

3

u/elcapitaine Mar 23 '26

Doesn't work in Firefox Android.

2

u/BillTran163 Mar 23 '26

Yeah, it's dead on Android.

2

u/c-cul Mar 23 '26

is it possible to add regex in search?

for example I want to find package for graphs processing

and got openssl, botan etc - bcs they contain "cryptographic" in their descriptions

3

u/_malfeasance_ Mar 23 '26 edited Mar 23 '26

i'll have a look. FTR, the top search box uses a custom BM25 (https://en.wikipedia.org/wiki/Okapi_BM25).

Edit: ok - done. there is regex support for name+desc and name search. you may need to do a ctrl+shft+R to refresh the wasm foo. see the help dialog for an example regex or two. that was a good idea, thanks.

3

u/GPSProlapse Mar 23 '26

It's kinda dead on phone, tries to resize every frame or so to a different with basically blinking at me

2

u/GPSProlapse Mar 23 '26

Works ok when I open the main screen tho, looks like you have some issues with narrow portrait resolutions

1

u/_malfeasance_ Mar 23 '26

Yeah. It's a desktop app. Sorry about that

2

u/GPSProlapse Mar 23 '26

No problem