3 ms·
I haven't grok'ed things properly yet, its a hefty read for my Monday morning, but the thing that leaps into my mind is to ask you why Javascript, of all things
by boffinAudio 2y ago
I haven't grok'ed things properly yet, its a hefty read for my Monday morning, but the thing that leaps into my mind is to ask you why Javascript, of all things, and not something like Lua?
Isn't Javascript just too finicky for something like this? Are other languages/approaches to integration with the execution environment possible/feasible?
(I apologize for my newbie question, hope you don't mind..)
- sfeng 2y agoWhat’s your definition of finicky? JavaScript is something like 3-10x faster than Lua for most benchmarks (1). If you’re referring to the event loop, it shouldn’t be all that relevant for singleminded code like this that is only processing a single event every half second. If you’re referring to mathematical oddities, it is also not relevant as JavaScripts love of floats is well suited here. 1- https://programming-language-benchmarks.vercel.app/amp/lua-vs-javascript https://programming-language-benchmarks.vercel.app/amp/lua-v...
- boffinAudio 2y agoThanks for the enlightenment, I can see I have to work on my understanding of JS a bit more .. I did not know that it surpassed Lua in terms of performance. I guess Mike Pall is sorely missed.
- TheRealPomax 2y ago> why Javascript Because no one's paying me, so my choice in language is about how easy I can do things like async code, hot reloading, and fast enough performance to not feel like the language itself is the bottleneck, and that makes JS a no-brainer (especially as Modern JS is quite fast, too!) > Isn't Javascript just too finicky for something like this? Maybe you're thinking of JS as a browser language, in which case: no, it's been a general purpose programming language with a standard library for over a decade now in the form of Node.js, which has been keeping in lockstep with the development of the language itself (which has changed a lot over the last decade, so if you've not looked at modern JS circa 2022~2024, it's rather different now =)
- boffinAudio 2y agoThanks for taking the time to reply, I had not really thought my question through .. I'm going to set aside some time to experiment with your project in my own MS Flight instance, and see how far I can take my understanding of things without getting on your radar. ;) I appreciate the patience it took to explain my dumb question, in hindsight it of course all makes sense.