Developing a communication layer between Python and JavaScript
Varnakov, Roman (2025)
Varnakov, Roman
2025
All rights reserved. This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-2025060319724
https://urn.fi/URN:NBN:fi:amk-2025060319724
Tiivistelmä
The study focused on the development of a two-way communication system for
Python and JavaScript programming languages in situations where JavaScript
runtime responses to requests sent by Python runtime. The objective of the study
was to create a socket-based communication module that facilitates interaction
between a Python client and a JavaScript client, leveraging Flask as the server
framework and SocketIO for communication.
The study leveraged various methods to create the system and evaluate it. As a
structure, class-based approach was introduced. For serialization, were used
JSON, MessagePack and Numpy. Evaluation methods involved simulated
request-response scenarios, latency measurements under different payload sizes
with a manual logging method. Wireshark was used to capture network traffic and
analyze it.
As a result, a complete prototype was developed and tested. The system
demonstrated reliable performance, even if there were certain improvement
considerations, efficient data exchange with a combination of JSON and zstd,
and stability under load, confirming its suitability for two-way communication
between Python and JavaScript environments.
Python and JavaScript programming languages in situations where JavaScript
runtime responses to requests sent by Python runtime. The objective of the study
was to create a socket-based communication module that facilitates interaction
between a Python client and a JavaScript client, leveraging Flask as the server
framework and SocketIO for communication.
The study leveraged various methods to create the system and evaluate it. As a
structure, class-based approach was introduced. For serialization, were used
JSON, MessagePack and Numpy. Evaluation methods involved simulated
request-response scenarios, latency measurements under different payload sizes
with a manual logging method. Wireshark was used to capture network traffic and
analyze it.
As a result, a complete prototype was developed and tested. The system
demonstrated reliable performance, even if there were certain improvement
considerations, efficient data exchange with a combination of JSON and zstd,
and stability under load, confirming its suitability for two-way communication
between Python and JavaScript environments.
