A fast EDN (Extensible Data Notation) reader written in C11 with SIMD boost
11–20 of 43 posts
Re: A fast EDN (Extensible Data Notation) reader written in C11 with SIMD boost
#12Very nice. Is there a plan to have an EDN writer in C as well?
Re: A fast EDN (Extensible Data Notation) reader written in C11 with SIMD boost
#13Can the metadata feature be used to ergonomically emulate HTML attributes? It's not clear from the docs, and the spec doesn't seem to document the feature at all.
tl;dr first element of the vector is a tag, second is a map of attributes test are children nodes:
[:h1 {:font-size "2em" :font-weight bold} "General Kenobi, you are a bold one"]
Re: A fast EDN (Extensible Data Notation) reader written in C11 with SIMD boost
#14This is a `map`, which bears semblence with a Json object. The following might look like an incorrect paylood, but will actually parse as valid EDN:
{:a 1, "foo" :bar, [1 2 3] four}
// Note that keys and values can be elements of any type.
// The use of commas above is optional, as they are parsed as whitespace.
If one wants to exchange complex data structures, Aterm is also an option: https://homepages.cwi.nl/~daybuild/daily-books/technology/at...Some projects in Haskell use Aterms, as it is suitable for exchanging Sum and Product types.
Re: A fast EDN (Extensible Data Notation) reader written in C11 with SIMD boost
#15This is superb. Thank you for making it and licensing it MIT. I think this is a contender to replace the lexer within jank. I'll do some benchmarking next year and we'll see!
you can run it locally with `make bench bench-clj bench-wasm`
Let me know if I can do anything to help you with support in jank.
Re: A fast EDN (Extensible Data Notation) reader written in C11 with SIMD boost
#16Interesting, I had to look up what EDN is. Important to note that EDN doesn't have a concept of a schema like JSON Schema. This is a `map`, which bears semblence with a Json object. The following might look like an incorrect paylood, but will actually parse as valid EDN: {:a 1, "foo" :bar, [1 2 3] four} // Note that keys and values can be elements of any type. // The use of commas above is optional, as they are parse…
Re: A fast EDN (Extensible Data Notation) reader written in C11 with SIMD boost
#17I think it would be better to not use Unicode (so that you can use any character set), and to use "0o" instead of "0" prefix for octal numbers. Also, EDN seems to lack a proper format for binary data. I think ASN.1 (and ASN.1X which is I added a few additional types such as key/value list and TRON string) is better. (I also made up a text-based ASN.1 format called TER which is intended to be converted to the binary D…
The best part of EDN that it is extendable :)
#binary/base64 "SGVsbG8sIHp6bzM4Y29tcHV0ZXIhIEhvdyBhcmUgeW91IGRvaW5nPw=="
This is a tagged literal that can be read by provided (if provided) custom reader during reading of the document. The result could be any type you want.
Re: A fast EDN (Extensible Data Notation) reader written in C11 with SIMD boost
#18Re: A fast EDN (Extensible Data Notation) reader written in C11 with SIMD boost
#19[dead]
Yes, EDN is a textual format intended to be human-readable. There is also a format called Transit used to serialise EDN elements. Unlike raw EDN, Transit is designed purely for program-to-program communication and drops human readability in favor of performance. It can encode data into either binary (MessagePack) or text (JSON), but in both cases, it preserves all EDN data types and originates from the Clojure language.