HNHacker News
TopNewBestAskShowJobs

_old_dude_

819 karma · joined January 8, 2017

submissionscomments
_old_dude_··on .NET Myths Dispelled
If you can, you can give a try to Quarkus, while the doc is not up to the level of Spring, in term of ergonomics, configuration, hot reload, test containers, this is closer to what .NET does, by example annotations are optional and are resolved at compilation not at the execution.
_old_dude_··on Coral, a Cobra fork with nearly all its features, but only 4 dependencies
I've recently used rewrite that comes with YAML recipes [1] for the common refactoring

[1] https://docs.openrewrite.org/reference/yaml-format-reference

_old_dude_··on Black, the uncompromising Python code formatter, is stable
prettier [1] and google-java-format [2]

[1] https://prettier.io/ [2] https://github.com/google/google-java-format

_old_dude_··on In defense of complicated programming languages
The two main advantages of using classes are:

a class is also a type (if you have a typed language),

a class is also a module, you group together values that makes sense together (the x and the y of a point) with the functions (methods) that interact with it.

When you have a lot of codes flying around, you can add encapsulation (private/public thingy) so the user of a code does not see the implementation which helps to create libraries that can evolve independently from the applications using them.

Also compared to an associative array, a class is more compact in memory (granted JavaScript runtimes see dictionaries as hidden classes).

_old_dude_··on From TypeScript to ReScript
The problem with the add types later approach is that in the end you have half baked .ts files left and right. And it becomes increasingly difficult to know when something compiles if it's because it's correct or because there is an any somewhere.
_old_dude_··on “I am literally losing sleep” over Java (1996)
Oracle did not open sourced Java, Sun did before dying.

But you are right that Oracle unified all paid/free versions of Java under the OpenJDK banner, even Android is using the OpenJDK now.

_old_dude_··on “I am literally losing sleep” over Java (1996)
The "dynamic" keyword [1] is my favorite blunder in C#. It's great if you are use it for COM interropt but it's awful otherwise.

The code compiles but from time to time it fails at runtime and performance are sometimes Ok, sometimes not depending on the call stack.

[1] https://docs.microsoft.com/en-us/dotnet/csharp/programming-g...

_old_dude_··on Swift Roadmap for performance predictability: ARC improvements and ownership
That why the next step is to introduce move-only types to have the same defaults as Rust.
_old_dude_··on State of Valhalla
I believe JEP 401 has not yet been updated to the new model, there is no .val anymore, instead there are nullable value types and non nullable primitive types, only the latter has a .ref box because the former is a reference.

Optional will be retrofitted to a value class not a primitive class, you get flattening but only on stack (parameter type or return type) not on heap (field).

I don't really understand the end of the part3 (the VM model), so i may be wrong.

_old_dude_··on Generics facilitators in Go
> it means that the entire compile time set of problems is also lifted into runtime

It's what Swift does if inlining is defeated, the type arguments are passed at runtime as a classical argument on stack.

You don't need full reflection as you suggest, only to be able to materialize the types as structs + an interface at runtime. Yes, it's a little slower but most of the overhead comes from the function not be inlined.

_old_dude_··on PR to Merge Multicore OCaml
You can try reason first, it's a frontend for OCaml with a C-like syntax

https://medium.com/@asankhaya/reason-with-ocaml-b75697a6c00b

_old_dude_··on Log4j 2.15.0 – Previously suggested mitigations may not be enough
More realistically, this code is 20 years old, several generations of maintainers worked on it, accumulating patches over patches over patches and nobody wanted to be the guy that say No / we should remove that feature.

You can see the discussions on HN about Gnome removing features as a good example about how hard it is.

_old_dude_··on CISA Director on Log4j Vulnerability
The idea of having different declarative security realms is fine but it's not what the Java Security Manager is.

The Java Security Manager is an API that allows to intercept and run codes, so devs use it as a Trojan Horse to patch code instead of fixing the root of the issue.

The Java Security Manager should die.

_old_dude_··on Log4j: Between a rock and a hard place
10 years ago, with DDOS attacks using hash table collision [1]. It was a sad Christmas, lot of RoR servers to patch.

[1] https://www.securityweek.com/hash-table-collision-attacks-co...

_old_dude_··on Magnus Carlsen wins longest world chess championship game of all time
Every time i see her, i see Anya Taylor-Joy in the Queen Gambit ...
_old_dude_··on New in C# 10: Easier Lambda Expressions
Very true, Java was late in the game in term of SIMD loop optimizations compared to C#.

Oracle engineers did the first implementation for Java 7, more recently it's mostly contributions from Intel, AMD and ARM [1].

[1] https://cr.openjdk.java.net/~vlivanov/talks/2019_CodeOne_MTE...

_old_dude_··on Go does not need a Java-style GC
It has nothing to do with the language but with the API / VM capabilities.

Both those restrictions are fixed, granted that this is not yet in the offical API, it's an incubation module (the equivalent of from __future__ of Python).

https://docs.oracle.com/en/java/javase/17/docs/api/jdk.incub...

_old_dude_··on Java and Scala’s type systems are unsound (2016)
This trick does not work with Java 11+, you can not peek and poke the JDK internals anymore.

It's the reason why the transition from Java 8 to 11 has been painful.

_old_dude_··on What's next for language design? (2017)
One of the issue with structural types is compiler error messages. By example, C++ templates are structural types and error messages are really hard to decipher.

Recent versions of Java (Java 8+) avoid structural types but provide structural conversions + inference.

We will see with the recent introduction of named records/tuples goes in the same direction or not.

_old_dude_··on What's next for language design? (2017)
There are interoperable since Java 8, using the operator ::

  com.google.common.base.Predicate<String> guavaPredicate = ...
  java.util.function.Predicate<String> predicate = guavaPredicate::apply;
_old_dude_··on Ask HN: What mental models do you use everyday?
1. imitate to understand the rules

2. create following the rules

3. break the rules

_old_dude_··on Metaobject protocols: Why we want them and what else they can do (1993) [pdf]
The idea is to let users of a language, here CLOS, to be able to intercept meta-messages like instance creation, method call, property access, etc to provide their own implementations.

It's like the doesNotUnderstand in SmallTalk, method_missing in Ruby or more recently .Net Dynamic Language Runtime or invokedynamic in Java.

_old_dude_··on New 16-inch MBP with M1 Max to feature High Power Mode for intensive workloads
I will show my age, but is there a turbo button [1] ?

[1] https://en.wikipedia.org/wiki/Turbo_button

_old_dude_··on Overhead of Returning Optional Values in Java and Rust
I expect Java to be slower, Optional was introduced as an afterthought not as a native construct like in Rust.

Sadly, the two benchmarks are not equivalent, the Rust version loop over ints, the Java version loop over longs.

Looping over longs is notoriously slow in Java, because there is no vectorisation and the JIT insert insert a GC checks because looping over longs may take a long of time.

Also one of the codes uses Optional<Long> instead of OptionalLong, so the code does a double boxing long -> Long -> OptionalLong.

_old_dude_··on Esbuild – An extremely fast JavaScript bundler
Browsers are good at caching JavaScript files, so it depends if the scripts are already cached or not.
_old_dude_··on High-performance garbage collection for C++ V8 (2020)
Here is the related research paper https://duckduckgo.com/?q=Cross-Component+Garbage+Collection
_old_dude_··on Asynchronous Programming in C#
Implementing coroutine requires to change to the code generator, the runtime and the garbage collectors and there is no general consensus on the way to implement them efficiently => this requires a huge investment in engineering.

For Rust, one of the feature of Rust is to have a minimal runtime, so using a compiler transformation seems a good fit.

For C#, Microsoft has a limited number of people working on the runtime of DotNet. Async/await was developed at the same time DotNet was transitioning to DotNet Core which also requires massive engineering, so it was about priority. The future will tell if at some point coroutine will be added to DotNet.

_old_dude_··on Revisiting Java in 2021 – Part II
This FAQ is about Java SE builds, not the OpenJDK builds.

Java is Still Free (2019) https://medium.com/@javachampions/java-is-still-free-2-0-0-6...

I don't know if there is a more recent version

_old_dude_··on How much faster is Java 17?
You can use the Spring AOT plugin [1] without enabling the support of GraalVM native image

[1] https://docs.spring.io/spring-native/docs/current/reference/...

_old_dude_··on How much faster is Java 17?
You mean Spring native [1], i think it's not ready yet.

[1] https://docs.spring.io/spring-native/docs/current/reference/...

← PreviousPage 5 of 11Next →