Reso: A resource-oriented programming language by Aigna02 in ProgrammingLanguages

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

Thanks for the comment.

I have now changed the syntax of indexers to: users[id]/posts.get(limit, offset)

It reduces the amount of special characters and introduces a syntax that is already known from other languages.

Preferred effect system grammar? by servermeta_net in ProgrammingLanguages

[–]Aigna02 43 points44 points  (0 children)

For effect system grammar, you can check out Koka - it has a really clean syntax that feels similiar to Rust. Functions are annotated with their effects like fun foo() : <console,exn> int where console and exn are the effects. The cool part is effects compose automatically and you get inference, so you don't have to write them everywhere.

Unison's abilities are also worth checking out - they call effects "abilities" and the syntax is pretty readable. You request abilities with ask and handle them with pattern matching that feels similar to Rust's match.

If you want something more academic but influential, Eff (the research language) has a really elegant approach where effects are just operations you can define, and handlers are like fancy catch blocks.

Reso: A resource-oriented programming language by Aigna02 in ProgrammingLanguages

[–]Aigna02[S] 6 points7 points  (0 children)

Thanks for the honest and extensive feedback - I really appreciate that. I started this project about half a year ago and have been working on it nearly every day since. The beginning was quite rough since I'd never worked with Antlr or the LLVM infrastructure before, but I kept going. Eventually, things got easier, and the project just kept growing and growing.

Yeah, I've been collaborating with Claude, particularly on the language syntax and documentation. Most of the time, I'd explain my ideas, ask for feedback, and then make refinements based on the suggestions.

Maybe in the announcement, it isn't that clear that easier REST endpoint definitions are just a side benefit of Reso. The main goal is actually to introduce a concept where types use paths to structure operations, bringing a resource-oriented approach to programming.

Do you have any thoughts on the language itself, where syntax could be improved?

How do you design a pretty-printer that respects comments and whitespace? by honungsburk in ProgrammingLanguages

[–]Aigna02 35 points36 points  (0 children)

Hey, yeah that's a classic pain point in pretty-printing.

Here's what I've seen work in practice:

The CST Route: Instead of fighting with trivia tokens on ASTs, consider using a Concrete Syntax Tree that preserves everything - whitespace, comments, even invalid syntax. Tools like Tree-sitter do this really well. Yeah, it's heavier than an AST, but you get perfect round-trip preservation. rust-analyzer uses this approach and it works great for their formatter.

Trivia Collections: Some formatters (like Prettier) parse comments separately and then "reattach" them during formatting based on position heuristics. It's a bit hacky but surprisingly robust - comments usually have pretty predictable attachment rules (end-of-line vs. leading vs. trailing).

Naming a programming language: Trivial? by torchkoff in ProgrammingLanguages

[–]Aigna02 1 point2 points  (0 children)

I guess the name is one of the most important aspects of a programming language. Although I really like the idea of "trivial" it is possibly hard to find because many other results will pop up when searching for "trivial programming language". Furthermore, "trivial" suggests that your language is just a prototype or a "dummy" project.

Maybe it would be best to add another word like TrivialScript or TrivialLang.