Max 8 - Better to use Javascript JS Or NodeJS ?
Hi everyone. Excuse my ignorant question if it may seem so, what do you think, better to use node js or NodeJs.
Who is better in performance ?
PS: My js nodes crash Max all the time, does this happen to you?
It would help if you specify what you're trying to accomplish. I think they would largely be used for different things in Max.
They work completely differently - Node runs in a separate process outside of your patch and thus all interaction with it is asynchronous and breaks the call chain in your patch. JS runs in your patch, but only in the low priority thread (which will also break a high thread call chain). There is also my project, Scheme for Max, which is like the JS object but uses Scheme and can run in either the high or low thread so it can be used for tight timing. I have used all three a fair bit - node is great for doing things totally outside of Max, but you have to deal with async programming like it's a webserver (so good for files, interacting with network, triggering other system events, etc). JS is good for UI work with it's rich Max API. Scheme for Max is great for scripting anything involving the scheduler - and generally getting all the goodies of a lisp in Max.
Thank you for your time.
Tyler Mazaika, you are right, sorry, but Ian Duncan answered my question very well that was what I wanted to know.
OK. Thanks.
As for JS, does it often crash your software? Even if the code is minimal and without any errors ?
For some strange reason it happens to me often.
To be honest, I haven't used the JS object in years as I now do anything I would have done in JS in Scheme, so not much help in terms of stability. It's *probably* something in your code though - the double edged sword of using real languages in Max (whether JS, Scheme, C/C++, etc) is that you can make Max crash with bad logic, infinite loops, and so on.
js/jsui might hang the Max process, but if it's crashing Max then that's a reportable bug. Javascript is memory-safe and shouldn't be able to cause that kind of error.
Ah yes, Nick is right, when I think about it my actual crashes came from C code called into from Scheme. You can definitely crash it with C! lol
But hangs, those are easy.