Serialize / deserialize (to JSON)

Hi, I wonder if it is possible to serialize / deserialize Mojo objects to / from JSON, either through metaprogramming, or through some Python bindings. Thanks.
5 Replies
Darkmatter
Darkmatter7d ago
Mojo has a plan for metaprogramming, but it's still work in progress. Python has no visibility into Mojo types because no type information makes it to runtime since Mojo is a compiled language. EmberJSON is an option, but that requires you to wire up the "to_json" and "from_json" yourself.
thomas_huegel
thomas_huegelOP7d ago
Thanks for your answer.
Darkmatter
Darkmatter7d ago
right click -> Apps -> Mark Solution in the future.
Darkmatter
Darkmatter7d ago
I can mark it since I'm a mod, most people can't mark other people's questions.
AkaHenry
AkaHenry7d ago
GitHub
GitHub - furnace-dev/sonic-mojo: A high-performance JSON processing...
A high-performance JSON processing library for the Mojo programming language, providing bindings for the Sonic-RS library and leveraging SIMD for fast JSON parsing and manipulation. - furnace-dev/s...

Did you find this page helpful?