Re:Show HN: A minimal Fortran TCP client and server
by tlb on Wednesday October 30, 2019 @09:49PM
(#21404944)
The C language specification doesn't require a pointer to have finite size. Just because every C implementation has a limit, it doesn't mean the language itself does.
[ Parent
| on HN ]
Re:Show HN: A minimal Fortran TCP client and server
by tzs on Wednesday October 30, 2019 @10:06PM
(#21405018)
Doesn't it imply that it must be finite, because you can use sizeof() to find its size, which yields something of type size_t, which has maximum size SIZE_MAX?
Re:Show HN: A minimal Fortran TCP client and server
by trillic on Wednesday October 30, 2019 @11:18PM
(#21405439)
The idea is that theoretically a perfectly portable C program could be written and work on problems of any size given sufficiently large hardware and a compiler implementation that takes advantage of that hardware.
Unlike a Fortran77 program, a portable C program doesn't have to change to support orders of magnitude changes in problem size.
Re:Show HN: A minimal Fortran TCP client and server
by jimws on Wednesday October 30, 2019 @11:33PM
(#21405509)
You did not answer the question of SIZE_MAX being the limit. So here it is once again:
> Doesn't it imply that it must be finite, because you can use sizeof() to find its size, which yields something of type size_t, which has maximum size SIZE_MAX?
Re:Show HN: A minimal Fortran TCP client and server
by tlb on Wednesday October 30, 2019 @11:56PM
(#21405611)
You could take the exact same C program and run it on a compiler+computer with sizeof(void *) == 64 or 128 or 1000000, and it should handle a correspondingly huge problem.
Re:Show HN: A minimal Fortran TCP client and server
by yiyus on Thursday October 31, 2019 @07:44AM
(#21407656)
I am not sure that would be valid. You could also use a defined constant as the limit in the Fortran program. In other words, you could argue that SIZE_MAX is part of the program, the same as the Fortran array size is defined in the program. But I am not sure it would be invalid either... just wondering.
Re:Show HN: A minimal Fortran TCP client and server
by Amelorate on Thursday October 31, 2019 @12:27PM
(#21410534)
Wouldn't it be possible to, with a really strange number format for integers, define SIZE_MAX as INFINITY? C doesn't require twos-compliment numbers, after all.
Re:Show HN: A minimal Fortran TCP client and server
by yiyus on Thursday October 31, 2019 @02:37PM
(#21412154)
> Wouldn't it be possible to, with a really strange number format for integers, define SIZE_MAX as INFINITY?
That's a very interesting question that got me thinking for quite a while and the only conclusion I reached is that you deserve an upvote.