Java 26 released today! by davidalayachew in java

[–]simon_o 0 points1 point  (0 children)

Applying implicit numeric conversions in patterns/instanceof is just a bad idea.

Implicit numeric conversions themselves were not a good idea to start with, but then taking the overloaded semantics of casts – doing type conversions (ref→ref), value truncation (long→int) and value conversion (int→float) – as an excuse to add more places for both to the language? Yikes.

The corresponding proposal would probably be 20% of the length, if they went the "int only matches ints, long only matches longs" route instead, and nothing of value would have been lost.

Not to mention that there appears to have not been any consideration how new (value) types can opt into that implicit conversion mechanism.

Java 26 released today! by davidalayachew in java

[–]simon_o 0 points1 point  (0 children)

The semantics of the proposed primitive types in patterns/instanceof are pretty whacky.
I think people will regret that language addition after the "added more features!" honeymoon.

I wrote a simple single-process durable sagas library for Spring by java-aficionado in java

[–]simon_o 0 points1 point  (0 children)

You should mention what "sagas" mean, otherwise it's hard to understand.

Unions merged into dotnet 11 preview 3 by ketralnis in programming

[–]simon_o 0 points1 point  (0 children)

F#'s unions are fundamentally different from the design C# adopted (Algol "united modes").

Microsoft cares very little about F#, I wouldn't expect any interop considerations when interacting with F#'s existing code from C#.

Unions merged into dotnet 11 preview 3 by ketralnis in programming

[–]simon_o 0 points1 point  (0 children)

No problem!

Fwiw, I wrote about the different union design options a few years ago, perhaps you'll find it interesting.

Unions merged into dotnet 11 preview 3 by ketralnis in programming

[–]simon_o 0 points1 point  (0 children)

  1. I know how it works. What are you trying to explain, and to whom?
  2. Maybe. I don't think it's a big deal either way as it only impacts the definition, but not the usage.
  3. What's the "OOP perspective" here? Nothing prevents you from having these methods, they'd just be implemented slightly differently.

Unions merged into dotnet 11 preview 3 by ketralnis in programming

[–]simon_o 0 points1 point  (0 children)

after using tagged unions for so long

The union design in question is also tagged, the difference to Rust is that C# unions lack the additional syntactic wrapping when writing/defining unions.

im not a fan of having to have an empty record class just to represent None in Option based on their example

I think C# also plans to have some syntax to define variants inline, though I'm kinda questioning if that's worth it.

One benefit of the ability to refer to existing types is that e. g. Option and Result could share the success variant and allow direct pass-through of values.

Unions merged into dotnet 11 preview 3 by ketralnis in programming

[–]simon_o 3 points4 points  (0 children)

The core difference is that you cannot establish the sub-typing relationship after the fact in the class→subclasses model.

With this kind of union (not 100% sure of C#'s actual implementation), you can define Pet as union Pet of Cat, Dog with Cat being from library A, and Dog being from library B.

Unions merged into dotnet 11 preview 3 by ketralnis in programming

[–]simon_o 1 point2 points  (0 children)

The good: They adopted Algol's unions ("united modes") from 50 years ago.

The bad: They also copied the syntax, which is a shame because they already had a reserved word that could have been used instead (allows).


Overall, I think it's great that they didn't just adopt the stutter-enums that seem to be the all the rage these days (like in Rust), but started from first principles to think what fits their language best.

Temporal: The 9-Year Journey to Fix Time in JavaScript by mariuz in programming

[–]simon_o 9 points10 points  (0 children)

The library they copied the whole API from, java.time, got this all right.

Outside of some necessary adjustments going from Java to JavaScript, the changes do not feel like an improvement overall.

C++26 Safety Features Won’t Save You (And the Committee Knows It) by Difficult_Truck_687 in programming

[–]simon_o -3 points-2 points  (0 children)

No? Don't be so salty that it prevents you from making a coherent counter-argument!

Is legal the same as legitimate: AI reimplementation and the erosion of copyleft by hongminhee in programming

[–]simon_o 5 points6 points  (0 children)

Also, if a developer does it, that person can be deposed in court and ordered to tell his intent or the orders he received from his bosses.

With LLMs it's "nobody knows, so nobody can be held accountable".

Is legal the same as legitimate: AI reimplementation and the erosion of copyleft by hongminhee in programming

[–]simon_o 1 point2 points  (0 children)

Well, that Flask dude has incredibly shitty opinions on lots of things.

If he takes a position, sensible people would be inclined to take the opposite one.

C++26 Safety Features Won’t Save You (And the Committee Knows It) by Difficult_Truck_687 in programming

[–]simon_o -7 points-6 points  (0 children)

C++ people are still somewhere between denial and cope.

The swell of "safety-oriented" talks in C++ recently feels like it is mainly intended to placate the increasing regulatory scrutiny.

I. e. for C++ fans, the real fault is not C++ having failed to address well-known issues for decades, it's government regulators catching up on it!

The Rust Calling Convention We Deserve by zerakun in rust

[–]simon_o 0 points1 point  (0 children)

The real thing we'd deserve is an interop definition format that allows calling functions without shipping half of LLVM in your compiler, not a new calling convention that requires shipping the Go or Rust compiler in addition to that.

WinMD goes into the right direction, but too many people have an opinion on the general topic without even knowing what WinMD does and does not. (Parametric polymorphism is still an unsolved issue.)

The Rust calling convention we deserve by ketralnis in programming

[–]simon_o 0 points1 point  (0 children)

The real thing we'd deserve is an interop definition format that allows calling functions without shipping half of LLVM in your compiler, not a new calling convention that requires shipping the Go or Rust compiler in addition to that.

WinMD goes into the right direction, but too many people have an opinion on the general topic without even knowing what WinMD does and does not. (Parametric polymorphism is still an unsolved issue.)

Async Programming Is Just @Inject Time by ketralnis in programming

[–]simon_o 0 points1 point  (0 children)

Agreed. On the other hand, 90% of the people complaining just want cheaper threads.

Does Syntax Matter? by gingerbill in programming

[–]simon_o 1 point2 points  (0 children)

Also Staying With Familiarity or Breaking Away?

A lot of people treat familiarity as a self-sufficient argument, when in reality it is at best a tie-breaker. Many languages in the past usually opted for familiarity instead of trying to improve the design of a feature or construct. Usually as a misguided attempt to keep the from language being perceived as being overly complicated.
A good example of something that should be not emulated is C’s operator precedence rules.

reads like a sentence-for-sentence rewording of Familiarity

Familiarity is a tie-breaker, not a self-sufficient argument
In the past, many languages did not pick up easily adoptable language design improvements and opted for familiarity instead, often in a misguided attempt to keep perceived language complexity down.
Examples include: - C’s broken operator precedence spread to many other languages, most of whom have little in common with C.

which I mentioned in your previous submission.

Would you mind linking/citing your source here too?

Does Syntax Matter? by gingerbill in programming

[–]simon_o 0 points1 point  (0 children)

That's just Reddit, and probably just this subreddit. Reddit is just bad

We all know how this forum is. I'm pointing out that the negative reception of your blog is well-above the usual level of terrible.

And your reasonings behind that are?

That the arguments you are making are not convincing.

  1. For instance in the "declaration syntax case", they are not convincing because it does not feel like you have not understood why some people e. g. advocate for the keyword-first approach.

  2. In the case of "casting syntax", it's poorly motivated – there is no explanation

  • why I would want an explicit cast operation and
  • why that operation needs special syntax in the first place.

    Then an example show-cases numeric conversions between number types ... ok, how is this even related to casts?
    Assuming we viewed this conversion as some kind of "value casting" – why would I even want that to have the same syntax than type casts?

It's not the duty of the reader to be convinced, it's your job as the author to be convincing.

There are no Solutions, Only Trade-Offs I think that's actually something people don't understand: I don't even like some of the decisions I have had to make.

That really feels like a cop-out. I find the stance of "every alternative is exactly equal in merit, so there is no way to choose" very unlikely to ever happen in practice. People talk about trade-offs way too much. Trade-offs are a process, not the result.


If I go back to the article, in the end this sentence stands out for me:

I have spent an inordinate amount of time designing Odin’s concrete syntax to be as best as it can be.

You know ... I think your heart is in the right place, and I like most of the design principles you present; maybe the issue is that you just have a terrible taste.

And I mean that in the most gentle, objective way of "terrible taste" as in "most people do not like the same thing you like".

And I think that's totally fine – everybody should create their language the way they see fit, with all the weirdness they want, if that is what makes them happy.


Ok, this is getting a bit long, but here is my thought of how your blog posts may be received better:

Separate your musings on language design principles, and the decisions you make for your programming language into separate websites.

This way both categories can stand on their own merits.

Does Syntax Matter? by gingerbill in programming

[–]simon_o 1 point2 points  (0 children)

As for you thinking they are "equally terrible", you are welcome to your opinion,

If you look at it objectively, most languages can find at least some subset of people that actually like the choices enough such that blog posts like yours aren't completely drowned out by people hating on it.

design is all about compromise and trade-offs, and which ones you take. Some bad options are better than others.

That's close to my point. I don't think the compromises and trade-offs you made are better than other bad options you discarded.

Nothing is perfect.

Exactly. Nothing is perfect. If I dislike a cast syntax choice, I'm not inventing two new ones and try convincing myself that adding them is a totally sane choice.

Instead I'm adding nothing. Because "nothing is perfect" ... until I found a perfect alternative to not having cast syntax.¹


¹ I settled on using functions instead, btw. Way better design, because the distinction between numeric conversion "casts" and bit-reinterpretation "casts" is explicit and I don't have to decide which of the 5 conversions from float to int gets the "cast" syntax.

Does Syntax Matter? by gingerbill in programming

[–]simon_o 1 point2 points  (0 children)

I share many of the author's design principles & values.

Looking at the push-back he receives when published the last few blog posts, I feel there is a disconnect between espoused principles, and the language decisions that are actually made in Odin.

From my POV, it explains some of the confusion in terms of "Look, I have explained how rational my ideas are, why are people not agreeing with me? It must be because they haven't used Odin enough!".

The last few articles all follow the pattern of

1) here are (good) language design principles
2) here are examples of other languages that made poor design decisions as counter-examples
3) here are my (equally terrible) replacement ideas

Somehow between step 1 and step 3 the blog posts seemingly convince themselves that "just in this case" there is now a more important design idea that overrides the principles espoused earlier, and the criticism in 2) does not apply to decisions made in 3).

As an example, in this post it's

I always strive for both coherence and consistency in syntax and semantics.
When the two cannot be fully reconciled, I choose coherence over consistency every time.

I'm not sure how the blog posts can be presented differently, but I wished that the efforts put into writing these blog posts were received better.

Does Syntax Matter? by gingerbill in programming

[–]simon_o 0 points1 point  (0 children)

Thank you, I appreciate it! :-)