dougbinks,
@dougbinks@mastodon.gamedev.place avatar

I was just looking at zstd project and was surprised at how many files there now are, and how complex building it looks to be.

wolfpld,
@wolfpld@mastodon.gamedev.place avatar

@dougbinks It's not that complex, though. I always just put the lib/ contents into my projects and that's it. You just need to add those files to the source list. No macro definitions, no fancy compilation flags, nothing.

The only semi-complex thing is the x64 assembly file used for decompression, but it just works, I never had any problems with it.

There is also build/single_file_libs to generate a single source file, but I've never used it.

dougbinks,
@dougbinks@mastodon.gamedev.place avatar

@wolfpld That's good to know. The readmes in the main and lib directories did not make that clear, and the sentence "The build system requires a hash function in order to separate object files created with different compilation flags" seemed to indicate a more complex build setup than just adding the files to a project.

wolfpld,
@wolfpld@mastodon.gamedev.place avatar

@dougbinks Ah, I have the same problem in Tracy, where some performance significant code is not needed in some utilities. As a result, one of the source files compiled with a specific flag gives two different API/ABIs.

I simply provide independent build files for each of the utilities that Tracy provides. You can switch between them in the editor and get the right set of compile flags for clangd, etc.

wolfpld,
@wolfpld@mastodon.gamedev.place avatar

@dougbinks Hashing object files seems like a solution where you just have one build file for everything and do no separation.

I don't know, maybe it's some kind of cargo cult that you need to build everything in your project from one place? I wanted to fix this in the Meson VS Code extension, and it was a constant "yeah, but why?", "nobody does that", and so on.

dougbinks,
@dougbinks@mastodon.gamedev.place avatar

@wolfpld Something I have noted is that open source code from certain big orgs tends to be very difficult to use outside those orgs since their build tools and processes have leaked into the library design.

wolfpld,
@wolfpld@mastodon.gamedev.place avatar

@dougbinks I believe the current layout of zstd is Yann's original design, before Facebook got involved.

pervognsen,
@pervognsen@mastodon.social avatar

@wolfpld @dougbinks Yeah, I haven't noticed a change. But Doug is definitely right about the Buck/Bazel virus infesting everything.

dougbinks,
@dougbinks@mastodon.gamedev.place avatar

@pervognsen @wolfpld Although the structure is similar, there are more files in the newer code along with more complex build instructions. I'm not sure if the change was due to fb though.

For example see:

https://github.com/facebook/zstd/tree/v1.3.2/lib/decompress

vs

https://github.com/facebook/zstd/tree/dev/lib/decompress

schelling,
@schelling@mastodon.gamedev.place avatar

@dougbinks I recently ported fzstd.ts to C and was surprised how simple it can be (way under 1k LOC).
But sadly all the complexity of real zstd seems what makes it fast. So far my optimizations couldn't get near its speed with just platform independent C code. I can't even beat miniz based deflate so far 😅

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • thenastyranch
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • ethstaker
  • Youngstown
  • mdbf
  • slotface
  • everett
  • rosin
  • ngwrru68w68
  • kavyap
  • khanakhh
  • cubers
  • provamag3
  • tacticalgear
  • osvaldo12
  • GTA5RPClips
  • cisconetworking
  • modclub
  • Durango
  • Leos
  • normalnudes
  • megavids
  • tester
  • anitta
  • JUstTest
  • lostlight
  • All magazines