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

n7800

  • Hero Member
  • *****
  • Posts: 802
  • Lazarus IDE contributor
    • GitLab profile
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.

This doesn't require a fork - it's possible in "official" Lazarus as well. The feature for configuring window fonts is already being discussed in !561. I also have some work-in-progress code for the full-screen mode, but it hasn't been published yet because the task is more complex than it seems. For example, whether to hide the menu in fullscreen mode and how to show it when pressing [Alt]/[F10], whether to show the IDE coolbar, and how all this will work together with docking and Desktops features...

This is off-topic here, but perhaps it will be implemented someday ))

Thaddy

  • Hero Member
  • *****
  • Posts: 19966
  • Pointless static linking author
It's quite likely that a genuinely safe version of FPC and/or Delphi might not be able to produce much more than a "hello world" program.
:D
Of course not. But you are right about Ada: you can write unsafe code in Ada too. I know, like me, you have Ada experience.
Otoh, the NIST C++ compiler is a stripped down C++ that tries to eliminate unsafe features from the C++ language (how?  :o), so efforts to make a programming language safer are not Pascal centric only.
I think such an initiative is not strange at all.
Any "programmer" that knows only one programming language is not a programmer

440bx

  • Hero Member
  • *****
  • Posts: 6619
The thing about creating a memory safe programming language is more a mirage than anything else.

Any language that allows unsafe code isn't memory safe since there can be areas in the code that are unsafe.  The only thing that has changed is the unsafe surface.

For instance, in Ada, creating unsafe code takes some setting things up, thereby creating a boundary for the unsafe code.  That's very much unlike C, C++ and FPC where every single line of code can be unsafe (just do pointer arithmetic and safety is out the window.)

Lastly, all the languages that can really be considered memory safe (neither Ada, C, C++, FPC, etc qualify) do so at considerable cost in more ways than one.  An example is Java, performance is a problem (unless you're writing a glorified but, portable of course, "hello world" program... look Ma, it's portable... woooohooo!)

For real programming the only language I've seen that provides a well balanced solution is Ada and, even Ada doesn't guarantee full safety.

A programming language is a tool.  How effective and safe the tool is, is ultimately determined by its user.  In the wrong hands, someone can probably find a way to cut themselves with liquid soap (I don't know how, but, somehow they'll figure out some way.)


« Last Edit: September 17, 2026, 07:40:23 am by 440bx »
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

H₂SO₄

  • Hero Member
  • *****
  • Posts: 511
Since we're already discussing safety, I'd like to propose a backwards-compatible mechanism for addressing the mutating method invoked on a  const-qualified parameter issue:

Code: Pascal  [Select][+][-]
  1. type
  2.   TBar = record
  3.   public
  4.     Qux: Integer;
  5.     procedure SetQux(Value: Integer); impure; // <--- New modifier acting like C++ `const` in reverse
  6.   end;
  7.  
  8. procedure TBar.SetQux(Value: Integer);
  9. begin
  10.   Qux := Value;
  11. end;
  12.  
  13. procedure Foo(const Instance: TBar);
  14. begin
  15.   Instance.Qux := 42;  // Rightfully fails to compile
  16.   Instance.SetQux(42); // Incorrectly succeeds on stock FPC, but would be caught by Unleashed (can't call impure method on const object)
  17. end;

I know that this is merely a band-aid solution to a fundamentally broken constness system, but in light of the severity of bugs it could prevent, I'd be very happy to see it land (be it in Unleashed or even stock FPC).
Introducing severe memory bugs in supposedly "safe" Pascal shouldn't be as easy as calling  Push  on a vector implemented as an advanced record (happened to me once - no pointer math required!)  :o

Thaddy

  • Hero Member
  • *****
  • Posts: 19966
  • Pointless static linking author
For real programming the only language I've seen that provides a well balanced solution is Ada and, even Ada doesn't guarantee full
Yup.  :) :)
I expect you to solve this riddle too:
https://forum.lazarus.freepascal.org/index.php/topic,74954.msg590553.html#msg590553

At least you make a decent chance.

Anyway, limitations are a good thing, to stay on subject.
« Last Edit: September 17, 2026, 10:52:40 am by Thaddy »
Any "programmer" that knows only one programming language is not a programmer

Fibonacci

  • Hero Member
  • *****
  • Posts: 1103
  • Behold, I bring salvation - Unleashed Pascal
    • fibo.gg
Unleashed IDE - new look, testers wanted

The IDE got a new look: themes, a new pane-based docking system and extra windows, all on the devel branch. Before it goes to main it needs testing - different OSes, desktops, setups, and honest opinions.

No Qt, and nothing third-party behind themes and panes - both are my own code, preinstalled, painted on the stock LCL widgetsets (win32 on Windows, GTK3 on Linux).

How to install
What's new

Themes
  • 8 themes - Light, Dark, Ocean, Frost, Paper, Ember, Midnight, Dusk - plus "Follow system"
  • Switched live from the View menu, no restart. Designer and Object Inspector follow the theme
  • Each theme can auto-generate a matching syntax highlight profile (on by default)
  • Scheme creator with live preview, and random rolls with previous/next - one click too many while hunting for the right one is no loss
  • Scheme manager, plus a Misc Colors window (one section so far, the messages window, more to come)
Panes - new docking
  • Tool windows dock as panes in a tree of splits around the editor; move or close them from the title bar, or hide title bars entirely
  • The form designer is always docked - a tab next to the source, no "enable docked designer?" question on first start
  • Three kinds of extra windows: empty (any panes, duplicates included - a second component list, another inspector), editor (the same file mirrored, or a different one) and designer
  • Several monitors? Put each window on its own screen
Portable
  • The whole install (IDE + compiler) lives in one folder, settings included
  • Move it, copy it, rename it, run it from a USB stick - the IDE notices the new location on start and updates every stored path itself
  • No need for the installer's shortcut: just run lazarus (lazarus.exe on Windows) from the lazarus folder
What to test
  • Does it work wherever stock Lazarus works? Windows, Linux (the installer builds the IDE with GTK3, and GTK3 got the most new code - themes backend, designer look, cursors), different desktops, HiDPI, multiple monitors
  • Move or copy the whole install somewhere else and start it again - does everything still work, 100%?
  • Themes and panes in everyday work - anything broken, ugly or annoying
  • Your personal opinion. What you like, what you'd change
Please include OS, desktop/widgetset and what you did when reporting.
Unleashed Pascal: async/await, parallel for, match, tuples, string interpolation, inline vars, autofree, no-RTTI & tons more. Star on GitHub ⭐

Fibonacci

  • Hero Member
  • *****
  • Posts: 1103
  • Behold, I bring salvation - Unleashed Pascal
    • fibo.gg
2 more themes (limit).
Unleashed Pascal: async/await, parallel for, match, tuples, string interpolation, inline vars, autofree, no-RTTI & tons more. Star on GitHub ⭐

Thaddy

  • Hero Member
  • *****
  • Posts: 19966
  • Pointless static linking author
In wsl2 it completely crashes my ubuntu 24 tls...
Any "programmer" that knows only one programming language is not a programmer

Fibonacci

  • Hero Member
  • *****
  • Posts: 1103
  • Behold, I bring salvation - Unleashed Pascal
    • fibo.gg
In wsl2 it completely crashes my ubuntu 24 tls...

WSL2 is not really a target - surprises there are kind of expected. Please try it on a real machine, or at least in a VM.

I'll still have a look at what went wrong there later, maybe it can be sorted out.
Unleashed Pascal: async/await, parallel for, match, tuples, string interpolation, inline vars, autofree, no-RTTI & tons more. Star on GitHub ⭐

Thaddy

  • Hero Member
  • *****
  • Posts: 19966
  • Pointless static linking author
wsl2 should be better than a VM, but It will test both on some real machines and a VM.
Any "programmer" that knows only one programming language is not a programmer

Fibonacci

  • Hero Member
  • *****
  • Posts: 1103
  • Behold, I bring salvation - Unleashed Pascal
    • fibo.gg
In wsl2 it completely crashes my ubuntu 24 tls...

I tried it myself - Ubuntu 24 on WSL2, same as yours - and it works 100% fine here. Installed very fast, no problems at all, and everything runs smoothly.

The only difference I can think of: I'm on Windows 10, you're probably on 11. Otherwise it's the same setup.
Unleashed Pascal: async/await, parallel for, match, tuples, string interpolation, inline vars, autofree, no-RTTI & tons more. Star on GitHub ⭐

creaothceann

  • Sr. Member
  • ****
  • Posts: 471
  • The minimap has some options in "Menu | Tools | Options | Editor | Minimap", the "Show minimap" could perhaps be synchronized with "Menu | View | Code Minimap".
  • I can't seem to change docked windows to stand-alone windows?
(tested on x86 Win10, will test on Win11 later)

I like that the configuration is now loaded automatically without requiring a command-line parameter; makes it possible to register *.lpi files to open with the executable.
« Last Edit: October 05, 2026, 01:08:46 am by creaothceann »

Fibonacci

  • Hero Member
  • *****
  • Posts: 1103
  • Behold, I bring salvation - Unleashed Pascal
    • fibo.gg
The minimap has some options in "Menu | Tools | Options | Editor | Minimap", the "Show minimap" could perhaps be synchronized with "Menu | View | Code Minimap".

Not sure exactly what you mean, but I've just added a Show the code minimap checkbox to the minimap page in IDE Options.

I can't seem to change docked windows to stand-alone windows?

There is no such option - the IDE is always one window. But you can open more windows from the main menu: Panes -> New empty / editor / designer window, and move any of them to another monitor.

For a similar effect to floating windows: create a new empty window, turn on the panes you want there, and turn them off in the main window. A new designer window works the same way - form editing then happens there, in that window.

Also: Misc Colors in the View menu is now Misc Look, with a few more options. I noticed that in a dark theme, for example, the disabled Remove button in the Project Inspector was not visible at all - so icons are now adjusted to the theme automatically. You can also change the font of the Messages window there now.
Unleashed Pascal: async/await, parallel for, match, tuples, string interpolation, inline vars, autofree, no-RTTI & tons more. Star on GitHub ⭐

Thaddy

  • Hero Member
  • *****
  • Posts: 19966
  • Pointless static linking author
@Fibonacci
14:26:09# (9015) Linking ../lazbuild
14:26:11# (1008) 8277 lines compiled, 3.6 sec, 4814448 bytes code, 3750504 bytes data
14:26:11# (1021) 2 warning(s) issued
14:26:11# (1022) 12 hint(s) issued
14:26:11# make[2]: Leaving directory '/home/thaddy/fpcstatic/lazarus/ide'
14:26:11# make[1]: Leaving directory '/home/thaddy/fpcstatic/lazarus/ide'
14:26:11# Registering release packages
14:26:11# Running: lazbuild lazbuild --add-release-packages
14:26:11# Error: (lazbuild) Invalid option at position 7: "add-release-packages"
14:26:11#   lazbuild --add-release-packages failed (lazbuild exit=6)
14:26:11# === INSTALL FAILED: lazbuild --add-release-packages failed (lazbuild exit=6) ===
Any "programmer" that knows only one programming language is not a programmer

Fibonacci

  • Hero Member
  • *****
  • Posts: 1103
  • Behold, I bring salvation - Unleashed Pascal
    • fibo.gg
14:26:11# Running: lazbuild lazbuild --add-release-packages
14:26:11# Error: (lazbuild) Invalid option at position 7: "add-release-packages"

That error points at the IDE branch. Are you absolutely sure you selected devel there? If you are, please mail the full installer.log to fibodevy@gmail.com
Unleashed Pascal: async/await, parallel for, match, tuples, string interpolation, inline vars, autofree, no-RTTI & tons more. Star on GitHub ⭐

 

TinyPortal © 2005-2018