News for hackers. Stuff that matters.
Re:The hunt for the missing data type by kragen on Monday March 04, 2024 @05:55PM (#39597267)
it's true that numbers are very abstract, which is what makes it so easy to design apis for them

the python runtime includes four built-in number types (small integer, arbitrary-precision integer, float, and complex) and the python standard library includes two more number types (decimal and fractions), and one of the most popular non-standard libraries for python is numpy, which provides some other kinds of numbers such as single-precision floats, vectors, and matrices. other systems like pari/gp have number libraries that provide other kinds of numbers, such as p-adic numbers and galois field elements

the only programming languages i've ever used that didn't have 'number' libraries were esoteric languages like brainfuck and the lambda calculus

Re:The hunt for the missing data type by ysofunny on Monday March 04, 2024 @08:34PM (#39598383)
numbers have all of mathematics as a background which is what makes it so easy to design apis for them

graphs are a much newer development, I think there's a very deep connection between category theory and graphs in general (and also computers make both much more useful somehow)

lambda calculus can be used to define numbers but it's a wonky construction, it's reminiscent of how sets can also be used to define numbers.

Re:The hunt for the missing data type by kragen on Monday March 04, 2024 @08:42PM (#39598457)
that seems reasonable