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
4.04k stars 199 forks source link

Why not C? - C can be accessed by any language and run on any platform #1078

Closed SamuelMarks closed 12 months ago

SamuelMarks commented 12 months ago

From my understanding, the disadvantages would be requirement of distributing precompiled shared libraries (so the host system could work without build tools; assuming tcc or αpε is not used instead). Other disadvantages would be the lack of namespaces, and types not being as complete as they are in other languages like FORTRAN and ASN.1.

But it would be far more portable to target C than any other language, right?

(yes yes I know some of the languages that can be targeted with Kaitai [Nim] can produce C code;)

So maybe it's more of a future request, extending the Nim target to create:

  1. wrappable C libraries
  2. FFI access code (generated automatically) in dozens of programming languages
  3. release these to their respective app stores (pip install, cargo install, &etc.)

Thoughts?

generalmimon commented 12 months ago

Please join the discussion in https://github.com/kaitai-io/kaitai_struct/issues/263.

generalmimon commented 12 months ago

Duplicate of #263

SamuelMarks commented 12 months ago

Thanks. Missed that. Commented on that issue.