Einzelnen Beitrag anzeigen

Medium

Registriert seit: 23. Jan 2008
3.679 Beiträge
 
Delphi 2007 Enterprise
 
#6

AW: Delphi Script and Inline ASM

  Alt 14. Okt 2012, 01:38
Since the only well developed and widely known (hence supported) Pascal compiler, with a license that would allow such things, is FreePascal, that would be your choice. However: It is not built for that purpose, and chances are, that you would need to make major adjustments to have it actually inject compiled stuff into a running process (which might even be noticed by AV programs).
An easier way would be, to use FPC to create a DLL with a predefined interface, and use that interface in your host application. But it still goes far further than scripting.

A great scripting tool that DOES on the fly compiling is Lua. The language then isn't pascal anymore, but since you mentioned .NET I gather that would not be an issue. There are at least two nice Lua bindings for Delphi that I have read about, so all to be done is defining the interface. The Lua runtime is free to ship with your program afaik, so it would provide you with all you need.

.NET would not be an easy option from what I know about it. The compiler is not free, so you'd at least need something that creates at least CL and has a fitting license. Having that CL injected into your process is a whole other story. I'd go for Lua. It's well established, well supported, and known as a tool many games even had made large time critical parts of them with it. And on top of that, the Lua language has some pretty neat features
"When one person suffers from a delusion, it is called insanity. When a million people suffer from a delusion, it is called religion." (Richard Dawkins)
  Mit Zitat antworten Zitat