DEV Community

Cover image for ProgpJS: a fast javascript engine for Go!

ProgpJS: a fast javascript engine for Go!

Johan PIQUET on February 19, 2024

Introduction Hello I'm Johan author of ProgpJS. It's my first open-source project, and it's why I'm very proud to write about it today. ...
Collapse
 
aungmyatmoe profile image
Aung Myat Moe • Edited

Yet another JS runtime dropped, looking forward this one!
I assume this one have very small amount of maintainer and background support. However, this showcase is so far so good in my experience. I have take a look to the source code, Wala, we can make some funny things with this runtime cheer!

Collapse
 
claratrcs profile image
claratrcs

Hello Jo! Happy to see it's finally out!

Collapse
 
johanpiquet profile image
Johan PIQUET

Hi Clara, happy to meet you here!

Collapse
 
aditya_raj_1010 profile image
A.R

In the context of building complex, scalable web applications, elucidate the strategies and best practices for incorporating "ProgpJS," a fast JavaScript engine designed for Go. Discuss how the integration affects the overall project architecture, focusing on topics such as managing shared state, communication protocols between Go and JavaScript components, and potential bottlenecks in performance. Furthermore, explore the implications on debugging and profiling techniques, and elaborate on how this integration aligns with modern trends in microservices and serverless architectures. Consider real-world scenarios where the interplay between Go and ProgpJS provides distinct advantages and challenges in comparison to traditional web development approaches.

"followback for more insightfull discussion"

Collapse
 
johanpiquet profile image
Johan PIQUET

thank you for your advice...there is a lot to do

Collapse
 
aditya_raj_1010 profile image
A.R

"followback for more insightfull discussion"

Collapse
 
rudransh61 profile image
Rudransh Bhardwaj

Broo yooooo thatd coolll

Collapse
 
aditya_raj_1010 profile image
A.R • Edited

Beyond the benchmark results, could you shed light on the optimization strategies employed within ProgpJS to achieve its impressive performance, particularly in scenarios involving mixed Go and JavaScript code?
followback for more insightful discussion

Collapse
 
johanpiquet profile image
Johan PIQUET

It comes from a lot of technicals stuffs, the main points been to reduce call between Go and C++, optimize threads / mutex management, reduce memory allocations and benchmark a lot in order to detect what are good or bad idea for performance. It's technical. The code seem simple when you read it and it is, but there is a lot of little details doing a big difference in performance. For exemple I don't use object pool, which seem to great better for performance but aren't at all when the server process a lot of requests.

Collapse
 
goodevilgenius profile image
Dan Jones

Could this be used in a go application to allow end users to add custom plugins, written in JavaScript?

I'm thinking something where they write some custom JavaScript, that hooks into my go code. I'd have a configuration file where they could add the paths to their js files, or possibly a predefined path where they add js files as plugins.

Would something like that be possible?

Collapse
 
johanpiquet profile image
Johan PIQUET

Hello Dan, I'm sorry but I don't understand what you want to do ...

Collapse
 
sarahpetitsoleil profile image
SarahPetitSoleil

Hi, thank johan! ... I get an error after the second launch about generated.cpp. Why?

Collapse
 
johanpiquet profile image
Johan PIQUET

Hi Sarah. It's because the generated code is about your previous version of the function JsTestMyFunction. Call arguments have been updated and now the generated code don't match anymore. I will add a script "reset_generated_code.sh" in the project root in order to restore a neutral version.

Collapse
 
johanpiquet profile image
Johan PIQUET

Ok the script is added. Feel free to ask me if you have another difficulties.

Thread Thread
 
sarahpetitsoleil profile image
SarahPetitSoleil

Thank you Johan!