Forum > FPC development

Frankenstein Pascal

<< < (2/21) > >>

trev:
Related: https://forum.lazarus.freepascal.org/index.php/topic,53139.0.html

440bx:

--- Quote from: yodabitiota on March 15, 2021, 11:29:23 pm ---But apart those cosmetic tweaks, mostly to increase cross-language readability,

--- End quote ---
Readability ??... sounds a lot more like it would greatly increase _unreadability_. 

At least in my mind, it is dubious that the "languages" that use "++" and curly braces are actually programming languages.  When I see that code, it makes me feel like a veterinarian looking at an epileptic chicken's EKG.  It's painful to look at the poor thing's misery.


--- Quote from: yodabitiota on March 15, 2021, 11:29:23 pm --- It'd just make pascal more similar to 80% of the languages out there.

--- End quote ---
I don't think it is practical nor desirable to make Michelle Pfeiffer look like Roseanne Barr with a beard and curly braces tattooed on her forehead. 


--- Quote from: yodabitiota on March 15, 2021, 11:29:23 pm ---So, a wild idea would be to start modifying FP compiler itself.

--- End quote ---
It does sound like a wild idea particularly considering that there are, unfortunately, plenty of languages out there that poke the programmer's eyes with curly braces, ampersands and more punctuation characters than Timothy O'Leary ever saw even in his wildest trips.


--- Quote from: yodabitiota on March 15, 2021, 11:29:23 pm ---making a mode switch {$FRANKENSTEIN ON} and applying some tweaks to the parser.

--- End quote ---
That's how the C language was designed.  40 years later and the scars are still showing.


--- Quote from: yodabitiota on March 15, 2021, 11:29:23 pm ---start by dropping it as feature request,

--- End quote ---
You might have a future in politics.  Next time there is a big earthquake, you can claim it's a "feature" designed to shake things up.


--- Quote from: yodabitiota on March 15, 2021, 11:29:23 pm ---Any pointers welcome.

--- End quote ---
here is one http://www.iso-9899.info/wiki/The_Standard 

engkin:

--- Quote from: yodabitiota on March 15, 2021, 11:29:23 pm ---First post here, so short introduction. Happy FPC&Lazarus user both hobby as professional.

Not sure where to put such question as this, figured might as well drop it here.

Thing that's on my mind for ages is a 'frankenstein' pascal. You know, fancy c operators like ++, replace begin and end block by curlies, and replace the curlies with hashes. But apart those cosmetic tweaks, mostly to increase cross-language readability, very little else. Well, maybe as wish to use 'var' ad-hoc (which has been discussed). It'd just make pascal more similar to 80% of the languages out there. Which i don't really use but i'm lazy.

So, my first approach was to see what macro's and operators could do. That's very limited when it comes to reserved words, or writing an operator or macro for '++' seems not possible at the moment.

So, a wild idea would be to start modifying FP compiler itself. Which is a rabbit hole i'm not sure willing to dive into or have time resources for, though something had to be the occasion one day, but even if so would be sane to check if such endeavor is actually possible; making a mode switch {$FRANKENSTEIN ON} and applying some tweaks to the parser.

Slightly more lazy approach would be to start by dropping it as feature request, somewhere people know about the internals may know, and maybe asking some feedback. It's likely i'm not the first with such suggestion so maybe there's some existing discussion or efforts about such feature that google not easily answered. Any pointers welcome.

--- End quote ---

Hi there, and thank you for this post. I did laugh after reading the title AND the first five six replies (thank you, 440bx).

As you have seen, you will not be allowed to touch the compiler. But don't get discouraged, it's easier and more logical to work on a transpiler: from Frankenstein Pascal to ObjFPC Pascal.

Beside the changes you want to include, you need to translate locations between Frankenstein Pascal source code and its counterpart ObjFpc Pascal. Line numbers will probably stay the same, it is the location in each line that will change. This will allow finding the location of, say, errors reported by the compiler in the correct location on your side.

If you do come up with a functional transpiler, ideas that are rejected by core developers could be added to yours. Also, new ideas could be tested on your side first before introducing them to FPC.

Edit:
Just to let you know what you are about to face, read this whole thread and it does not finish there, read the replies in the bug report mentioned in the first post. There is also a mailing list thread about it, I don't have the link, where the whole thing started.

I don't blame people resisting new ideas, good or bad, but that should not prevent you from giving your idea a try.

Martin_fr:

--- Quote from: yodabitiota on March 15, 2021, 11:29:23 pm ---similar to 80% of the languages out there
--- End quote ---

https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(syntax)#Blocks
Gives about 20 {} examples. And almost twice as many other examples.

Ok, https://en.wikipedia.org/wiki/List_of_programming_languages_by_type#Curly-bracket_languages
gives approx 60 {} examples, but then there are unlisted none {} languages too.

Not sure, how the 80% got computed. <sarcasm>Probably computed using curly brackets</sarcasm>

engkin:

--- Quote from: Martin_fr on March 16, 2021, 03:11:55 am ---Not sure, how the 80% got computed. <sarcasm>Probably computed using curly brackets</sarcasm>

--- End quote ---

I don't think so, that would make it cryptic and unreadable.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version