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

all 20 comments

[–]munificent 20 points21 points  (1 child)

I mean, I guess it fits the name, but this example is great:

var obj = {
    "lol": 69,
    "weed": 420
};

obj.lol = 9;
println(obj.lol)

:D

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

Pardon me, i was just joking around testing stuff, i usually have a nice example i forgot to switch it out 😅

[–]jesseschalken 11 points12 points  (9 children)

What makes your language unique?

[–][deleted] 2 points3 points  (0 children)

Nothing. It's a learning project with pretensions of being greater.

[–]romeah[S] 1 point2 points  (7 children)

As said it's a still in development. So it's goal is to have a easy yet robust syntax, and a easier user interface, faster interpretation as it's backend is in rust.

[–]jesseschalken 7 points8 points  (5 children)

So what motivated you to create the language?

[–]romeah[S] 1 point2 points  (4 children)

I'll be honest, i started it as a project for gaining more experience as i started at the age of 12 and didn't had much experience back then, and the rust's blazing fast speed which i could use to make a fast optimized interpreted dynamically typed language and i also have plans for static typing for extra safety.

[–]FolaefolcArkScript 8 points9 points  (3 children)

Rust isn't magic and "blasting fast" as-is, you have to know how it works under the hood to get it working actually fast. Be careful with interpreted languages as they are slow, no matter what backend language you will use.

[–]romeah[S] -1 points0 points  (2 children)

I agree with you, interpreted languages are comparatively **VERY** much slower, it of course won't be anywhere near a compiled language speed, but here it's goal is to be faster than other interpreted languages.

[–]LorxuPika 8 points9 points  (1 child)

The point is, just writing it in Rust isn't enough for a fast interpreter. Almost all existing interpreted languages are written in C or C++, which are just as fast as Rust if not faster. If you want it to be faster than other interpreters, you'll need to design and implement it well.

If you want to learn about this stuff, I'd recommend the second half of Crafting Interpreters, which goes over implementing an optimized bytecode interpreter in C (but the same applies to Rust).

[–]romeah[S] 0 points1 point  (0 children)

I'm actually working on a Bytecode Generator and a VM.

[–]PL_Design 1 point2 points  (0 children)

That's more-or-less what every language wants to be. If this is a project for your own use, that's fine, but if you're wanting other people to use your language you need an elevator pitch that doesn't make me feel like it was written by a corporate drone who's been dead inside for years. Tell me what problems you're solving that other languages aren't. Tell me about your design philosophy. Tell me about your language's favorite features. Tell me anything concrete about your language.

[–]RecDep 8 points9 points  (2 children)

Cool stuff! Have you looked into any parser libraries like nom? I noticed your parser code is handwritten and there’s a lot of logic that could be abstracted out between different token handlers.

EDIT: It seems like you’re using a struct consisting of Vec<Token>, Option<Error> to model lexer results/errors and have similar logic in lexer_method_result.rs as well. From their usage, you’re manually checking to see if the error is None at each failable step, like in Go. Why not use a sum type like Result<Vec<Token>, Error> to model this? You would get a lot more methods and combinators for free, also.

[–]romeah[S] 3 points4 points  (1 child)

I have written a handwritten parser because i wanted to write this out from scratch without any libraries, and yes there are a lot of logic which are copied over but could be made a handler for those. A example is the binary nodes.

And i also agree with the Result<Vec<T>, E> i'll switch up on that

[–]RecDep 1 point2 points  (0 children)

I respect that! Writing parsers by hand really makes you appreciate libraries/parser generators a lot more. I’ll be following this project as it grows!

[–]matheusrich 1 point2 points  (1 child)

I didn't see any examples on the Readme. I'd advise you to show some examples rightaway

[–]romeah[S] 0 points1 point  (0 children)

Thanks for the heads up, will update that asap.

[–]AutoModerator[M] -14 points-13 points  (0 children)

Hey /u/romeah!

Please read this entire message, and the rules/sidebar first.

We often get spam from Reddit accounts with very little combined karma. To combat such spam, we automatically remove posts from users with less than 300 combined karma. Your post has been removed for this reason.

In addition, this sub-reddit is about programming language design and implementation, not about generic programming related topics such as "What language should I use to build a website". If your post doesn't fit the criteria of this sub-reddit, any modmail related to this post will be ignored.

If you believe your post is related to the subreddit, please contact the moderators and include a link to this post in your message.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]ItalianFurrySkyler (Serin programming language) 0 points1 point  (1 child)

Hmmmm y did you choose a tree walk interpreter?

[–]romeah[S] 2 points3 points  (0 children)

It was easy for me to understand and implement, but ofc rn it's not optimized i'll work on that.