REPL for the Rust programming language

Related tags

Scripting rust repl
Overview

Rusti

A REPL for the Rust programming language.

The rusti project is deprecated. It is not recommended for regular use.

Dependencies

On Unix systems, Rusti requires libncursesw (libncurses on Mac OS).

Building

Rusti builds with Rust nightly, using the Cargo build system.
Currently, it must be built using a nightly release of the Rust compiler released no later than 2016-08-01.

The recommended method of installation is to use the following command to rustup:

rustup install nightly-2016-08-01

Installation using Cargo

Rusti can be installed directly using Cargo. The following command will download, compile, and install Rusti, placing it in ~/.cargo/bin/ or your operating system equivalent, assuming you haved installed nightly-2016-08-01 using rustup:

rustup run nightly-2016-08-01 cargo install --git https://github.com/murarth/rusti

Then you can run it like this:

rustup run nightly-2016-08-01 ~/.cargo/bin/rusti

Building from a Git clone

If using rustup, the following command will create an override to use the correct nightly build within the rusti source tree:

rustup override add nightly-2016-08-01

Build with Cargo:

cargo build

Run tests:

cargo test

Run rusti:

cargo run

Install:

cargo install

Usage

Running rusti gives a prompt that accepts (most) any valid Rust code. If the final statement is an expression, the result will be displayed using the std::fmt::Debug trait. This is equivalent to println!("{:?}", expr);.

rusti=> println!("Hello, world!");
Hello, world!
rusti=> 2 + 2
4
rusti=> (0..5).collect::<Vec<_>>()
[0, 1, 2, 3, 4]

If any delimiters are left open, rusti will continue reading input until they are closed. Only then will the code be executed.

rusti=> fn factorial(n: u32) -> u32 {
rusti.>     match n {
rusti.>         0 => 0,
rusti.>         1 => 1,
rusti.>         n => n * factorial(n - 1),
rusti.>     }
rusti.> }
rusti=> factorial(3)
6
rusti=> factorial(4)
24
rusti=> factorial(5)
120

rusti can also run a file given on the command line.
Note that a rusti input file is not quite the same as a typical Rust program. A typical Rust program contains a function named main. While a rusti program can define functions, no functions will be called automatically. Instead, all statements not within a function body will be executed sequentially, just like interactive mode.

Loading Crates

Loading crates which are part of the standard Rust distribution is as easy as declaring the crate, thusly:

extern crate foo;

However, loading a crate that you have compiled yourself requires some extra steps:

  • First, rusti must be able to find the location of compiled crate.
    You can add a path to its search list using the command line option -L path.
    rusti accepts any number of -L arguments.

  • Secondly, rusti requires both an rlib and a dylib version of the compiled crate. If you're building your crate with Cargo, the following command will build the required files for your project's library:

    cargo rustc --lib -- --crate-type=rlib,dylib
    

    If you're building with rustc directly, simply add --crate-type=rlib,dylib to the build command to produce the required files.

Code completion

rusti provides optional support for code completion using Racer.

To enable code completion, install Racer as outlined in the Installation Instructions and place the racer executable into your PATH.

Commands

These are special inputs interpreted by rusti that are not directly evaluated as Rust code, though they may operate on Rust code.

Commands are invoked by entering a line beginning with . or :, followed by the name of the command and, perhaps, some text used by the command.

Command names may be arbitrarily abbreviated.
For example, .type may be abbreviated as .typ, .ty, or .t.

.block

The .block command will run multiple lines of Rust code as one program.

To end the command and run all code, input . on its own line.

rusti=> .block
rusti+> let a = 1;
rusti+> let b = a * 2;
rusti+> let c = b * 3;
rusti+> c
rusti+> .
6

Entering .q instead will end the command without running code.

.exit

The .exit command exits the REPL loop.

.help

The .help command shows usage text for any available commands.

.load

The .load command evaluates the contents of a named file.

.print

The .print command will display the value of an expression, using the std::fmt::Display trait. This is equivalent to println!("{}", expr);.

.type

The .type command will display the type of an expression without running it.

rusti=> .type 42
42 = i32
rusti=> .t 'x'
'x' = char
rusti=> .t "Hello!"
"Hello!" = &'static str
rusti=> .t (1i32, 2u32)
(1i32, 2u32) = (i32, u32)
rusti=> fn foo() -> i32 { 1 }
rusti=> .t foo
foo = fn() -> i32 {foo}
rusti=> .t foo()
foo() = i32

Limitations

Currently, Rusti has the following limitations. I hope to fix each of them, but some may prove to be large problems to tackle.

  • Functions and types are redefined in each round of input.
    This is inefficient.
  • static items are also redefined in each round of input.
    This means that the address of a static item will change in every round of input and that the values of mut items or those with interior mutability will be reset to their initial definition on each round of input.
    This is bad.
  • Use of thread_local! causes a crash.
    This is bad.
  • let declarations are local to the input in which they are defined.
    They cannot be referenced later and are destroyed after that round of input completes its execution.
    This is inconvenient.
  • And more!

License

Rusti is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

Comments
  • LLVM ERROR: Program used external function '___morestack_addr' which could not be resolved!

    LLVM ERROR: Program used external function '___morestack_addr' which could not be resolved!

    Simple commands (e.g. 2 + 2, println!("Hello world")) result in "LLVM ERROR: Program used external function '___morestack_addr' which could not be resolved! An unknown error occurred".

    crash mac-osx 
    opened by Sarjo2222 24
  • Implement a readline alternative on Windows

    Implement a readline alternative on Windows

    The recommended method of using GNU Readline on Windows is to install Cygwin, which is an unappealing option for some users. A Windows version of the rusti::readline module could be implemented using Windows' console API.

    feature 
    opened by murarth 13
  • rusti: error while loading shared libraries: librustc_driver-c8005792.so: cannot open shared object file: No such file or directory

    rusti: error while loading shared libraries: librustc_driver-c8005792.so: cannot open shared object file: No such file or directory

    Following the README directions verbatim:

    • rustup install nightly-2016-08-01
    • rustup run nightly-2016-08-01 cargo install --git https://github.com/murarth/rusti
    • rusti
    $ rustup --version
    rustup 0.6.3 (a0e2132 2016-08-28)
    $ rustc --version
    rustc 1.11.0 (9b21dcd6a 2016-08-15)
    $ cargo --version
    cargo 0.12.0-nightly (6b98d1f 2016-07-04)
    $ rusti --version
    rusti: error while loading shared libraries: librustc_driver-c8005792.so: cannot open shared object file: No such file or directory
    
    opened by djanderson 8
  • failed fresh install on mac os x

    failed fresh install on mac os x

    Steps to reproduce:

    1 As instructed by the readme, I've installed the nightly version of rust with:

    curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly
    

    2 Also installed gnu readline with

    brew install readline
    

    3 Cloned the repo with:

    git clone [email protected]:murarth/rusti.git
    cd rusti
    

    4 Build the project with:

    cargo build
    

    Expected results

    The REPL should be installed and usable

    Actual results

    Error prevented the project to build:

           Fresh libc v0.1.8
           Fresh regex v0.1.30
           Fresh rand v0.3.8
           Fresh log v0.3.1
       Compiling rusti v0.0.1 (file:///Users/fcz/work/rusti)
         Running `rustc src/rusti/lib.rs --crate-name rusti --crate-type lib -g --out-dir /Users/fcz/work/rusti/target/debug --emit=dep-info,link -L dependency=/Users/fcz/work/rusti/target/debug -L dependency=/Users/fcz/work/rusti/target/debug/deps --extern env_logger=/Users/fcz/work/rusti/target/debug/deps/libenv_logger-9877a407b506c549.rlib --extern tempfile=/Users/fcz/work/rusti/target/debug/deps/libtempfile-c9be745af97f9817.rlib --extern log=/Users/fcz/work/rusti/target/debug/deps/liblog-8a6aba167994951e.rlib --extern getopts=/Users/fcz/work/rusti/target/debug/deps/libgetopts-1dade5d0522f070b.rlib`
           Fresh tempfile v0.3.0
           Fresh env_logger v0.3.1
           Fresh getopts v0.2.11
    src/rusti/exec.rs:31:5: 31:20 error: unresolved import `syntax::ast_map`. There is no `ast_map` in `syntax`
    src/rusti/exec.rs:31 use syntax::ast_map;
                             ^~~~~~~~~~~~~~~
    error: aborting due to previous error
    Could not compile `rusti`.
    
    Caused by:
      Process didn't exit successfully: `rustc src/rusti/lib.rs --crate-name rusti --crate-type lib -g --out-dir /Users/fcz/work/rusti/target/debug --emit=dep-info,link -L dependency=/Users/fcz/work/rusti/target/debug -L dependency=/Users/fcz/work/rusti/target/debug/deps --extern env_logger=/Users/fcz/work/rusti/target/debug/deps/libenv_logger-9877a407b506c549.rlib --extern tempfile=/Users/fcz/work/rusti/target/debug/deps/libtempfile-c9be745af97f9817.rlib --extern log=/Users/fcz/work/rusti/target/debug/deps/liblog-8a6aba167994951e.rlib --extern getopts=/Users/fcz/work/rusti/target/debug/deps/libgetopts-1dade5d0522f070b.rlib` (exit code: 101)
    
    opened by fczuardi 8
  • Segmentation fault when calling `llvm::LLVMGetPointerToGlobal` on Windows (LLVM ERROR: Incompatible object format!)

    Segmentation fault when calling `llvm::LLVMGetPointerToGlobal` on Windows (LLVM ERROR: Incompatible object format!)

    I tried cleaning $PATH, using different rustc (dev or nightly), no good so far, always the same segmentation fault no matter you run from cli or repl.

    bombless@bombless-PC ~/rusti
    $ target/rusti.exe -e 0
    DEBUG - searching for sysroot in PATH D:\msys64rust\mingw32\bin;D:\msys64rust\usr\local\bin;D:\msys64rust\usr\bin;D:\msys64rust\usr\bin;D:\msys64rust\home\bombless\rust\i686-pc-windows-gnu\stage1\bin
    DEBUG - sysroot from PATH entry D:\msys64rust\home\bombless\rust\i686-pc-windows-gnu\stage1\bin
    DEBUG - loading crate D:\msys64rust\home\bombless\rust\i686-pc-windows-gnu\stage1\bin\rustlib\i686-pc-windows-gnu\lib\std-4e7c5e5c.dll
    DEBUG - compiling module
    DEBUG - loading crate D:\msys64rust\home\bombless\rust\i686-pc-windows-gnu\stage1\bin\rustlib\i686-pc-windows-gnu\lib\std-4e7c5e5c.dll
    LLVM ERROR: Incompatible object format!
    Segmentation fault
    
    
    bombless@bombless-PC ~/rusti
    $ rustc -V -v
    rustc 1.0.0-dev (b6d91a2bd 2015-02-15 07:53:07 +0000)
    binary: rustc
    commit-hash: b6d91a2bdac45cd919497a24207fab843124d4ba
    commit-date: 2015-02-15 07:53:07 +0000
    host: i686-pc-windows-gnu
    release: 1.0.0-dev
    
    bombless@bombless-PC ~/rusti
    $
    
    crash windows 
    opened by bombless 8
  • Linking Error

    Linking Error

    Trying to build rusti gives this error:

        Compiling rusti v0.0.1 (file:///Users/.../Documents/RProjects/rusti)
    error: linking with `cc` failed: exit code: 1
    note: "cc" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/.../Documents/RProjects/rusti/target/debug/rusti" "/Users/.../Documents/RProjects/rusti/target/debug/rusti.o" "-Wl,-force_load,/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libmorestack.a" "-Wl,-dead_strip" "-nodefaultlibs" "/Users/.../Documents/RProjects/rusti/target/debug/librusti.rlib" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lrustc_driver-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lrustc_privacy-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lrustc_resolve-11582ce5" "/Users/.../Documents/RProjects/rusti/target/debug/deps/libenv_logger-63352e48193fbb80.rlib" "/Users/.../Documents/RProjects/rusti/target/debug/deps/liblog-54cf393d3c69686f.rlib" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lrustc_borrowck-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lrustc_trans-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lrustc_typeck-11582ce5" "/Users/.../Documents/RProjects/rusti/target/debug/deps/libregex-3bea3061fd389532.rlib" "/Users/.../Documents/RProjects/rusti/target/debug/deps/libgetopts-d6ecf60df5ea72e6.rlib" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lrustc_lint-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lrustc-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lrustc_back-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lsyntax-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lterm-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lgraphviz-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lrbml-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-larena-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lflate-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lrustc_llvm-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lrustc_data_structures-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lserialize-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-llog-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lfmt_macros-11582ce5" "/Users/.../Documents/RProjects/rusti/target/debug/deps/libtempfile-1e8a000811fae654.rlib" "/Users/.../Documents/RProjects/rusti/target/debug/deps/librand-b924d9fc5b3eb5b8.rlib" "/Users/.../Documents/RProjects/rusti/target/debug/deps/liblibc-2eda841eb12a3090.rlib" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lgetopts-11582ce5" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lstd-11582ce5" "-L" "/Users/.../Documents/RProjects/rusti/target/debug" "-L" "/Users/.../Documents/RProjects/rusti/target/debug/deps" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-L" "/Users/.../Documents/RProjects/rusti/.rust/lib/x86_64-apple-darwin" "-L" "/Users/.../Documents/RProjects/rusti/lib/x86_64-apple-darwin" "-lmorestack" "-lreadline" "-lpthread" "-ledit" "-lm" "-lc++" "-lc" "-lm" "-lSystem" "-lpthread" "-lc" "-lm" "-lcompiler-rt"
    note: ld: warning: directory not found for option '-L/Users/.../Documents/RProjects/rusti/.rust/lib/x86_64-apple-darwin'
    ld: warning: directory not found for option '-L/Users/.../Documents/RProjects/rusti/lib/x86_64-apple-darwin'
    Undefined symbols for architecture x86_64:
      "_rl_completion_suppress_append", referenced from:
          readline::completion_fn::__rust_abi in librusti.rlib(rusti.o)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    error: aborting due to previous error
    Could not compile `rusti`.
    

    Occurs on OS X 10.10.3 using rustc 1.2.0-nightly (0cc99f9cc 2015-05-17) (built 2015-05-17)

    opened by Sarjo2222 7
  • can't build/run master

    can't build/run master

    i cloned rusti repo, have nightly rust installed, but can't build rusti

    eplatonov@eplatonov-vb-mint ~/projects/github/rusti (master) $ cargo clean 
    eplatonov@eplatonov-vb-mint ~/projects/github/rusti (master) $ rustc --version
    rustc 1.8.0-nightly (c8fc4817d 2016-02-22)
    eplatonov@eplatonov-vb-mint ~/projects/github/rusti (master) $ cargo --version 
    cargo 0.9.0-nightly (93fb4c0 2016-02-22)
    eplatonov@eplatonov-vb-mint ~/projects/github/rusti (master) $ cargo build 
       Compiling libc v0.2.4
       Compiling winapi-build v0.1.1
       Compiling kernel32-sys v0.2.1
       Compiling regex-syntax v0.2.2
       Compiling memchr v0.1.7
       Compiling aho-corasick v0.4.0
       Compiling log v0.3.4
       Compiling advapi32-sys v0.1.2
       Compiling getopts v0.2.14
       Compiling winapi v0.2.5
       Compiling regex v0.1.46
       Compiling rand v0.3.12
       Compiling tempfile v1.1.3
       Compiling env_logger v0.3.2
       Compiling rusti v0.0.1 (file:///home/eplatonov/projects/github/rusti)
    error: linking with `cc` failed: exit code: 1
    note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/eplatonov/projects/github/rusti/target/debug/rusti.0.o" "-o" "/home/eplatonov/projects/github/rusti/target/debug/rusti" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/home/eplatonov/projects/github/rusti/target/debug" "-L" "/home/eplatonov/projects/github/rusti/target/debug/deps" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/home/eplatonov/projects/github/rusti/target/debug/librusti.rlib" "/home/eplatonov/projects/github/rusti/target/debug/deps/libenv_logger-2fedde90a22290a6.rlib" "/home/eplatonov/projects/github/rusti/target/debug/deps/libgetopts-852fe11dd444cf81.rlib" "/home/eplatonov/projects/github/rusti/target/debug/deps/liblog-87d547eff707fc8e.rlib" "/home/eplatonov/projects/github/rusti/target/debug/deps/libregex-e2957abba0c5c748.rlib" "/home/eplatonov/projects/github/rusti/target/debug/deps/libregex_syntax-695a6c2a2c33e892.rlib" "/home/eplatonov/projects/github/rusti/target/debug/deps/libtempfile-7a516df1b247e424.rlib" "/home/eplatonov/projects/github/rusti/target/debug/deps/librand-12e778fcd5eb28e9.rlib" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_driver-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_passes-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_typeck-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_lint-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_privacy-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "syntax_ext-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_plugin-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_resolve-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_borrowck-fd663c41" "/home/eplatonov/projects/github/rusti/target/debug/deps/libaho_corasick-32050201217e44e8.rlib" "/home/eplatonov/projects/github/rusti/target/debug/deps/libmemchr-940d9877eaa7970c.rlib" "/home/eplatonov/projects/github/rusti/target/debug/deps/liblibc-adb8b8e7aaa2f93f.rlib" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_metadata-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_trans-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_platform_intrinsics-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_mir-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rbml-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_data_structures-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_back-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "flate-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "getopts-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "arena-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "fmt_macros-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "graphviz-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_front-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "syntax-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "term-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "serialize-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "log-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_llvm-fd663c41" "-L" "/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "std-fd663c41" "-l" "readline" "-l" "pthread" "-l" "rt" "-l" "dl" "-l" "m" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "compiler-rt"
    note: /usr/bin/ld: cannot find -lreadline
    collect2: error: ld returned 1 exit status
    
    error: aborting due to previous error
    Could not compile `rusti`.
    
    To learn more, run the command again with --verbose.
    

    is there something I'm missing?

    opened by jozic 6
  • Cant run built executable

    Cant run built executable

    I can run rusti fine using cargo run, but whenever I build it using cargo build, both with and without --release and attempt to run rusti from the target/{debug|release} dir I get the following error: dyld: Library not loaded: x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-darwin/lib/librustc_driver-8cf6ce90.dylib Referenced from: /Users/mitur/gits/rusti/target/debug/./rusti Reason: image not found [1] 61341 trace trap ./rusti

    I am building using multirust with nightly currently on rustc 1.6.0-nightly (8864f2c83 2015-12-07)

    On osx 10.11.1

    I would happily provide any other information that could help.

    Thanks

    opened by nicrgren 6
  • Racer completion not working

    Racer completion not working

    I just installed rusti and racer, and added both to my path. Both are functional, but I can't get any completions in rusti. Did I install something wrong, or is this a bug?

    opened by ghost 6
  • Mac OS X lazy symbol binding failed

    Mac OS X lazy symbol binding failed

    Trying to run Rusti gives the following error message:

     Running `target/debug/rusti`
    dyld: lazy symbol binding failed: Symbol not found: __ZN6driver19phase_1_parse_input20hfdf988a0e9a4ff55NqaE
      Referenced from: /Users/.../rusti/target/debug/rusti
      Expected in: /usr/local/lib/librustc_driver-4e7c5e5c.dylib
    
    dyld: Symbol not found: __ZN6driver19phase_1_parse_input20hfdf988a0e9a4ff55NqaE
      Referenced from: /Users/.../rusti/target/debug/rusti
      Expected in: /usr/local/lib/librustc_driver-4e7c5e5c.dylib
    
    An unknown error occurred
    
    crash mac-osx 
    opened by Sarjo2222 6
  • Crash when pressing Backspace on Windows

    Crash when pressing Backspace on Windows

    After starting and pressing Backspace, the app crashes (regardless if it's first Backspace, or after typing something and trying to correct it):

    C:\prog\rusti>cargo run -v
           Fresh utf8-ranges v0.1.3
           Fresh void v1.0.2
           Fresh libc v0.2.15
           Fresh log v0.3.6
           Fresh bitflags v0.4.0
           Fresh winapi v0.2.8
           Fresh rand v0.3.14
           Fresh memchr v0.1.11
           Fresh winapi-build v0.1.1
           Fresh cfg-if v0.1.0
           Fresh getopts v0.2.14
           Fresh aho-corasick v0.5.2
           Fresh regex-syntax v0.3.4
           Fresh assert_matches v1.0.1
           Fresh semver v0.1.20
           Fresh shell32-sys v0.1.1
           Fresh ole32-sys v0.2.0
           Fresh rustc_version v0.1.7
           Fresh kernel32-sys v0.2.2
           Fresh tempfile v1.1.3
           Fresh thread-id v2.0.0
           Fresh thread_local v0.2.6
           Fresh regex v0.1.73
           Fresh nix v0.6.0
           Fresh env_logger v0.3.4
           Fresh linefeed v0.1.0
           Fresh rusti v0.0.1 (file:///C:/prog/rusti)
        Finished debug [unoptimized + debuginfo] target(s) in 0.25 secs
         Running `target\debug\rusti.exe`
    rusti=> thread 'main' panicked at 'attempted to multiply with overflow', C:\Users\Mateusz\.cargo\registry\src\github.co5
    stack backtrace:
       0:         0x65400d0e - <unknown>
       1:         0x653fef6e - <unknown>
       2:         0x653ff7d4 - <unknown>
       3:         0x653ff605 - <unknown>
       4:         0x653ff515 - <unknown>
       5:         0x653ff47c - <unknown>
       6:         0x654388b5 - <unknown>
       7:         0x654387f0 - <unknown>
       8:           0x9a9bf7 - <unknown>
       9:           0x44fdab - <unknown>
      10:           0x45b424 - <unknown>
      11:           0x45fd8a - <unknown>
      12:           0x454748 - <unknown>
      13:           0x46a25b - <unknown>
      14:           0x6d30af - <unknown>
      15:           0x6d2757 - <unknown>
      16:           0x6d6afd - <unknown>
      17:           0x6dcada - <unknown>
      18:           0x4014fe - <unknown>
      19:         0x653ff3ec - <unknown>
      20:         0x654100e8 - <unknown>
      21:         0x653fe4f4 - <unknown>
      22:           0x40153a - <unknown>
      23:           0x4013b4 - <unknown>
      24:           0x4014e7 - <unknown>
      25:     0x7ff9612d8101 - <unknown>
    error: Process didn't exit successfully: `target\debug\rusti.exe` (exit code: 101)
    
    C:\prog\rusti>rustc --version
    rustc 1.12.0-nightly (7333c4ac2 2016-07-31)
    
    opened by akavel 5
  • Possible REPL improvements.

    Possible REPL improvements.

    If you are looking for some inspiration you should take a look at julia's REPL. It is the best REPL I have ever worked with. The killer features are special mods :

    1. help ? which can show documentation of any function inside the console
    2. command ; which can run console commands (on Windows it is cmd, on Linux it is bash ...)

    And there are many more goodies. I recommend you download it and play with it a little bit.

    opened by AnthonyJacob 0
  • Assertion failed (crash) on Windows

    Assertion failed (crash) on Windows

    C:\prog\rusti>cargo run -v
           Fresh winapi-build v0.1.1
           Fresh assert_matches v1.0.1
           Fresh regex-syntax v0.3.4
           Fresh getopts v0.2.14
           Fresh cfg-if v0.1.0
           Fresh winapi v0.2.8
           Fresh log v0.3.6
           Fresh utf8-ranges v0.1.3
           Fresh void v1.0.2
           Fresh ole32-sys v0.2.0
           Fresh kernel32-sys v0.2.2
           Fresh bitflags v0.4.0
           Fresh semver v0.1.20
           Fresh libc v0.2.15
           Fresh rustc_version v0.1.7
           Fresh memchr v0.1.11
           Fresh thread-id v2.0.0
           Fresh rand v0.3.14
           Fresh shell32-sys v0.1.1
           Fresh thread_local v0.2.6
           Fresh tempfile v1.1.3
           Fresh aho-corasick v0.5.2
           Fresh regex v0.1.73
           Fresh nix v0.6.0
           Fresh env_logger v0.3.4
           Fresh linefeed v0.1.0
           Fresh rusti v0.0.1 (file:///C:/prog/rusti)
        Finished debug [unoptimized + debuginfo] target(s) in 0.23 secs
         Running `target\debug\rusti.exe`
    rusti=> println!("Helo");
    Assertion failed!
    
    Program: C:\prog\rusti\target\debug\rusti.exe
    File: C:/bot/slave/nightly-dist-rustc-win-gnu-64/build/src/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp, Line 198
    
    Expression: M->getDataLayout() == getDataLayout() && "DataLayout Mismatch"
    
    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
    error: Process didn't exit successfully: `target\debug\rusti.exe` (exit code: 3)
    

    See also: https://github.com/murarth/rusti/issues/39#issuecomment-241894475 — my environment is still the same, with newest rusti (f9a5ded292a30dc93059f9baec89dcbcc8299719).

    opened by akavel 7
  • Add a way to time how long functions take to execute

    Add a way to time how long functions take to execute

    e.g. In F# interactive you would use:

    > #time;;
    --> Timing now on
    > let rec fib n = if n < 2 then 1 else fib (n-1) + fib(n-2);;
    Real: 00:00:00.000, CPU: 00:00:00.000, GC gen0: 0, gen1: 0
    val fib : n:int -> int
    
    > fib 42;;
    Real: 00:00:02.615, CPU: 00:00:02.612, GC gen0: 0, gen1: 0
    val it : int = 433494437
    

    Its a nice feature in F#, I thought it may be useful in rusti. Im not exactly sure how easy it would be to add?

    opened by 7sharp9 1
  • Crash trying to print value from external crate

    Crash trying to print value from external crate

    Trying to print a value for a type defined in an external crate is crashing rusti:

    $ cargo run -- -L testi/target/debug/ Running target/debug/rusti -L testi/target/debug/ rusti=> extern crate testi; rusti=> use testi::Foo; rusti=> Foo LLVM ERROR: Program used external function '__ZN21Foo...std..fmt..Debug3fmt20h8530f8b2d5755ad6iaaE' which could not be resolved! An unknown error occurred

    To learn more, run the command again with --verbose. $

    Environment:

    • OS X Yosemite 10.10.3
    • rustc 1.5.0-nightly (6e5a32547 2015-09-19)
    • cargo 0.6.0-nightly (de11b58 2015-09-16)
    • rusti commit 842564d20987530ed87522bcb0db6eb42eb1daaf

    Both rusti and the testi crate compiled clean with this version.

    External crate: $ cat testi/Cargo.toml [package] name = "testi" version = "0.0.1"


    $ cat testi/src/lib.rs

    [derive(Debug)]

    pub struct Foo;

    opened by xasmx 1
  • rusti with Jupyter

    rusti with Jupyter

    I want to learn rust but in the context of data processing, and rusti looks like the way to go.

    Do you have any plans to support a kernel for iPython like this? It should at least make some common problems (readline, zmq, history, ...) easier, and a full integration means we can write notebooks that can run as examples on the web, look at some .ipynb files in this nice project.

    feature 
    opened by dashesy 8
Owner
Murarth
Murarth
A computer programming language interpreter written in Rust

Ella lang Welcome to Ella lang! Ella lang is a computer programming language implemented in Rust.

Luke Chu 64 May 27, 2022
Oxide Programming Language

Oxide Programming Language Interpreted C-like language with a Rust influenced syntax. Latest release Example programs /// recursive function calls to

Arthur Kurbidaev 113 Nov 21, 2022
The hash programming language compiler

The Hash Programming language Run Using the command cargo run hash. This will compile, build and run the program in the current terminal/shell. Submit

Hash 13 Nov 3, 2022
🍖 ham, general purpose programming language

?? ham, a programming language made in rust status: alpha Goals Speed Security Comfort Example fn calc(value){ if value == 5 { return 0

Marc Espín 19 Nov 10, 2022
A small programming language created in an hour

Building a programming language in an hour This is the project I made while doing the Building a programming language in an hour video. You can run it

JT 40 Nov 24, 2022
The Loop programming language

Loop Language Documentation | Website A dynamic type-safe general purpose programming language Note: currently Loop is being re-written into Rust. Mea

LoopLanguage 20 Oct 21, 2022
Stackbased programming language

Rack is a stackbased programming language inspired by Forth, every operation push or pop on the stack. Because the language is stackbased and for a ve

Xavier Hamel 1 Oct 28, 2021
sublingual: toy versions of existing programming languages

sublingual: toy versions of existing programming languages This is a collection of toy languages created by taking much "larger" languages (e.g. Rust)

Eduard-Mihai Burtescu 20 Dec 28, 2022
A static, type inferred and embeddable language written in Rust.

gluon Gluon is a small, statically-typed, functional programming language designed for application embedding. Features Statically-typed - Static typin

null 2.7k Dec 29, 2022
Lisp dialect scripting and extension language for Rust programs

Ketos Ketos is a Lisp dialect functional programming language. The primary goal of Ketos is to serve as a scripting and extension language for program

Murarth 721 Dec 12, 2022
Rhai - An embedded scripting language for Rust.

Rhai - Embedded Scripting for Rust Rhai is an embedded scripting language and evaluation engine for Rust that gives a safe and easy way to add scripti

Rhai - Embedded scripting language and engine for Rust 2.4k Dec 29, 2022
Interpreted language developed in Rust

Xelis VM Xelis is an interpreted language developed in Rust. It supports constants, functions, while/for loops, arrays and structures. The syntax is s

null 8 Jun 21, 2022
A rusty dynamically typed scripting language

dyon A rusty dynamically typed scripting language Tutorial Dyon-Interactive Dyon Snippets /r/dyon Dyon script files end with .dyon. To run Dyon script

PistonDevelopers 1.5k Dec 27, 2022
Source code for the Mun language and runtime.

Mun Mun is a programming language empowering creation through iteration. Features Ahead of time compilation - Mun is compiled ahead of time (AOT), as

The Mun Programming Language 1.5k Jan 9, 2023
Interactive interpreter for a statement-based proof-of-concept language.

nhotyp-lang Nhotyp is a conceptual language designed for ease of implementation during my tutoring in an introductive algorithmic course at Harbin Ins

Geoffrey Tang 5 Jun 26, 2022
Scripting language focused on processing tabular data.

ogma Welcome to the ogma project! ogma is a scripting language focused on ergonomically and efficiently processing tabular data, with batteries includ

kdr-aus 146 Dec 26, 2022
A Python compiler targeting JS, implemented in Rust.

A Python compiler targeting JavaScript, implemented in Rust.

Gideon Grinberg 5 Jun 17, 2021
Diplo is a script runner and dependency manager made in rust mainly for Deno.

Diplo is a script runner and dependency manager made in rust mainly for Deno. Documentation Tricked.pro/diplo Installing - windows installer Features

Tricked 23 May 9, 2022
A safe-against-invalid-input version of wren.io, written in Rust.

safe_wren A nearly-complete implementation of the Wren language (wren.io) in Rust. The original https://github.com/wren-lang/wren from wren.io is refe

Rubber Duck Engineering 20 Jul 16, 2022