Author Topic: Unleashed Pascal (async/await, parallel for, match, string interpolation & more)  (Read 59526 times)

Fibonacci

  • Hero Member
  • *****
  • Posts: 1089
  • Behold, I bring salvation - Unleashed Pascal
    • fibo.gg
One more screenshot. The previous ones weren't the newest - I took them and recorded the video, then made some more modifications. The newest state:
  • panel titles can be hidden (as in the screenshot)
  • there is a scheme generator (with a live preview on your code)
  • there are more themes ("Ocean" in the screenshot)
For comparison I'm also attaching my current Unleashed IDE, personalized for me.

Packages - I guess the code could go back into packages, but that's not how I imagined a modern IDE. There should be options you can turn on or off, including the docked IDE (panels) and the docked form editor. If those were packages, how would people even know there was something to install? Better to build all the "basic" functionality into the IDE and provide options to customize it. Docked or not, themes, syntax highlighting - these are basic things and should not require installing a package. Leave packages for things like additional LCL controls or whatever.

About dark themes... I have almost NO LIGHT where I work (some dimmed LEDs here and there), my monitors are at about 5% brightness, and if I accidentally open a white website, it's like a strong flashlight straight to the eyes - like walking out of a basement into full sunlight :D The IDE should simply offer personalization, and everyone sets it up the way they like.

I can see neither of you likes the minimap :) That's fine - for me it's a MUST. I can't code without it. It serves as a preview, tells me how long the file is, and doubles as a scrollbar (new IDE only, not lazideminimap package).

That should answer some of your concerns.
Unleashed Pascal: async/await, parallel for, match, tuples, string interpolation, inline vars, autofree, no-RTTI & tons more. Star on GitHub

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12715
  • Debugger - SynEdit - and more
    • wiki
Seem we misunderstand each other on the packages subject.  I was comparing to "pre installed packages" => which is what Lazarus has for docking today. The package is just a matter of source management.  Hence my comment on minimap, were this wasn't yet considered.

creaothceann

  • Sr. Member
  • ****
  • Posts: 445
Mods: feel free to split this off to a new topic :)

OFF TOPIC

@creaothceann,

could you tell us the size of your 2k and 4k monitors ?

I've considered getting one of those but, I don't want to change the font scaling to make the text readable.  I've often wondered if a 32" monitor @ 4k would render text that is readable without having to scale it, hence my question to you.

Currently my largest monitor is 27" with a resolution of 1920x1200 and I find the text to be readable but, it is probably at the edge of what I can read for hours at a time.  27" with res of 1920x1080 is easily readable for hours at a time.  I'd like to have text to be no smaller than what appears in the 1920x1200 in a 2k or 4k setup and I've often wondered if 32" is enough or would I need something larger ?

4k (3840 x 2160) is exactly twice the horz. and vert. resolution of FullHD (1920 x 1080), so if you don't change the font scaling, you get twice the horz. and vert. number of characters at half the apparent size (assuming same panel size and viewing distance). To keep the same apparent character size you'd have to double the width and height of the panel.

It's hard to convey the visual appearance of a 4k display at Windows' default font scaling. Imagine everything on your screen with a fixed size (buttons) taking up half the space on your screen, too small to be readable unless you focus really hard on them. On the other hand, lines in AutoCAD or in videogames become much finer and less flickery.

A 27" 4k display set to 200% font scaling would allow you to see the characters at the same apparent size as a 27" 1080p display, but with finer curves. This improved readability can then be used to make the characters a bit smaller (putting a bit more of them onto the screen) while keeping the same visual quality. That's why I have the font scaling set to 150%.

You might have to see (and test) it in person, at a shop, office or at a friend's place.

- - -

Note that these can all have an influence on the viewing experience:
- panel size
- panel aspect ratio (4:3, 16:9, 16:10, widescreen, rotated to vertical, etc.)
- panel type (IPS, VA, OLED etc.)
- panel backlight (constant, strobing, micro-LED etc.)
- panel dimming zones
- panel coating (glossy, matte, OLED "purple")
- panel curvature
- black frame insertion / backlight strobing (maybe G-Sync Pulsar in the future?)
- max. brightness (full screen and in small regions)
- max. contrast ratio
- color format (chroma subsampling or limited/full RGB)
- subpixel pitch
- subpixel layout
- refresh rate
- input delay
- pixel response time (on LCDs can be partially fixed with Overdrive)
- viewing distance
- viewing angles (bad displays distort the colors when you look up/down)
- ClearView/etc. settings

My setup:

2k: https://geizhals.de/iiyama-g-master-gb3266qsu-b1-red-eagle-a2374078.html
4k: https://geizhals.de/dell-alienware-aw3225qf-a3097692.html

The first one is a 31.5" 1440p 144Hz display with Adaptive Sync and "1ms (MPRT)" pixel response time, which sounds great on paper until you realize that it's a VA LCD display with awful pixel response time, so the number of Hz doesn't even matter. Like all LCDs the panel has crystals that need to physically move, so there's a certain delay when switching colors. The mouse cursor and other moving elements leave a very visible "shadow" behind them, and fast movements in games or even scrolling a website requires a "settling time" until you can see the new picture's content clearly. 1440p at that size means that you can almost see the pixels, and text is fuzzy around the edges. The lower adaptive sync range (48Hz) still leads to tearing when the framerate dips down in a game. Also, on a completely black screen you can still kinda see the backlight through.

The second one is about the same size, but up to 240 Hz and with a 30 times better pixel response time. I can pan around in a game and everything is instantly there (assuming the graphics card is rendering fast enough). The pixel size is so small that programs that don't understand font scaling (e.g. Delphi 5, Paint Shop Pro 7) have almost microscopic buttons. HDR is quite possible thanks to the color depth and maximum brightness. A completely black screen is indistinguishable from it being turned off. There are some downsides: the OLED price, the pixel refresh interval (recommended: every 4 hours), OLED flicker with variable refresh rate in certain dark scenes, sensitive panel coating.
« Last Edit: August 14, 2026, 11:11:02 am by creaothceann »

440bx

  • Hero Member
  • *****
  • Posts: 6585
Thank you @creaothceann, that information is very helpful.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1319
I can see neither of you likes the minimap :) That's fine - for me it's a MUST. I can't code without it. It serves as a preview, tells me how long the file is, and doubles as a scrollbar (new IDE only, not lazideminimap package).

I had no idea there was a minimap package, many thanks for this.  I also find minimaps extremely helpful.  I also like how you're not using the component palette.  I've recently started leaning into the docked IDE, and have now taken inspiration from your video.  Not sure I see the need for a forked IDE though, I'm assuming all can go in packages.  Well not sure I see the need for another forked IDE, Unleashed has an important place.

As for themes - these are personal and as long as they're switchable, then all good.  I hadn't realise Lazarus themes needed a reboot, and I can see the advantage of dynamically switching between light and dark.  But I won't use dark personally.  Eye sight, I can't differentiate windows in dark mode, get frustrated on splitters, edge of windows etc. But that's personal only.
Lazarus Trunk/FPC latest fixes on Windows 11
  How to use the forum:  https://wiki.lazarus.freepascal.org/Forum

creaothceann

  • Sr. Member
  • ****
  • Posts: 445
I'm assuming all can go in packages

For a long time I didn't even know about packages that modify the IDE, I thought they were all just for adding functionality to projects.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12715
  • Debugger - SynEdit - and more
    • wiki
I can see neither of you likes the minimap :) That's fine - for me it's a MUST. It serves as a preview, tells me how long the file is, and doubles as a scrollbar

Hence, good it exists. I don't know how it integrates into the workflow of people who use it.
- I am not really interested how long my file is.
- I don't really use the scrollbar much (and other scrolling is mostly limited to within one function)
- So I don't need a preview, or visual indicator of what lives where.

My navigation are
- codetools
- bookmarks
- occasionally folding
- heavy use of multiple source editors (having the same file, at different functions next to each other on the screen).

And the last bit is one, where docking really don't work for me. Usually I have 3 source editors on screen => those could still be docked. But depending what I work on, that number goes up to a dozen. All different sized, some showing 50 lines of code, other 5 lines. (locked against accidental scrolling).

To arrange those in a docked layout, when I have to set the size of each of them according to the code I have just open now => that is not very practical to me. Also, I may have to temporarily widen one for a long line, then just overlap is easier, than if all other windows are resized by docking rules. (and need to be exactly undone)



Of course, if I am forced to do something on a laptop, where I don't have half of the screen space that the above requires, I do sometimes use a docked IDE (e.g. to debug another IDE, because the one small screen does not handle two sets of floating windows). But then a laptop is not a regular working space. Laptops are in so many ways not ergonomical.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12715
  • Debugger - SynEdit - and more
    • wiki
About dark themes... I have almost NO LIGHT where I work (some dimmed LEDs here and there),
That is why I said light themes are for proper ergonomical setup work areas. That includes proper lighting (unless you have some rare medical condition, disallowing that). If your eyes are adjusted to a light room, if the light is set to cause no glare, no reflection, if the monitor is set so white is no brighter than the white page of a paper book in the same room, .... Then there is no blinding, at least not unless a normal paper book is blindingly bright to you.

CM630

  • Hero Member
  • *****
  • Posts: 1788
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Handling of optional parameters of routines in fpc if what pisses me most.
For example
Code: Pascal  [Select][+][-]
  1.    MyProc (a:integer=0; b: string = ''; c: double = 0);
is called in VB the following way:
Code: Pascal  [Select][+][-]
  1.   MyProc(,,2.45);
If fpc it is called:
Code: Pascal  [Select][+][-]
  1.   MyProc(0,'',2.45);

Are there some improvements in that direction, or are they planned?

EDIT: ChatGPS says that Delphi accepts
Code: Pascal  [Select][+][-]
  1. MyProc(c := 2.45);
« Last Edit: August 14, 2026, 11:06:10 am by CM630 »
Лазар 4,8 32 bit (sometimes 64 bit); FPC3,2,2

creaothceann

  • Sr. Member
  • ****
  • Posts: 445
Handling of optional parameters [...]

Are there some improvements in that direction, or are they planned?

https://github.com/unleashedpascal/compiler/issues/3

chamfay

  • New member
  • *
  • Posts: 8
One more screenshot. The previous ones weren't the newest - I took them and recorded the video, then made some more modifications. The newest state:
  • panel titles can be hidden (as in the screenshot)
  • there is a scheme generator (with a live preview on your code)
  • there are more themes ("Ocean" in the screenshot)
For comparison I'm also attaching my current Unleashed IDE, personalized for me.

Packages - I guess the code could go back into packages, but that's not how I imagined a modern IDE. There should be options you can turn on or off, including the docked IDE (panels) and the docked form editor. If those were packages, how would people even know there was something to install? Better to build all the "basic" functionality into the IDE and provide options to customize it. Docked or not, themes, syntax highlighting - these are basic things and should not require installing a package. Leave packages for things like additional LCL controls or whatever.

About dark themes... I have almost NO LIGHT where I work (some dimmed LEDs here and there), my monitors are at about 5% brightness, and if I accidentally open a white website, it's like a strong flashlight straight to the eyes - like walking out of a basement into full sunlight :D The IDE should simply offer personalization, and everyone sets it up the way they like.

I can see neither of you likes the minimap :) That's fine - for me it's a MUST. I can't code without it. It serves as a preview, tells me how long the file is, and doubles as a scrollbar (new IDE only, not lazideminimap package).

That should answer some of your concerns.

Good changes :), I like it.
I hope to see fullscreen mode with hiding some tabs, to concentrate on the code editor.
Second thing I hope to see is the ability to change the font size of the messages window.

creaothceann

  • Sr. Member
  • ****
  • Posts: 445
autofree EXPR:

Sugar that turns a fresh class instance into a scoped resource. The generated cleanup is "if (x <> NIL) then begin  x.Free;  x := nil;  end"

Afaik Free itself already checks for NIL, so that extra check could be omitted?

- - -

Minor issue:

Code: Pascal  [Select][+][-]
  1. function Test(const i : integer) : AnsiString;
  2. begin
  3.         Result := case (i AND %11) of
  4.                 %00: '0';
  5.                 %01: '1';
  6.                 %10:
  7.                         case (i SHR 7) of
  8.                                 0:   'x';
  9.                                 else '';
  10.                 else '';
  11. end;

The second else is not highlighted as a case-of label.
« Last Edit: August 17, 2026, 07:18:34 pm by creaothceann »

Fibonacci

  • Hero Member
  • *****
  • Posts: 1089
  • Behold, I bring salvation - Unleashed Pascal
    • fibo.gg
autofree EXPR:

Sugar that turns a fresh class instance into a scoped resource. The generated cleanup is "if (x <> NIL) then begin  x.Free;  x := nil;  end"

Afaik Free itself already checks for NIL, so that extra check could be omitted?

Will check that in the sources later.



Minor issue:

Code: Pascal  [Select][+][-]
  1. function Test(const i : integer) : AnsiString;
  2. begin
  3.         Result := case (i AND %11) of
  4.                 %00: '0';
  5.                 %01: '1';
  6.                 %10:
  7.                         case (i SHR 7) of
  8.                                 0:   'x';
  9.                                 else '';
  10.                 else '';
  11. end;

The second else is not highlighted as a case-of label.

I assume you mean the keyword group markup - the case / of / else / end pairing, not the plain syntax colouring. The outer else drops out of the group. I'll see what I can do about it.
Unleashed Pascal: async/await, parallel for, match, tuples, string interpolation, inline vars, autofree, no-RTTI & tons more. Star on GitHub

Thaddy

  • Hero Member
  • *****
  • Posts: 19805
  • Glad to be alive.
BTW optional parameters like VB are supported, but only for methods in classes that support IDispatch afaik: TAutoObject. VB uses IDispatch internally. GetIdsOfNames.  Right-to-left evaluated default parameters are already supported. So ChatGPT hallucinated a bit.
« Last Edit: August 18, 2026, 08:38:30 am by Thaddy »
Any "programmer" that knows only one programming language is not a programmer

Thaddy

  • Hero Member
  • *****
  • Posts: 19805
  • Glad to be alive.
@Fibonacci
Any plans for additional explicit constraints for generic types, most importantly <T:Ordinal> ?
Ordinal covers all integer types regardless of sign + ansichar + enums and sets, including sparse enums.
Makes it possible to iterate over them in a typesafe manner. for x in T do, for T in T do.
Currently that is only partially possible by checking for tkXXX in the body.
« Last Edit: August 18, 2026, 08:49:03 am by Thaddy »
Any "programmer" that knows only one programming language is not a programmer

 

TinyPortal © 2005-2018