baalexander/rosmsgjs — Issue #6: Avoid generating the message code, just generate messages from definition at load time ?
Author: temsa
Created: 2012-02-22 16:13:59+00:00
State: open

Code generation has about no sense for those messages IMHO.

'roslua' for example creates necessary objects directly from message files at node start.

What is required to achieve "no generation" ?

- having an equivalent to roscd to get the message package directory (probably hardest part ?). I'd personally try to avoid spawning roscd
- convert message type to + '/msg/' + + '.msg'
- parse required message files (as a stream if you want with thing like [bufffer-stream](https://github.com/dodo/node-bufferstream) + 'split' , with 'newline' tokens, and '--' tokens)
- do a md5 on message files (equivalent to rosmsg md5 ) to get the (required ? ) md5. I guess you can use any md5 library for node working on a string or a buffer (maybe 100% JS is enough in terms of performance) when the whole buffer has been read.
- make an object with that (in your implementation, this should, of course, be a Backbone Model)

My guess is all of that could be done pretty quickly at node start, so shouldn't have a major impact on performances.