Better HN
topnewbestaskshowjobs
Log inSign up

lbalazscs

63 karma · joined Sep 12, 2022 (4y ago) · 25 submissions

Submissions

comment 1y ago · link · parent

A sentence from the article: "Given the extreme undesirability of any new language features I'd hardly propose bound-pointers now."

It shows that C++ was considered too complex already in the 90s.

comment 1y ago · link · parent

The link about Stiver has some details:

> Stiver decided to write his own decompiler as a side project. To overcome the weaknesses of existing alternatives, he took a different approach. After reading the bytecode, he constructed a control-flow graph in static single-assignment form, which is much better to express the program semantics abstracting the particular shape of bytecode. At the beginning of this project, Stiver knew little about static analysis and compiler design and had to learn a lot, but the effort was worth it. The resulting decompiler produced much better results than anything available at that time. It could even decompile the bytecode produced by some obfuscators without any explicit support.

https://blog.jetbrains.com/idea/2024/11/in-memory-of-stiver/

comment 1y ago · link · parent

We are already living in an (almost) ideal world: https://github.com/raphw/byte-buddy/discussions/1798

comment 1y ago · link · parent

It's naive to hope that automatic tests will find all problems. There are several types of problems that are hard to detect automatically: concurrency problems, resource management errors, security vulnerabilities, etc.

An even more important question: who tests the tests themselves? In traditional development, every piece of logic is implemented twice: once in the code and once in the tests. The tests checks the code, and in turn, the code implicitly checks the tests. It's quite common to find that a bug was actually in the tests, not the app code. You can't just blindly trust the tests, and wait until your agent finds a way to replicate a test bug in the code.

comment 2y ago · link · parent

In 2015 there was no ZGC. Today ZGC (an optional garbage collector optimized for latency) guarantees that there will be no GC pauses longer than a millisecond.

comment 2y ago · link · parent

Regarding openings, there's a trade-off between chess training and chess results. Rote memorization can improve your results (if you already have good skills), but it won't improve your skills.

Learning endgames is not about blindly memorizing moves in specific positions. You learn tricks that can be used in a large number of positions. Even the seemingly very specific positions can be mirrored left-right (not to mention black-white).

comment 2y ago · link · parent

There is a difference between memorization and rote memorization. In chess, rote memorization of master games or chess positions is not a recognized training method. Chess memory improves as a byproduct of analyzing many positions.

comment 2y ago · link · parent

Your link is only for value types, but this one is more general, it's for any type. Obviously the two are related, but not the same. Nullability for value types has performance implications as well.

comment 2y ago · link · parent

"Oracle GraalVM" (the former "Enterprise Edition") is now free, but (unlike "GraalVM Community Edition") not open source.

comment 2y ago · link · parent

I guess you missed the part where Linus Torvalds has apologized for years of being a jerk.

https://arstechnica.com/gadgets/2018/09/linus-torvalds-apolo...

comment 2y ago · link · parent

The ONNX Runtime is written in C++ and it uses the GPU. And Java is certainly much faster than Python.

comment 2y ago · link · parent

I often do a Google search, and then go directly to the Wikipedia result. My reasoning is that during the initial search, I don't know if there's a Wikipedia page about that topic, and I might need a fallback option.

comment 2y ago · link · parent

I only used Launch4j on Windows, but in the downloads you can find Linux and MacOS versions as well. At the bottom of the webpage it explains that it can be built on even more platforms, if you have MinGW binutils 2.22 (windres and ld only) on those platforms.

If I remember correctly, you can't just pull out the exe created by jpackage, because it doesn't contain the runtime. The installer installs both the runtime and the exe. The exe created by Launch4j also doesn't include the runtime, but Launch4j is better at finding a system-wide runtime, and can direct the user to a specific download site (such as adoptium.net) instead of java.com. If you want to have JUST a single exe, then I think GraalVM's native image is the only option.

comment 2y ago · link · parent

jlink only creates a runtime (the parts of the JDK that are actually used by your app), but there's a relatively new command called jpackage for creating installers: https://docs.oracle.com/en/java/javase/21/jpackage/packaging...

EDIT: I see now that you already know jpackage, but you don't want an installer. In that case you can use launch4j, which just wraps a jar in an exe: https://launch4j.sourceforge.net/

comment 3y ago · link · parent

I actually did that, and I asked for the first paragraph from "Great Expectations", and the answer was correct.

Of course the first paragraph of any famous novel is in itself famous, so I also asked for the first paragraph from Chapter XL, from the same novel. Interestingly the first 12 words were correct, but the rest was hallucination.

Original: It was fortunate for me that I had to take precautions to ensure (so far as I could) the safety of my dreaded visitor; for, this thought pressing on me when I awoke, held other thoughts in a confused concourse at a distance.

ChatGPT 3.5: "It was fortunate for me that I had to take precautions to ensure the safety of my treasure, for with such a boy as Compeyson on the loose, I was not likely to find much mercy at his hands. I had not told Herbert about the money, and I was glad to have the chance to count it before he came back. I found that I had still twenty-one sovereigns, six shillings, and sixpence left."

comment 3y ago · link · parent

My understanding is that Stream internals are a very complex piece of software that can have multiple different bugs. By the way, I agree with you that eager versions of the Stream methods should also be available directly on the collections.

comment 3y ago · link · parent

The latest Mockito works with Java 21; you'll just see a warning about the usage of the bytebuddy agent. In the future, you'll need to explicitly approve the loading of agents (you can call it "magic"), which will improve the security of your programs.

comment 3y ago · link · parent

I hope that 2024 will be the year when people stop pointing to duplicate or fixed bugs...

comment 3y ago · link · parent

The question of "single UI or GPU bound thread" could be solved in a future release with custom virtual thread schedulers. Java 21 concentrates on solving the problem of server-side applications.

comment 3y ago · link · parent

Ideally knowing "what is synchronous and what is asynchronous" shouldn't be your concern, just like freeing memory isn't your concern in a language with garbage collection. Similarly, you don't have to know the "real" memory addresses when using virtual memory.

Ask yourself why do you want to know what is asynchronous. In a typical server-side app synchronous, blocking, thread-per-task code is easy to write and read. There is only one drawback: you can run out of kernel threads. Asynchronous code solves this problem, but virtual threads solve it in a better way, because you can have three orders of magnitude more virtual threads compared to kernel threads. Ultimately, it's all about the number of threads you are allowed to use.

comment 3y ago · link · parent

Oracle's main Java product (OpenJDK) is 100% open source and free to use. If you also want extra support, then you can also use the "Oracle JDK", which is technically the same as OpenJDK. The only difference is the support, which of course was never free.

comment 3y ago · link · parent

Indeed.

> The Franco-Swiss border runs through the CERN campus and building 31 is literally just a few feet into France. However, there is no explicit border within CERN and the main entrance is in Switzerland, so the situation of which country it was invented in is actually quite a tricky one. The current commemorative plaque, which is outside a row of offices where people other than Tim Berners-Lee worked on the web, is in Switzerland. To add to the confusion, in case Tim thought of the web at home, his home was in France but he temporarily moved to rented accommodation in Switzerland, just around the time the web was developed.

https://davidgalbraith.org/uncategorized/the-exact-location-...

comment 3y ago · link · parent

They claim that "Reddit, Slack, Gmail, Uber, etc" could also be done with a similar level of effort.

comment 3y ago · link · parent

Here's a tested ChatGPT prompt:

Suggest better variable and method names in the following Java code. Don't list the new code, only the changes, in the format "oldName" => "newName". You can also suggest multiple alternatives in the format "oldName" => "newName1" or "newName2"

In my experience, 90% of the proposed changes are bad, but occasionally it does have good ideas.

Of course, you shouldn't upload your company's code to OpenAI, but you can try it out on open source or experimental projects.

comment 4y ago · link · parent

Fischer announced Fischer Random Chess in 1996, long after his retirement from competitive chess (1972). His reason for doing so in 1996 was very prosaic: he was simply no longer familiar with modern opening theory.