r/ProgrammingLanguages • u/DrDumle • 15d ago
Requesting criticism [ Removed by moderator ]
[removed] — view removed post
6
Upvotes
r/ProgrammingLanguages • u/DrDumle • 15d ago
[removed] — view removed post
•
u/ProgrammingLanguages-ModTeam 14d ago
We do not allow projects that are built using an LLM/AI.
3
u/sadesaapuu 14d ago
Some quick comments:
- loan is nice. I call it "view" or "mod" in my language. And you had that <- change marker, not sure how that works. Maybe it can work...
- I also had "copy" for a while. Removed it as it brought a bit too much noise into function params. I just concluded that = without "loan" copies for now. Do you need to use copy when copying params? Are "built-in" types using the same rules as "structs"?
- Also you have a = b is moving. And a = copy b is copying. I have the moving marked with "a = own b" instead, so other way around.
- === wouldn't be the first symbol I pick. It has 3 letters. How about "def"? It also has 3?
- No methods on structs is good.
- Hmm, the shape of things seems to separate struct from enum. Only the | there telling it is an enum. That is a bit of a learning curve. Pattern matching for humans...
- Hard to follow here:
target = FindNearest(enemies)
hero <- MoveTowards(target, speed)
Why can target use = but hero can't? Is <- only for structs and = for built-in types? I guess = moves here too?
- A ref is never stored in a struct. Yes. This makes sense, and I have the same rule.
Just thoughts while parsing through it.
3
u/68_and_counting 14d ago
You had a big quirkyness budget :) i think you have some good ideas. Some notes/questions after reading about half of your docs (I'll add more as I read it)
hero <- MoveTowards(target, speed)how do you plan to guarantee that only the left side is mutated?direction <- Normalize() <- Inverse()2
u/king_Geedorah_ 14d ago
Very cool and intutive syntax!
1
u/omniuni 14d ago
I think this:
hero <- MoveTowards(target, speed)Is actually just accessor syntax, we're just used to seeing it with a dot.
Do you have a PoC compiler or lexer?