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
---
Python + WebSocket: typical setup
Python has very stable WebSocket libraries:
websockets (async, very common)aiohttp FastAPI (for larger services)
---
Minimal Python WebSocket server
# 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:
python ws_python_server.py---
Harbour side: no change needed
The Harbour WebSocket client:
- does not know if the backend is Node or Python
- speaks the same protocol
- uses the same code
ws_send_text( '{ "cmd": "VERSION" }' )
cReply := ws_recv_text()Reply:
{
"engine": "python",
"version": "3.12",
"msg": "hello from python"
}---
Why this is architecturally strong
You now have:
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.
---
When Python makes more sense than Node.js
| Task | Better |
|---|---|
| SQL / APIs / PDF | Node.js |
| AI / ML / statistics | Python |
| NumPy / Pandas | Python |
| Web rendering | Node.js |
| Prototyping | both |
---
Portable Python: same surprise as Node.js
Yes, Python can also be:
- portable
- no installer
- no registry
- local folder only
Example:
/python
python.exe
Lib/
ws_service.pyStart โ works.
Exactly like Node.js.
---
Conclusion
This 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