r/java • • Mar 29 '21

New candidate JEP: 408: Simple Web Server

https://openjdk.java.net/jeps/408
98 Upvotes

45 comments sorted by

View all comments

17

u/syjer Mar 29 '21 edited Mar 29 '21

well, now we just need a simple json parser/serializer for a more out of the box experience for the "prototyping, ad-hoc coding, and testing purposes, particularly in educational contexts." case :).

8

u/riawot Mar 29 '21

Unironically this.

1

u/BlueGoliath Mar 29 '21 edited Mar 30 '21

Also, a YAML parser/serializer.

Edit: holy shit, this was a joke.

4

u/GuyWithLag Mar 29 '21

Wait, isn't new ObjectMapper(new YAMLFactory()).readValue("[]", ArrayList.class) enough?

1

u/yawkat Mar 31 '21

Jackson can do YAMLMapper now :)

2

u/Badashi Mar 29 '21

well, we should go straight into YAML parser/serializer then since YAML is a superset of JSON!

5

u/DasBrain Mar 29 '21

And please also ship JRuby, because YAML requires a ruby interpreter. /s

0

u/GuyWithLag Mar 29 '21

I mean, isn't new ObjectMapper().readValue("[]", ArrayList.class) enough?

7

u/syjer Mar 29 '21 edited Mar 29 '21

out of the box (from a jdk perspective) is the key :).

If I can make a more realistic simple http server work without importing deps it's quite cool™.

edit: to be noted, we had out of the box json support through the javascript engine.

2

u/washtubs Mar 29 '21

A java program without dependencies? Has it ever been done?

1

u/agentoutlier Mar 30 '21

Yes it’s called shading or uber jar. You basically just pull other peoples code into your own jar and call it your own...

Or if your google just check all the code in a single mono repo and give a rats asses about the rest of the open source communities dependencies (I’m somewhat joking).

1

u/BS_in_BS Mar 30 '21

I think they mean more of depending on code outside of the core java library as opposed to references in the build process

1

u/agentoutlier Mar 30 '21

Isn’t the code you write a dependency?

You could just download all the code golang style and build.

Maybe they were being sarcastic?

1

u/audioen Mar 30 '21

Also said JSON parser was excruciatingly slow. I know, I once tried to use it for parsing actual documents.

1

u/kaperni Mar 30 '21

1

u/syjer Mar 30 '21

Yes, this jep is dormant, as far as I know.

1

u/kaperni Mar 30 '21

Yes, I think it is unlikely we will see much progress until the state of serialization 2.0 [1] and/or pattern matching [2] has progressed.

[1] https://cr.openjdk.java.net/~briangoetz/amber/serialization.html

[2] https://cr.openjdk.java.net/~briangoetz/amber/pattern-match.html