News for hackers. Stuff that matters.
Re:Some Memories of Niklaus Wirth by Martin Odersky by nickpeterson on Wednesday January 17, 2024 @07:03AM (#39026599)
It’s interesting that odersky helped put generics in Java and also made Scala. Don Syme helped put generics in .net, and then made F#. It feels like two people on a very similar trajectory.
Re:Some Memories of Niklaus Wirth by Martin Odersky by mjburgess on Wednesday January 17, 2024 @07:21AM (#39026730)
The question, "how do we make functional languages popular, (useful?) in the enterprise?" was a question in the air for, i'd, say decades. The 00s answer was to create a merger between enterprise langs (Java, C# etc.) and functional langs in a new language.

The net result, as we know now, was to push those langs to adopt functional features -- rather than to shift to others.

I suspect the question for the niche programming community, of the next decade, will be "how do we make effect systems popular?" or some such thing.

Or, "how do we make AOT metaprogramming popular?" etc. (cf., jai, zig... carbon, circle, ...)

I suspect if a post-C++ new-wave gets popular, with structural typing and ct metaprogramming, we might see the same in C# quite easily

Re:Some Memories of Niklaus Wirth by Martin Odersky by pjmlp on Wednesday January 17, 2024 @07:37AM (#39026880)
You already get them with code generators and Rosylin, but it is a bit painful to use.
Re:Some Memories of Niklaus Wirth by Martin Odersky by SideburnsOfDoom on Wednesday January 17, 2024 @08:46AM (#39027583)
There is also a new compiler feature, "interceptors" that swaps in calls at compile-time. https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/cs...

This looks very hard to use well, but that's because "it's not for you" to use directly in app code, rather it's a low-level building block for such AOT and code generation patterns and toolkits.

Re:Some Memories of Niklaus Wirth by Martin Odersky by pjmlp on Wednesday January 17, 2024 @09:10AM (#39027866)
I hate it, as it is a bad approach to what should have been a proper AOP framework like PostSharp or Microsoft Fakes.

Instead we will end with a special cased mini framework, designed to override reflection code for the purposes of AOT code generation.

Something that AOT toolchains for Java have solved much better with agents, PGO and config files.

From my point of view, it is neither a good approach to sort that out, nor a good AOP alternative.

Re:Some Memories of Niklaus Wirth by Martin Odersky by gfraiteur on Thursday January 18, 2024 @02:15PM (#39046246)
Agreed. Roslyn analyzers, code generators, refactoring providers and other extension points are not designed for application developers but are rather building blocks.

We built a code generation and analysis framework based on these Roslyn extension points. It's called Metalama: https://doc.postsharp.net/metalama.

Re:Some Memories of Niklaus Wirth by Martin Odersky by santiagobasulto on Wednesday January 17, 2024 @10:39AM (#39029198)
I didn't know Syme helped with generics in .net. Very interesting indeed.

I think it makes sense for these people to create their own "perfect" languages. I'm not aware of C#, but I know (or knew) Java very well. And Generics always was a half-baked option for a broken language.

From a purists' perspective, in Java "everything is an object", except ints or floats, but we have Integer or BigInt, but then we have `null`, but then... if Integer extends from Number, does that mean that a List<Integer> extends from List<Number>? Nobody knows...

Those things are what I feel Odersky wanted to solve and couldn't with Java, so he went "Bender Style".