Sign in Join
Wiki copytemporary

Feature Ideas: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11> **Warning:** This page is intended to **collect ideas** for features that **could** be included in FPC/Lazarus. Putting an idea here does **not mean** it **WILL** be put into FPC/Lazarus. It's just a place to gather ideas. Think of this as more of a wishlist.
22
33If it is clear who is going to implement the feature, for example, because you have a patch or somebody on the mailing list volunteered to implement it, then it can be added to the [FPC/Lazarus Bugtracker](http://bugs.freepascal.org/), so it can be tracked and scheduled for a release.
44
55If you really want to see a feature implemented urgently, have a look at [[Bounties]] to pay for development.
66
77Tags: Wish, Wishes, Wishlist
88
99# IDE
1010
1111Features that could be included in the IDE
1212
1313## An Integrated IDE
1414
1515(Partly) done in 0.9.29: see [[Anchor Docking]]
1616
1717> **Warning:** There are known bugs in the docking implementation. The Lazarus developers are aware of these and will be working on them if time permits. If you want to help speed this up by providing code, please get in touch on the Lazarus mailing list
1818
1919There are too many windows in the IDE. The more features you use the more they pile up on your desktop and become hidden behind other windows. This is confusing for the newbie and otherwise a mess. Docking windows as found in some IDEs might seem to give flexibility however in practice it is a two dimensional solution. You accidentally undock a window and have it hanging on your mouse while you try to put it back where it was. It would be better to use conventional splitters and tab controls to put it all together into a logical layout.
2020
2121- Associated windows should be converted to Frames and then placed on a single form or tab page on the main form
2222- 1\. There should be a Welcome Page having new project wizards, a list of recent projects, help and resources
2323- 2\. A Development tab containing sub tabs for code and for form design
2424
2525:* a. Code tab including Code Explorer, Source Editor and Project Manager
2626
2727:* b. Form design tab including Object Inspector, Form designer and Component Palette
2828
2929- 3 Debug tab containing the Debug windows as Frames.
3030
3131- 4 since an integrated IDE has less screen real estate, swapping in and out windows need to be easier.
3232
3333:* a. Probably a view concept is needed (different layout in debug then in normal (debug)). Maybe differentiate dependning on the F12 state (designer visible) too.
3434
3535:* b. Big missing feature is the ability to let tabs page in from the side (a tab system to the left and right from the screen, ideal for process manager). When such tab loses focus, it pops back.
3636
3737## Auto-generated database form
3838
3939If you have set up a TSQLQuery, it would be nice to be able to let the IDE autogenerate a from with appropriate controls for all fields. --BigChimp 16:39, 8 August 2014 (CEST)
4040
4141## Easier Dragging & Dropping
4242
4343### Ideas that have been implemented
4444
4545Done in 0.9.29: Options / Form editor / Ask name on create pool: after you add a component at Form, what is your next action? Editing Name/Caption in OI. Would be nice having OI focused and a key field like Name/Caption/Text selected. It would be very intuitive just having to type after dropping the component.
4646
4747## Common
4848
4949- enable menu access through access keys like under windows (i hate mouse sessions :o)
5050
5151example: \<alt\>-\<f\> for file menu. **Question: what operating system/widget set are you talking about?**
5252
5353### Ideas that have been implemented
5454
5555- (Done in 1.1) Open files in the same folder as the current tab editor, like SCite does, it's a bit annoying to navigate from folder to folder every time you need open a file related to the one we are editing at the moment.
5656
5757## Source Editor
5858
5959- Multiple splitting (and close the split) the editor to horizontal and vertical views like with VIM, so I can do split for example Vertically, and inside do a split for Horizontal editor. And we can close each split by right click on the movable splitter and select it from a menu item.
6060
6161- VIM keyboard support - require implementation of a command line like that can accept keyboards like with the VIM text editor.
6262
6363
6464A good example is Qt Creator: you press Alt+V+V and get into FakeVim mode, where most vim commands work
6565
6666Question: what do you mean by keyboard? Another keyboard layout? Different shortcuts keys? Shortcut keys can already be defined via the Tools menu
6767
6868- Multi linguistic spell checkers for strings and comments, using aspell, hspell, ispell etc... (aspell and hspell already have binding for FPC)
6969
7070### Ideas that have been implemented
7171
7272- (Done in 0.9.27) When focusing/selecting one BEGIN the respective END should be in RED to show where it really ends.
7373
7474- (Done in 0.9.29) Movable tabs, so we can place tabs as we wish instead of keeping them where they where opened.
7575
7676- (Done in 0.9.27) Ability to have a way to fold code arbitrary by using comments with special chars such as
7777
78-`some code {% /* } <-- start folding `\
79-` more code`\
80-` ...`\
81-` ...`\
82-`and more code {% */ } <-- stop folding `
78+```text
79+some code {% /* } <-- start folding
80+ more code
81+ ...
82+ ...
83+and more code {% */ } <-- stop folding
84+```
8385
8486- Done: if you click on an error message, the cursor jumps to the code line in question and highlights it.Color code on errors with special underline or some type of color that the user can select/change that will help to locate where the problem is (not instead of the error message that exists today).
8587
8688- Done: see below Ability to keep the string mark (that added to 0.9.27) of a word/selected string as permanent with a toggle of a menu item/key/toolbar or something
8789
8890
8991QUESTION: Does that refer to the "highlight all occurrences" of "word under caret"/"current selection"?
9092
9193That is possible (try alt-M)
9294
9395- (Done: Lazarus 1.0+: context-sensitive help is included with at least the windows installer. See [[Installing Help in the IDE]] Inline help for a command/reserve word that the mouse cursor/keyboard caret are under that word (not instead of the tooltip that exists today when the mouse is hover the command/variable).
9496
9597- (Done) When pressing on CTRL on a file/variable/type etc.. that we are trying to load, it will place a tooltip telling what is going to be opened (the file + the line number) (The information is shown when hovering over the variable)
9698
9799- Done in 0.9.29 Ability to save and load color scheme for syntax highlight.
98100
99101- Done (present in at least 1.2): see Edit/Find in Files which has a replace option Within the "Edit" menu, add an option called "Replace in files...", which allow find and replace text in all the units of the application, doing it at once.
100102
101103### Improvement of the menu and toolbars
102104
103105- to allow end user customization
104106- to obtain more styled menu (similar as Shagrouni xp-menu style)
105107
106108## Integrated and Working Debugger
107109
108110Debugging from inside the IDE can be a frustrating process. I believe this is a combination of GDB being more C/C++ centric, or because it is a more generalized standalone debugger. Either way, I think the ultimate solution is to write a custom debugger for use with FPC and Lazarus IDE. This way it will be possible for the debugger to support ALL Object Pascal and Lazarus IDE requirements, or maybe even be compiled into the Lazarus IDE itself. GDB does support Object Pascal, but not nearly at the level it does with C/C++.
109111
110112An IDE without sufficient debugging support is a hard sell to would-be contributors or Delphi converts. This might also have contributed to some of the negative comments received in the Delphi non-technical newsgroup. Make no mistake, I love the many unique IDE features Lazarus has to offer - it beats Delphi IDE by far.
111113
112114Apart from the standard Lazarus debugging solution using gdb there are multiplle custom written debuggers, partly or completely implemented in Object Pascal:
113115
114116- [[FpGdbmiDebugger]]: uses gdb but also adds Pascal code. In development, experimental; included with Lazarus
115117- **[[FpDebug]]**: Located at components\lazdebuggers\lazdebuggerfp\LazDebuggerFp.lkp Currently support Linux and Windows
116118- **[Duby](http://sourceforge.net/projects/duby/)**: A research project on SourceForge.net.
117119- **[fpdebug (fork of duby)](https://github.com/graemeg/fpdebug)**: It's a fork of Duby with some further development work. I didn't know about the name conflict with the Lazarus one though. The joys of the FP* prefix. :)
118120
119121Please try out these projects and contribute if you can.
120122
121123## Object Inspector
122124
123125### Search field
124126
125127add a "search" text box at the top or bottom (preferred, maybe user settable) of Object Inspector to be able to search for a name or value (maybe with right click menu checkable options on whether Name or Value or both are searched) in the properties/events list
126128
127129Question: What about sub properties?
128130
129131### Recent page
130132
131133add a "Recent" tab to Object Inspector apart from the "Favorites" one, would be more useful than the Favorites one since it's automatic (would keep all properties/events that have been edited \[fields that have either been changed or ENTER was pressed to CONFIRM/REset their current value - focus lost events shouldn't be considered editing if value of property/event field didn't change\])
132134
133135Question: How are items removed from the list?
134136
135137### Not registered component classes
136138
137139Add a field in the object inspector to allow specifying the real class that will be instantiated, with that will allow to uses derived classes without remake/link the IDE, of course the new fields for the real class will not be available to edit in designer. An example: We place a TEdit in a form, but we want to use a derived class we made that add a new field/property/method to TEdit and we will use that new field/property/method programming but in design time it's enough to work with TEdit, actually there is an option to change the class but only to another one that's already linked on the IDE.
138140
139141> **Note:** The class must be registered. This is needed for streaming and RTTI. If you don't want to register the real class, then register a fake class. It would be possible to create an artificial derived class from a registered component class on the fly. This has nothing to do with the OI. A dialog to manage all artificial classes must be implemented and a menu item must be added somewhere.
140142
141143## Refactoring
142144
143145### Global Variable/Method renaming
144146
145147Proper renaming (as in if I rename a field in an object it can change everything that uses it but NOT other stuff that happens to have the same name) -Plugwash
146148
147149
148150Already implemented: See Source Editor -\> popup menu -\> refactoring -\> rename identifier
149151
150152### Parameter Renaming in Methods
151153
152154adding a parameter to a method (and updating everything that uses it) -Plugwash
153155
154156
155157How should that work? What should the IDE/codetools put as parameter at the places?
156158
157159
158160You specify that when you ask for the parameter to be added. Plugwash 05:09, 30 September 2006 (CEST)
159161
160162For example, you add a parameter "b: boolean". The method is used a 100 times.
161163
162164- Possibility 1: You add a default parameter too. No change to the using methods is needed.
163165- Possibility 2: You press compile and the compiler will jump to every occurence and you can decide, what to do.
164166- Possibility 3: A new dialog is added to the IDE, where you can specify to insert a ",false" at every occurence.
165167- Possibility 4: ?
166168
167169Do you have 3 in mind or 4?
168170
169171### Parameter reordering
170172
171173like Delphi. A dialog to add, remove, reorder parameters of a function, method, property.
172174
173175### Improvement of the IDE like GExperts does for Delphi
174176
175177- Done: see Project/Publish project Backup tool...
176178- Tab : provision to set Tab spacing
177179
178180
179181Question: please indicate what you specifically miss in Tools/Editor/General/Tab and Indent
180182
181183- Rename Components (where it is possible too, to fill some properties in this moment. f.e. Button: Caption, Width, Height, Action)
182184
183185## I have a dream of components : Jedi
184186
185187Sure I switch immediately from Delphi to Lazarus.
186188
187189- The Jedi components are a mix of OS dependant, Borland dependant and architecture specific code. I doubt these will ever work on anything but windows/x86. (and maybe win64 with a bit shoehorning). Example: To use a string routine in the strings unit of JCL, you have to fix like 12 units, some of which poke around in the Borland specific debug code. And then you haven't even reached the units of the JVCL, besides this there is a [[licensing]] problem. Marcov 18:27, 4 October 2008 (CEST)
188190- A lot of Jedi code has been implemented in FPC already. Question: do you need more? What components exactly? --BigChimp 15:16, 28 March 2014 (CET)
189191
190192## Code completion
191193
192194### Create/Free objects
193195
194196Declare an object myObj:TMyClass into a TForm class an type some Ctrl-Shift-Key, then the IDE adds a line myObj:=TMyClass.Create in FormCreate and myObj.Free in FormDestroy. -Rednaxel
195197
196198### Add list properties
197199
198200Declaring an indexed property like 'property Items\[i: integer\]: TAType' and using this feature (Ctrl-Shift-Key, Menu), should popup a dialog to setup some parameters and then it should add a private variable fItems: TFPList; (or 'array of' or TList or ^AType), create code in the constructor, destroy code in the destructor and access methods GetItems, SetItems.
199201
200202## Visual Form Inheritance
201203
202204VFI (Visual From Inheritance) works in Lazarus but there are some missing features:
203205
204206- When ancestor and descendant are open in the IDE and a property of the ancestor is changed, then change the descendant too.
205207
206208## Conditional Compiler Options
207209
208210See [[Conditional Compiler Options]].
209211
210212## Help
211213
212214### A small tutorial for Object Oriented Programming
213215
214216I wish to have in Lazarus as in Eclipse in the Help menu a Tutorial for Object Oriented Programming.
215217
216218- This is a good idea, but I think a **offline** help browser is first required. Lucky for you, I already implemented such a beast, called [DocView](http://sourceforge.net/projects/fpgui/files/fpGUI/1.4/). :-) I also have a few old programming manuals around that could contribute to the contents. I know Borland released the OOP chapter what was included in the Turbo Pascal v5.5 & v6 manuals for everybody to use (freely downloadable). So maybe that will be the best place to start. A downloadable copy of the OOP Chapter can be found [here](http://geldenhuys.co.uk/articles/). I also have freely available INF e-books (viewable with DocView) that cover the introduction to Object Pascal and OOP programming (follow [this](http://geldenhuys.co.uk/~graemeg/inf_books/) link) --Ggeldenhuys 13:44, 29 November 2013 (GMT)
217219- Offline help has been included since Lazarus 1.0x with lhelp and the chm format. A help menu item that shows lhelp is included with Laz trunk. Maybe the .inf books could be converted to chm and included with the Lazarus installer --BigChimp 14:21, 30 November 2013 (CET)
218220
219221## Better Macro support by making them easier to find
220222
221223See the feature request [\#14558](http://bugs.freepascal.org/view.php?id=14558) in Mantis. In summary, add a button next to EditBox controls which support macro usage. Clicking the button will display a popup menu with available macros at that level and insert the selected macro into the EditBox at the cursor position.
222224
223225## Copy and Paste Support for a lazy programmer (in properties-editor)
224226
225227Maybe it's by design (because of the same behaviour under win and mac)... but I think, it's a little bit of annoying. When I try to copy the chosen "name" of a component out of proterties-editor by selecting it and ctrl+c, I will not get the text of the name, but the object/component description itself (which is useless, I guess). There is not even a "copy" item in the context-menu. I use very long descriptive names for components (and variables) and it would be nice, to get these unhandy names somehow into the clipboard. KaLi 14:56, 30 June 2010 (CEST)
226228
227229
228230This seems to work in 0.9.31, both Ctrl+C and via context-menu [Bart](http://wiki.lazarus.freepascal.org/User:Bart)
229231
230232## Code Library Window or Tab
231233
232234It would be great to have a built in location to store all those useful pieces of code. Ones that you have created, or found useful.
233235
234236My ideal feature list would be:
235237
236238- Save and Load my personal code
237239- Attach Zip file ( useful for keeping a sample project, showing the code in use).
238240- Ability to Upload Code / zip to central online repository.
239241- Ability to synchronize or select repository code and download to my own code store.
240242- Code could be sectioned into well thought out categories, like Types of controls, Libraries, complete project examples, Tutorials, etc.
241243- A place to show the most recent code submitted by Category.
242244
243245It would also be a good place to help people who need some assistance. I would have the following options:
244246
245247- Option to Ask for help on a control or subject matter.
246248- Notification when a solution is uploaded to the repository.
247249- Maybe a points system rating the assistance given out of 10 ( 1 being not useful, 10 being just what I needed)
248250
249251
250252The "Code Librarian" third party code library tool is available made by Lazarus forum user taazz. Helping him with incorporating these features (if he wants to) could be the best way of getting this functionality: <http://forum.lazarus.freepascal.org/index.php/topic,22752.0.html> and <https://sourceforge.net/projects/codelibrarian/>
251253
252254## Write and run unit tests from subpackage of project being tested
253255
254256The main idea is to have ability to write and run Unit tests from a subpackage of main project. **Please see [[Feature Ideas/UnitTests]]**
255257
256258# LCL
257259
258260## Components
259261
260262Components that are possible to make that will work across all platforms supported by Lazarus
261263
262264- Do you mean customdrawn components? If so, that is already possible. I think the TStringGrid is a customdrawn component. Alternatively, look at [[fpGUI]] for a completely customdrawn GUI toolkit. --Ggeldenhuys 23:56, 30 September 2009 (CEST)
263265
264266### Visual
265267
266268- The existing **TDBLookupComboBox**, could be greatly enhanced by something like an "**.IsFiltered** property": If true, the control should reduce its list of visible (and hence selectable) values in the dropdown list by filtering the DataField by the current DBLookupComboBox while editing. This means, onChange (resulting in DBLookupComboBox.Text updated to someString) automatically reduces the list to **SELECT lookup_field FROM lookup_table WHERE lookup_field LIKE %'+someString+'%**. A feature like that would greatly enhance the usability of Lazarus made database applications!\
267269 To illustrate this idea, compare other similar projects: [1](https://www.freelancer.com/projects/Delphi/Custom-Delphi-TDBLookupComboBox/) [2](https://www.devexpress.com/Support/Center/Question/Details/B196085/filtering-dataset-of-tcxdblookupcombobox) or [3](https://www.drupal.org/sandbox/jauzah/1748434), or this [screenshot](https://www.drupal.org/files/project-images/select2element_screen.jpg) .
268270
269271- Already implemented [[Add Help to Your Application]]: Help system for apps created by Laz! It is a plugin system. That's why it supports cross-platform help system and using the OS's native help system.
270272
271273- The current LCL TStringGrid is a nice improvement over Delphi's feeble control with the same name. Would be great if it could be improved even more!
272274 - Support for data validation event handler, similar to Orpheus grid's OnUserValidation event. *There are many events, for example OnEditingDone, and OnValidateEntry to do this. See [[Grids Reference Page]] and [[Event order]]*
273275 - Support for retrieving, displaying, editing and storing data that are stored in an existing memory structure or in a file rather than in grid itself, similar to the Orpheus grid's OnGetCellData and OnGetCellAttributes events. *There is the TTIGrid, that can show TCollection, TList and TFPList of TPersistent. What else do you need? Additionally, you can bind a TBufDataset to a dbgrid...*
274276 - A TImage component wich support transparent winxp alpha 32 bit icon images
275277 - Support for RightToLeft BidiMode. Fixed in 0.9.31 according to <http://bugs.freepascal.org/view.php?id=18918>. Bug report tracking all RTL/Bidi: <http://bugs.freepascal.org/view.php?id=19303> If there are still bugs, please report them to the bug tracker.
276278- TTrayIcon
277279 - Add a TImageList property in TTrayIcon to change TrayIcon icon or animate it
278280
279281### NonVisual
280282
281283- Clipboard and TTimer that don't depend on LCL. If you use these in a library or console app, the compiler drags in a lot of unused and unneeded LCL code. If you have multiple DLL's, this code is duplicated in each. Current implementations appear to follow the Delphi design approach, where Clipboard and TTimer have dependencies on the VCL - this probably wasn't necessary.
282284 - TfpTimer is a non-LCL timer already available in FPC in unit **fptimer.pp**. Online help is available [here](http://lazarus-ccr.sourceforge.net/docs/fcl/fptimer/index.html). --Ggeldenhuys 14:38, 2 September 2009 (CEST)
283285 - This may be true on Windows, but it´s False for Linux. I recently implemented TTimer for qt interface and the implementation calls Qt API. I think the same applies to Clipboard, since the clipboard depends on the widgetset used too (gtk or qt for example), not only on the operating system. --Sekelsenmat 20:40, 5 Mar 2006 (CET)
284286 - The LCL is a visual component library. None visual components are provided by the FCL.
285287 - Lazarus will only provide components based on the LCL.
286288
287289## PDA Support
288290
289291Something that currently does not exist is a complete multiplatform solution for PDAs. If we can implement this, Lazarus will become the first multiplatform RAD for PDAs ever created. Some devices work with Java, some work with c++ and Qtopia, some work with their particular APIs, there is no single solution currently that can embrace a large portion of PDAs. Application have to be redone for every PDA or simply just run on one of them (what most people do).
290292
291293The LCL implements many things. It is not necessary to implement them all to have a reasonably working Lazarus PDA widgetset. The most important things to be implementeded for PDAs are:
292294
293295- TApplication
294296- TForm
295297- TScreen
296298- TCanvas and painting
297299- Most Events (onClick and OnPaint at least)
298300- Basic widgets like: TButton, TLabel, TEdit, TMemo.
299301- Only minimum necessary LCLIntf functions to make TCanvas work. (GetDC, ReleaseDC, BeginPaint, EndPaint and some painting functions)
300302
301303Others can be easily implemented by people who need them after those are ready.
302304
303305Here is a list of some PDAs and the status of their support on Free Pascal / Lazarus:
304306
305307- Windows CE - The compiler already works really well cross compiling for Windows CE. The [[Windows CE Interface]] is under implementation.
306308- Symbian OS - Possible for their ARM devices. Requires first adding a new Runtime Library for this OS to the Compiler. This OS has it's own API. There are open source projects for python and c to work on Symbian OS, so Free Pascal should work as well when a RTL is written.
307309- Qtopia - For Zaurus and other linux-based PDAs. This is much easier now that basic Qt4 widgetset has being implemented, because Qtopia is very similar to Qt4. Some magick on the bindings is expected to make the same widgetset code to run for both Qtopia and Qt4.
308310- Java - Some handheld devices, specially phones, only support java bytecode. May seam a little odd, but there is a Pascal Compiler capable of compiling the source into a jar and then into bytecode. It's name is Midlet Pascal <http://www.midletpascal.com/> It may be possible to develop a similar technology that adds a java bytecode target for Free Pascal. Some people already start porting midletpascal to delphi <http://forum.boolean.name/attachment.php?attachmentid=7975&d=1255392966>, follow instructions on <http://www.pascalgamedevelopment.com/forum/index.php?topic=5466.0> to access it.
309311- Palm OS - PalmOS 5 Garnet support requires that first the 68k compiler is working (runs on ARM processor with a kind of emulation) and then a RTL for palmos needs to be written. Only Free Pascal 1.0 supports 68k, this wasn't updated and the new compiler 2.0 doesn't support it yet (work in progress by [[fpc:User:Chain-Q]]), so will be a problem.
310312
311313PalmOS 6 Cobalt is fully arm, so it only requires a rtl, but it has zero devices working on it currently and won't be on the market until 2007 at least.
312314
313315Other compilers that support this target: [Pascal & Palm Compiler](http://www.ppcompiler.org) and [HsPascal](http://hspascal.fihl.net/). Unfortunately those compilers are not open source, so we can't use their code, we need to implement PalmOS RTL from zero.
314316
315317## More Interfaces
316318
317319- Cocoa - Requires that first OpenSTEP bindings are created for Free Pascal. Cocoa interface support has been started; see [[Cocoa Interface]]
318320- BeAPI - interface for Haiku, ZetaOS and BeOS. There is no powerful RAD on this OS.
319321 - Bindings to the BeAPI has been started - though not part of the Lazarus project. Have a look at SourceForge [befpc](http://befpc.sourceforge.net/) project.
320322- [SDL](http://www.libsdl.org) - something like what was done in [Pixel Image Editor](http://www.kanzelsberger.com/pixel/).
321323- MacApp 2.0 - For 68k-based Mac computers. MacApp was Apple Computer's primary object oriented application framework for the Mac OS for much of the 1990s. First released in 1985, it is arguably the first such system to be widely used, notably on a microcomputer platform. Microsoft's MFC and Borland's OWL were both based directly on MacApp concepts. This framework was completely written on Object Pascal, so it should integrate really nicely with Free Pascal and Lazarus. When Apple moved to PowerPC it also dropped Object Pascal support, but that's another story. A emulator for 68k-Mac can be easely set up with [BasiliskII](http://basilisk.cebix.net/). There is also a project called MacApp2PPC that upgraded MacApp pascal code to run on Power PCs.
322324- OS/2 native - Free Pascal works well with OS/2, so this should be quite possible.
323325- Solaris - OpenSolaris versions exist and it's quite similar to Linux so why not ? For information on the Solaris port of Lazarus, see: [[Lazarus on Solaris]]
324326- Web Interface - Application compiles to an embedded HTTP Server who serves forms in ajax pages (or compiles it to an Apache Module), like Intraweb in Delphi. Discussion in <http://www.lazarus.freepascal.org/index.php?name=PNphpBB2&file=viewtopic&t=2489>
325327- Already implemented: [fpGUI](http://fpgui.sourceforge.net/) - A widget set written in Free Pascal without any large library requirements. fpGUI talks directly to the underlying graphics library and is very easy to port to new platforms. Currently it supports Linux, ARM-Linux, FreeBSD, Windows and WinCE. - Under development here: [[fpGUI Interface]]
326328
327329### improved EventQueue
328330
329331- [[Lazarus improved Event Queue]]
330332
331333### Lua
332334
333335- Support for Lua interfacing. (Binary modules?)
334336 - What is Lua interfacing? Is it a graphical widgetset? What is the difference between what you want and is supplied by the lua units of fpc: <http://svn.freepascal.org/svn/fpc/trunk/packages/lua/>
335337 - Perhaps the poster wanted to use the Lua scripting language to access the LCL widgetset. Had a quick look at the FPC lua package mentioned above: no readme, no test, no demo, so not easy to see what that package does/can do. Perhaps it can be used as-is to do what the poster wants; in that case, some additional samples/documentation may be handy. BigChimp, September 2012
336338
337339# Visual Improvements
338340
339341## An idea for a splash screen
340342
341343![](/wiki-images/e/ea/Splash_logo2_.png%E2%80%8E)
342344
343345The font for "write once..." is DejaVue Serif Condensed, for "Lazarus" is Phantom, and for "object pascal" is Tahoma.
344346
345347If you want to change the splash logo on Windows, in your main Lazarus installation folder find "images" folder and there find "splash_logo.bat". Then edit and run it or replace "splash_logo.png" and run "splash_logo.bat".
346348
347349### critique
348350
349351- as if people's desktops are not already cluttered to the max... not desirable
350352
351353# FPC
352354
353355## Per-type Byte Alignment
354356
355357A means to align variables and records in a unit is already possible with compiler directives, but is somewhat messy and might cause conflicts in some situations. What I propose is an addition to the Free Pascal syntax that forces all variables of a defined type to be aligned to a particular boundary. e.g.
356358
357359``` pascal
358360 type
359361 AlignedDouble = Double align 16;
360362
361363 type
362364 TVector4f = packed record
363365 X, Y, Z, W: Single;
364366 end align 16;
365367
366368 type
367369 TVector4fArray = array of TVector4f align 32;
368370 { tighter restrictions than TVector4f, so it's okay. Note that this should probably align Var[0] to a 32-byte boundary, not necessarily Var as a whole }
369371```
370372
371373Such aligned types are useful and even necessary for when working with SSE and AVX, where significant speed gains can be achieved with aligned data (and some operations require it).
372374
373375Apparently Delphi supports something like this already, but it isn't well-documented.
374376
375377### Nuances
376378
377379- The exact syntax.
378380- Cross-platform support. Do all platforms support memory alignment?
379381- Exact error messages or behaviour if you specify a non-power of 2 alignment.
380382- What happens if you try to typecast an unaligned variable to an aligned type? (Aligned to unaligned should be fine)
381383- What happens if you try to typecast a pointer to an unaligned type to a pointer to an aligned type?
382384- What happens if you, say, declare a type aligned to 16 bytes, and then declare another type that is equal to it but is only aligned to 8 bytes?
383385- What happens if you, say, declare a type aligned to 16 bytes, then use it as a field in a record type, aligned or otherwise?
384386
385387CuriousKit ([[User talk:CuriousKit|talk]]) 18:28, 5 December 2017 (CET)
386388
387389## "vectorcall;" modifier for Win32 and Win64
388390
389391This function modifier is the only unique modifier for Win64 (although it can be used in Win32 too), introduced by Microsoft at the behest of game developers who wish to reduce the overhead of passing vectors and the like into subroutines. The basic details are the same as the regular Win64 calling convention, but attempt to vectorise certain record types and pass them in their entirety through a single XMM register (something which is already possible in Linux64 sometimes). Details can be found here: <https://msdn.microsoft.com/en-us/library/dn375768.aspx>
390392
391393This may require the byte alignment feature described above.
392394
393395
394396vectorcall is implemented in (the upcoming) fpc 3.2 for the win64 platform. Bart
395397
396398### Nuances
397399
398400- What happens if it is used on a platform other than Win32 or Win64? Does a compiler error occur or is it ignored with a warning?
399401
400402CuriousKit ([[User talk:CuriousKit|talk]]) 23:04, 5 December 2017 (CET)
401403
402404- - It is ignored with a warning. Bart ([[User talk:Bart|talk]]) 17:43, 20 December 2022 (CET)
403405
404406- As an example of prior art I think Vector Pascal[1](https://sourceforge.net/projects/vectorpascalcom/) is noteworthy. MarkMLl ([[User talk:MarkMLl|talk]]) 09:12, 6 December 2017 (CET)
405407
406408## "default"-value in a proc or function call
407409
408410- There is a limitation in the freepascal-Syntax where you can not depend on the default-parameter lefthand from an explicit parameter. I suggest a possibility where you can say "default" in a function-call, and set other parameters at the same time.
409411
410412``` pascal
411413program DefaultParameter;
412414
413415{$mode objfpc}{$H+}
414416
415417type
416418 Pilots = (Charles, Amelia, Belly, Louis);
417419
418420procedure Fly(Pilot: Pilots = Belly; Copilot: Pilots = Charles);
419421begin
420422 if (Pilot=Copilot) then
421423 halt(1);
422424end;
423425
424426begin
425427 Fly; // we fly with Belly+Charles
426428 Fly(); // we fly with Belly+Charles
427429 Fly(Amelia); // we fly with Amelia+Charles
428430 Fly(Louis, Belly);
429431
430432 // The following "default" is my Feature Idea
431433 // │
432434 // v
433435 Fly(default, Amelia); // we fly with Belly+Amelia
434436end.
435437```
436438
437439### Critique
438440
439441- If such a feature should exist, wouldn't it be more straightforward to simply not specify anything before the comma? (i.e. "Fly(, Amelia);") CuriousKit ([[User talk:CuriousKit|talk]]) 14:50, 7 December 2017 (CET)
440442
441443## "pure;" function directive
442444
443445I propose a new directive keyword that can be specified for functions, named **pure**. Its intention is to act as a hint to the compiler that the function is fully self-contained, has no side-effects (although the compiler will actually check if this is the case) and is guaranteed to return the same output for a given input. An example would be the Int function, which returns the input value with the fractional part stripped off, and nothing else.
444446
445447So what would be the advantage of a function being 'pure'? With a pure function, if the input values are constants, then the output(s) will also be constants, hence they can be pre-calculated during compilation and the function call completely replaced with an assignment, offering a massive speed boost and providing a sort of general-purpose means of doing what some internal compiler routines do in regards to replacing calls with static values.
446448
447449There are potentially two ways that the compiler can determine if a function is pure:
448450
449451- Perform deep analysis of the pre-compiled assembly language, almost like an emulator (platform-dependent, but will allow pure assembler routines to be considered for function purity, which may be beneficial for operations such as ROL, ROR, BSF and BSR).
450452- Run the subroutine's source code through PascalScript (largely platform-independent), and if unresolved reference errors occur, then the function can be considered impure.
451453
452454In this case, the **pure** keyword gives a hint to the compiler as to which procedures to check for purity, so it doesn't waste a potentially long time on routines that the programmer already knows are impure.
453455
454456If a function is marked as **pure** but it turns out not to be, the compiler throws a warning much like what happens if it's marked as **inline**, but something makes it an invalid candidate. The following paradigms would make a function a non-eligible candidate:
455457
456458- Reading from or writing to external memory (including static and global variables)
457459- Reading from or writing to I/O
458460- Contains **var** parameters (since, by definition, they cannot be a constant)
459461- Dereferencing a pointer (which also means object methods cannot be made pure, including **constructor** and **destructor** since, by definition, they allocate and deallocate memory related to object instantiation. I don't think class methods can be pure either) - the only exception to this are **out** parameters, since their type and size are tightly controlled and the dereferencing is effectively hidden from the programmer anyway.
460462- Allocating or deallocating memory
461463- Obtaining the address of something (using the @ operator)
462464- Calling another function (unless that function is also pure, in which case, pre-computing an output becomes a recursive operation. Note that actual recursion, where a function calls itself, is allowed and may be required in places... for example, with an implementation of a factorial function)
463465- There are code paths where uninitialized values can be read (this includes reading an **out** parameter prior to writing to it).
464466
465467There are probably other things that prevent a function from being pure.
466468
467469**pure** will generally only be used on **function**s; **procedure** is nevertheless valid because the output may be an **out** parameter, so long as the procedure's body follows all of the rules of a pure function.
468470
469471### Nuances
470472
471473- What happens if the pre-computation of an output value would cause an exception to be raised (e.g. division by zero)?
472474- What happens if the pre-computation would cause an infinite loop? How well can this be detected via finite state analysis rather than a timeout? (It's likely very difficult to do it purely via finite states - see [Turing's Halting Problem](https://en.wikipedia.org/wiki/Halting_problem)).
473475- What happens if a constant is declared to equal a pure function (e.g. "**const** QuarterPi = atan(1);" if atan is declared and proven pure). On the surface this seems perfectly valid, but what happens if optimizations are turned off?
474476
475477CuriousKit ([[User talk:CuriousKit|talk]]) 01:20, 17 June 2018 (CEST)
476478
477479## Support for Traits
478480
479481As a user who never got warm with the concept of interfaces, I'd like to suggest support for traits [2](https://en.wikipedia.org/wiki/Trait_(computer_programming)).
480482
481483## Support for Promises
482484
483485I know there are TThread.ExecuteInThread, Synchronize, Queue, etc. But JavaScript's promises [3](https://en.wikipedia.org/wiki/Futures_and_promises) are so intuitively to use that I'd love to see support in FPC. Could be an enormously handy feature when dealing with tasks for which, on the one hand, TThread would be overdimensioned, but on the other hand, doing the task in the main thread would on the other hand cause lags. I'm especially thinking about web requests, loading data from a file (which could be on a network drive), etc.
484486
485487# Other
486488
487489## Fixes branch releases
488490
489491Already done: Currently we only have snapshots of the fixes branch, and it would be nice to also have them as releases. To have releases, those builds would have to be tested by someone, so I volunteer for that. What is needed is a testing checklist, and the start of it can be found on my page, User:Arny. Any further ideas are welcome!
490492
491493- This is already done and maintained for v0.9.28 onwards of Lazarus. Downloads of *fixes* releases are available on SourceForge.
492494
493495## See Also
494496
495497- [[Bounties]] - A way to make sure your feature idea is implemented.
496498- [[How do I create a bug report]] general information on submitting bugs, what should be covered in a bug report, and using the bug tracker.
497499- [[Tips on writing bug reports]] detailed information on what should be covered in a bug report.
498500- [[Database bug reporting]] Specific info and sample programs for database bugs
499501- [[Moderating the bug tracker]]
500502
501503---
502504*From the Free Pascal wiki, page "Feature Ideas", as it stood on 2022-12-20 after a change by Bart, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
503505Category: Lazarus
504506Category: Proposals

Back to history