News for hackers. Stuff that matters.
Re:Don't run 'strings' on untrusted files by akira2501 on Saturday October 25, 2014 @03:50PM (#8509189)
http://www.lysator.liu.se/c/bwk-on-pascal.html

It's a hobby horse by this point, but it makes it clear that the Pascal of 30 years ago is not the Pascal of today. The same can be said of C.

These languages have evolved to be where they are today, mostly because hardware has evolved to be where it is today. Castigating past decisions as laziness really seems to be ignorant of this process, what it involved, and why it was necessary to make the decisions that we have up until now.

Engineering, on the whole, is the art of compromise.

Re:Don't run 'strings' on untrusted files by zanny on Saturday October 25, 2014 @10:00PM (#8510046)
Reading through some gstreamer code this weekend, I contend that "C of 30 years ago is not the C of today".

It is still all the most horribly insecure and obtuse passing of raw pointer manipulation and bitwise logic ever. The preprocessor is still hell on software. Every variable is named something like gst_hello_world_parser_box because when you write complex software in it you always get huge name conflicts.

It still thinks the best way to manage memory is to not manage it at all. People complained for so long about having to put your deletes in destructors in C++, too bad you have no such thing in C at all - you don't have classes, after all. Guess it has to go in the procedural function logic. Like 30 years ago.

Re:Don't run 'strings' on untrusted files by lazyjones on Saturday October 25, 2014 @08:10PM (#8509849)
> These languages have evolved to be where they are today, mostly because hardware has evolved to be where it is today.*

No. Pascal and Modula-2 were perfectly usable, safe systems programming capable languages 20 years ago. Pascal was widely used in commercial product development (DOS/Windows), Modula-2 was scarce, but taught at universities with high quality development environments available for many platforms and the Oberon OS was based on the language Oberon, which was heavily influenced by/derived from Modula-2.

Everything necessary to produce safe, maintainable, fast software was available back then, but lazy/uneducated/stubborn people used C instead and wrote crappy software we still have to use today. It's a shame really.

Re:Don't run 'strings' on untrusted files by alayne on Saturday October 25, 2014 @11:17PM (#8510148)
I'm sure Pascal was really the silver bullet and its failure had nothing to do with Pascal derivatives being academic, non-portable, not very expressive, and having numerous other issues.

I think your ad hominem comments about people who implemented in C are in poor taste and not based in reality.

Re:Don't run 'strings' on untrusted files by 4ad on Sunday October 26, 2014 @05:55AM (#8510674)
I don't understand why we talk about Pascal at all, since Pascal is just as memory-unsafe as C.
Re:Don't run 'strings' on untrusted files by pjmlp on Sunday October 26, 2014 @06:30AM (#8510726)
No, because Pascal offers proper strings, bound checked arrays,open arrays, real enumerations, numeric ranges and reference parameters.
Re:Don't run 'strings' on untrusted files by ajuc on Sunday October 26, 2014 @06:22AM (#8510716)
in one important practical aspect it isn't - strings are length+content in pascal, not null-delimited as in c. It's very important difference.
Re:Don't run 'strings' on untrusted files by 4ad on Sunday October 26, 2014 @07:19AM (#8510787)
You read into buffers, not strings. You can easily have buffers overflows. Pascal arrays are bounds checked, but not when it matters: http://wiki.lazarus.freepascal.org/Secure_programming#Buffer....
Re:Don't run 'strings' on untrusted files by lazyjones on Sunday October 26, 2014 @07:44AM (#8510828)
The problems mentioned there (assigning to array elements with out-of-bounds indices) can be avoided by using range checks (-CR option for fpc). It's strange (and silly) that this is apparently off by default for fpc, but it's not a language feature of Pascal.
Re:Don't run 'strings' on untrusted files by pjmlp on Saturday October 25, 2014 @04:57PM (#8509387)
> April 2, 1981

USCD Pascal was created in 1978, Mesa in the mid-70s and Algol in 1968.

Most of the complaints don't apply to them.

Re:Don't run 'strings' on untrusted files by cbd1984 on Saturday October 25, 2014 @06:21PM (#8509581)
> UCSD Pascal

bwk's point, then as now, was that once you deviated from Standard Pascal, you had to either bet on a specific horse in the non-standard Pascal race, or develop your own Pascal-like language with its own inherent defects, similar to but different from the defects of Standard Pascal and other Pascal-like languages. Your code would likely never interoperate with anyone else's Pascal variant.

C, which had one de facto standard implementation and less genetic drift (because the standards, first K&R and then ANSI and ISO, were never as terrible as Standard Pascal's definition), didn't suffer from this nearly as much.

Mesa didn't, either, but only because it was fairly obscure, and there sure were a lot of Foogols running around for a while, of which Pascal and its semi-clones formed only one family.

Re:Don't run 'strings' on untrusted files by pjmlp on Sunday October 26, 2014 @02:09AM (#8510354)
Nothing of this was relevant in 1981.

The first K&R was published in 1978, ANSI/ISO C in 1989.

In 1981 C only mattered if you had access to a UNIX system, there were hardly any K&R compliant compilers.

Anyone using C outside a UNIX system was also betting on a specific horse.

Which is one of reasons why ANSI C has so much undefined and unspecified behaviours defined, as the committee didn't want to rule out any implementation.