News for hackers. Stuff that matters.
Re:I am disappointed by dynamic typing by mountainriver on Tuesday November 29, 2022 @01:14PM (#33791072)
100% agree with this. I recently had a problem in python where dynamically generating the classes was the cleanest implementation.

What I found was basically no IDEs supported runtime generation of code for things like autocomplete. Jupyter does but it’s a limiting environment.

It made me realize this is a mostly unexplored space with little tooling

Re:I am disappointed by dynamic typing by compiskey on Tuesday November 29, 2022 @01:24PM (#33791206)
Been thinking about this as well. Working on language native libs to react to eBPF telemetry and scale logic forks appropriately to avoid exhausting the host, motivated by disdain for Docker/k8s. I’d rather just import a dep and develop the behavior.

But I don’t have to time to write all that. So I have actually been writing helper scripts to generate object code and function signatures via ast libs.

This is how I originally “learned programming” in the 90s. The industry zeitgeist shifted to “churn out code” and all that wizardry was lost. I have no idea how to prove it but I sometimes think it was intentional to capture worker agency.

It’s been fun reconnecting to it but the ecosystem of helper tooling … well there is none. Tons of blogs with basics about for loops though.

Re:I am disappointed by dynamic typing by williamcotton on Tuesday November 29, 2022 @01:23PM (#33791189)
Interesting! I would love if you could expand on your recent problem and also how this applies to OP!
Re:I am disappointed by dynamic typing by quonn on Tuesday November 29, 2022 @01:18PM (#33791116)
I think F# could do this well.
Re:I am disappointed by dynamic typing by Koshkin on Tuesday November 29, 2022 @01:25PM (#33791222)
Re:I am disappointed by dynamic typing by bob1029 on Tuesday November 29, 2022 @01:29PM (#33791270)
See also - Source Generators, which can replace some forms of reflection.

https://learn.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/s...

Re:I am disappointed by dynamic typing by int_19h on Tuesday November 29, 2022 @11:09PM (#33796917)
A big reason why this kind of stuff doesn't quickly become unreadable in C# is that the output of a source generator must be a new file. So the ability to extend existing code is limited to the facilities that the language specifically provides for this purpose (partial classes & members, extension methods etc). It also means that tooling can treat all such generated code as virtual files, allowing them to be inspected, debugged etc.
Re:I am disappointed by dynamic typing by quonn on Wednesday November 30, 2022 @05:07AM (#33798871)
I meant this which is different: https://learn.microsoft.com/en-us/dotnet/fsharp/tutorials/ty...

For example, there is an SQL provider that gives you generated types and auto-complete but it does this without running a source generator that emits files. It just happens inside the compiler.