Hacker News new | ask | show | jobs
by nsonha 1239 days ago
does it need a js engine though?
3 comments

I took a quick look at the github repository (because I'm on macos), and it looks like it is written in javascript (and xml) using "gjs", which exposes the gnome libraries to javascript. So I think it's a gtk/gnome program, but written in javascript instead of C and using a webkit widget for the book itself.
App is written in JS and uses a JS library to render epub in the browser, how else could it work?
NOT "written in JS and use a JS lib"?
So you've some kind of problem with the implementation language? Because then you can say the same about any other. "Does it need to be written in Python?" "Does it need to be written in Rust?" What's even the point?
re-read what being discussed, someone said to display epub you need to able to render HTML, I said "but it does NOT need to RUN js". And then you were the person who brought up implementation language which happens to be js, which is irrelevant to the point everyone was making.
The OG comment mentions JS codebase being bundled to a browser engine. Then it's mentioned that it makes sense to do that. And then you specifically asked "does it need a js engine though?". For this specific app, the answer is yes. You cannot open an epub directly on browser and you need to parse it to do that. That somehow for this app is JS. If your question was whether epubs may contain JS then it's wrongly posed.
I replied to this comment

> Ebooks are basically HTML, so this is one case where bundling a browser engine is going to be necessary in any case.

and my point was contesting the statement that a full browser engine is necessary for displaying epub, the implementation language is not the point.

epub may contain JS
I do not think that is true. My incredibly quick skim of the epub format is not finding JavaScript.