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

Re: A Extended Pascal Implementation : CONCEPT.

Fri Jul 20, 2018 4:12 pm

Why not the "Pascal subset" of Ada? Base it on Ada 2012 and use pragma Profile to create the subset and keeping within the rules of the language. Use pragma Restrictions to enforce restrictions on the language. Ada is more powerful Pascal, it's also a lot more readable as begin...end don't need to be literally everywhere, i.e. if's, loops, etc. Plus you get a more powerful type system and package/unit system to boot.

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

Re: A Extended Pascal Implementation : CONCEPT.

Fri Jul 20, 2018 4:25 pm

Probably because is Ada is more dead than the Dead Sea Scrolls.

I have not met an Ada programmer since about 1994.

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

Re: A Extended Pascal Implementation : CONCEPT.

Fri Jul 20, 2018 5:08 pm

Heater wrote:
Fri Jul 20, 2018 4:25 pm
Probably because is Ada is more dead than the Dead Sea Scrolls.

I have not met an Ada programmer since about 1994.
Think you need to update your knowledge.

ejolson
Posts: 1842
Joined: Tue Mar 18, 2014 11:47 am

Re: A Extended Pascal Implementation : CONCEPT.

Fri Jul 20, 2018 9:23 pm

Lucretia wrote:
Fri Jul 20, 2018 4:12 pm
Why not the "Pascal subset" of Ada?
I wonder how the person who started this thread is doing and whether there is any progress. He hasn't posted here for some time. The Bitwise Ion compiler seems similar in concept. I wonder how hard it is to port that to the Pi.

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

Re: A Extended Pascal Implementation : CONCEPT.

Sat Jul 21, 2018 2:39 am

Lucretia wrote:
Fri Jul 20, 2018 5:08 pm
Heater wrote:
Fri Jul 20, 2018 4:25 pm
Probably because is Ada is more dead than the Dead Sea Scrolls.

I have not met an Ada programmer since about 1994.
Think you need to update your knowledge.
You are right. I got that wrong. The last time I met anyone programming in Ada was 1996. It was whilst I was working at Lucas Avionics in Hemel Hempstead. Before that it was about '94 whilst working on the Primary Flight Computers of the Boeing 777 at GEC Avionics in Rochester.

I'm not counting myself, 8 years ago I wrote an assembler in Ada. It was painful. I played with Ada for the ATMEL AVR devices about that time.

Did I miss something since then?

@ejolson,

Currently the Bitwise Ion compiler compiles Ion source into C. As such I'm sure no porting is required, it will build and run on the Pi just fine.

There is no binary executable code generation for any target yet. It would be great if someone produced an ARM code generator backend for Ion.

DavidS would not like it though, looks too much like C.

ejolson
Posts: 1842
Joined: Tue Mar 18, 2014 11:47 am

Re: A Extended Pascal Implementation : CONCEPT.

Sat Jul 21, 2018 4:24 am

Heater wrote:
Sat Jul 21, 2018 2:39 am
DavidS would not like it though, looks too much like C.
You may be right. However, from my point of view the main idea was to create a compiler simple enough that one person could develop and understand it. Such a compiler would then serve as a resource for simple hobbyist projects and people using the Raspberry Pi to learn how computers work.

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

Re: A Extended Pascal Implementation : CONCEPT.

Sat Jul 21, 2018 6:48 am

Heater wrote:
Sat Jul 21, 2018 2:39 am
[Currently the Bitwise Ion compiler compiles Ion source into C. As such I'm sure no porting is required, it will build and run on the Pi just fine.

There is no binary executable code generation for any target yet. It would be great if someone produced an ARM code generator backend for Ion.
That backend might be called GCC?

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

Re: A Extended Pascal Implementation : CONCEPT.

Sat Jul 21, 2018 8:03 am

@ejolson,
...from my point of view the main idea was to create a compiler simple enough that one person could develop and understand it. Such a compiler would then serve as a resource for simple hobbyist projects and people using the Raspberry Pi to learn how computers work.
Yes, I think it's an excellent idea.

@jahboater,
That backend might be called GCC?
Might be. Others call it Clang/LLVM. Still others call it MSVC.

Bitwise really needs a code generator backend for ARM.

I once wrote a toy compiler for a language about as sophisticated as Tiny Pascal, probably less so, that generated x86 directly. It worked but the generated code was horribly inefficient.

Not sure that I have much of a clue how to create a decent code generator for Ion.

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

Re: A Extended Pascal Implementation : CONCEPT.

Sat Jul 21, 2018 1:52 pm

Heater wrote:
Sat Jul 21, 2018 2:39 am
Lucretia wrote:
Fri Jul 20, 2018 5:08 pm
Think you need to update your knowledge.
You are right. I got that wrong. The last time I met anyone programming in Ada was 1996. It was whilst I was working at Lucas Avionics in Hemel Hempstead. Before that it was about '94 whilst working on the Primary Flight Computers of the Boeing 777 at GEC Avionics in Rochester.

I'm not counting myself, 8 years ago I wrote an assembler in Ada. It was painful. I played with Ada for the ATMEL AVR devices about that time.
In my experience, the only people who find Ada "painful" are those who like to hack stuff together without thought, like they do in C or C++ and then spend weeks in a debugger.

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

Re: A Extended Pascal Implementation : CONCEPT.

Sat Jul 21, 2018 1:54 pm

Lucretia wrote:
Sat Jul 21, 2018 1:52 pm
Heater wrote:
Sat Jul 21, 2018 2:39 am
Lucretia wrote:
Fri Jul 20, 2018 5:08 pm
Think you need to update your knowledge.
You are right. I got that wrong. The last time I met anyone programming in Ada was 1996. It was whilst I was working at Lucas Avionics in Hemel Hempstead. Before that it was about '94 whilst working on the Primary Flight Computers of the Boeing 777 at GEC Avionics in Rochester.

I'm not counting myself, 8 years ago I wrote an assembler in Ada. It was painful. I played with Ada for the ATMEL AVR devices about that time.
In my experience, the only people who find Ada "painful" are those who like to hack stuff together without thought, like they do in C or C++ and then spend weeks in a debugger fixing the problems.

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

Re: A Extended Pascal Implementation : CONCEPT.

Sun Jul 22, 2018 9:53 am

You might like to delete your last post by the way.
Lucretia wrote:
Sat Jul 21, 2018 1:52 pm
In my experience, the only people who find Ada "painful" are those who like to hack stuff together without thought, like they do in C or C++ and then spend weeks in a debugger.
You are way off the mark here, and insulting (most) C/C++ programmers.

This comment, and others like it in the past, would seem to indicate that you have not used (modern) C/C++, and modern C/C++ compilers and their support tools much - if at all.

Nowadays there is all the static and run-time checking that you could want, and importantly the costly stuff is optional so you can write efficient code if needed.

There are good reasons why most of the software in the world is written in these languages (compared to Ada which I suspect has a vanishingly small percentage by comparison).

User avatar
Gavinmc42
Posts: 2099
Joined: Wed Aug 28, 2013 3:31 am

Re: A Extended Pascal Implementation : CONCEPT.

Sun Jul 22, 2018 11:28 am

In my experience, the only people who find Ada "painful" are those who like to hack stuff together without thought, like they do in C or C++ and then spend weeks in a debugger fixing the problems.
I think I need to learn ADA, just did 6 weeks with CRO and logic analyzer debugging some C code.

Must have gotten soft by using Pascal for the last two years ;)
I hack together Pascal code without much thought and it works fine :lol:
The advantage of Object Pascal(Ultibo) is using units written by better coders ;)

Could Ada be used baremetal on Pi's?
I have tried just about every other language on Pi's what is one more?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: A Extended Pascal Implementation : CONCEPT.

Mon Jul 23, 2018 3:19 am

Gavinmc42,
I think I need to learn ADA, just did 6 weeks with CRO and logic analyzer debugging some C code.
I suggest you do take a look at ADA. It's somewhat like Pascal but even more strict about types and such. You will feel quite at home, I must have spent months debugging Ada projects with a CRO and Logic Analyser.
I hack together Pascal code without much thought and it works fine
I hack together C/C++ code without much thought and it works fine.
The advantage of Object Pascal(Ultibo) is using units written by better coders
The advantage of C/C++ is that there is plenty of code out there written by others to make use of.
Could Ada be used baremetal on Pi's?
I'm sure it could. Almost all the Ada projects I have worked on were "bare metal". People use Ada for the tiny 8 bit ATMEL AVR chips, no operating system there.
I have tried just about every other language on Pi's what is one more?
I don't suggest people go off learning every language under the sun. Lot's of them are conceptually the same so it's kind of pointless.

I make an exception for Ada as learning Ada can provide an insight into how horribly wrong programming language design can go.

Mind you, C++ is another great example of that.

The great thing about Ada is that it tries to catch a lot of programmer errors at compile time. It's very fussy about types and such. Give the right build options it will do further checking at run time, out of range variables, out of range array access etc.

Problem is that does not help much. There are of course tons of other bugs a program can have. You still need to test the finished code. You will need code reviews and perhaps formal analysis etc. And of course it helps to have a good design before you start.

People working in Ada environments, in avionics, military etc, generally have whole teams of people dedicated to testing.

Anecdotally, my experiences in the trenches testing Ada projects indicates they have as many bugs as any other language I have worked with. However, they did have far bigger teams to cover all that testing, review, design, etc.

User avatar
Gavinmc42
Posts: 2099
Joined: Wed Aug 28, 2013 3:31 am

Re: A Extended Pascal Implementation : CONCEPT.

Mon Jul 23, 2018 4:46 am

I did not know Ada was Pascal influenced, it has begin/end.
But now there is a "new" Ada that uses the C brackets { } :o

Just wondering if Ada would make more sense for IoT?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: A Extended Pascal Implementation : CONCEPT.

Mon Jul 23, 2018 7:54 am

Gavinmc42 wrote:
Mon Jul 23, 2018 4:46 am
I did not know Ada was Pascal influenced, it has begin/end.
They (the DoD) had the choice of basing Ada on Pascal or basing it on Algol68.
They chose Pascal because Algol68 was already a powerful and complete language, whereas Pascal was not (Mr Wirth created it as a teaching language). It was easier therefore to develop Pascal into the language they wanted.

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

Re: A Extended Pascal Implementation : CONCEPT.

Thu Jul 26, 2018 6:18 am

I'm not sure how heavily Ada was influence by Pascal. It certainly takes inspiration from there, but also from Algol and other languages. All these structured "third generation" languages are children of Algol anyway.

The whole Ada history is a train wreck. The DoD wanted to standardize on a single language rather than have to support the 450 or so languages they found being used in military projects. A good idea, right? The whole idea was put out to tender and a handful of companies offered their solutions. After a couple of evaluation rounds Ada was selected and mandated for use in all DoD projects in 1991. See Wikipedia for the gory details.

Problem here is you are designing a single language to cover every use case from small real-time embedded systems up to huge distributed programs running on mainframes and such. The result being a horribly huge and complex language, difficult to implement, ill suited to anything, whose performance sucked, and hated by all programmers.

Meanwhile back in the UK the MoD had to tag along and mandate Ada as well, throwing out their previous standard of Coral 66.

The DoD realized it's mistake 6 years later and in 1997 removed the Ada mandate. They now wanted to go for the perceived cheaper option of Commercial Off The Shelf (COTS) solutions. So vendors used whatever language they liked.

Probably by now the DoD would find they are back to 450 odd languages being used in their systems :)

Return to “Other programming languages”

Who is online

Users browsing this forum: No registered users and 2 guests