Recent

Author Topic: 64 bits and PascalScript  (Read 2863 times)

maurog

  • Jr. Member
  • **
  • Posts: 52
Re: 64 bits and PascalScript
« Reply #15 on: June 15, 2025, 06:06:29 pm »
Yes, that would be a possibility. Thank you very much.
And yes, Lazarus is definitely a beast – it comes with everything you need, but sometimes also more than you expect. 😅 (Chat-GPT)

LV

  • Sr. Member
  • ****
  • Posts: 303
Re: 64 bits and PascalScript
« Reply #16 on: June 15, 2025, 07:17:33 pm »
Sometimes I catch myself thinking that I stubbornly do some things in Pascal. Although it may be suitable, such as Lua (https://github.com/malcome/Lua4Lazarus), for these purposes.  :)

maurog

  • Jr. Member
  • **
  • Posts: 52
Re: 64 bits and PascalScript
« Reply #17 on: June 15, 2025, 08:27:56 pm »
Yes, Pascal is simply more fun. Besides, if you use PascalScript, you don’t need any DLLs or shared objects.
And on top of that, for PascalScript there’s already a simple IDE with full debugger support implemented.
I’ll probably stick with PascalScript, and when I have more time (right now I’m busy with TurboBird), I plan to take a deep dive into the PascalScript source code.
Maybe I’ll be able to improve something. And if not, I’ll contact Carlo (the author). Maybe he’ll help us.

And yes, Lazarus is definitely a beast – it comes with everything you need, but sometimes also more than you expect. 😅 (Chat-GPT)

PascalDragon

  • Hero Member
  • *****
  • Posts: 6035
  • Compiler Developer
Re: 64 bits and PascalScript
« Reply #18 on: June 16, 2025, 09:58:12 pm »
Newer versions of Delphi have some API to make calls using RTTI... I don't know what is avail in FPC 3.3.1 (and I heard somewhere it may need some so/dll - but I may have mistaken something else).

The API is available even in FPC 3.2.2. Without a function call manager it can be used for register-functions on i386 as well as on x86_64-win64. For other platforms (and calling conventions) the use of libffi through the FFI.Manager unit is required (and thus the use of libffi.so).

LV

  • Sr. Member
  • ****
  • Posts: 303
Re: 64 bits and PascalScript
« Reply #19 on: June 19, 2025, 11:17:30 pm »
Hi

The suggestion above to solve this problem is a workaround. It consisted of writing wrappers and registering in the script engine for the host program procedures that ran additional event handler scripts. This is not very convenient. After getting to know the PascalScript source code a little, you can find another solution. The attached project shows the idea of ​​registering handlers that can be created in the main script code using a simple example.
The functionality has been tested using Lazarus 3.4; FPC 3.2.2 on Win32, Win64, and Deb64.


 

TinyPortal © 2005-2018