Being safe on the internet (was Re: Here we go again - ISP DPI, but is it interception?)
colinthomson1 at o2.co.uk
Tue Aug 10 17:48:36 BST 2010
Ian Batten wrote:
> And, by extension, you can write FORTRAN in anything, although I was impressed by
> this: http://queue.acm.org/detail.cfm?id=1039535
Actually it's pretty hard to write Fortran in Pascal version 1. That's because Pascal 1 is a BAD thing, not because it provides useful extra protection.
Pascal v1 did exclude some of the worst security errors, but it precluded use of a very large number of useful, safe and secure (and for an engineer, essential[note 1] algorithms.
Kernighan's critique is on the web at http://www.lysator.liu.se/c/bwk-on-pascal.html.
[note 1] Something I have often had to have is a means of getting the inverse and/or the eigenvectors of a linear transformation. In Fortran I can easily write a subroutine that accepts an array, checks that it's 2 dimensional, square, and not degenerate, returns an error indication if it fails the check, and returns its (approximate because of rounding errors) inverse if it passes the check (or, often more usefully, returns its decomposition into primitive matrices: those representing operations of vector exchange within a matrix [note 2], scalar multiplication of a vector within a matrix, and vector addition within a matrix). In Pascal you can't do that at all because it's impossible, for example, to write a routine that will accept both a 2-element vector and a 3-element vector as parameter (the stupidest type system ever invented actively prevents this) so to solve the general problem you need an unbounded number of programmes (one for 2X2 matrices, one for 3X3 matrices, one for 4X4 matrices, and so on ad infinitum). Pascal is the only language I know [note 3] in which this subroutine is impossible to write.
[note 2]Vector exchange is used in this subroutine only to minimise rounding errors caused by the use of finite precision arithmetic. If full precision is maintained throughout it isn't needed.
More information about the ukcrypto