Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pron
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
14 ms
·
121.
▲
by
pron
3mo ago
I originally came to Java because of the better performance it offered compared to C++ in large programs . The JVM is specifically designed to remove some of the fundamental performance overheads that low-level languages suffer from, and m
122.
▲
by
pron
3mo ago
> I kind of discovered "why Rust" from first principles and from then on I was hooked. I get it. The language certainly does appeal to some people, and I can understand why, just as I understand why it does not appeal to others
123.
▲
by
pron
3mo ago
> or that you are writing programs that are doing things that would require unsafe literally everywhere You don't need unsafe "literally everywhere" to run into issues. First, what matters most are the areas that are most
124.
▲
by
pron
3mo ago
I get that perspective and I agree it has value, but for me, Rust is a jack of all trades but master of none, all while being one of the most complicated languages ever made and requires very long build times. So I agree it continues C++&#x
125.
▲
by
pron
3mo ago
> To me, those are also performance characteristics. Maybe my view on what constitutes "performance" is broader than average here. Yes, but they come with speed gains, so you can't say that you pay "performance overhe
126.
▲
by
pron
3mo ago
> I'd argue that the value of Rust is that it makes low-level viable for a lot of stuff that would otherwise require a lack of memory safety; a lot of it is stuff that might be written in a higher level language, but that's jus
127.
▲
by
pron
3mo ago
> But the way the author of Fil-C presents their arguments it often comes across in a kind of antagonistic manner, like he has a chip on his shoulder. You may well be right. I've yet to learn about it, but I'm planning to.
128.
▲
by
pron
3mo ago
> Table stakes for me . Ok, so if you meant "table stakes" as an expression of a personal preference and suitability to the programs you write without making an unsupported universal claim such as "this leads to better co
129.
▲
by
pron
3mo ago
> it promotes an "us vs them" mindset, instead of a "we're all trying to improve memory safety" mindset But you did the same thing when, on the spectrum that ranges from C to ATS, with Zig, Rust, and Java somewhe
130.
▲
by
pron
3mo ago
> Rust and Java both don't have much problem with unsafety, whereas C does, and at least from what I've heard, Zig does as well. I'm not interested in the definition so much as I am in calling it "table stakes",
131.
▲
by
pron
3mo ago
> Java and Rust have actually very similar memory safety profiles They really don't. Look at how many basic data structures (in the standard library or outside it) require unsafe features in Java vs Rust. > Zig has an identical m
132.
▲
by
pron
3mo ago
So that could be a clear definition, but for it to be "table stakes" it needs to have some universal value and it doesn't (in fact, that very same definition could also classify even C as "memory safe"): https:&#
133.
▲
by
pron
3mo ago
That framing may seem intellectually satisfying, but it's not useful in practice. Consider the extreme edge case of C: We can clearly mechanically delineate between the empty program and a non-empty one, we call the empty program safe
134.
▲
by
pron
3mo ago
> I believe memory safety is table stakes I'm not sure what that means. Java lets you do many things programs may want to do in a memory-safe way but not everything. Rust lets you do fewer things than Java in a memory-safe way, but
135.
▲
by
pron
3mo ago
Oh, wow. > large gathering of perfectly normal, peaceful Brits Let's just say that when a Tommy Robinson crowd walk into a pub, the perfectly normal, peaceful Brits look for the exits.
136.
▲
by
pron
3mo ago
No, because the functionality this is the core of is explicitly for small, simple JSON tasks. If the core were streaming, you would need to always write quite a bit of non-trivial code for small, simple JSON tasks. Note that the lack of som
137.
▲
by
pron
3mo ago
> Maybe a good set of design considerations for java.util.json would be “what does this API need to run a CRUD app written in modern java?” Reading the JEP, that is not the motivation. The target is more a short script or some REPL inter
138.
▲
by
pron
3mo ago
The motivation behind this JEP is laid out in the JEP under the section "Motivation". As I understand that section (and I wasn't involved in writing this JEP), good and popular marshalling libraries for JSON already exist, an
139.
▲
by
pron
3mo ago
> there's really not that much scope to creep into First, we've been in this game far too long to know that this isn't the case. Second, this is only incubation. It may well be that the team behind this feature intend to a
140.
▲
by
pron
3mo ago
There it's not about ambiguity: https://news.ycombinator.com/item?id=49025644
141.
▲
by
pron
3mo ago
And vice versa. As someone who likes both languages, I appreciate how they both have their pros and cons. I was a Schemer before I learnt Java (when Java barely existed) and I adore Clojure, but if I were to write 10 MLOC mobile network rou
142.
▲
by
pron
3mo ago
You could, but it would be significantly worse. Number and JsonNumber are nearly equivalent in this context, except that JsonNumber has the major advantage of being in the same sealed hierarchy as the other JSON types, allowing for nice pat
143.
▲
by
pron
3mo ago
And there's nothing in Java preventing that. In fact, it is trivial to implement that exact API on top of the API proposed in the JEP.
144.
▲
by
pron
3mo ago
That's not the reason. The question was about JSON generation from existing Java types, not about a DSL. Java JSON libraries offer similar conveniences (in fact, you can be much more sophisticated, clear, and convenient than the DSL yo
145.
▲
by
pron
3mo ago
I'm not involved with the design of this API, but it seems to me that the issue on the JSON generation side (where you're complaining about ceremony) is feature creep. Creating the API you want on top of the proposed one is trivia
146.
▲
by
pron
3mo ago
Because JSON types don't cleanly map to Java types. For example, a JSON number could be an int, a long, a double, a BigInteger, or a BigDecimal. Which of them the Java code wants is not something you can deduce (most generally, you cou
147.
▲
by
pron
3mo ago
gcc and LLVM have also copied ideas from C2, and there's been cross-pollination between Java and C++ compilers going back decades. All three are among the most sophisticated optimising compilers right now.
148.
▲
by
pron
3mo ago
(BTW, when I wrote "Not one of those projects ... changed their language", I meant after less than a decade , as a continuation to the previous comment) First, technically respected products like the ones you describe either 1. p
149.
▲
by
pron
3mo ago
It's not necessarily the thing that matters most to executives, who are often those making decisions, but it's always been the thing that mattered most to programmers (at least those of them who have any emotions or strong prefere
150.
▲
by
pron
3mo ago
> This is just so weird to me, because I would say the same about Zig. Then why is it weird if you're saying the same thing? Different programming languages appeal to programmers with different tastes, and so it makes sense that som
More ›