frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

FracturedJson

https://github.com/j-brooke/FracturedJson/wiki
134•PretzelFisch•2h ago

Comments

damnitbuilds•1h ago
Nice.

And BTW, thanks for supporting comments - the reason given for keeping comments out of standard Json is silly ( "they would be used for parsing directives" ).

Xymist•1h ago
It's a pretty sensible policy, really. Corollary to Hyrum's Law - do not permit your API to have any behaviours, useful or otherwise, which someone might depend on but which aren't part of your design goals. For programmers in particular, who are sodding munchkins and cannot be trusted not to do something clever but unintended just because it solves a problem for them, that means aggressively hamstringing everything.

A flathead screwdriver should bend like rubber if someone tries to use it as a prybar.

nodja•38m ago
On one hand, it has made json more ubiquitous due to it's frozen state. On another hand, it forces everyone to move to something else and fragments progress. It would be much easier for people to move to json 2.0 rather than having hundreds of json + x standards. Everyone is just reinventing json with their own little twist that I feel sad that we haven't standardized to a single solution that doesn't go super crazy like xml.

I don't disagree with the choice, but seeing how things turned out I can't just help but look at the greener grass on the other side.

libria•32m ago
> A flathead screwdriver should bend like rubber if someone tries to use it as a prybar.

Better not let me near your JSON files then. I pound in wall anchors with the bottom of my drill if my hammer is not within arms reach.

mystifyingpoi•30m ago
> A flathead screwdriver should bend like rubber if someone tries to use it as a prybar.

While I admire his design goals, people will just work around it in a pinch by adding a "comment" or "_comment" or "_comment_${random_uuid}", simply because they want to do the job they need.

If your screwdriver bends like a rubber when prying, damn it, I'll just put a screw next to it, so it thinks it is used for driving screws and thus behaves correctly.

patates•1h ago
XML people were doing crazy things in the Java/.NET world and "<!--[if IE 6]>" was still a thing in HTML when JSON was being designed.

I also would have wanted comments, but I see why Crockford must have been skeptical. He just didn't want JSON to be the next XML.

frizlab•1h ago
Unrelated: why spaces inside the parentheses? It’s not the first time I see this, but this is incorrect!
cromulent•16m ago
JSON doesn't have parentheses, but it does have braces and brackets. The JSON spec specifically allows spaces.

> Insignificant whitespace is allowed before or after any token.

frizlab•8m ago
I was talking about the parent comment, which has spaces inside the parenthesis (I do prefer no spaces inside brackets and braces in my JSONs, but that’s another story).
polshaw•1h ago
Is there an option for it to read the contents from a pipe? that's by far my biggest use for the jq app.
tuetuopay•1h ago
this would be amazing to be chained with jq, that was my first thought as well.
simonw•52m ago
There's a C# CLI app in the repo: https://github.com/j-brooke/FracturedJson/blob/main/Fracture...

  Output is to standard out, or a file specified by the --outfile switch.  Input is from either standard in, or from a file if using the --file switch
It looks like both the JavaScript version and the new Python C# wrapper have equivalent CLI tools as well.
barishnamazov•1h ago
This is pretty cool, but I hope it isn't used for human-readable config files. TOML/YAML are better options for that. Git diff also can be tricky with realignment, etc.

I can see potential usefulness of this is in debug mode APIs, where somehow comments are sent as well and are rendered nicely. Especially useful in game dev jsons.

silvestrov•56m ago
Just say Norway to YAML.
merelysounds•40m ago
This is a reference to YAML parsing the two letter ISO country code for Norway:

    country: no
As equivalent to a boolean falsy value:

    country: false
It is a relatively common source of problems. One solution is to escape the value:

    country: “no”
More context: https://www.bram.us/2022/01/11/yaml-the-norway-problem/
Y-bar•17m ago
We stopped having this problem over ten years ago when spec 1.1 was implemented. Why are people still harking on about it?
actionfromafar•11m ago
Now add brackets and end-tags, I'll reconsider. ;)
actionfromafar•37m ago
Yaml is the worst. Humans and LLMs alike get it wrong. I used to laugh at XML but Yaml made me look at XML wistfully.

Yaml - just say Norway

airstrike•22m ago
The Norway issue is a bit blown out of proportion seeing as the country should really be a string `"no"` rather than the `no` value
frizlab•1h ago
This is interesting. I’d very much like to see a code formatter do that kind of thing; currently formatters are pretty much inflexible, which makes getting structure out of a formatted code sometimes hard.
barishnamazov•1h ago
Right. In my previous work, I wrote a custom XML formatter for making it look table-like which was our use case. Of course, an ideal solution would have been to move away from XML, but can't run away from legacy.
thechao•55m ago
I just built a C++ formatter that does this (owned by my employee, unfortunately). There's really only two formatting objects: tab-aligned tables, and single line rows. Both objects also support a right-floating column/tab aligned "//" comment.

Both objects desugar to a sequence of segments (lines).

The result is that you can freely mix expression/assignment blocks & statements. Things like switch-case blocks & macro tables are suddenly trivial to format in 2d.

Because comments are handled as right floating, all comments nicely align.

I vibe coded the base layer in an hour. I'm using with autogenerated code, so output is manually coded based on my input. The tricky bit would be "discovering" tables & block. I'd jus use a combo of an LSP and direct observation of sequential statements.

shiandow•57m ago
This looks very readable. The one example I didn't like is the expanded one where it expanded all but 1 of the elements. I feel like that should be an all or norhing thing, but there's bound to be edge cases.
londons_explore•45m ago
Great. Now integrate this into every JSON library and tool so I get to see it's output more often
tomtomtom777•23m ago
I think integration into jq would be both powerful and sufficient.
simonw•45m ago
It looks like there are two maintained implementations of this at the moment - one in C# https://github.com/j-brooke/FracturedJson/wiki/.NET-Library and another in TypeScript/JavaScript https://github.com/j-brooke/FracturedJsonJs. They each have their own test suite.

There's an older pure Python version but it's no longer maintained - the author of that recently replaced it with a Python library wrapping the C# code.

This looks to me like the perfect opportunity for a language-independent conformance suite - a set of tests defined as data files that can be shared across multiple implementations.

This would not only guarantee that the existing C# and TypeScript implementations behaved exactly the same way, but would also make it much easier to build and then maintain more implementations across other languages.

Interestingly the now-deprecated Python library does actually use a data-driven test suite in the kind of shape I'm describing: https://github.com/masaccio/compact-json/tree/main/tests/dat...

That new Python library is https://pypi.org/project/fractured-json/ but it's a wrapper around the C# library and says "You must install a valid .NET runtime" - that makes it mostly a non-starter as a dependency for other Python projects because it breaks the ability to "pip install" them without a significant extra step.

DJBunnies•16m ago
While I wish JSON formally supported comments, it seems more sensible (compatible) to just nest them inside of a keyed list or object as strings.

  {
    foo: "bar",
    ans: 42,
    comments: {
      ans: "Douglas Adams"
    }
  }

First new motion sickness drug arrives after nearly half a century

https://newatlas.com/disease/first-motion-sickness-drug/
1•Brajeshwar•47s ago•0 comments

Stranger Things 5 Finale Ending Explained

https://www.netflix.com/tudum/articles/stranger-things-5-episode-8-ending-explained
1•HelloUsername•7m ago•1 comments

Bees – Best-Effort Extent-Same, a btrfs dedupe agent

https://github.com/Zygo/bees
1•embedding-shape•10m ago•0 comments

Investigating and fixing a nasty clone bug

https://kobzol.github.io/rust/2025/12/30/investigating-and-fixing-a-nasty-clone-bug.html
1•r4um•11m ago•0 comments

Show HN: Linvisual – A simple to use Linear Algebra Visualization library

https://github.com/Jeditrix/Linvisual
1•jeditrix•12m ago•0 comments

Show HN: LoginLlama – behaviour-based login anomaly detection for small teams

https://loginllama.app
1•joshghent•17m ago•0 comments

ARKit Testing with RobotKit

https://www.chrisdavis.com/articles/arkit_robotkit.html
1•nthState•18m ago•1 comments

We Become What We Behold (2016)

https://github.com/ncase/wbwwb
1•Lwrless•20m ago•0 comments

You are already behind by not having read this post

https://christianheilmann.com/2026/01/02/you-are-already-behind-by-not-having-read-this-post/
2•ArmageddonIt•21m ago•1 comments

Show HN: I built a countdown app because system alarms gave my friend anxiety

https://apps.apple.com/us/app/duepal-visual-countdown-timer/id6756181712
1•elevenapril•22m ago•1 comments

Ask HN: Successful one-person online businesses in 2026?

2•vekker•22m ago•1 comments

Street Fighter 2 fixed a typo with a human leg [video]

https://www.youtube.com/watch?v=dUkLYOPRYH4
1•sd9•22m ago•0 comments

The Kimwolf Botnet Is Stalking Your Local Network

https://krebsonsecurity.com/2026/01/the-kimwolf-botnet-is-stalking-your-local-network/
1•todsacerdoti•23m ago•0 comments

Do you want a prompt saver and fantastic organizer?

1•SRMohitkr•23m ago•0 comments

Stardust study resets how life's atoms spread through space

https://www.chalmers.se/en/current/news/see-stardust-study-resets-how-life-s-atoms-spread-through...
3•geox•25m ago•0 comments

Matryoshka embeddings: How to make vector search 5x faster

https://sderosiaux.substack.com/p/matryoshka-embeddings-how-to-make
2•chtefi•26m ago•0 comments

Tesla sales fall for the second year in a row

https://www.businessinsider.com/tesla-sales-fall-second-year-ev-elon-musk-2026-1
3•jrpelkonen•26m ago•2 comments

DeepSeek's new AI training method is a 'breakthrough' for scaling

https://www.businessinsider.com/deepseek-new-ai-training-models-scale-manifold-constrained-analys...
2•ryan_j_naughton•27m ago•0 comments

Reward

https://taylor.town/reward
3•surprisetalk•29m ago•2 comments

Software Dispatch Network

https://shadily-absolvable-jayla.ngrok-free.dev
1•iabdullah2025•29m ago•1 comments

How much energy do Microsoft and Google consume? The Dutch don't know

https://www.techzine.eu/news/infrastructure/137595/how-much-energy-do-microsoft-and-google-consum...
2•amirmasoudabdol•31m ago•1 comments

The Janus Protocol

https://yusufaytas.com/the-janus-protocol/
7•yusufaytas•32m ago•0 comments

I'm having the worst career winter of my life

4•mariogintili•34m ago•8 comments

Rails to the Edge and Beyond

https://intertwingly.net/blog/2026/01/02/Rails-to-the-Edge-and-Beyond.html
1•ingve•35m ago•0 comments

Cities: Skylines II Is a Car Game–and It Doesn't Suck Anymore

https://www.thedrive.com/news/cities-skylines-ii-is-secretly-a-car-game-and-it-doesnt-suck-anymore
1•PaulHoule•35m ago•0 comments

The Netflix Simian Army (2011)

https://netflixtechblog.com/the-netflix-simian-army-16e57fbab116
2•rognjen•36m ago•0 comments

EKS: Russia's space-based missile early warning system (2021)

https://www.thespacereview.com/article/4121/1
1•sklargh•36m ago•0 comments

Building Todoist's Ramble #3: Visualizing the Waveform

https://www.doist.dev/building-ramble-3-visualizing-the-waveform/
2•rfgamaral•36m ago•0 comments

Communication with Submarines

https://en.wikipedia.org/wiki/Communication_with_submarines
1•tosh•36m ago•0 comments

Tesla loses EV crown to China's BYD

https://www.ft.com/content/c1c5f811-7b3f-4011-8e1e-cccb5aa80313
1•thm•37m ago•0 comments