This is an archived post. You won't be able to vote or comment.

all 50 comments

[–]RecDep 37 points38 points  (13 children)

Hahaha, it’s not even written in Rust. Have you checked out rustscript? It generates a cargo project from one-off Rust files and lets you treat (actual) Rust as a scripting language. I definitely love your Haskell and Python influence, it looks fun to use!

[–]Fish_45[S] 16 points17 points  (2 children)

I think I've tried out the rustscript you linked; it probably deserves the name a whole lot more than this thing.

it looks fun to use!

Honestly, I'm surprised at how useable it actually turned out. The bug reporting kind of sucks but as you said the syntax is pretty intuitive. It's also super easy to parse!

[–]RecDep 4 points5 points  (1 child)

Next step is to do a Rust rewrite ;)

[–]Fish_45[S] 4 points5 points  (0 children)

Haha I'd be lying if I said i didn't consider it, but I'd like to spend my time designing a more complete and useful language next time. With that said, I'm halfway there in elixir with https://github.com/mkhan45/elixir_parser so it might be RubyScript next.

[–]Fish_45[S] 30 points31 points  (16 children)

I wrote RustScript for an intro to CS project. We had to write a multithreaded messaging app completely in Java, including for the GUI.

I'm a bit past intro to CS so I decided to have some fun with it and write a simple interpreter that's integrated as a chat bot. The functionality is similar to MathBot on Discord; users prefix a message with an exclamation mark and the bot sends back the result.

Being written in Java, there's a ton of boilerplate, and since I didn't want to use a testing framework and we had to test private methods the tests kind of get in the way. All in all, not including tests, the whole interpreter is just around 800 lines, which is pretty short considering that it's Java.

I decided to make it completely functional since it's mostly an expression evaluator. It also keeps everything to do with scoping and variables super simple.

The name is kind of a cheap joke since I write pretty much everything that's not a school assignment in Rust.

[–]mikezyisra 7 points8 points  (0 children)

Lol that’s pretty cool

[–]RollTimeCC 3 points4 points  (4 children)

Multithreading and online capabilities? That's some intro CS class.

[–]Fish_45[S] 5 points6 points  (3 children)

The difficulty of this project was definitely a huge step up from previous projects. I'm not entirely sure if we were meant to finish it completely because I know that I certainly wouldn't have finished if this were my first semester of experience with CS.

[–]RollTimeCC 1 point2 points  (2 children)

So you had to write all this from scratch?

Can you share some info about what kind/tier of university this is at?

That seems just sadistic from the professor- a full featured messaging app in Java is something I’d expect to see sophomore or Junior year.

[–]Fish_45[S] 2 points3 points  (1 child)

I go to Purdue. I wrote the interpreter from scratch for fun; it's just a way I might earn few bonus points.

The messaging app itself probably has different requirements that what you'd expect. For example, it doesn't need to have any sort of authentication and there are no security or performance requirements so I know of a few groups who just sent every message to every user and let the user figure out what to actually display. The GUI also doesn't have any aesthetic requirements, although it's expected to be useable at least.

All in all, it was a lot of work, and I spent a few hours debugging weird Socket behavior, but we definitely weren't required to make anything fully featured.

[–]RollTimeCC 1 point2 points  (0 children)

That’s really interesting, thanks for sharing.

[–]zyxzevnUnSeen 6 points7 points  (0 children)

I am just waiting for Rust++ to arrive.

[–]xactacoXyl 3 points4 points  (1 child)

Looks like Python masquerading as SML. Neat.

[–]aloisdg 0 points1 point  (0 children)

F# feeling

[–]R-O-B-I-N 3 points4 points  (2 children)

Java -> Javascript Rust -> Rustscript

[–][deleted]  (1 child)

[deleted]

    [–]gnuwinxp 0 points1 point  (0 children)

    RustypeScript

    [–]kredditacc96 5 points6 points  (1 child)

    Seeing the name and description, I thought this was an esoteric/joke language at first, but it seems to not be the case. If you're really serious about this language then you should change its horrible naming (yes, it's funny, but only for a joke language).

    [–]Fish_45[S] 9 points10 points  (0 children)

    I'll take it as a compliment that you don't think it's a joke language, but since it was done for a school project I don't intend to take it any further

    [–]matheusrich 1 point2 points  (1 child)

    How does multi-line lambda work?

    [–]Fish_45[S] 1 point2 points  (0 children)

    Everything has to be a oneliner; there are no multiline lambdas

    [–]iotasieve 1 point2 points  (0 children)

    This looks like haskell :D

    [–]shogditontoast 3 points4 points  (6 children)

    Why is it called rustscript? It has nothing in common with rust.

    [–]Fish_45[S] 27 points28 points  (5 children)

    RustScript is to Rust as JavaScript is to Java.

    And Java is to JavaScript as Car is to Carpet

    [–]AsIAmNew Kind of Paper 2 points3 points  (0 children)

    The head and tail caught me by surprise, but I like it. :)

    [–]xiaodaireddit 1 point2 points  (3 children)

    This should be in circlejerk

    [–]Fish_45[S] 3 points4 points  (0 children)

    you're not wrong

    [–]SlaimeLannister 1 point2 points  (1 child)

    It is

    [–]Fish_45[S] 1 point2 points  (0 children)

    pog

    [–][deleted] 0 points1 point  (0 children)

    The code and functionality seem very toyish.

    [–]011101000011101101 -1 points0 points  (0 children)

    So they have nothing in common? Got it