Plug For PASCAL

“Is it worth the extra effort to add static type annotations to a JavaScript project? Should I use Facebook’s Flow or Microsoft’s TypeScript if so? Will they really catch bugs that would otherwise have made it to master?
 
both Flow and TypeScript are pretty good, and conservatively either of them can prevent about 15% of the bugs that end up in committed code. “That’s shocking. If you could make a change to the way we do development that would reduce the number of bugs being checked in by 10% or more overnight, that’s a no-brainer. Unless it doubles development time or something, we’d do it.”
 
See To type or not to type: quantifying detectable bugs in JavaScript
Assuming the results of this study are transferable to other programming languages, PASCAL, being strongly typed, deserves another plug for simplicity, reliability and speed of development. It’s cool when the biggies plug your favourite feature of your favourite language. I’ve liked PASCAL from Day One. It was designed for teaching and learning but it still is superior to nonsensical languages like C which lack meaning in every line of code. My first PASCAL programme still compiles and runs correctly while C-programmers run for the hills every time the C-compiler gets tweaked and does something differently…

About Robert Pogson

I am a retired teacher in Canada. I taught in the subject areas where I have worked for almost forty years: maths, physics, chemistry and computers. I love hunting, fishing, picking berries and mushrooms, too.

This entry was posted in Teaching, technology and tagged , , , , . Bookmark the permalink.

36 Responses to Plug For PASCAL

  1. oiaohm says:

    Deaf Spy really its you who has the pink elephants problem. Benchmarks exist that show pascal complier performance. Those benchmarks explain why developers using pascal don’t need to know as much as those using C# and Java.

  2. Deaf Spy says:

    Pink elephants, Fifi? This is dangerous, get your pills, while you still can.

  3. oiaohm says:

    Deaf Spy
    Absolutely not true. No Pascal compiler can match the levels of optimizations C++ compilers do, nor the JIT of modern Java VM, nor even the new 64-bit JIT compiler of C#.
    Those benchmarks on debian was with the new 64-bit JIT complier of C# and it not completive with freepascal let alone the current commercial pascal compliers.

    http://benchmarksgame.alioth.debian.org/u64q/pascal.html
    Basically spend sometime going over the results of benchmarks by the benchmarksgame.

    Sorry you statement does not agree with benchmark results like it or not mine do.

    http://wiki.freepascal.org/FPC_JVM fun part about freepascal is that you can back-end onto a java Jit. So the reality is you can built Java from freepascal interesting enough most cases there is no performance gains without increased memory usage using a JVM backend. Even if you code the same example in Java you see the same performance trait more memory usage lower cpu usage when ever Java out performs a pascal complier. .Net you see more memory usage and lower performance than using Freepascal.

    Particular usages in fact have Freepascal beating gcc in both C and C++ modes. Freepascal is not the best optimizing commercial pascal complier on the market.

    Reason why most remaining commercial pascal compliers are optimized for memory is they target like AVR chips that you are measuring memory in kb not megabytes.

    Deaf Spy I find it funny that you just made another arguement that is proven baseless by a cite I had already given.

  4. Deaf Spy says:

    Something more, in case Robert is still paying attention.

    You also failed to set any flags to make sure that a particular type of string was used that might have allowed some generic guess.

    Of course. I expected some thought on the problem, but I saw only total ignorance. You buzz around the actual problem, but you can’t even pin-point it. You are obviously incompetent.

    http://benchmarksgame.alioth.debian.org/u64q/pascal.html

    Now, this is fascinatingly stupid. All tests where Pascal beats Java actually rely on external libraries, some of which are most-likely written in C.

    Fifi, you are so ignorant that you can’t even understand from reading the code that it uses external libraries, some of them 100% written in another language.

  5. Deaf Spy says:

    Bwaha-ha-ha-ha-ha!

    Pascal coders are not required to know as much as C++ or C# or Java programmers to get reasonable results out.

    Not true. The mere question I asked and the answer are a proof for that.

    Because the Pascal complier does a fairly good job of being memory and processor effective.

    Absolutely not true. No Pascal compiler can match the levels of optimizations C++ compilers do, nor the JIT of modern Java VM, nor even the new 64-bit JIT compiler of C#.

    Most Pascal compliers have a bias to memory efficiency over cpu efficiency.

    Not true for any established compiler since Heilsberg’s TurboPascal compiler.

    The rest is so laughable that it doesn’t even deserve a comment.

    Fifi, get a rest, sweetie. You are hallucinating again.

  6. oiaohm says:

    Deaf Spy no there is a true answer there. Your question was and is crap. Its funny how you say I wrote gibberish every time I give an answer that shows that you are absolutely wrong.

    Pascal coders are not required to know as much as C++ or C# or Java programmers to get reasonable results out. Because the Pascal complier does a fairly good job of being memory and processor effective. Most Pascal compliers have a bias to memory efficiency over cpu efficiency.

    Deaf Spy basically you have insanely short attention span.

    Freepascal is still used at some universities for first year programming students. Mostly because if you are all sharing a server a novice is more likely to good neighbor using Freepascal than most other things.

    Deaf Spy you presumed the same requires in programmer knowledge apply to all programming languages. Pascal is interesting because the way the language is design the complier get decent results without programmer needing to know as much.

    Go and Rust and other attempts at safer languages that turn up are to attempt to reduce how much coders need to know to get functional results.

    The two things you were missing. task declares in .net don’t work if they are not defined as public. Nasty trap if you are needing to build for early versions of .net is that task <value> is required because if you do not give a return type some of those early version produce something that behaves as bad using a aync void function.

    So you want to have stable threading in .net you have to declare stuff public every time you use the public define you add overhead.

    Deaf Spy if you go through those benchmarks it will come clear why coders still bother using C and C++. The reality is Java is not great but C# heck anything .net is pure horrible in memory and cpu usage.

    Deaf Spy put that string question before an Enterprise Java programmer and you will get a response like Robert that they don’t care. This caring how a string is processed is one of the signs that a program language may have issues. In C# case its not just the language with issues is like task that is a jit/aot issue where you have to use public define to use it. So when there is a enterprise battle for a contract Java vs C# the Java developer has to do less work to get better performing code than the C# developer. That extra work requires the C# developer to know more internals and the big problem here is the C# developer never really gets the performance payback for knowing the extra stuff. So a C# developer works their tail off to get the results Java programmer got with very little effort.

    Main reason for Java limit popularity in desktop applications is its GUI APIs are completely horrible.

    Deaf Spy you have applied something that is a sign of fault in C# to Pascal. It also would have been invalid to ask it of a Java programmer.

  7. Deaf Spy says:

    With that said, I wrote this little piece, which is more then say Fifi has ever provided.

    With all honestly, your code is following better coding conventions than the last pascal snippet Robert bestowed upon us.

  8. Deaf Spy says:

    Congratulations, Fifi! You had your 15 seconds of your brain-cells working as a team today! You got even close to giving the actual answer. Unfortunately, these 15 seconds run out before you could actually answer my question, and you threw yourself into your usual gibberish.

  9. oiaohm says:

    Deaf Spy issue here is freepascal is used on AVR chips where memory is not limitless and you don’t have the same cpu memory operation.

    Therefore, any programmer would think twice and be sure to know what a simple assignment actually does: does it copy one pointer, or does it copy a blob? That is why Pascal, being high-level language, has a few different types of strings. Just to allow developers to use the proper one for their needs.
    Freepascal changes the type of string it uses based on optimization setting and cpu setting. The fact you put freepascal in the mix made the question not answerable without limiting to a particular CPU and optimization flags.

    http://wiki.freepascal.org/String#String_types
    If you read here String is a alias for ShortString, AnsiString or Unicodestring (UTF16) based on complier setting.

    String in Pascal is a generic type where you should not presume that a particular type of string has been used. Being a alias not a real thing was first done by borland with Dephi and you set what form is used with a complier flag.

    Freepascal uses the exact same in code flags as Dephi for default String type selection.

    Deaf Spy you asked a question without assigning what string type it was or with what cpu it was on.

    That is why Pascal, being high-level language, has a few different types of strings. Just to allow developers to use the proper one for their needs.
    The reason why its a complier flag controlled thing is that you can rebuild the code different ways and test the different options without having to recode everything.

    The 4 different string types have 4 different performance effects and 4 different limit problems.
    http://wiki.freepascal.org/Character_and_string_types
    Just to be fun as versions of freepascal come out the rules on items like string also change. So number of operations might be increased or decreased because you changed pascal complier version. This is also true for delphi.

    Deaf Spy Pascal complier does is 100 percent version dependent. You did not list a exact Pascal complier did you and asked a question that can only be properly answered with exact pascal complier version and architecture involved.

    You also failed to set any flags to make sure that a particular type of string was used that might have allowed some generic guess.

    http://benchmarksgame.alioth.debian.org/u64q/pascal.html
    Deaf Spy please look at these benchmarks above. This is not programmers attempt to be particularly clean. Freepascal and even delphi can turn out to be memory lighter than using C# and java this is without the programmer knowing what the complier is doing.

    C# developers have to start knowing more because .net is a hog.

  10. Deaf Spy says:

    PASCAL is a high-level language and the programmer has no need to know the answer.

    That would be true in a Utopian world, where RAM and CPU speed are limitless…

    In real world, programmers need to know pretty well how to make sure their application in not a memory / processing hog. Nowadays you run multiple apps simultaneously on your PC and you should make sure your app is a good neighbor. Or that you will be able to process as much data as possible within the limited resources you have.

    Therefore, any programmer would think twice and be sure to know what a simple assignment actually does: does it copy one pointer, or does it copy a blob? That is why Pascal, being high-level language, has a few different types of strings. Just to allow developers to use the proper one for their needs.

    P.S. Fifi, you are totally, hopelessly clueless. Proving you wrong is the same as proving one wrong for writing that a fish can ride a bicycle.

  11. oiaohm says:

    Grece that is still way less than I provided to exploitguy here demoing the memory issue with Linux using unallocated memory and other different C issues.

    With that said, I wrote this little piece, which is more then say Fifi has ever provided.
    So ever is a very long time. Very idiot to make claims like that.
    http://mrpogson.com/2012/09/19/see-ie-is-spaghetti-code/
    Sorry Grece about time you say sorry for the lie. I have provide way more than you pastebin that is correct on this site. You presumed something very incorrect and never checked.

    Basically I have provided C code many times in arguments here with the C code being 100 percent valid snippets every single time.

    It also proves that when you are careful you can code somewhat correctly. The example code I provided here was in fact styled correctly and you pastebin is still not that.

    Grece and just to be funny you know that list stuff you so call know about me about time you go through it one of the arguments related to that also contains me using C code snippets that you were apart of. So you have made a fact up in your head that you have provided evidence over and over again that you have seen as false.

    About time you stop deceiving to yourself. The reality is I am a programmer. I don’t do much code in the public domain.

  12. Grece says:

    NOTE: I am not a programmer

    With that said, I wrote this little piece, which is more then say Fifi has ever provided.

    https://pastebin.com/kp686Ayj

  13. oiaohm says:

    Deaf Spy no you have run away.

    Deaf Spy also I have a question based on your example why under some historic C# solutions and current does your example code fragment
    async Task DoSmthOneAsync() { … }
    be wrong and fail to build or not operate correctly. You do have two syntax error that can annoy the heck out of you when you are using your example code on more than .net solution or working with other developers?

    So you have not answered with a fixed question yet Deafspy. You need to name two errors with that line.

    Really Deafspy about time you stop accusing others of running away when in fact its you who are running away by
    1) not using a person correct nym to ask question because getting it answer is going to prove you are idiot.
    2) Ignoring questions asked directly of your handle.

    Considering a modern Pascal compiler (Dephi, FreePascal), how many memory-copy operations would be performed?
    Deaf Spy putting FreePascal in the question sends the question to hell.
    http://wiki.freepascal.org/Platform_defines
    FreePascal supports multi different cpu types and yes the answer to question changes with CPU type.

    Deaf Spy so much for asking a real easy question. Reality this is the second question about coding that is a wrong question due to lack of information. Pascal programmers are also not expect to answer what the Pascal complier does.

    Deaf Spy you are trying to ask a question so you can argue I cannot code. Problem is I can code and you cannot code properly or don’t know enough information to ask the question properly. You are running away from admitting that Deaf Spy. Having to admit I am better at something than you would most likely break your ego.

  14. Deaf Spy asking a stupid question, wrote, “how many memory-copy operations would be performed?”

    That’s just silly. PASCAL is a high-level language and the programmer has no need to know the answer. It depends on the instruction sets of the machine which is the target of the compiler and how strings are implemented. It could be byte by byte moves. It could be word by word moves except for the odd bytes. It could be just moving two pointers. Who knows? Who cares?

    PASCAL compilers I’ve seen treat “string” as array of char. It could just as well be a pointer to an array of char. Char can be defined in different ways too, like a byte of storage containing one character, or a word containing packed characters etc. In many cases the programmer has no need to know the details. That’s what high-level means.

  15. Deaf Spy says:

    I knew you would run away, Fifi.
    Now, Fifi, here comes one really easy one. Robert, this is Pascal, your favorite language, you are invited to join in.

    Consider this code:

    var s1, s2 : string;
    ...
    begin
    s1 := 'This is a test';
    s2 := s1;
    end;

    Considering a modern Pascal compiler (Dephi, FreePascal), how many memory-copy operations would be performed?

  16. oiaohm says:

    Deaf Spy also I have a question based on your example why under some historic C# solutions and current does your example code fragment
    async Task DoSmthOneAsync() { … }
    be wrong and fail to build or not operate correctly. You do have two syntax error that can annoy the heck out of you when you are using your example code on more than .net solution or working with other developers.

    There are two different errors in that like of yours Deaf Spy one applies to historic C# and one is current C# trap for the unwary. You should at least be able to find what you missed for the current C# trap with using.

    async void DoSmthTwoAsync() { … }
    https://msdn.microsoft.com/en-us/magazine/jj991977.aspx
    Heck a error that is a know cause of security faults and crashes in .net how brilliant of you Deaf Spy. So any properly coded .net code this function should not exist at all created under normal programing conditions.

    Your example is not an asynchronous event handler right so your code is wrong like it or not as there is only one safe condition to use async void that is of asynchronous event handler anywhere else .net compiler might build and it might run but its unstable and will cause issues.

    There is a test you can add to your development work-flow that will reject any code in .net that the developer has been idiot and done async void. Most of the time someone does async void it a bug waiting to happen because its not in the one condition that it works correctly.

    I decide to answer more completely when I worked out that your question proved that you were even more of a idiot Deaf Spy. What are you needing us to answer you homework for you. A question like this can be given out on a employment interview to see who sees that the question is totally invalid because section of the code goes against best prac and will be causes of errors in production.

    So as normal you have failed code question correctly and ignore best practice. Just because you can write code a particular way and the complier will accept it does not mean you should code it that way.

  17. oiaohm says:

    Deaf Spy really you have just broken my basic rule. You did not use oiaohm in the question you asked fifi who does not exist so don’t complain when I don’t answer what you have requested. The fact I can answer this question is on record because I have answered it before in the debate with lead developer of mono that is hidden. It was a debate into memory usage of mono.

    Deaf Spy C# is not a language that Robert has ever said he uses and I have never said I use it in a dominate way either. So you question is not valid because you failed to check the basics as normal. You asked a question in a language neither of us use that much. So this is you just being half smart attempt to get advantage to change topic because you don’t want to admit you cannot get anything right. Yes you even got asking this question wrong because you choose the wrong program languages and did not use my handle through out.

  18. Deaf Spy says:

    I am in a good mood today, Fifi. A small quiz for you. Robert, you say you know computers and programming, you’re invited to join.

    In C#, you have this async / await feature, a very handy thing to let common people write continuation in a clean manner.

    consider this two routines:

    async Task DoSmthOneAsync() { ... }
    async void DoSmthTwoAsync() { ... }

    Then you call them like this:

    await DoSmthOneAsync();

    and

    DoSmthTwoAsync();

    Question for you, Fifi. When will each of these two functions return the execution to the caller?

  19. oiaohm says:

    Deaf Spy I don’t think you have managed to bring in a single valid fact on responses to this topic.

  20. oiaohm says:

    Deaf Spy really you need to take a rest. Please I said rule based language.

    English is a option based language there is a very big difference.
    https://www.oxford-royale.co.uk/articles/english-language-rules-native-speakers.html
    Why you see lots and lots of write up about English rules and native speakers not knowing them. Because a lot of english rules are optional if you obey them or not. Its like the old i before e except after c was taught as a English spelling rule for decades until someone checked and found that there were more english word that broke that rule than obeyed it.

    >>Now English has no rules.<< This is in fact true in the early time of modern english.
    https://en.wikipedia.org/wiki/Spelling_of_Shakespeare%27s_name

    Classic one is to ask a person to write William Shakespeare name as he did when he was alive. He writes his name 3 different ways in his own last will and testament. One of the clues that you have a true document from his time is massive variation in spelling.

    Reality when it comes to spelling in english you have to know the origin of the word to know what spelling rules apply. So english does have some rules. Problem being option based language as English is rules can be ignored if particular conditions are meet also rules can have solid meaning if options are meet as well.

    Basically claiming English has no rules is being a idiot. So basically here goes clueless Deaf Spy again.

  21. Deaf Spy says:

    Now English has no rules. Take a rest, Fifi. Seems you had rough nights under the lamppost.

  22. oiaohm says:

    Deaf Spy really I see such a idiot so fallen for deception. With exploitguy I demo in C why using unallocated memory was not random in Linux. This is not something you can do if you cannot code because there were not a single bit of example code demo existence at the time. You have seen that I can code first hand yet you are now telling lies. See so far deceiving yourself.

    “Besides a mathematical inclination, an exceptionally good mastery of one’s native tongue is the most vital asset of a competent programmer. ”
    There is one problem. The person who wrote that was German and Deutsch is a rules based language. So your quote does not apply to english speaking coders.

    http://www.kegel.com/kerspell/
    Deaf Spy see when you look at documentation in english programmers you find something really shocking. Most of the best ones are really poor at english even if english is their native this is why in the english world you need technical writers.

    Basically again Deaf Spy lack of research and use a comment that applies to Deutsch programmers but does not apply to english programmers. You failed to allow for the person who wrote that comment native bias. Applying a comment for programmers from one language to programmers from a different language does not work.

    Basically you so clueless Deaf Spy with a head filled with incorrect facts.

  23. Deaf Spy says:

    Fifi, but of course you can’t code. There is not a single being on this planet who believes so.

    Edsger Dijkstra has said:
    “Besides a mathematical inclination, an exceptionally good mastery of one’s native tongue is the most vital asset of a competent programmer. ”

    This alone does it for you, FFE. 🙂

  24. oiaohm says:

    Deaf Spy no not hurt at all. It has done exactly what it need to. It make you idiot believe I could not code. When I had submitted perfect snippets. It proves how you let your personal bias override facts Deaf Spy.

    Lets just say you fell for it hook line and sinker Deaf Spy.

  25. Deaf Spy says:

    Still butt-hurt from your writeln() fiasco, aren’t you, Fifi? And you are eager to forget the branch-prediction fiasco, aren’t you, FFE?

  26. oiaohm says:

    Only way Deaf Spy could be telling truth is if fifi is grece or Deaf Spy as those have never put up working code when debating.

  27. oiaohm says:

    Deaf Spy I have wrote functional C snippets here before and pascal snippets as well. You saw it I did a few in pascal the writeln debate without syntax errors. Of course you have ignored the stuff I have done right. The fact you bring the writeln bit up all the time you should have read that.

    So here is another case of Deaf Spy being baseless and telling fibs.

  28. Deaf Spy says:

    Grece wrote a snippet but has syntax errors

    Well, at least he wrote a snippet. I am yet to see Fifi achieve that!

  29. Grece wrote a snippet but has syntax errors.

  30. oiaohm says:

    Deaf Spy I wonder when you will post a proper post without large factual holes.

  31. Deaf Spy says:

    Seen any pink elephants, Fifi? Or aliens doing pot? Get your meds soon.

  32. oiaohm says:

    Grece you are the Hamdonger around here.

  33. oiaohm says:

    HamDong its nice to see you calling yourself a idiot.

  34. Grece says:

    program HamDong;

    begin

    writeln(‘You’re an idiot.’)

  35. oiaohm says:

    https://www.tiobe.com/tiobe-index/
    Deaf Spy again not doing research. Pascal has been in the top 20 used languages for a long time. Its currently at 12 at worst it was a 20. So long after Borland was having noting to-do Pascal it has seen commercial growth. Pascal has never made it back up to its golden age of the 6 in 2001 language since it been down at 20 in 2015 but its still managed to climb back up to 11/12 in 2017 this being able to gain market share is not sign of a dead language.

    So your story does not match the numbers. The tiobe index shows Pascal has had multi opportunities on the commercial stage after Borland stopped in 2008 and Embarcadero Technologies took over. Including some places that are kind strange. Like there are quite a few Nintendo DS that turned out to be writing in Pascal using freepascal. Strange commercial usages have kept the pascal language going.

    Deaf Spy so saying Pascal is dead is a real overstatement. Saying its unlikely ever to get back in the top 10 of languages would be correct and likely to remain in the top 20 for a while yet.

    The long term average number compared to current popularity shows that Pascal has been a highly volatile language in popularity and commercial interest.

    Also the TIOBE numbers are showing something interesting if you had been totaling up the market share covered by the top 20 over the last few years the percentage of the market those cover is reducing. So the program languages been used is diversifying for good or bad.

    Deaf Spy so basically you are back again with false facts. It was possible to create a story against using pascal using the facts but you were too lazy to-do that.

  36. Deaf Spy says:

    Well, Pascal is dead. Borland blew the only opportunity this language had on the commercial stage. Now, viva C#.

Leave a Reply

Your email address will not be published. Required fields are marked *