public
Last active

  • Download Gist
rust_in_coderunner.md
Markdown

Prototyping Rust Code in CodeRunner

CodeRunner is a nifty little app for OSX that allows you to play around with test code with minimal fuss. Here are some instructions for setting it up to build Rust code.

CodeRunner

Setup instructions

  1. Go to CodeRunner > Preferences...
  2. Select the Languages tab
  3. Down the bottom of the list view, click the plus sign to add a new language called Rust
  4. Enable the Language uses compilation script checkbox, and click Edit script
  5. Copy the following code into compile.sh:
#!/bin/bash

compname=`echo "$1" | sed 's/\(.*\)\..*/\1/'`
rustc $3 "$1" -o "$compname"
status=$?
if [ $status -eq 0 ]; then
    echo $compname
    exit 0
elif [ $status -eq 127 ]; then
    echo -e "\nTo run code in this language, you need to install the Rust compiler from https://github.com/mozilla/rust/."
fi
exit $status
  1. In the Run Command textbox, enter ./$compiler.
  2. Add the following text to the Code Template:
fn main() {
    %@
}
  1. Set the Syntax Mode to None
  2. Enter rs for the File Extension

Broken for me until I did "] then" -> "]; then".

When attempting to run the same code snippet as in the screenshot above I receive a "Untitled: No such file or directory". I am wondering if there are other path variables or configuration settings I am missing in CodeRunner.

CodeRunner

Sorry guys for the late replies, gist doesn't seem to notify you of comments.

@taliesinb woops, updated

@ttdonovan Not sure. Could you post an image of your prefs? Btw, are you running 0.9-pre? The 'no debug symbols' thing has been fixed for a while.

Hey, thanks a lot for posting this. You rock.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.