kaitai-io / kaitai_struct

Kaitai Struct: declarative language to generate binary data parsers in C++ / C# / Go / Java / JavaScript / Lua / Nim / Perl / PHP / Python / Ruby
https://kaitai.io
4k stars 196 forks source link

Wuffs backend may be needed and code of wuffs std library can be probably reused #943

Open KOLANICH opened 2 years ago

KOLANICH commented 2 years ago

https://github.com/google/wuffs

It is both a memory-safe programming language and the standard library having the stuff we usually have in KS runtimes. The results are transpiled into C.

Should we also reuse their std library and remove as much code as we can from C and C++ runtimes?

@DarkShadow44 @nigeltao

DarkShadow44 commented 2 years ago

Sorry, I don't see the point here. What can we borrow from wuffs? As far as I see it, there's only a bunch or unrelated parsers in there. Only thing could be zlib, but we already use the tried-and-tested zlib.

Also, I don't want to rewrite the compiler/runtime to wuffs-code that needs to be compiled. It would be a new language that I'm unfamiliar with, especially since it doesn't allow dynamic memory allocations.

KOLANICH commented 2 years ago

What can we borrow from wuffs?

at least some compressors we currently jave in kaitai.compress, I guess ? Reading functions like read_u32le turned out to be builtins resulted in compiler-generated code.

Only thing could be zlib, but we already use the tried-and-tested zlib.

Yes, this.

Also, I don't want

Completely OK.