Hello friends,
after connecting Harbour to Node.js via WebSocket, I will try the next obvious step:
Python can talk to Harbour via WebSocket in exactly the same way.
No tricks.
No frameworks.
No global installs.
✔ bidirectional
✔ stateful
✔ portable
✔ no registry
✔ no global runtime
Harbour ↔ WebSocket ↔ Python is technically just as clean as Harbour ↔ Node.js.
--- Why this works today (and was unthinkable years ago)Back then (Crystal Reports, COM, DLLs):
- global runtimes
- version conflicts
- mandatory installers
- hard to support
Today (Node / Python / Harbour):
- everything runs in user space
- each runtime is isolated
- WebSocket is a clear contract
- processes are replaceable
The operating system is just transport now.
Python has very stable WebSocket libraries:
- websockets (async, very common)
- aiohttp
- FastAPI (for larger services)
Code: Select all | Expand
# ws_python_server.py
import asyncio
import websockets
import json
async def handler(ws):
print("client connected")
async for msg in ws:
print("RX:", msg)
data = json.loads(msg)
if data.get("cmd") == "VERSION":
reply = {
"engine": "python",
"version": "3.12",
"msg": "hello from python"
}
await ws.send(json.dumps(reply))
async def main():
async with websockets.serve(handler, "127.0.0.1", 8083):
print("Python WS server on ws://127.0.0.1:8083")
await asyncio.Future()
asyncio.run(main())Start with:
Code: Select all | Expand
python ws_python_server.pyThe Harbour WebSocket client:
- does not know if the backend is Node or Python
- speaks the same protocol
- uses the same code
Code: Select all | Expand
ws_send_text( '{ "cmd": "VERSION" }' )
cReply := ws_recv_text()Reply:
Code: Select all | Expand
{
"engine": "python",
"version": "3.12",
"msg": "hello from python"
}You now have:
Code: Select all | Expand
Harbour
↔ WebSocket (JSON)
↔ Node.js (SQL, PDF, Web)
↔ Python (AI, ML, statistics)
↔ other servicesHarbour does not decide how something is done —
only what is needed.
WebSocket makes the language interchangeable.
Yes, Python can also be:
- portable
- no installer
- no registry
- local folder only
Example:
Code: Select all | Expand
/python
python.exe
Lib/
ws_service.pyStart → works.
Exactly like Node.js.
--- ConclusionThis PoC shows that Harbour can integrate with multiple modern runtimes in a clean, understandable way.
No rewrites.
No global dependencies.
Just a clear interface.
Best regards,
Otto