Forum > FPC development

Frankenstein Pascal

(1/21) > >>

yodabitiota:
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.

AlexTP:
It is some far-left extremism, that curly brackets for begin-end. And it's not needed, Pascal has it's own syntax which is OK.

yodabitiota:

--- Quote from: Alextp on March 15, 2021, 11:40:59 pm ---It is some far-left extremism, that curly brackets for begin-end. And it's not needed, Pascal has it's own syntax which is OK.

--- End quote ---
Ok, instead of Frankestein you want to call it Vegan Pascal? Sure.

Syntax is ok, readability suffers. There's a reason python only uses whitespace for block markings. And var declarations out of block are only slightly less bad than global variables at occasion.

I really wish some of those were a feature.

winni:

--- Quote from: Alextp on March 15, 2021, 11:40:59 pm ---It is some far-left extremism, that curly brackets for begin-end. And it's not needed, Pascal has it's own syntax which is OK.

--- End quote ---

Can you please explain the connection between far-left extremism and curly brackets.
I'm curious.

Winni

trev:

--- Quote from: winni on March 15, 2021, 11:51:06 pm ---Can you please explain the connection between far-left extremism and curly brackets.

--- End quote ---

I imagine that it is the opposite of the connection between far-right extremism and square brackets.

Navigation

[0] Message Index

[#] Next page

Go to full version