News for hackers. Stuff that matters.
Re:Modernizing AWK, a 45-year old language, by adding CSV su... by carlmr on Thursday May 12, 2022 @09:18AM (#31353699)
I still think objects are great, but PowerShell makes it so hard to deal with them.

I think F#-interactive (FSI) with its Hindley-Milner type-inference, would have been a much better base for a shell.

Re:Modernizing AWK, a 45-year old language, by adding CSV su... by gpvos on Thursday May 12, 2022 @09:45AM (#31354075)
I'm not familiar with F#, but I do hate CSV tools that try type inference on data; in my opinion the csvkit tools should have the -I option on by default.
Re:Modernizing AWK, a 45-year old language, by adding CSV su... by carlmr on Thursday May 12, 2022 @10:06AM (#31354409)
F# does type inference like this:

    let x = 1;
x is now an integer. Now you can't do

    printfn "%s" x;
Only

    printfn "%i" x;
So it has strong static typing, but most of the time you don't need to be explicit about them. It can even infer function types.

If you use FSI (F# interactive( it will always print the signatures in between, so that it's really easy to explore interfaces.

Re:Modernizing AWK, a 45-year old language, by adding CSV su... by majkinetor on Thursday May 12, 2022 @10:10AM (#31354461)
> I still think objects are great, but PowerShell makes it so hard to deal with them.

LOL, this is amazing...

Re:Modernizing AWK, a 45-year old language, by adding CSV su... by carlmr on Thursday May 12, 2022 @12:32PM (#31356427)
The thing is, I've used .NET a lot, and C# and F# I can code in my sleep. The same object system, integrated in PowerShell, makes it really hard to use.
Re:Modernizing AWK, a 45-year old language, by adding CSV su... by majkinetor on Thursday May 12, 2022 @01:46PM (#31357523)
That is even more amazing.

What makes it "so hard". $object.Proprety or $object.Method() is the same. new versus new-object? [type] vs type ?