[fpc-pascal] simpleIPC for all programming languages ?
noreply at z505.com
noreply at z505.com
Mon May 8 05:15:37 CEST 2017
I was thinking, that I need a way to use IPC (inter process
communication) in all languages, so for example I could compile a plain
C exe, Delphi exe, Rust exe, Nimrod exe, or GoLang exe and communicate
back with fpc (very powerful idea). But simpleIPC is only available for
FPC/lazarus, not other tools, so really it's only good for fpc to fpc
communication. But the whole point of IPC is that it's general purpose
for any exe/elf.
So rather than rewrite simpleIPC in every language out there, (big waste
of time), why not just load SimpleIPC.dll where the fpc compiled dll
contains simpleipc functions? Any programming language that can load a
DLL (virtually all languages these days) can now use simpleIPC. Each
program that wants to use ipc, simply loads the simple ipc dll written
in fpc.
So this way delphi could communicate with fpc/lazarus programs, golang
could communicate, nimrod, rust, c, c++, etc.
Then I would create a simpleIPC website advertising this idea, as an
alternative to say ZeroMQ.
Then some small questions arise: is it possible to statically link fpc
code into other programs rather than it being a DLL? for example .a
files instead of a dll at runtime? Then theoretically, IPC could be
linked in statically, not just as a dll.
Indeed the dll functions will need to be flattened out (non object
oriented) so all languages can use IPC, but that's not a problem for me
- simply I write some wrappers around SimpleIPC objects and make them
plain C/pascal like procedures, which is not so hard.
I have forgotten if fpc can generate .a files to statically link? I know
it can link in AFAIK .a static files, for example sqlite? But the other
way around: fpc generating static .a files? This is not mandatory for
this idea to work, just would be interesting to know, as an alternative
to a run time loaded IPC dll.
More information about the fpc-pascal
mailing list