Re: [fpc-pascal] Create class descendant at runtime?
On 04/29/2014 06:59 PM, Mark Morgan Lloyd wrote: In my case it was a MIDI filter:... Ahh, one keyboarder more on this list :-) . Hi to you. (off topic: I once successfully tested doing MIDI/Audio VST plugins with Delphi, using an appropriate SDK that is available in the Internet. Right now I am done building a Windows embedded PC based blackbox for the sound software I use with a keyboard. Doing VS Plugins with fpc myself would be a nice option, but of course this box completely is on 64 Bit and I did not find an SDK to be used on this behalf. Did you ? ) -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Create class descendant at runtime?
Michael Schnell wrote: On 04/29/2014 06:59 PM, Mark Morgan Lloyd wrote: In my case it was a MIDI filter:... Ahh, one keyboarder more on this list :-) . Hi to you. Only marginally. A small and elderly Yamaha hooked up to PianoBooster and a MIDI output box, with Brighton/Bristol available as an alternative output device. (off topic: I once successfully tested doing MIDI/Audio VST plugins with Delphi, using an appropriate SDK that is available in the Internet. Right now I am done building a Windows embedded PC based blackbox for the sound software I use with a keyboard. Doing VS Plugins with fpc myself would be a nice option, but of course this box completely is on 64 Bit and I did not find an SDK to be used on this behalf. Did you ? ) I remember. In my case I'm interfacing to ALSA on 32-bit x86 Linux, I found a couple of sets of declarations etc. in Pascal... I can't remember whether one of them was adequate or if I merged them in some way. It seems to me that ALSA needs a lot of housekeeping code to do comparatively simple jobs. In part, the project was an experiment in interfacing plugins etc. I was interested to explore the extent to which a plugin could be written as both a library and as a standalone program, in an attempt to conform to the spirit of GPL (answer: on unix it can't). -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Create class descendant at runtime?
Michael Schnell wrote: On 04/29/2014 03:58 AM, Craig Peterson wrote: Does Free Pascal or any of the included packages have a way to create a descendant of a class at runtime? Only a script interpreter could possibly create a Type at runtime. AFAIK, there is a Pascal script interpreter usable with fpc. And in a script I don't think this is a bad idea (but I am not an expert with scripts). Or possibly building the source for a dll/so on the fly. However the entire custom class would have to be hidden in the library, i.e. couldn't be exposed by the interface since this would have to be known when the main program was compiled. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Create class descendant at runtime?
On 04/29/2014 10:34 AM, Mark Morgan Lloyd wrote: Or possibly building the source for a dll/so on the fly. A nice and funny idea combining the benefits of scripting and compiling. A little bit similar to the ahead of time reatlime compiler in a Java or CIL framework. Did somebody ever indeed put something like this to work ? -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Create class descendant at runtime?
Michael Schnell wrote: A little bit similar to the ahead of time reatlime :-) compiler in a Java or CIL framework. Did somebody ever indeed put something like this to work ? I've got something where I can recompile a .so and the main program reloads it automatically (usually) without crashing. To clarify: it fails to reload on occasion possibly because it drops a signal but I've not seen it crash since I'm careful about when the swap is attempted. I've not tried building something into the main program to reconstruct the source of the library and recompile it. I'd note that I'm being paranoid about protecting the interface- lots of magic numbers- and that the .so is always generated with a unique name. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Create class descendant at runtime?
On 04/29/2014 04:59 AM, Michael Schnell wrote: On 04/29/2014 10:34 AM, Mark Morgan Lloyd wrote: Or possibly building the source for a dll/so on the fly. A nice and funny idea combining the benefits of scripting and compiling. A little bit similar to the ahead of time reatlime compiler in a Java or CIL framework. Did somebody ever indeed put something like this to work ? That sounds like an interesting project. Maybe I should add such an example on one of these pages (that contain mini Free Pascal distributions): www.CtrlTerm.com www.TurboControl.com/monitor.htm ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal