A couple of years ago Mike McFarlane wrote a plugin for Sublime text that understood the ROBOTC syntax and function library. I have forked that project and did a minor update on that today. Sublime Text is a cross platform text editor that many developers like to use, see this youtube demo that shows how to install the plugin on OS X and create a simple ROBOTC file. If there is any interest I may add other features (or you can fork and add them yourselves).
I got sublime and the plugin working on windows, but my question is: is there any way to compile and download to the cortex? or is this simply a text editor and nothing more? or is there a way to somehow force this code into PROS or RobotC and have it compile and download in the background?
Sublime is simply a text editor, you’d need RobotC, or PROS to download it.
Would it be possible to create code for a compiler plugin for sublime? is it worth me looking into or would it be more work than its worth?
If you can create a working ROBOTC compiler for Sublime we will probably offer you a job Seriously, it’s one of things that’s technically possible but not without lots of knowledge of the inner workings of the current compiler.
I just threw this out (remember, I didn’t write this, just tweaked) as something for those who already use sublime and wanted to have a few shortcuts for ROBOTC functions.
ah, okay. I’m not sure if i should take this as a challenge or not thank you for your reply, and if you make any additions to this please be sure to keep us updated, because i surely would be interested
How about vi and Emacs keybindings inside robotc?
Do these kids even know what vi is?
Using vi on a VT-100 for programming was an upgrade for me.
First text editor I used was SOS (Son of Stopgap) on a PDP-10.
consider it a challenge, ive done a bit of game hacking / reverse engineering i might be able to do it
Good Luck Compilers seem pretty complex. I might play with it a little, but here’s my thought: (correct me if i’m wrong) A compiler actually goes and checks to first see if the code makes logical sense, and it has to understand the Robot C language. (so PROS compiler will not work with robotC code, and vise versa) Then after reading and interpreting the code, it has to then determine if it will work. If it dosnt work, then it has to be able to tell you what dosn’t work, and why. If it does work, then it has to go even further and translate it into code that the cortex can read and understand. Maybe binary? i have no idea. But the file you send to the cortex (i believe) is not the same as the file that you are viewing. It has been translated… so your compiling program has to do all that.
Now to reverse engineer the program? that sounds much easier than coding all that yourself, but I have no idea how robomatter has protected the inner workings of their code, it may be encrypted or locked to where you cant view it. Even if you used Linux or something to view it, it is probably encrypted? No idea
anyway, good luck! be sure to post if you make any headway on this adventure
it doesn’t look like they are using any encryption or obfuscation, but that certainly doesn’t mean i can decompile it into something that makes sense
VI/VIM mode would be amazing on RobotC
We do not encrypt the compiler output, in fact, we make it easy for you to figure out how some of this works, just look at the ROBOTC assembly window output (view->assembly) after you have compiled a program. Remember we run the compiled code on a virtual machine, that’s how we are able to support different hardware platforms (cortex, vexIQ, EV3 etc.) so we have out own instruction set.
First stage experiment for you may just be a syntax check to show errors in the code prior to compiling.
If you want to learn more about compilers I highly recommend this book:
I just finished my compilers course utilizing this book and it is by far the best textbook to explain what the steps are as a program is compiled. Unfortunately though since it is a textbook it is a bit pricey. (Probably can find the pdf of it somewhere online tbh)