Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

cician/grain-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This repo is my attempt at making a JSON library for the Grain programming language. The objective is to merge it into Grain's standard library.

API structure

I think that it makes sense to design the API very explicitly so it could be used as basic blocks for higher level libraries, but not on a too low level either. So more like a sort of DOM representation, not a pull/event parser and not an auto-magic "object binding" kind of library either. Hopefully it could serve as a building block for more sophisticated libraries.

Building

You need to have Grain already installed and on the path. Then just launch grain ./json.test.gr to run tests.

Resources

  • The JSON spec

  • When you think you've done a good job optimizing the code, look at this and think again. Not that I'd go into this crazy level of optimization. Just leaving a note here for inspiration.

Credits

Parsing code loosely based on one written by jozanza and provided on grain's Discord.

Releases

No releases published

Packages

No packages published