r/ProgrammingLanguages • u/Fish_45 • May 05 '21
Language announcement RustScript: A simple functional based programming language with as much relation to Rust as JavaScript has to Java
https://github.com/mkhan45/RustScript37
u/RecDep May 05 '21
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!
16
u/Fish_45 May 05 '21
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!
5
u/RecDep May 05 '21
Next step is to do a Rust rewrite ;)
7
u/Fish_45 May 05 '21 edited May 05 '21
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.
0
May 05 '21
[deleted]
9
u/Crazy_Direction_1084 May 05 '21
Rust is written in Rust but uses LLVM as a backend, thus making it dependent on C++.
1
u/posting_drunk_naked May 06 '21
I'll be surprised if there isn't a project out there right now re-implementing llvm in Rust.
If nothing else for the reason you just said: Rust dependence on LLVM = Rust dependence on C++
7
u/joonazan May 05 '21
It is, though. https://github.com/rust-lang/rust
0
May 05 '21
[deleted]
10
u/GOKOP May 05 '21
But Rust would still originally have been written in something else
As, um... every language ever?
0
May 05 '21
[deleted]
6
u/hexane360 May 05 '21
You're getting downvotes because it would have taken you 10 seconds to go to https://github.com/rust-lang/rust and see that it's self hosted.
And then you tried to backpedal by saying the equivalent of "well, every language needed to be bootstrapped at some point, therefore I was kind of right".
At the moment I write 100% of my tools in my own language ... so I tend to more scrutinizing of such claims.
How does this make any sense? It's like saying "I drove to work today, so I doubt you did". Besides, no one but you was making a claim. It's not a secret that rust is self hosted.
-3
May 05 '21 edited May 05 '21
I back-pedaled on which language I'd thought hadn't yet got around to self-hosting.
Yes, I could have gone online to fully research my one-line quip, but I didn't; so shoot me.
My comment about Rust originally being written in something else was supposed to be a comparison with RustScript, the subject of this thread: RustScript is not written in Rust; neither was Rust at one point.
But now, folks, that is no longer true: github will tell you that 97.6% of the sources on that project - not including LLVM (all the fiddly bits) - are in Rust.
Jolly good for them.
Phew!
(And this has cost me a dozen downvotes. What a lovely, tolerant community!)
6
u/kredditacc96 May 05 '21
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).
11
u/Fish_45 May 05 '21
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
2
4
u/shogditontoast May 05 '21
Why is it called rustscript? It has nothing in common with rust.
28
u/Fish_45 May 05 '21
RustScript is to Rust as JavaScript is to Java.
And Java is to JavaScript as Car is to Carpet
-6
u/shogditontoast May 05 '21
At least JavaScript looked vaguely like Java.
32
u/TinBryn May 05 '21
Its got
letandfn, how much more similarity do you need?0
6
2
4
4
2
3
1
0
30
u/Fish_45 May 05 '21
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.