Hacker News new | ask | show | jobs
by ok_dad 197 days ago
Yea, they just posted this a few days ago:

https://www.anthropic.com/engineering/advanced-tool-use

They discussed how running generated code is better for context management in many cases. The AI can generate code to retrieve, process, and filter the data it needs rather than doing it in-context, thus reducing context needs. Furthermore, if you can run the code right next to the server where the data is, it's all that much faster.

I see Bun like a Skynet: if it can run anywhere, the AI can run anywhere.

3 comments

Java can run anywhere too
Java is owned by Oracle. And you sure don't want to do business with that company. There's a reason why postgresql is slowly eating their cake.
This is FUD. Java has many open source implementations and nobody needs to deal with Oracle.
Even if we postulate that he fear is unwarranted and irrational, the fear is still real, based on Oracles history of lawsuits, and so the explanation still holds.
It explains nothing.

Java is possibly the safest bet on the future, it's open source both in spec and in the most common implementation (OpenJDK), and is so widely used that there are multiple FAANG companies critically dependent on Java working that alone could continue the development of the platform were anything happen.

Besides, Oracle has been a surprisingly good steward of the language.

https://en.wikipedia.org/wiki/Google_LLC_v._Oracle_America,_.... is not what I would call “good stewardship”
We could also postulate based on left-pad that npm and javascript in general shouldn't be used.

It has similar bases on facts.

"npm and javascript in general shouldn't be used" — stipulated
Immediately read this as "prostate" and proceeded to spit out my coffee. Carry on
Well except Google that got sued for US$8.8 Billion because they decided to use specific API signatures but provide their own implementation...?!
What Google did was similar what Microsoft did back in the days. Marketing something as Java, but wasn't Java.
It incredible how far the "Do not evil" marketing won the hearts of computing nerds, Google only got positive karma for doing with Android exactly what Microsoft did with J++.

To this day Android Java is not fully compatible with Java proper, and Kotlin became Google's version of C#.

Come on, that's a completely different story, Google made their own independent SDK using but incompatible with Java. Nobody's arguing you should do that.

Plus last time I checked Oracle lost that lawsuit.

... and Oracle lost
And the lesson is not to trust Oracle.
Anywhere where the correct Java version is installed correctly, important caveat
You can just supply a minimized runtime for your program, which is the primary way to ship Java programs for quite some time now.
Are you a Java dev by any chance?
I'm a dev. I don't know, I'm using a bunch of different languages, Java being one of them and I find it a very good fit for typical backend requirements.
Java’s cardinal sin was not owning the OS like Microsoft’s C# to force end-users to update the framework. Oracle really didn’t understand what they were sitting on with their Ubuntu competitor Solaris.
This has no longer been the case for C# for 10 years since the release of .NET Core and (now) .NET. The runtime is no longer bundled with the OS.

This is only true for older .NET Framework applications.

Isn’t it post installation still updated via Windows Update as they said (force end-users to update the framework)?
Only patches, it doesn't automatically install new major versions
It’s relevant enough that I feel I can roll out this bash.org classic…

<Alanna> Saying that Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders

EDIT: someone has (much to my joy) made an archive of bash.org so here is a link[1], but I must say I’m quite jealous of today’s potential 1/10,000[2] who will discover bash.org from my comment!

[1] https://bash-org-archive.com/?338364

[2] https://xkcd.com/1053

Perhaps my biggest claim to fame is being #11 on the bash.org top 100.
Hah, found it: https://bash-org-archive.com/?207373

So how did it work back in the day, people would just submit text and it would get upvoted? I always assumed like half of them were just made up.

Yep, exactly that. I recall that the voting was interesting because it was just ranked on absolute number of votes, no time decay or anything, so it would take quite some time for a new contender to accumulate votes to "compete" on the leaderboard. I don't remember if there were even accounts or if anyone could just vote repeatedly, modulo some IP or cookie-based limits.

As far provenance, I assume a lot of them were made up too, but this one was real.

Not discovered from scratch, but was a big fan when it was alive and kicking. Went there from time to time to get some mood boosters. So was very sad when found that it's gone (original one). Thanks a lot for sharing that bash-org-archive.com exists, what a great fun going down this memory lane.
I’ve been browsing the archive since I left that comment, they really were the good old days weren’t they. IRC was my introduction to geekdom, and I don’t think it would be unreasonable to say it shaped my life. Here I am 30-ish years later, an old man yelling at clouds — and I wouldn’t change much!

If anyone ever requested/used an eggdrop(?) bot from #farmbots or #wildbots on quakenet then thanks to you too; that was certainly one of the next steps down the path I took. A (probably very injectable) PHP blog and a bunch of TCL scripts powering bots, man I wish I could review that code now.

As one of the lucky 1/10000, holy shit that was amazing. Thank you.

To everyone else: I acknowlege that this post is not adding value but if you were one of the lucky 1/10000 you would understand that I have no choice.

That's hilarious. My comment is mostly a joke, but also trying to say that "runs everywhere" isn't that impressive anymore.
Yeah everyone proclaims to IANAL nowadays.
wait - how do you search the quotes??
https://www.google.com/search?q=site%3Abash-org-archive.com+...

seems to work. relies on that individual quote being indexed, and google SERPs feeling like returning full results at the moment, of course. when the latter fails, I've found success with site: queries on Bing (of all places.)

I don’t think there is a search function, I got the exact wording from a web search (I think “bash Java anal”, arguably a dangerous search!) and then after submitting I wondered if there is an archive of the quotes.
I found another appropriate XKCD: https://xkcd.com/1682/
I truly don’t understand that one. Might be the first XKCD that has gone over my head.
I ain’t hot a horse in this race I just put 2 and 2 together to get 4. I’m sure Java is fine but they didn’t buy Java.
Not in the browser, and no – webassembly doesn't count, otherwise you can say the same about Go and others.
Wasm does count, and you can say the same about Go and others.
Sure, they run, but they can't touch the DOM or do much that's very interesting without JavaScript.
Js just runs as is. Atwood's Law and all that.
I remember a time ...
Why doesn’t wasm count?
Compile step makes things more complicated.
As opposed to minimized JS.
You don’t need to minimize JS to be able to run it.
why would the tool minify the script it generated?
Same problem, different orders of magnitude.
May I ask, what is this obsession with targeting the browser? I've also noticed a hatred of k8s here, and while I truly understand it, I'd take the complication of managing infrastructure over frontend fads any day.
HN has a hatred of K8s? That’s new to me
K8s is used in many situations it shouldn't be, and a lot of HNers (including me) are bitter about having to deal with the resulting messes
This is a site for startups. They have no business running k8s, in fact, many of the lessons learned get passed on from graybeards to the younger generation along those lines. Perhaps I'm wrong! I'd love to talk shop somewhere.
java did run in the browser once.... it was embedded directly on the browser there was also nsapi

you could also run java with js if you are brave enough https://kreijstal.github.io/java-tools/

Java runs in the browser currently, after a transpilation step (same as .ts):

https://teavm.org/

Also CheerpJ (with support for Swing UIs even), Closure compiler, and now GraalVM also has an experimental WasmGC target.
Java is not for sale.
Java can be depended on without buying anything.
Oracle lawyers want you to think so.
Ahem, Temurin/OpenJDK disagree
You mean the company that 100% open-sourced Java and made the open-source (same license as Linux) OpenJDK the reference implementation?
Java's price is your time which you will need tons of as Java is highly verbose. The ultimate enterprise language
try java 25, and update your priors :)
Can't exactly write Java 25 without updating your legacy application, can you? And it tends to be the oldest applications that are the hardest to update for some painful reason. Would be nice if we all could live on the bleeding edge all the time
Lipstick on a pig.
No amount of updates will wash away the stink of Oracle from Java.
This is such a crappy point. People say it's better now but even in java 8 it's just BS. Oh boo hoo I have to write a few extra words here and there. Woe is me. The IDE will autogenerate the boilerplate for you, you don't even have to write it yourself. And once it's there it's actually useful, there's a reason it exists.
Seriously. I don’t get all the over concern over the verbosity. At least in java you can tell what the hell is going on. And the tools…so good. Right now I am in python typescript world. And let me tell you, the productivity and ease of java and c# are sorely missed!
On 3 billion devices
run code anywhere hamstrung by 90s syntax and hidden code indirections
Haven’t checked in on Java in a while?
From what I gather everyone is still stuck on Java 8 so no need to check?
Even stuck on Java 8 it's less verbose than Go, which everyone seems to love.

But the majority of projects are on a newer JDK than 8 for quite some years now.

Not even latest Java is less verbose than Go.
Where do you gather this from? We are a startup, on Java and on 25.
Why didn't you choose something more modern/sensible. go/kotlin/anything else on the planet?
No, everyone isn’t. You really should check.
This is absolutely untrue. Code from JDK 8 runs fine on JDK 25 (just released LTS). It is true that if you did something silly that locks you into certain dependency versions, you may be stuck, but this is not the majority of applications.
I tried to check in on Java recently but got a NullPointerException when using the AbstractSingletonProxyFactoryBean !
R/ProgrammerHumor quality comment here.
I'll never understand people making fun of verbosity. So you really prefer short, ambiguous, opaque and unpronounceable abbreviations? Really?!
For me at least, I find it easier to see the shape of algorithms, control flow, and expressions when the variable names are concise. But this also might be because I have found Go to fit my use-cases and thinking style well, and Go programs tend to follow this naming convention.

For example, if I have a struct `PageEntity` with a field `Id`, and I am iterating over a slice of such IDs, I would prefer using `pid` instead of `pageEntityId` as the variable name. But Java APIs and conventions tend to use these longer names, so I find it takes more thinking to remember the different names instead of quickly seeing the behavior of code at a glance.

Java also tends to have a lot of inheritance which results in these long glued-together names and makes it harder to follow program flow because behaviors get introduced in multiple different places (i.e., it has the opposite of locality of behavior).

But those are just my opinions and experiences! I know many people love Java, and it is a versatile and powerful language.

The irony is that the same bunch of folks will complain about array languages.
i haven't. do people still use the "class" keyword?
Is that the issue people have with Java?
and JavaScript even anywherer!
AI tools value simplicity, fast bootstrapping and iterations, this rules out the JVM which has the worst build system and package repositories I've ever had the displeasure of needing to use. Check in gradle binaries in 2025? Having to wait days for packages to sync? Windows/Linux gradle wrappers for every project? Broken builds and churn after every major upgrade. It's broken beyond repair.

By contrast `bun install` is about as good as it gets.

Gradle is something that only Android devs should be using, and because of Google imposes its use. Had not been for Google and Android Gradle plugin, almost no one would care.

Please give me Java tools over C, C++, JavaScript or Python ones, any day of the week.

Only .NET and Rust compare equally in quality of DX.

AI tools value simplicity?!?

Check in the Python dependency management chaos, what it is the proposal this month, from what AI startup doing Python tools in Rust?

Apples and oranges. Maven is leagues beyond npm. Screw Gradle.

How many mass security incidents have there been with npm just the last few weeks?

Maven is excellent! Once you understand it, you can work with almost any Maven project without needing to learn the specifics. I’d take Maven or Cargo any day over anything in the JavaScript or Python ecosystem.
It's just too bad bun is based on literally the worst programming language that's in actual use.
TypeScript's one of the best, and bun runs it natively.
Typescript is a band aid on the gaping gushing wound that is JavaScript. It attempts to fix one problem JS has and it doesn't really succeed.
Sounds like cope. Great Type System, Language Server, IDE Integration, compiler feedback, tooling ecosystem, DX Hot Reload - all things that made it the most used programming language on GitHub.
By using Gradle you certainly didn't make yourself a favor.
I am unsure why people feel the need to say this about Gradle. If you aren't doing anything fancy, the most you will touch is the repositories and dependencies block of your build script, perhaps add publishing or shadow plugins and configure them accordingly but that has never been simpler than it is now. Gradle breaks when you feel the need to unnecessarily update things like the wrapper version or plugins without considering the implications that has. Wrapper is bundled in so you don't have to try and make a build script work with whatever version you might have installed on your system if you have any, toolchain resolution makes it so you don't even need to install an appropriate JDK version as it does that for you.

If the build script being a DSL is the issue, they're even experimenting around declarative gradle scripts [0], which is going to be nice for people used to something like maven.

0: https://declarative.gradle.org/

So now there will be Kotlin DSL, Groovy DSL and declarative DSL, spread out over up to five files in the project root. Gradle is like C++, trying to climb out of it's complexity hole by digging deeper every new version.

The problem with Gradle is that it never had a clear philosophy to begin with. It's trying to be everything to everybody, changes best practices every year and has enough features that the project at hand could entirely be built out of Gradle scripts itself.

And oh, it still requires an update to run everytime a new JDK is released even though the SDK is the most backward compatible thing ever written.

And yet. None of these issues exist in Maven to begin with.
At the same time, only Maven requires doing a clean install from time to time as it fails to properly track what needs updating.

Gradle is better from this perspective, and hopefully with its "kotlinization" we will see some stability, which was the biggest issue it had before.

What do you mean by "context" here?
Under "Programmatic Tool Calling"

> The challenge

> Traditional tool calling creates two fundamental problems as workflows become more complex:

> Context pollution from intermediate results: When Claude analyzes a 10MB log file for error patterns, the entire file enters its context window, even though Claude only needs a summary of error frequencies. When fetching customer data across multiple tables, every record accumulates in context regardless of relevance. These intermediate results consume massive token budgets and can push important information out of the context window entirely.

> Inference overhead and manual synthesis: Each tool call requires a full model inference pass. After receiving results, Claude must "eyeball" the data to extract relevant information, reason about how pieces fit together, and decide what to do next—all through natural language processing. A five tool workflow means five inference passes plus Claude parsing each result, comparing values, and synthesizing conclusions. This is both slow and error-prone.

Basically, instead of Claude trying to, e.g., process data by using inference from its own context, it would offload to some program it specifically writes. Up until today we've seen Claude running user-written programs. This new paradigm allows it the freedom to create a program it finds suitable in order to perform the task, and then run it (within confines of a sandbox) and retrieve the result it needs.

Claude Code moved to partial file reads over the summer.

Super premature optimization. It’ll hallucinate what lines it needs to read, it’ll continuously miss critical context in favor of trimming tokens.

Luckily we can now hook and force the agent to read full files at least once.

I've had it happen almost every time I try to give them another shot. It presents a snippet of my code, claims there's a bug due to an unhandled edge case, and completely miss the (literally) very next line that specifically handles the edge-case it mentioned.
Thanks for the reply.
Jesus wept, for the nerds joyfully want skyney