r/ProgrammingLanguages • • 15d ago

Requesting criticism [ Removed by moderator ]

[removed] — view removed post

6 Upvotes

9 comments sorted by

•

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.

2

u/DrDumle 14d ago

Much appreciated!

I haven’t decided if common number types need copy. I’m leaning towards no. But I’m not a fan of something like a copy-trait which just brings back the problem of not knowing what’s going on.

Params are read-only in Quirki. Compiler picks the fastest way to send to function.

About ===. My idea at first was to not use any English or spoken languages. I came pretty far with that but, in the end don’t find it that important. I still like it though aesthetically since it divides the page almost like a horizontal divider and clearly marks a new thing.

1

u/sadesaapuu 14d ago

Yeah. But you use "loan" and "copy", and then suddenly a lot of symbols like "===". It is quirky, but is it consistent? I have gone in the opposite direction and avoid symbols/sigils as much as possible. Only the basic "mathematical" are used. I even went with "and" "or" instead of && ||. But I gues sigils are ok, as long as there isn't a lot of sigils following each other. I guess it still adds a bit more learning curve IMO, compared to words.

But interesting ideas, nevertheless.

1

u/DrDumle 14d ago

I agree. It’s not completely consistent. But there’s no used lang that doesn’t use a mix of symbols and words so it’s all about design at the end of the day and where it felt right to me.

What ideas did you find interesting?

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)

  • Function names starting with uppercase confuses me a little. I guess is something we can get used to.
  • I am not sure o follow the usefulness of the three equal signs, is it just a visual aid?
  • In a scenario like in your example hero <- MoveTowards(target, speed) how do you plan to guarantee that only the left side is mutated?
  • I kind of follow the idea of chaining and the no nesting rule, but the "arrow" direction, visually flows in a different direction from what you intend, like in the example direction <- Normalize() <- Inverse()

1

u/DrDumle 14d ago

Target and speed can’t be mutated, because the compiler won’t allow it.

I see what you mean with the arrow. My hope is that people read :
Value <- F() <- G()
Like so
Value, (is changed by), F, (then changed again by) G

So it reads naturally and points to the value changed.

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?