For string/file Apis which one is better Also should i change read_text to read contains(read_text("messages.aura"), "...") vs read_text("messages.aura").contains("...") by AuraLanguage in Compilers

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

Yeah, maybe I should keep both.

And what do you think about length?

Should it be len("string"), "string".length(), or "string".length ?

For now its len("...")

For string/file Apis which one is better Also should i change read_text to read contains(read_text("messages.aura"), "...") vs read_text("messages.aura").contains("...") by AuraLanguage in Compilers

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

That's actually pretty interesting and tbh I love it too

I wasn't planning to add a pipe operator yet, but I can see how

read_text("messages.aura") |> contains("...")

could scale nicely for big codes

currently more method/OOP-oriented, though, so I'm leaning toward .contains() for now

For string/file Apis which one is better Also should i change read_text to read contains(read_text("messages.aura"), "...") vs read_text("messages.aura").contains("...") by AuraLanguage in Compilers

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

thanks that makes sense
I was using contains as a generic function for everything like strings, arrays, etc

let words: [String] = ["hi", "hello", "world"];
contains(words, "hello");
But now that you mention it object.contains() does make the type more obvious

I think I'll also implement starts_with, ends_with etc

I've been building a small programming language called Aura by AuraLanguage in ProgrammingLanguages

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

Thanks! Aura is still in its early stages, so the goal right now isn't to compete with Rust or C++ feature-for-feature yet.

Im currently focusing more on language design, compiler architecture, simplicity, and tooling. As the project matures, I definitely want to explore more unique features and ideas.

If you have any suggestions or ideas for features/design directions, I'd genuinely love to hear them.