News for hackers. Stuff that matters.
Re:Aho – a Git implementation in Awk by bagful on Saturday February 10, 2024 @07:38PM (#39331652)
I love AWK. Its stringly-typedness would make a Javascript programmer blush: 0, “”, and actually-nothing are identically falsey. Numbers are no different from strings representing numbers, like Lua. Somehow, I don’t mind — if you really need to keep your numbers numbers and strings strings, sigilate the value (prepend with #/$) and peel it off with a substr() later.
Re:Aho – a Git implementation in Awk by garaetjjte on Saturday February 10, 2024 @07:58PM (#39331761)
Lua does not represent numbers with strings. It does have number type which is always floating-point.
Re:Aho – a Git implementation in Awk by nmz on Saturday February 10, 2024 @08:22PM (#39331873)
Integers were introduced in 5.3.
Re:Aho – a Git implementation in Awk by samatman on Saturday February 10, 2024 @10:18PM (#39332388)
I like the way Lua handles strings and numbers quite a bit. They're different types, but arithmetic will convert a string to a number when it can.

This is without footguns, because concatenation is a different operator entirely.

    2 + "3"  -- 5 
    2 .. "3" -- "23"
It's rather convenient, especially when you can combine it with LPeg to parse files with numbers in them, then do the maths directly.