Recent

Author Topic: Discussion - What if fpc syntax becomes C-like?  (Read 3116 times)

GypsyPrince

  • Guest
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #30 on: April 05, 2020, 06:58:35 pm »
If it were efficient, it would be used more rather than being ranked way behind.

lucamar

  • Hero Member
  • *****
  • Posts: 2833
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #31 on: April 05, 2020, 07:17:57 pm »
If it were efficient, it would be used more rather than being ranked way behind.

The ""popularity" of a language depends on lots of things beyond the perceived "efficiency" of coding in it. In fact most of the reasons why a language becomes "popular" have little to do with how easy/efficient is to program in it. Think, for example, on the number of "better C than C" which flourish for a time and then die.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.8/FPC 3.0.4 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

GypsyPrince

  • Guest
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #32 on: April 05, 2020, 07:31:07 pm »
If companies found the language to be efficient, more companies would be using it. They apparently disagree with your opinion.

lucamar

  • Hero Member
  • *****
  • Posts: 2833
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #33 on: April 05, 2020, 08:06:58 pm »
If companies found the language to be efficient, more companies would be using it. They apparently disagree with your opinion.

According to that logic no company would be using it, they would be using the "more effcient" one. That there are, in fact, quite a lot of them using it then serves to contradict your statement.

In most companies (whether software houses or internal software depts.) a language's perceived "efficiency" is considered (if it ever is) as a minor reason in the decision of what to use: potential programmers pool, tools price, existing code-base and quite a lot other things are considered before even efficiency comes to the table. And this is not an opinion, it's a fact I've gleaned through my long career as a programmer.

But, of course, feel free to think whatever you want. You don't like Pascal? OK, use any other thing :)
« Last Edit: April 05, 2020, 08:09:00 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.8/FPC 3.0.4 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

JanRoza

  • Hero Member
  • *****
  • Posts: 570
    • http://www.silentwings.nl
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #34 on: April 05, 2020, 08:27:51 pm »
Can we stop these useless discussions before we bash in each others head.
We are Pascal users and discuss its use, Im getting tired of all those Pascal newcomers who need Pascal to look like another language to be able to use it.
My motto is simple: try a language, you like it than learn it, you don't like it than move on.
Don't try to turn Pascal in something it is not.
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
Laz: Lazarus 2.0.8 FPC 3.0.4
       Lazarus 2.1.0 FPC 3.3.1
       CodeTyphon 7.2 FPC 3.3.1

GypsyPrince

  • Guest
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #35 on: April 05, 2020, 08:46:14 pm »
@JanRoza

Quote
try a language, you like it than learn it, you don't like it than move on.

The exact same point is easily made regarding a feature requested by someone. If you like it - use it. If you don't like it - don't use it. The only person/people who have the right to gripe about any particular request are the developers of the language/IDE. If your are not one of its developers on which the burden of implementing such a feature might rest, then you have no business saying anything about the request, other than to politely (and in an adult manner) offer an alternative suggestion as to how the person might achieve their desired goal.

Don't bash someone else for asking about a feature you will not be forced to use if you choose not to. Doing so is the absolute epitome of childish behavior.
 
Life really is that simple.
« Last Edit: April 05, 2020, 09:00:05 pm by GypsyPrince »

GypsyPrince

  • Guest
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #36 on: April 05, 2020, 09:23:02 pm »
@marcov

Quote
You would have to rewrite the entire parser, and redesign the whole dialect. Possible, but not trivial.

This is a very patient and informative response to the OPs question.

I don't know if you are one of Lazarus' developers, but I'm going to take a blind guess and say you are (?).

It is nice that you are keeping in mind that most people who request a feature have absolutely no experience whatsoever in developing a parser or compiler. Even as long as I've been programming, I wouldn't pretend to know where to begin with customizing Free Pascal to my preferences, and I'm guessing (I could very easily be wrong here) the original poster wouldn't either. So, it is nice to see that you politely point out how much work it would take to implement his request rather than the often seen response given by others which equates to "Your feature request is stupid because we don't want it. Now go away!."
« Last Edit: April 05, 2020, 09:24:37 pm by GypsyPrince »

Tomas Hajny

  • Moderator
  • New Member
  • *****
  • Posts: 38
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #37 on: April 05, 2020, 09:44:47 pm »
Everybody involved, please, stay on topic, or don't reply. No offenses to others! As one of moderators of this forum, I've just removed about ten responses which were either completely irrelevant, or full of dirty words and direct offenses. And before replying further (even on topic), read the FAQ reference posted by Marco.

One addition - if you believe that some post is not appropriate (impolite, off-topic, etc.), don't reply to it and use the link "Report to moderator" instead.
« Last Edit: April 05, 2020, 11:25:21 pm by Tomas Hajny »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8372
  • FPC developer.
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #38 on: April 05, 2020, 11:12:44 pm »
@marcov

Quote
You would have to rewrite the entire parser, and redesign the whole dialect. Possible, but not trivial.

This is a very patient and informative response to the OPs question.

I don't know if you are one of Lazarus' developers, but I'm going to take a blind guess and say you are (?).

No. I work on Free Pascal, and mostly in libraries, not the language. But I learned a thing or two about language (and language discussion) over the years.  Note this is mostly my opinion, but some parts (like C syntax having been suggested many times and categorically rejected) are facts.

The adding of random borrowings from other languages to official FPC is extremely unlikely, see the mentioned faq item.  Pure syntax rearrangements need not apply, since they only complicate and expand the dialect. Even if you would agree that a random syntax B is better than current syntax A (and usually we don't), having them BOTH (you need to keep A out of backwards compatibility) is even worse than having only the lesser one of them.

And no, having a compiler switch or dialect mode doesn't fix that, just look at the strange objfpc-Delphi mode split that is an artefact of such discussions that still persists 20 years later. In time it will only mean that the FPC codebases will become (even more) a patchwork of styles and dialects. That is more likely to send a newbie running for the hills than clean, Pascal syntax.

I would expect interesting solutions that might get a level further on the feature selection path to be more in the direction of co-routines/m*n light threading,  maybe tuples and multiple returns from functions in general. But even those need to be embedded in a framework to make a chance. A feature in isolation is rarely worth the trouble.

So no tired old 1970's C syntax, which has been proposed already roughly three times an year since 2000 and been roundly rejected every time..  Usually also paired with the same old transparent reason of "familiarity for newbies", while the net difference only covers the first half of the first page of a tutorial book. (and you can't even skip that half page entirely since the resulting hybrid would be subtly different anyway)

Most other arguments seem to be self-evident in nature and not particularly critical of the C block syntax in the first place (and concepts like Dangling else are over their head). And even C++ follows Modula2+Pascal by introducing a modular structure, only 40 years late.

And then there is the killer problem. Who is going to implement it? This is even a problem for an accepted solution, but even more for a controversial one (since even if you can show it to somewhat work, it might not be accepted).

There is no tin of developers that are just waiting for inspiration. Most devels have todo lists that keep them busy even after retirement.

Quote
It is nice that you are keeping in mind that most people who request a feature have absolutely no experience whatsoever in developing a parser or compiler. Even as long as I've been programming, I wouldn't pretend to know where to begin with customizing Free Pascal to my preferences, and I'm guessing (I could very easily be wrong here) the original poster wouldn't either. So, it is nice to see that you politely point out how much work it would take to implement his request rather than the often seen response given by others which equates to "Your feature request is stupid because we don't want it. Now go away!."

Well, above you have a verbose "stupid etc" bit.

However, the semicolon bit was different because it hadn't come up (seriously) before, and I misjudged the initial impact on the parser. It was way larger than I initially thought (thanks to Mark and Thaddy for discussing it). Initially I thought it would be solvable locally, e.g. just fixing the ELSE statements (e.g. by forcing always a block), but the straw that broke the camel's back is behaviour with incorrect code. You would really have to redo the most basic level of the scanner/parser.

And if you want to make/suggest language suggestions, you need to start playing with parser software or write your own one, so you can predict effects better. And when doing that it is important to persist, and implement the language as designed, and don't let the parser architecture (tool or handcrafted RD) tempt you in solving it the easy way. Then you very swiftly discover that implementing undetailed features that don't align with the language philosophy is hard, very hard.

ASBzone

  • Sr. Member
  • ****
  • Posts: 347
  • Automation leads to relaxation...
    • BrainWaveCC Utilities
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #39 on: April 06, 2020, 06:19:45 am »
Hello,

I've just started learning Pascal. For the most part the syntax feels redundant or idk how to explain exactly. I'm sure some will get the idea
Now say that fpc is being written from the ground up as a new project, same language features, support etc, but just the syntax is more C-like. Would this bring a positive or a negative results?

The questions I always want to ask when these discussions come up are these:

1. If the perceived benefits of FPC are so small, that you would be distracted or discouraged by its lack of a more C-like syntax, what would cause you to embrace it if it did have such a syntax?

2. What is your dissatisfaction with the existing C-like languages that caused you to look for another language, yet desire it to be C-like?

3. Why is there this implication that popularity is the best measure of the success of a language?
-ASB: https://www.BrainWaveCC.com

Lazarus v2.0.9 r63081 / FPC v3.2.0-beta-r45317 (via FpcUpDeluxe) -- Windows 64-bit install w/32-bit cross-compile
Primary System: Windows 10 Pro x64, Version 1909 (Build 18363.778)
Other Systems: Windows 10 Pro x64, Version 1909 or greater

PascalDragon

  • Hero Member
  • *****
  • Posts: 1489
  • Compiler Developer
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #40 on: April 06, 2020, 09:19:02 am »
The more I delve into Object Pascal the more I am finding it is not for me and will probably set it to the side, shortly. I like OP's verbosity, but there are many shortcomings in the language which make it inefficient as a commercial-level production language. Given the resistance by purists against evolving, OP will remain little more than a niche/hobby language.

That is your view and your view only. There are enough companies out there that use Object Pascal, be it with FPC or Delphi. Because if not, at least Delphi would no longer exist with it being a commercial - and in the higher editions quite expensive - tool. And regarding the language FPC and Delphi aren't that different, so everything that counts for/against Delphi counts for/against FPC as well (aside from a few language features that we don't support yet).

Also we're not against the language evolving, but we're against people shouting "look at feature X of language Y and implement that in FPC!!!!11". A new feature needs to be carefully evaluated whether it's something that really benefits the language or if it's simply the syntactic sugar of the day.

The exact same point is easily made regarding a feature requested by someone. If you like it - use it. If you don't like it - don't use it.

This statement is not correct in the general case either. I mean yes, if I don't want to use a certain feature I don't need to use it, but if I use third party code I at least need to be able to understand it. Let's assume a user who doesn't like to use interfaces. And now he has to use third party code that's heavily based on interfaces (and let's say that rewriting/reimplementing it is not feasible). Thus he'll at least need to understand how interfaces work, so he can use them correctly.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8372
  • FPC developer.
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #41 on: April 06, 2020, 09:50:53 am »
That is your view and your view only. There are enough companies out there that use Object Pascal, be it with FPC or Delphi. Because if not, at least Delphi would no longer exist with it being a commercial - and in the higher editions quite expensive - tool.

With 25% discount the cheapest version it is Eur 1250 or so. Do we really still have to say "higher editions" :P


GypsyPrince

  • Guest
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #42 on: April 06, 2020, 10:56:44 am »
@PascalDragon

Quote
That is your view and your view only.

Well, that's not exactly a revelation, or at least it shouldn't be considering I wrote this as immediately following that statement:

Quote
Now... my personal finding of OP to be inefficient does not mean it is a bad language. Not at all. In fact, it is apparently a great language which many, many others find to be useful and efficient for their particular needs. My point is simply that while OP/Lazarus is perfect in fitting the needs of some, it does not meet the needs of some others.

So, your pointing out what I already said is an exercise in redundancy.

Quote
This statement is not correct in the general case either. I mean yes, if I don't want to use a certain feature I don't need to use it, but if I use third party code I at least need to be able to understand it. Let's assume a user who doesn't like to use interfaces. And now he has to use third party code that's heavily based on interfaces (and let's say that rewriting/reimplementing it is not feasible). Thus he'll at least need to understand how interfaces work, so he can use them correctly.

Yeah... this made absolutely no sense in the context of the point I was making. But rather, it actually re-enforces my point that if a tool doesn't work for his particular needs, he should feel free to pick another that does meet his needs.
« Last Edit: April 06, 2020, 11:23:00 am by GypsyPrince »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8372
  • FPC developer.
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #43 on: April 06, 2020, 10:58:44 am »
Quote
This statement is not correct in the general case either. I mean yes, if I don't want to use a certain feature I don't need to use it, but if I use third party code I at least need to be able to understand it. Let's assume a user who doesn't like to use interfaces. And now he has to use third party code that's heavily based on interfaces (and let's say that rewriting/reimplementing it is not feasible). Thus he'll at least need to understand how interfaces work, so he can use them correctly.

Yeah... this made absolutely no sense in the context of the point I was making. But rather, it actually re-enforces my point that if a tool doesn't work for his particular needs, he should feel free to pick another that does meet his needs.

Ok, try my phrasing of the same sentiment from the (long) post above:

Quote
And no, having a compiler switch or dialect mode doesn't fix that, just look at the strange objfpc-Delphi mode split that is an artefact of such discussions that still persists 20 years later. In time it will only mean that the FPC codebases will become (even more) a patchwork of styles and dialects. That is more likely to send a newbie running for the hills than clean, Pascal syntax.

GypsyPrince

  • Guest
Re: Discussion - What if fpc syntax becomes C-like?
« Reply #44 on: April 06, 2020, 11:11:42 am »
Quote
In time it will only mean that the FPC codebases will become (even more) a patchwork of styles and dialects. That is more likely to send a newbie running for the hills than clean, Pascal syntax.

I have to politely disagree, being that many far more mainstream languages than Pascal utilize a patchwork of styles and continue to attract newbies - i.e, JavaScript, PHP, C++ (though admittedly C++ has become an unhinged nightmare), etc.

 

TinyPortal © 2005-2018