Page 1 of 1
HTMLRenderer on the Server
Posted: Fri Oct 04, 2024 5:23 pm
by paulmansour
Tools like Node
https://nodejs.org/en/, and Deno
https://deno.com/ and others allow running JavaScript on the server without a browser.
What would be the drawbacks, if any, of using the HTMLRenderer on the server to execute Javascript from APL?
The form/window of course would be irrelevant and could be hidden or ignored.
Re: HTMLRenderer on the Server
Posted: Sat Oct 05, 2024 7:17 am
by Morten|Dyalog
Hi Paul! I can't think of a reason why it would be a quote bad idea unquote to create an HTMLRenderer with ('Visible' 0) to run JavaScript. In fact, I have been experimenting with doing exactly this in our experimental "EWC" tool (
http://github.com/dyalog/ewc), to have the ApexCharts library generate SVG graphics from APL without displaying them to the user.
Re: HTMLRenderer on the Server
Posted: Sat Oct 05, 2024 5:06 pm
by kai
What does that mean in terms of resources? In particular when a significant number of requests need to be handled in parallel.
(My guts are saying this can't be right)
Re: HTMLRenderer on the Server
Posted: Sat Oct 05, 2024 5:29 pm
by Morten|Dyalog
Well, the answer to that is going to be "it depends" :).
Spinning up the HTMLRenderer probably costs about 10,000 times more than producing a chart in JavaScript, so I wouldn't spin a new one up each time, if performance was critical.