I have around 52K of embedded C code I would like to convert to Squirrel. The goal is to dramatically reduce the hardware footprint I’m dealing with and get away from arrays and strings in C (damn them). I have been working through the examples, modify them for my own purposes and the IDE appears to be, to put it lightly, very light. So, for instance, I don’t get any compilation errors despite code being egregiously incorrect. Am I missing something here?
I don’t believe the Imp is designed with large embedded applications in mind. For a start 52K of C converted to Squirrel almost certainly won’t fit right now (although this will change when code execution from flash is implemented).
Thanks for the response. As for code size I had it in my head that the Imp had a hardware enabled byte code interpreter on it and that the server was streaming byte code to it and the Imp was streaming state changes streamed back to the server.
The source is compiled into byte code on the server and downloaded to the imp from where it executes (out of RAM). By all accounts Squirrel byte code is very space inefficient, and there’s only 128KB of RAM on the CPU which needs to hold the heap and stack for the OS as well as user code.
Part of the idea of being cloud-based and always-connected, is that if you’ve got anything really complicated to do, you can do it at the server end. If your code does anything much more than reading sensors and telling the server about it, or activating outputs when told to by the server, then perhaps that functionality doesn’t belong at the imp end.
Version control of Squirrel programs is something we know we’re going to need to do better than at present. We have some ideas in that area but no firm plans as yet.
Peter
What about the idea of producing a Squirrel library that people could use in the SQDEV Eclipse plugin - - http://wiki.squirrel-lang.org/default.aspx/SquirrelWiki/SQDEV.html
+1
The IDE is being significantly upgraded, but as Rob says - 52k of C code is not the idea here at all. If you have heavyweight stuff to do, you do it server-side, not imp-side, where power and space are at a premium.
Thanks for the reply. There is a hole in my understanding on what “the server side” is. One of the most attractive ideas of the Imp to me (aside from the ability to punch through WEP) is that I could move large swaths of cantankerous C code to the Imp server where I could instead use a much more powerful and safer Object Oriented language (aka, Squirrel). I kept looking for a place where I could write my own code that would execute exclusively on the server and fed data from Imps, effectively private vimps. Instead I found a static list of public vimps and the code I do write is relegated to an Imp. I assume this will change, yes? Alternatively I might just be missing something.
Yes, this will change. You will be able to write vimps yourself - it’s just that’s not quite ready yet, hence the limited menu.