HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
tjson
tjson-spec
HTML2016–2017
tjson / tjson-spec

tjson-spec

IETF-style specification and test cases for TJSON

2Distinct people
15Mentions
0Explicit recommenders
64GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

IETF-style specification and test cases for TJSON

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by week15 dated mentions

Observed mentions: 2016-11-02 21:38:10 UTC to 2017-04-26 03:03:54 UTC. Weeks start Monday, UTC.

0510152016-10-31 00:00:00 UTC to 2016-11-07 00:00:00 UTC (exclusive): 13 mentions; 0 submissions, 13 commentsOct 312016-11-07 00:00:00 UTC to 2016-11-14 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-11-14 00:00:00 UTC to 2016-11-21 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-11-21 00:00:00 UTC to 2016-11-28 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-11-28 00:00:00 UTC to 2016-12-05 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-12-05 00:00:00 UTC to 2016-12-12 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-12-12 00:00:00 UTC to 2016-12-19 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-12-19 00:00:00 UTC to 2016-12-26 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-12-26 00:00:00 UTC to 2017-01-02 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-02 00:00:00 UTC to 2017-01-09 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-09 00:00:00 UTC to 2017-01-16 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-16 00:00:00 UTC to 2017-01-23 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-23 00:00:00 UTC to 2017-01-30 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsJan 232017-01-30 00:00:00 UTC to 2017-02-06 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-02-06 00:00:00 UTC to 2017-02-13 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-02-13 00:00:00 UTC to 2017-02-20 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-02-20 00:00:00 UTC to 2017-02-27 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-02-27 00:00:00 UTC to 2017-03-06 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-03-06 00:00:00 UTC to 2017-03-13 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-03-13 00:00:00 UTC to 2017-03-20 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-03-20 00:00:00 UTC to 2017-03-27 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-03-27 00:00:00 UTC to 2017-04-03 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-04-03 00:00:00 UTC to 2017-04-10 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-04-10 00:00:00 UTC to 2017-04-17 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-04-17 00:00:00 UTC to 2017-04-24 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-04-24 00:00:00 UTC to 2017-05-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 commentsApr 24

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Oct 312016-10-31 00:00:00 UTC2016-11-07 00:00:00 UTC13013
Nov 72016-11-07 00:00:00 UTC2016-11-14 00:00:00 UTC000
Nov 142016-11-14 00:00:00 UTC2016-11-21 00:00:00 UTC000
Nov 212016-11-21 00:00:00 UTC2016-11-28 00:00:00 UTC000
Nov 282016-11-28 00:00:00 UTC2016-12-05 00:00:00 UTC000
Dec 52016-12-05 00:00:00 UTC2016-12-12 00:00:00 UTC000
Dec 122016-12-12 00:00:00 UTC2016-12-19 00:00:00 UTC000
Dec 192016-12-19 00:00:00 UTC2016-12-26 00:00:00 UTC000
Dec 262016-12-26 00:00:00 UTC2017-01-02 00:00:00 UTC000
Jan 22017-01-02 00:00:00 UTC2017-01-09 00:00:00 UTC000
Jan 92017-01-09 00:00:00 UTC2017-01-16 00:00:00 UTC000
Jan 162017-01-16 00:00:00 UTC2017-01-23 00:00:00 UTC000
Jan 232017-01-23 00:00:00 UTC2017-01-30 00:00:00 UTC000
Jan 302017-01-30 00:00:00 UTC2017-02-06 00:00:00 UTC000
Feb 62017-02-06 00:00:00 UTC2017-02-13 00:00:00 UTC000
Feb 132017-02-13 00:00:00 UTC2017-02-20 00:00:00 UTC000
Feb 202017-02-20 00:00:00 UTC2017-02-27 00:00:00 UTC000
Feb 272017-02-27 00:00:00 UTC2017-03-06 00:00:00 UTC000
Mar 62017-03-06 00:00:00 UTC2017-03-13 00:00:00 UTC000
Mar 132017-03-13 00:00:00 UTC2017-03-20 00:00:00 UTC000
Mar 202017-03-20 00:00:00 UTC2017-03-27 00:00:00 UTC000
Mar 272017-03-27 00:00:00 UTC2017-04-03 00:00:00 UTC000
Apr 32017-04-03 00:00:00 UTC2017-04-10 00:00:00 UTC000
Apr 102017-04-10 00:00:00 UTC2017-04-17 00:00:00 UTC000
Apr 172017-04-17 00:00:00 UTC2017-04-24 00:00:00 UTC000
Apr 242017-04-24 00:00:00 UTC2017-05-01 00:00:00 UTC202

What Hacker News says

15 sources
JSON is not defined in terms of UTF-8. That would be patently ridiculous, since UTF-8 is a serialization. TJSON is defined as a serialization format on top of a JSON-like data model. The TJSON spec originally used the terminology "Unicode String", but moved to using "UTF-8 String", the rationale for which is given here: https://github.com/tjson/tjson-spec/issues/27 If your intent is to actually effect a change in the specification, that is the proper place to do it, but specific criticisms of the exact wording of the specification, preferably in the form of pull-requests, would be the best way to affect such changes. If your intent is not to effect a change in the specification, you're entitled to your opinion, but I'm done discussing the matter as the discussion has ceased to be meaningful to me. Generic criticisms like "You used 'UTF-8'
Read the rest
instead of 'Unicode'" outside the context of specific sections of the specification aren't particularly helpful. Furthermore, what does the author intend for escaped characters? Are they allowed? Presumably not, since that would provide for non-canonical representations. You are continuing to miss the point: TJSON intends to provide a foundation to use content-aware content hashing in lieu of a canonicalization scheme as an alternative solution which works across multiple encodings of the same data, sidesteps the exact problems you're talking about, and also allows arbitrary subsets of an object graph to be authenticated without requiring rehashing/resigning. Please see this closed issue on canonicalization ("won't do"): https://github.com/tjson/tjson-spec/issues/24 From what I can gather, TJSON is offering a degree of abstraction you have not yet fully gleaned. The core idea is: many serializations, one underlying data structure/object graph. TJSON is a mere serialization layer, and indeed many TJSON documents may refer to the same underlying data structure, but all will have the same "objecthash": https://github.com/benlaurie/objecthash
In Introducing TJSON, a stricter, typed form of JSON
I am curious if you simply missed the numerous places this post refers to CBOR? Such as this: There exists a binary analogue of JWT called CWT which is based on the Compact Binary Object Representation (CBOR) standard. Unfortunately you can’t convert JWTs to CWTs without the original issuer re-issuing them and re-signing them in the new format. Or this: This is a pervasive problem for anyone who would like to store authenticated/signed data natively in a binary format (e.g. Protobufs, Thrift, capnp, MessagePack, BSON, or CBOR), but also permit clients to work natively with a JSON API without necessarily being aware of a full-and-evolving schema. JSON is a human-meaningful serialization format, as opposed to all the binary formats named in the post, including CBOR. See also: https://github.com/tjson/tjson-spec/issues/26 TJSON could potenti
Read the rest
ally provide non-lossy transcoding to/from the similarly tagged types in CBOR in ways JSON itself cannot.
In Introducing TJSON, a stricter, typed form of JSON
Responding to: EDIT: Looking at the spec [1] it seems to address some of these, but still indicates a strong confusion between data types (Unicode, rational numeric) and data representations (UTF-8, IEEE double). The format is described in terms of the tags (which act as type annotations), each of which corresponds to a specific on-the-wire format. Different tagged serializations of the same data may correspond to data of the same type. A better place to discuss ambiguities in the spec regarding this issue is here: https://github.com/tjson/tjson-spec/issues/27 The idea that different on-the-wire representations of an object correspond to the same typed data object (and can therefore result in the same hash) is core to understanding content-aware hashing. So to your I'm guessing the author just conflated accusations, I don't think you full
Read the rest
y understand what's going on here.
In Introducing TJSON, a stricter, typed form of JSON
1) Numeric precision of integers is (under)specified in RFC 7159 section 6: https://tools.ietf.org/html/rfc7159#section-6 Note that when such software is used, numbers that are integers and are in the range [-(2**53)+1, (2**53)-1] are interoperable in the sense that implementations will agree exactly on their numeric values. There is no contract that JSON integers give you full 64-bit precision. TJSON has such a contract, and tests for support for full-precision 64-bit integers (and expected failure in the boundary cases) is specified in the canonical test cases/examples file: https://github.com/tjson/tjson-spec/blob/master/draft-tjson-... 2) Please see https://github.com/tjson/tjson-spec/issues/27 3) Yes, these specific ranges are covered in the spec: https://www.tjson.org/spec/#rfc.section.3.3 4) Z-normalized RFC3339. See: h
Read the rest
ttps://www.tjson.org/spec/#rfc.section.3.4 5) TJSON provides a repertoire of types which approximates what's available in the scalar types of a format like Protobufs: https://developers.google.com/protocol-buffers/docs/proto3#s... What about, say, IP addresses Simple solution for that case: IP addresses have canonical representations as strings, so use their string representations. Or, if you prefer, represent them as a TJSON object. 6) objecthash provides an alternative to canonicalization: we can use a "content-aware" hash algorithm to produce a digest of the content rather than trying to arrange the content into a canonical form. See: https://github.com/tjson/tjson-spec/issues/24 I hate to be so negative, but this really comes off as half-baked. As far as I can tell, you didn't read the spec. All of your perceived ambiguities are addressed.
In Introducing TJSON, a stricter, typed form of JSON
Six things: 1) "Lack of full precision 64-bit integers" is bullshit. Numeric precision is not specified by JSON. If a parser can't deal with 64-bit integer values, it's a poor parser. 2) "s: UTF-8 string" What does this mean? JSON strings are strings of Unicode code points; JSON itself may be encoded as UTF-8, -16, or -32. So does this mean "encode the string as UTF-8, then represent as Unicode code points"? That makes no sense. Does this mean "encode the string as UTF-8 and output directly regardless of the encoding of the rest of the JSON output"? That makes no sense either. So I'm guessing the author just conflated "UTF-8" with "Unicode", which is concerning given that he is attempting to define an interchange protocol. 3) "i: signed integer (base 10, 64-bit range)" What does this mean? (-2^64,2^64)? (-2^63,2^63)? [-2^63,2^6
Read the rest
3)? 4) "t: timestamp (Z-normalized)" What does that mean? There are literally dozens of timestamp formats. Does he mean full ISO 8601, restricted to UTC? 5) What is the point of TJSON anyway? When you deserialize, you still have to check that the data is of the type you expect. At best this saves a bit of parsing, since the deserializer can do that automatically. Various JSON schema languages already exist, which give you this richer typechecking. The only use case I can think of for this is exactly what the author mentions further down the article: canonicalization for content-aware hashing. But this only works if the only types you care about fall into the small handful he thought of. What about, say, IP addresses? Case-insensitive strings (such as e-mail addresses)? 6) If we're talking about canonicalization, TJSON does not say how to canonicalize decimal numbers. I suppose this stems from the author's mistaken belief that numbers in JSON are IEEE floats (they're not, regardless of what common broken parsers do). I hate to be so negative, but this really comes off as half-baked. EDIT: Looking at the spec [1] it seems to address some of these, but still indicates a strong confusion between data types (Unicode, rational numeric) and data representations (UTF-8, IEEE double). [1] https://github.com/tjson/tjson-spec/blob/master/draft-tjson-...
In Introducing TJSON, a stricter, typed form of JSON
Putting type sigils on object keys does not solve the problem of typing arrays, unless the types of array array elements are always homogenous, disallowed as the root symbol (they are presently allowed), and are always typed by their membership in an object (and therefore by the key referring to them). This also does not solve the problem of how to type multidimensional arrays. The question of homogenous types for non-scalars is still an open issue, and is probably the best place to further discuss this: https://github.com/tjson/tjson-spec/issues/23 As an aesthetic note: I personally find "$" visually noisy as a sigil, and think it has generally lost favor as a sigil for commonly used expressions in programming languages, but is probably familiar to users of Perl, PHP, bash, and BASIC
In Introducing TJSON, a stricter, typed form of JSON
Binary keys are useful anywhere data is named/identified by a cryptographic key or hash, such as content-addressable systems: https://en.wikipedia.org/wiki/Content-addressable_storage A keyring where the object members are named by public keys is another example of where binary keys are useful. Tags on keys are like types for columns or any other schema. I would rather not have to pre-process the values. Tags on keys do not work for arrays, at least as the format is presently specified. They could potentially work if arrays always consist of homogenous types, and objects were the only allowed nonterminal allowed by the root symbol. See: https://github.com/tjson/tjson-spec/issues/23
In Introducing TJSON, a stricter, typed form of JSON

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.