swampdog
Posts: 140
Joined: Fri Dec 04, 2015 11:22 am

Re: Pascal?

Fri Sep 09, 2016 9:23 pm

Heater wrote:Problem is there is no such thing as BASIC.

There are many languages that carry that name and are somehow similar. But they are all incompatible. There is no coherent standard.

Similarly for Pascal.

I want any code I write to be available in as many places as possible. Even if nobody else uses it, it future proofs it against changes in hardware, operating systems etc.

That means I need standards that everybody strives to support.

That pretty much means C, C++ and Javascript now a days.
Unfortunately Pascal got shot in the foot & not just by itself. When I was in higher education we got stuck with a syllabus which required us to use some mainframe "template". You couldn't just type in Pascal in an editor, it had to be "pre-parsed" and entered in sections in the way of prompts which could have only have been invented by some crazed cobol programmer.

It was tolerable at first, reading characters to make up a string but thereafter a nightmare. It wouldn't allow the (non standard) string input facility and because you couldn't cut 'n' paste your working "string input function" into it - a real drudge. Sensible people skipped lectures to learn (back then K&R) C.

Then came Delphi. That's pretty cool but Borland struggled to expand the market, hence C++ Builder. It was a bit of a bodge but ultimately what killed it, was windows (imo). The RAD tool seemed great on the surface but a client would ask for seemingly trivial feature. Next thing you know, you're buried inside the winapi fighting it and the VCL.

My biggest regret (in programming terms) was not learning QT.

Heater
Posts: 8103
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pascal?

Fri Sep 09, 2016 9:41 pm

DavidS,
That is stick with the standard for Pascal (not object pascal, just pascal), ...
What standard?

Last time I checked there was an ISO standard for Pascal that has not changed since 1991 or so. And which nobody actually codes to.

I recently had a terrible time wasting life marrying code together that was written to different "standards".

Please do post any of your old Javascript here that no longer works. I would love to see what fails. JS has been an incredibly consistent and backwards compatible language since it was created. And standardized soon after.

Sticking to C++98 is silly. There have been some great improvements to the language since then.

C++ templates can be great. Their use does not cause code bloat as some might expect.

The STL, that's another story...

User avatar
DavidS
Posts: 3009
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Pascal?

Fri Sep 09, 2016 10:19 pm

Heater wrote:DavidS,
That is stick with the standard for Pascal (not object pascal, just pascal), ...
What standard?

Last time I checked there was an ISO standard for Pascal that has not changed since 1991 or so. And which nobody actually codes to.
That is the standard. And every pascal I know of supports the ISO standard (though usually the older version).

So if you code to the standard your code should compile on just about any pascal.
I recently had a terrible time wasting life marrying code together that was written to different "standards".

Please do post any of your old Javascript here that no longer works. I would love to see what fails. JS has been an incredibly consistent and backwards compatible language since it was created. And standardized soon after.

Sticking to C++98 is silly. There have been some great improvements to the language since then.

C++ templates can be great. Their use does not cause code bloat as some might expect.
That does not mean that the newer C++ is as widely supported, nor is it likely to ever be widely supported.

There are what, maybe 5 or 6 C++ compilers that support the newer standards, at most?
The STL, that's another story...
:).

Code: Select all

#include <iostreem>

int main(void){
 long n = 0;

 while (1){
   cout << "C++ is a great language" << n++ << "times over.  Operater overloading even better.\n";
   if (n > 0x7FFFFFFD) n = 0;
 }
}
ARM BASIC: For the love of Simplicity, Fast Interpreted BASIC, and Assembly Language.
Always KISS Keep It Simple Silly.

Heater
Posts: 8103
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pascal?

Sat Sep 10, 2016 9:00 am

Yes, that is the standard. However in my experience nobody codes to that standard. A standards compliant compiler would be no use to most.

Of course newer C++ is widely supported. GCC, Clang and MS C++ are pretty much up to date. That covers pretty much all the host platforms we need and targets many others.

User avatar
gordon@drogon.net
Posts: 1970
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Pascal?

Sat Sep 10, 2016 9:31 am

Heater wrote:Problem is there is no such thing as BASIC.

There are many languages that carry that name and are somehow similar. But they are all incompatible. There is no coherent standard.
There are standards... Two modern standards (ANSI/ISO and ECMA) and each has a full and lite version... I only know of one BASIC that's remotely compatible though (and its not RTB). But as you say; who uses the standards...

I have read the ECMA standard - too mean to buy the ANSI/ISO standard[1], however according to the ECMA paper, they're essentially the same - however it's a bit weird in places and I wonder just what they were thinking of for some of the functions, etc. they have in the standard. But hey, that's standards for you, I guess, and it's too easy for me (and maybe others) to simply implement a basic-like thing with most of the standard C library as builti-ins with the same name rather than a "standard" BASIC name.

Similarly for Pascal.
Isn't Pascal more a case of (competing?) "ecosystems" now? ie. Borland, Delphi, TurboPascal, UCSD, Lazarus/Free Pascal or whatever their names are these days? I suspect that each might well stick to the old ISO standard, but in addition each of these will have their own standards to work in their own ecosystem...
I want any code I write to be available in as many places as possible. Even if nobody else uses it, it future proofs it against changes in hardware, operating systems etc.

That means I need standards that everybody strives to support.

That pretty much means C, C++ and Javascript now a days.
K&R, "ANSI", C99, ... ;-)

I'm in the process of trying to get some 25 year old C code going on the Pi... It's compiling but not working - mostly due to outdated network code, but the compiler whinges are pretty impressive! I've also recently typed up/edited some very old BASIC programs (some of the old classic 70's games) to run under RTB - some of them are actually very well written, given the constraints of BASIC at that time. Some of them are terrible.

One language that hasn't changed as far as I can tell is BCPL. I wrote loads of it at one point and Martin Richards is still about with a very good Pi implementation.

Finally, on the subject of standards, I'll leave you with this: https://xkcd.com/927/

-Gordon
[1] I'm Scottish and have the stereotype of a nation to uphold!
--
Gordons projects: https://projects.drogon.net/

bensimmo
Posts: 1914
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Pascal?

Sat Sep 10, 2016 10:02 am

Where does python stand in all of this and its standards, why can't they sort out there two versions and be done with it.
As that is basically the BASIC of todays learning crowd.

User avatar
DavidS
Posts: 3009
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Pascal?

Sat Sep 10, 2016 6:49 pm

bensimmo wrote:Where does python stand in all of this and its standards, why can't they sort out there two versions and be done with it.
As that is basically the BASIC of todays learning crowd.
Unfortunately there will always be the 'that would be cool', and 'why not have this' with all languages. That is why C has changed so much, that is why there are so many variations on BASIC, that is why there are so many extensions to Pascal, etc. I would imagine the same goes for Python.
ARM BASIC: For the love of Simplicity, Fast Interpreted BASIC, and Assembly Language.
Always KISS Keep It Simple Silly.

Heater
Posts: 8103
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pascal?

Sat Sep 10, 2016 7:19 pm

I don't think C has changed very much since it was standardized in 1989. That's nearly three decades!

What changes there have been do not break old C code.

After all, there is no point in adding crap to C, it's already in C++ :)

Even Python has been pretty stable.

The others though are a mess.

jahboater
Posts: 1936
Joined: Wed Feb 04, 2015 6:38 pm

Re: Pascal?

Sat Sep 10, 2016 8:02 pm

gordon@drogon.net wrote:K&R, "ANSI", C99, ... ;-)

I'm in the process of trying to get some 25 year old C code going on the Pi... It's compiling but not working - mostly due to outdated network code, but the compiler whinges are pretty impressive!
Modern C compilers are just much more fussy than 25 years ago. I bet all the whinges are actually worth fixing.
gordon@drogon.net wrote:One language that hasn't changed as far as I can tell is BCPL. I wrote loads of it at one point and Martin Richards is still about with a very good Pi implementation.
I wrote a little BCPL, and a lot of B.
As an extension GNU C has ({ xxxx }) a facility I remember in BCPL and missed (being able to return a value from a compound statement).

bserce123
Posts: 43
Joined: Mon May 22, 2017 3:28 pm

Re: Pascal?

Mon Jun 19, 2017 7:43 pm

DavidS wrote:Ultibo for the Pi is what has piqued my interest in Pascal again but, in all honesty, only as a means to an end.
Is this an outstanding invitation to 'join the club'? We're currently trying to install and activate Ultibo on a Raspberry3.

Lucretia
Posts: 43
Joined: Sun Aug 28, 2011 10:49 pm
Contact: Website

Re: Pascal?

Mon Oct 16, 2017 5:33 pm

stderr wrote:
Tue Feb 16, 2016 5:11 am
DavidS wrote:I find it interesting that the Pascal programming language is almost never menioned.
Do to its rules Pascal is likely one of the simplest languages to create an optimizing compiler for. Pascal is also among the simplest languages
Though I also find it interesting that I can not find a single ARMv6/ARMv7 complient Pascal compiler,
Of course there's always Ada, which is just Pascal made into the most complicated language possible.
Naah, it's not complicated. But when you've used Ada, moving to a language without it's type system is hard/impossible, you'll be wanting it back.

I'd love to see if there's another language with Ada's type system, or something close to it.

e.g. ranges, modular types (auto wrap around), tasking, real-time, distributed systems, attributes for querying the type system, overloading, OO, generics, real package/module system, separates, can do low-level stuff in a high-level way, highly portable, etc.

Heater
Posts: 8103
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pascal?

Mon Oct 16, 2017 5:56 pm

Naah, Ada is so ugly and it type system such a pain that no programmers ever wanted to use it and the DoD had to drop the Ada mandate. It's approach to object oriented programming is so hard to understand that even CS professors teaching it could not understand it. When I saw one such Prof commenting in his example code that "Ada is absurd" because he had not understood how tagged types work I realized it was time to move on.

jahboater
Posts: 1936
Joined: Wed Feb 04, 2015 6:38 pm

Re: Pascal?

Mon Oct 16, 2017 6:15 pm

Lucretia wrote:
Mon Oct 16, 2017 5:33 pm
e.g. ranges, modular types (auto wrap around), tasking, real-time, distributed systems, attributes for querying the type system, overloading, OO, generics, real package/module system, separates, can do low-level stuff in a high-level way, highly portable, etc.
Obviously it is wildly different, but I wonder how much of that list modern C++ can do?
C++14 or later.

Heater
Posts: 8103
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pascal?

Mon Oct 16, 2017 6:47 pm

DavidS,
I would strike Javascript off of that list, as I have a number of old JS code that will NOT work on current versions of JS. They are on some of my floppies from the mid 1990's.
Seems unlikely to me.

Javascript did not arrive til December 1995. It was standardized in 1996. Thanks to Microsoft muscling on on the ECMA standards committee even things that Netscape wanted to fix in the language did not get changed. MS had already cloned the language very well, warts and all, and did not want it changed.

I'd love to see this old Javascript that is not supposed to work anymore.

Heater
Posts: 8103
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pascal?

Mon Oct 16, 2017 6:49 pm

jahboater,
I wonder how much of that list modern C++ can do? C++14 or later.
Pretty much all of it.

Lucretia
Posts: 43
Joined: Sun Aug 28, 2011 10:49 pm
Contact: Website

Re: Pascal?

Mon Oct 16, 2017 7:04 pm

Heater wrote:
Mon Oct 16, 2017 5:56 pm
Naah, Ada is so ugly and it type system such a pain that no programmers ever wanted to use it and the DoD had to drop the Ada mandate. It's approach to object oriented programming is so hard to understand that even CS professors teaching it could not
It is documented in other places the reasons why DoD dropped the mandate, 1) programmers who'd never seen the language were frightened of it and just put up mental barriers so they were never going to want to use it. 2) The initial version of the language was hard to implement, but it's a much nicer language now, still tricky to implement, but still. 3) The DoD decided to go the COTS route instead and dropped the mandate.

It's nowhere near as ugly as the C languages or Pascal with it's annoying need to have to use begin .. end on if and loop statements, in Ad you don't.
Heater wrote:
Mon Oct 16, 2017 5:56 pm
understand it. When I saw one such Prof commenting in his example code that "Ada is absurd" because he had not understood how tagged types work I realized it was time to move on.

You've already stated that in another thread and you stated that the professor was wrong in that he didn't understand the language, you corrected him, but you decided to move on anyway. Hardly Ada's fault.

Lucretia
Posts: 43
Joined: Sun Aug 28, 2011 10:49 pm
Contact: Website

Re: Pascal?

Mon Oct 16, 2017 7:05 pm

jahboater wrote:
Mon Oct 16, 2017 6:15 pm
Lucretia wrote:
Mon Oct 16, 2017 5:33 pm
e.g. ranges, modular types (auto wrap around), tasking, real-time, distributed systems, attributes for querying the type system, overloading, OO, generics, real package/module system, separates, can do low-level stuff in a high-level way, highly portable, etc.
Obviously it is wildly different, but I wonder how much of that list modern C++ can do?
C++14 or later.
Not directly in the language, which is my point. In C++ you would need a ton of templates and preprocessor magic to get it done, which in turn leads to really ugly and difficult to read code.

Heater
Posts: 8103
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pascal?

Mon Oct 16, 2017 7:55 pm

Lucretia,
Hardly Ada's fault.
The problem was to do with Ada's tagged types and polymorphism if I remember correctly. I was having a hard time understanding it. Then I found this prof's tutorial, which was generally pretty good but I got even more confused by his example. I was almost ready to agree with him that "Ada is absurd" when the penny dropped and I realized he did not understand it either.

Is that Ada's fault or were we both just to stupid to understand it? No, don't answer that.

Lucretia
Posts: 43
Joined: Sun Aug 28, 2011 10:49 pm
Contact: Website

Re: Pascal?

Mon Oct 16, 2017 8:07 pm

Heater wrote:
Mon Oct 16, 2017 7:55 pm
Lucretia,
Hardly Ada's fault.
The problem was to do with Ada's tagged types and polymorphism if I remember correctly. I was having a hard time understanding it. Then I found this prof's tutorial, which was generally pretty good but I got even more confused by his example. I was almost ready to agree with him that "Ada is absurd" when the penny dropped and I realized he did not understand it either.

Is that Ada's fault or were we both just to stupid to understand it? No, don't answer that.
Ada's OO fits in with the rest of the "set-like" type system. Unlike other languages which just have classes, Ada distinguishes between the class, i.e. the actual tagged type, and the class hierarchy, i.e the set of all types in the hierarchy rooted from a particular tagged type, e.g. T'Class. No other language does that.

Also, other languages tend to go with massive class hierarchies, e.g. see, literally any C++ framework library, where they have 1 root class which usually implements their own RTTI system and then every class derives from that. In Ada, you create root tagged types whenever and where-ever, because the type system gives you all the static information you need via attibutes (the ' operator).

David_J_Haley
Posts: 2
Joined: Thu Nov 23, 2017 2:57 pm

Re: Pascal?

Thu Nov 23, 2017 3:19 pm

I did a Post Grad Dip in computer science in the mid 1980s. At the time Pascal was a popular teaching language. In the early 1990s I was involved in some reasonably significant projects using Modular 2 on PC hardware running OS/2. Since then I have not had a lot of professional involvement in software development. In the late 1990s I discovered Ada which is the true successor to Pascal. The GNAT compiler (based on gcc) is freely available for non commercial use from AdaCore. Several years ago they released an Ada 2012 compliant cross compiler for the RPi (Hosted on x86 Linux) I am now most of my way through a physical computing project that uses both parallel I/O and the SPI interface. My major difficulty to date has not being able to link to C libraries such as WiringPi. There is a Learning curve for Ada but it is sufficiently similar to Pascal to be comprehensible and has inbuilt support for separate compilation.

Heater
Posts: 8103
Joined: Tue Jul 17, 2012 3:02 pm

Re: Pascal?

Thu Nov 23, 2017 8:26 pm

David_J_Haley,

Separate compilation works fine in C, C++ and many other languages.

Ada is interesting. It was designed for "safe" programming "in the large". Big teams, lots of code.

My experience of it in aerospace in the '90's was that it failed. Teams that adopted it ended up with a huge mess of unfathomable code the execution time of which was totally unpredictable. Just what you don't want in a fly by wire system, for example.

Given the hassle of making use of libraries in C or C++ from Ada I don't see any point in persisting with it for small personal projects.

Also for small personal projects it's nice to be able to share your code with others (Strangely enough people have even used my code from time to time). Much nicer to use a language others can make use of easily.

zog
Posts: 189
Joined: Sun Nov 20, 2011 5:43 pm
Contact: Website

Re: Pascal?

Fri Dec 01, 2017 12:45 pm

There are pascal versions of the wiringpi library out there. I partially implemented one and somebody else did another one. I only implemented what i needed when i needed it. You can write directly to memory address on the pi with pascal as long as you reserve the addresses before hand.

Return to “Other languages”

Who is online

Users browsing this forum: RogerW and 5 guests