Page 1 of 1

Live API question : JS vs. Python

Posted: Mon Jan 21, 2013 10:05 pm
by Glennzone
Hi folks,

Just looking for some clarification : In the Live API is it true that what is exposed in JavaScript are the same objects as those exposed in Python ?

I'm working on some customizations to the Launchpad in the python scripts. I just want to make sure I'm on the right page.

I've been working on a M4L device, but my impressions are that python scripts are faster.

Re: Live API question : JS vs. Python

Posted: Tue Jan 22, 2013 12:40 am
by amounra93
http://cycling74.com/forums/topic.php?id=23910

;)

a

edit::Sorry, I was pressed for time earlier. I guess my simple opinion is that "Yes, Python is much faster". Whatever you're going to do with the API in javascript is going to have to be handed over to Python anyway (and there is much involved there). But working in m4l also has it's strengths. I recommend using both, but doing as much as you can comfortably do in Python. Some processes just don't make much of a difference, and the prototyping time is going to be faster in js than in Python.

General rule: send as few calls to API objects as you can get by with, if efficiency is your goal. Python will deal with any API stuff natively faster than m4l will. If you need to call a process that is going to manipulate an array of API objects, write the method in Python, and initiate it from js using a single call.

Re: Live API question : JS vs. Python

Posted: Wed Jan 23, 2013 2:34 am
by Glennzone
That's good info. I hope it gets lots of reads so others can benefit as well.

It's wonderful to get a concensus.

Thanks,
Glennzone