frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

JEP 540: Simple JSON API (Now in Incubator)

https://openjdk.org/jeps/540
27•theanonymousone•1h ago

Comments

whartung•36m ago
Well, this will be fun.

I already have one of these (I'm sure I'm not alone). It's about 500 lines.

I found I'm not a huge fan of the JAX-B-ish style serialization of Java objects for JSON. I don't want to really downplay them, they certainly have their uses, they're very popular, I just don't like fighting them. Hand writing JSON marshaling code has not been arduous for me (notably with my utility layer). (I also, philosophically, strive to avoid "magic" in my code as much as practical.)

Of course, I still need a parser, I'm using GSONs parser, which means I'm still dragging in the whole bean level serialization infrastructure. I just don't use it. And while I've done JSON parsers before, I felt it was something better to import than maintain myself. So, in that sense, it's a mixed bag.

But, I do enjoy using it.

This will be a worthwhile JDK capability. Ideally it can replace mine.

gavinray•31m ago
It used to be the case that if you wanted to build a web service on the JVM, you wanted 2 things:

1. An HTTP server library/framework

2. A JSON library

We got a decently-performing and unopionated HTTP server in JDK 18 with "HttpHandlers" and "SimpleFileServer" plus "jwebserver" CLI

It later received Virtual Thread support, which made performance + scalability very competitive.

With a JSON module, you finally won't NEED to rely on external deps to build a basic JVM web service without pain.

Now, we just need a proper CLI framework like picocli, or at least "argparse" from Python stdlib...

IanGabes•28m ago
Including this in the standard library speaks to how much a citizen JSON has become, where a language simply can't afford to not consider it.

I find it interesting to note that nowhere in this JEP is the word "serialization", which is what most people might associate with JSON libs. Or rather, they are studiously ignoring that feature and just improving the ergonomics of interacting with JSON.

ameliaquining•16m ago
If I'm guessing correctly what you mean by "serialization", the JEP refers to it as "data binding" and includes a section on why it's not going to be part of this library.
mcfedr•16m ago
its crazy its taken Java so long to realise this
MeteorMarc•27m ago
Many languages have json marshalling and unmarshalling in their standard libs, e.g. C#, golang, python.
whaley•25m ago
Meanwhile, Jackson has been going strong for almost 20 years now https://github.com/FasterXML/jackson.

One of my favorite things about Jackson was being able to arbitrarily navigate through the document with a rich and fluent API (JsonNode) in jackson.databind, which this JEP at least conceptually borrows from with the JsonValue abstraction. Both of these are better than how some of the other implementations do it, where you are effectively working with glorified Map<String,Object>

exabrial•18m ago
Is this just including JSR-367 in the sdk? I've used that for years along with its many implementations. Great stuff!
q3k•18m ago
Happy to see that numbers are arbitrary width/precision until explicitly cast by the user. This goes against so many other JSON libraries that will always cast all numbers to double (or even float) thereby silently corrupting JSON numbers representing large values (eg. memory addresses).

Does anyone know how this behaves when encountering a repeated key in an object? (RFC8259 states that keys SHOULD be unique, which makes that generally allowed and implementations all behave slightly differently).

Sankozi•11m ago
Using JSON as a configuration format is a big mistake. JEP authors could learn a bit from package.json problems. Hope JSON will not be used in anything significant for JDK configuration.
dfabulich•9m ago
A stated goal of the API is to have "low ceremony"; this seems like a lot of ceremony.

    IO.println(JsonObject.of(Map.of("providers",
        JsonArray.of(List.of(JsonString.of("SUN"),
            JsonString.of("SunRsaSign"),
            JsonString.of("SunEC"))))));
There's gotta be a better way!

Surely there could be some way of creating a JsonArray of native Java Strings, Booleans, Doubles, and Integers without requiring clients to explicitly convert each value into a JsonValue. And why am I forced to convert a native List into a JsonArray just so I can make it the value of a JsonObject?

Why can't I write this?

   JsonObject.of(Map.of("providers", List.of("SUN", "SunRsaSign", SunEC"))));

Writing by hand is good for your brain

https://nealstephenson.substack.com/p/writing-by-hand-is-good-for-your
347•dwwoelfel•2h ago•141 comments

Software rendering in 500 lines of bare C++

https://haqr.eu/tinyrenderer/
112•mpweiher•2h ago•22 comments

Astronomers may have found the first exomoon

https://www.eso.org/public/news/eso2610/
125•MarcoDewey•3h ago•50 comments

Learn OpenGL, extensive tutorial resource for learning Modern OpenGL

https://learnopengl.com/
70•ibobev•2h ago•32 comments

Startup founders urge Trump not to shut off Chinese open weight AI

https://www.politico.com/news/2026/07/22/startup-founders-urge-trump-not-to-shut-off-chinese-open...
273•theanonymousone•1h ago•278 comments

Launch HN: Screenpipe (YC S26) – Power your agents by your 24/7 screen recording

8•louis030195•21m ago•2 comments

JEP 540: Simple JSON API (Now in Incubator)

https://openjdk.org/jeps/540
27•theanonymousone•1h ago•12 comments

Hybrid-Electric Aicraft Engine Targeting 30% Fuel Efficiency

https://www.rtx.com/news/news-center/2026/07/21/rtxs-pratt-whitney-canada-advances-hybrid-electri...
37•r2sk5t•3h ago•14 comments

Free way to get your data out of ChatGPT Business accounts

https://github.com/Conradqh/scrapemychats
23•conradqh•1h ago•3 comments

Show HN: Remux – an open-source tmux workspace designed for iPhone

https://github.com/h3nock/remux
40•bitwise42•2h ago•10 comments

Learn WebGPU for C++

https://eliemichel.github.io/LearnWebGPU/
23•ibobev•2h ago•4 comments

AI Companies Are Trying to Hide a Staggering Amount of Debt

https://futurism.com/artificial-intelligence/ai-companies-hide-debt-off-balance-sheet
331•technewssss•4h ago•153 comments

Encryption and Globalization 15 Years Later: E2EE and the "Going Dark" Debate

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6959699
22•iamnothere•2h ago•10 comments

Show HN: OneCLI – OSS credential gateway that keeps secrets out of AI agents

https://github.com/onecli/onecli
8•Jonathanfishner•1h ago•2 comments

How to Sell a Kettle

https://www.economist.com/business/2026/07/16/how-to-sell-a-kettle
17•bazzmt•3d ago•3 comments

Show HN: Palmier Pro – open-source macOS video editor built for AI

https://github.com/palmier-io/palmier-pro
12•hchtin•1h ago•3 comments

Show HN: Whetuu – a zero-config cross-shell prompt written in Zig

https://yamafaktory.github.io/whetuu/
25•yamafaktory•2h ago•6 comments

OpenStreetMap: Admin_level for All Countries

https://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative#Table_:_Admin_level_for_all_cou...
46•ivanjermakov•4d ago•5 comments

What happens when the information runs out

https://blog.jimgrey.net/2026/06/30/what-happens-when-the-information-runs-out/
29•mooreds•3h ago•5 comments

NerdLens: Mirror your computer with cardboard VR

https://github.com/ThatXliner/NerdLens
14•thatxliner•2h ago•6 comments

Emacs Is a Lispboard

https://en.andros.dev/blog/06bfd107/emacs-is-a-lispboard/
24•andros•3h ago•7 comments

Scanning for Pangram Errors

https://veryfineprint.substack.com/p/scanning-for-pangram-errors
56•jsnell•6d ago•32 comments

Brow6el: A full-featured web browser for the terminal using Chromium

https://tangled.org/janantos.tngl.sh/brow6el
26•nerdypepper•3h ago•6 comments

You can now run same OCI images as containers or Firecracker microVMs

https://github.com/pullrun/pullrun
14•pullrun•3h ago•4 comments

The Unity CLI: manage Unity from your terminal

https://unity.com/blog/meet-the-unity-cli
73•nateb2022•1d ago•21 comments

Show HN: macOS menu-bar manager for SSH port forwards

https://github.com/lx2026/RelayBar
22•linxy97•2h ago•3 comments

UK households free to install plug-in balcony solar panels from end of August

https://www.theguardian.com/money/2026/jul/23/uk-households-free-install-plug-in-balcony-solar-pa...
39•DamonHD•1h ago•15 comments

OpenAI’s accidental attack against Hugging Face is science fiction that happened

https://simonwillison.net/2026/Jul/22/openai-cyberattack/
219•abhisek•15h ago•178 comments

Cruller: Bun's Zig Runtime, Continued on Zig 0.16

https://ziggit.dev/t/cruller-buns-zig-runtime-continued-on-zig-0-16/16734
139•Erenay09•11h ago•98 comments

Fields Medals 2026

https://www.mathunion.org/imu-awards/fields-medal/fields-medals-2026
22•nill0•2h ago•7 comments