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: 9957
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: 2004
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: 9957
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: 2004
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: 3024
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: 9957
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: 3024
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: 2122
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: 9957
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: 2122
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: 3024
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: 9957
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 :)

Thaddy
Posts: 173
Joined: Wed Mar 06, 2013 11:28 am

Re: A Extended Pascal Implementation : CONCEPT.

Mon Nov 05, 2018 8:32 am

Although writing a compiler is fun! (part of my job and my masters) I don't see the point elsewhere, when Freepascal is NOT closed source and highly advanced.
It even compiles AARCH code for the Raspberry Pi, both for nixes as for bare metal and contrary what is stated above only the compiler itself has a GPL v 2 restriction. The lgpl+linker exception is even less restrictive. And ALL sourcecode is available, there is no closed source anywhere.
Ultibo also uses - the bare metal options of - FreePascal for that reason. It would be futile to write such an optimizing compiler other than that it is fun.
It is very hard to improve on a compiler that is already 25 years old and extremely well maintained.
Written on one of my day-to day RPi3B's.

Thaddy.

p.s. If you want to pursue it, I am available for advice(after all that's as I stated) . Just don't call it extended Pascal: that already exists and has a feature set that is even less than a subset of the current FreePascal.

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

Re: A Extended Pascal Implementation : CONCEPT.

Tue Nov 06, 2018 2:05 am

Heater wrote:
Thu Jul 26, 2018 6:18 am
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.
If the Linux kernel can cover every use case from embedded systems to huge distributed programs running on mainframes, why could not a programming language do likewise?

Many corporations have replaced bespoke legacy software with off-the-shelf commercial offerings. When doing so I believe there is a risk of losing the competitive advantages which come from doing something different. In situations where military investments are for show, it probably doesn't matter what software is used or whether the airplanes and missiles are even lumps of plastic. However, in the event of any significant conflict or war where there is a chance of losing, it is not clear that using Windows defender and other off-the-shelf software would provide a strategic advantage.

I think the idea behind the proposed Pascal-like programming language, no matter what it is called, is to be simple and self contained. Generating optimized code is not interesting, because as pointed out there are already good optimizing compilers. What is missing, however, is a self-contained codebase that can be understood by one person and audited by a team for correctness to ensure the resulting executables (including the compiler binaries themselves) are free of compiler-injected backdoors. As already discussed, a simple but feature-complete non-optimizing compiler would also useful for teaching and hobbyist use.

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

Re: A Extended Pascal Implementation : CONCEPT.

Tue Nov 06, 2018 10:00 pm

ejolson,
If the Linux kernel can cover every use case from embedded systems to huge distributed programs running on mainframes, ...
That might be a bit of a stretch of an assumption.

There are plenty of embedded systems that don't have the space or speed for Linux, or don't have MMUs. There are plenty of embedded systems that require real-time deterministic behavior which is not so easy to achieve with Linux. There are a lot of embedded of real-time operating systems in use as a result. Or perhaps no operating system at all.

It is remarkable though how small Linux systems can be now a days, like a lot of home routers.
...why could not a programming language do likewise?
Arguably for similar reasons. Space, speed, etc. I have worked on Ada projects, military and avionic, sometimes it was a bit of a squeeze and the results were not pretty.

Having said that I'm retracting on what I said a bit. Especially as I recall that there is an Ada compiler for 8 bit AVR processors. https://sourceforge.net/p/avr-ada/wiki/Home/ Which is quite amazing.
As already discussed, a simple but feature-complete non-optimizing compiler would also useful for teaching and hobbyist use.
I totally agree. For that we have things like Oberon: https://en.wikipedia.org/wiki/Oberon_(p ... _language)

I was eagerly following Per Vognsen's development of Ion, a simplified but equally powerful language to C, in his recent series on Youtube. https://www.youtube.com/watch?v=T6TyvsK ... wMSDM3aTtX He managed to write the whole compiler in a few weeks in front of our eyes almost.
Last edited by Heater on Sun Nov 11, 2018 6:47 am, edited 1 time in total.

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

Re: A Extended Pascal Implementation : CONCEPT.

Fri Nov 09, 2018 12:05 pm

I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Other programming languages”