Open huahaiy opened 3 years ago
Related discussions on https://clojureverse.org/t/clojure-interoperability-with-the-native-world/7277
@huahaiy What you describe fits my situation exactly. I'm seriously wanting to use Datalevin but don't want to have to use Clojure to do it. A C library would be amazing.
Have you seen this work on an EDN parser in C++? https://github.com/edporras/edn_turbo/tree/main/ext/edn_turbo
To be honest, I'd be nearly as happy with JSON output as the Clojure collection types don't really have C corollaries anyway.
We will go JSON route for this. See #182
For other languages to use Datalevin, it is ideal to make Datalevin a C shared library. However, it is inconvenient to use Datalevin if there is no C library that can handle EDN data. It is OK to treat query/transaction input as plain text, but it would be much more convenient if the results could be consumed by C easily. Unfortunately, there's no C library for EDN data. Another option is for Datalevin to output JSON results instead, with inevitable loss of type information.
I think this problem does not just affect Datalevin, but also the whole Clojure ecosystem. The adoption of Clojure is hindered by the lack of interoperability with the native world, which is primarily built on top of C. An EDN C library would hugely alleviate this problem.