Native Development on Small PCs

Discussions on programming older machines

Re: Native Development on Small PCs

Postby deathshadow60 » Mon Jan 10, 2011 10:38 pm

CommodoreJohn wrote:Still, given my druthers, I'll take a questionable language that was designed for flexibility and real-world use from the ground up over a questionable language that was hacked into flexibility and usability contrary to the entire spirit of the original project ;)

That's an arguement that you'll hear a lot -- but kind-of forgets that all the useful C dialects ALSO have been "hacked into flexibility" and have NEVER had the "and usability" aspect addressed properly.

Comparing the old vanilla Pascal to any ANSI C or even K&R is unfair at best -- and have you ever dealt with C prior to K&R? Hell, even Ansi C made improvements to the language that the mainframe environment pascals never saw. Is C++ less of a kludge than Object pascal or more?

Of course, that has ALWAYS been the real weakness of pascal -- it's not the language or the syntax, it's the compilers that are often the limiting factor... hence why Borland's implementation, especially once they "allegedly" borrowed object pascal from Apple remains the most successful "pascal" -- though as I often say Object pascal is NOT Apple's idea, it's actually just Modula-2 with a couple minor things renamed. Modula couldn't make it because I've NEVER seen a decent capable compiler for it... so they tricked us by changing a few minor things and calling it Pascal.

Seriously, apart from the swap between "class" and "object" -- just how much difference is there from Modula by the time of say... Delphi 3?

Though to me, the biggest advantage of Pascal comes from how objects work. In C++ and most objective C offshoots objects often feel shoehorned into the language and often LACK the versatile inheritance methodologies like ELF's or even proper handling of constructors/destructors. In pascals, objects feel like a natural extension to the language because they are nothing more than overglorified records that happen to have functions in them.

But then I always considered C's STRUCT's to be uselessly crippled because of the LACK of strict typecasting, definition on how it's supposed to be (or not be) packed, and of course the lack of a length-first string type or more importantly a by-type memory allocation/release mechanism. I'll stack NEW and DISPOSE against malloc/calloc/free any day (though a realloc might be nice!) -- especially with the ability to pass a constructor to NEW and a destructor to DISPOSE WITH parameters... especially when depending on the compiler your constructor/destructor may or may not get run when you allocate a pointer to a class or run the constructor. (really depending on dialect of C or the offshoot).

I can use C and C-dialect offshoots like JS, PHP, etc... but I always feel like kicking someone square in the nuts by the time I'm done.

Though at least so far we've not heard the crybaby "but the rules are too strict" nonsense from anyone. Whenever I hear that one I think the same people who sleaze out HTML 3.2, slap a tranny doctype on it and then try to pass it off as modern markup and professional quality work. Much like HTML 4 STRICT the rules put in place help prevent you from doing things you shouldn't be doing in the first place and making mistakes that can be avoided altogether. There's a fine line between order and anarchy -- and if people would just follow a few simple rules and use programming languages that prevented dumbass mistakes we wouldn't have 20 year old bugs in the BSD codebase still existing in OSuX, the ability to use a memory overflow in many jpeg decoders to actually execute code hidden in a image file, and the billions of other "overflow" type errors that occur due to the idiocy of actually trusting things like null terminated strings to stay in range, for buffer counters to actually EQUAL the end and not go past them due to some process you might not have control over or rogue encoding values in the data stream, etc, etc...

Heh yeah... let's face it, the top programming mistakes made by people using non-Wirth languages? A total lack of RANGE CHECKING and trusting input to be safe to process.
The only thing about Adobe web development products that can be considered professional grade tools are the people promoting their use.
deathshadow60
 
Posts: 62
Joined: Mon Jan 10, 2011 6:17 am
Location: Keene, NH

Re: Native Development on Small PCs

Postby CommodoreJohn » Tue Jan 11, 2011 7:07 am

Oh, I'm not going to claim that C was never ugly (and I can understand people saying it still is ;)) Still, while really old-school C is definitely a frightening beast (and even K&R is more than a little balky,) it's still something you can use - functionality that the language is missing can (by and large) be kludged in by hand, thanks to things like pointers and weak typing. Vanilla Pascal, on the other hand, is not only not useable for any kind of serious programming (array size as part of the data type? Bleargh!) it's not even extensible to fix any of its shortcomings - hence, as you point out, the different compilers all trying to make it more like other languages. While I am definitely impressed that Pascal devotees and compiler developers managed to extend it into something honestly usable, it still seems to me that their efforts are more along the lines of fighting the very nature of the beast they're trying to train, while C's development has been more about bringing order and sanity to what was already a usable (if most definitely hairy) language.

And on a more technical level, it's quite trivial to implement length-first strings in C, if you want them. Packed records and range checking less so, but even they become simple enough in C++ (whatever its other faults, it does provide a lot of opportunity for fitting such things into normal operations, thanks to operator overloading.)

And while I hear your complaint about people being lazy and making bad assumptions, I don't think more restrictive languages are the answer to that. A dumbass programmer is going to be a dumbass programmer no matter what language they work in, and the only real difference is what the symptoms of their idiocy will manifest as. C gives mysterious stale-pointer crashes, Pascal just refuses to compile - either way, the idiot is faced with his idiocy, and whether he learns from it is entirely on him.
Packard-Bell 286 (DOS 3.3, 32MB HD, 2.6MB RAM, HGC/EGA)
Tandy 1000TX (DOS 3.2, 640KB RAM, TGA)
CommodoreJohn
 
Posts: 28
Joined: Thu Apr 29, 2010 4:13 pm
Location: Minnesota, USA

Re: Native Development on Small PCs

Postby deathshadow60 » Tue Jan 11, 2011 8:49 am

CommodoreJohn wrote:thanks to things like pointers and weak typing.

I hear the pointers one a lot -- and I wonder how the devil people think vanilla pascal doesn't have pointers. DEC Pascal had them (first one I ever used back in '79), Alcor on the Trash-80 had them (though it was not a unique type -- you just referenced an integer with ^ and assigned it with @), DEFT had them on the CoCo, OS/9 Pascal had them, Turbo certainly had them... I can't imagine pascal WITHOUT pointers -- would make records a hell of a lot less useful. I know a LOT of people never quite grasped how to use ^ and @ in the first place and it was missing from many of the educational texts -- doesn't mean they haven't been part of pascal all along... Which to my knowledge they HAVE. It's why NEW and DISPOSE have been there since the start... Land sakes the first practical BTREE implementation was done using pascal records!

Which the 1973 document by Wirth describing the language will back me up on...
http://www.standardpascal.com/The_Progr ... l_1973.pdf

I have to ask, and it might sound silly -- are you sure you didn't have them, or were you just unaware of them and their use?

As to weak typing, given the ability to TYPECAST and the inclusion of functions to properly translate between types in the language specification (excepting perhaps string to number -- which is easy enough to code anyways) I fail to see how that is an issue. I hear people badmouthing strict typecasting all the time -- and I really wonder what the devil that's about. Maybe it's because I learned machine language FIRST (on a Cosmac Elf) where EVERYTHING is strictly typecast by the register size...

CommodoreJohn wrote:Vanilla Pascal, on the other hand, is not only not useable for any kind of serious programming (array size as part of the data type? Bleargh!)

That's because if you are going to use a dynamic element, you should be allocating a pointer to it, and then use a separate pointer (which is just a flat 16 bit integer on 8 bit systems) to increment as your index.

Which is why today you'll often find in my code:

Code: Select all
   bufferOffset:=bufferPointer;
   bufferEnd:=bufferOffset+bufferSize;
   while (bufferOffset<bufferEnd) do begin
      { do whatever you want with bufferOffset^ here }
      inc(bufferOffset);
   end;


The inc keyword (taken from modula) being better than doing a +1 since the amount it increases by is based on the size of the type of pointer -- since typed pointers have been in the spec since the start too. Could be:

bufferOffset:^word;
bufferOffset:^byte;
bufferOffset:^someAbsurdlyComplex3KRecordType;

But even before INC it was easy enough to say bufferOffset:=bufferOffset+sizeof(bufferOffsetType); all the way back to Wirths original implementation. I think people just got confused because type "integer" prior to ISO 7185:1983 was also your pointer storage. Type pointer having been added to the official spec to allow for increasing/decreasing the size of a pointer (as opposed to pascal only being designed to use integer as an 16 bit unsigned pointer).

Code: Select all
it's not even extensible to fix any of its shortcomings

Which hasn't been true in ANY implementation since 1976. Most compilers added a means of including files, and any implementation after 1983 typically includes "units" -- which I'll stack up against C headers any day.

Especially since they seem a billion times better thought out.

It often seems like there are a lot of myths and half-truths about Pascal -- I really wonder where a lot of the completely false (like pointers) or horribly out-of-date information (including library files) about it comes from. I think it's probably that stupid "why I hate pascal" garbage people always link to that is chock full of misinformation, half-truths and outright card stacking LIES.

CommodoreJohn wrote:while C's development has been more about bringing order and sanity to what was already a usable (if most definitely hairy) language.

The only thing that even seems to be trying to do that IMHO is C# -- everything else is much like HTML 5 -- it just makes things worse.

CommodoreJohn wrote:C gives mysterious stale-pointer crashes, Pascal just refuses to compile - either way, the idiot is faced with his idiocy, and whether he learns from it is entirely on him.

Sometimes neither of those is idiocy -- sometimes it's a simple typo. I've always been in the camp where a typo shouldn't be allowed to compile. I'd much rather have the compiler say "This is wrong, this is the line it's wrong on, this is the column on the line where the error occured" than allow a program to actually compile with some sort of bug that could crash the program destroying data files, making you look like an idiot to a client some month later when the bug does rear it's ugly head, or worse crashes the entire system.

Any language where a typo can magically become a new variable is very poorly thought out IMHO. I LOVE forward declaration and strict typecasting... should be mandatory on EVERY language.
The only thing about Adobe web development products that can be considered professional grade tools are the people promoting their use.
deathshadow60
 
Posts: 62
Joined: Mon Jan 10, 2011 6:17 am
Location: Keene, NH

Re: Native Development on Small PCs

Postby Vorticon » Tue Jan 11, 2011 7:44 pm

Wow! I wish I had you around each time someone made fun of me for still using Pascal and disliking C! I feel so much better now :)
Vorticon
 
Posts: 276
Joined: Fri Nov 27, 2009 7:25 am

Re: Native Development on Small PCs

Postby Trixter » Wed Mar 09, 2011 11:22 am

I'm late to the party, but here is a quick summary of some editors (along with some patches to editors) that I did trying to find a decent editor for oldskool development: http://www.oldskool.org/guides/texteditors

Since most of my source is unit-ized, most files are under 100K and so I use Aurora.
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 506
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Previous

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron