A human-friendly DSL for ATProto Lexicons mlf.lol

Semi-colon for defs #2

Closed stavola.xyz
Closed opened by stavola.xyz

This is feedback from someone just getting started with MLF. I find it useful to get feedback for my projects from users that first use it as they don't have an in-depth understanding yet, which sometimes uncovers things I just got accustomed to. Hence this comment.

I was surprised that defs need a semi-colon but records are not allowed to have one. I prefer having less semi-colons, so I would drop them from the defs. Though there can well be a reason to have them, which I didn't understand yet. So feel free to close this as a won't fix.

There are also two examples where they are missing:

https://tangled.org/stavola.xyz/mlf/blob/52d38883/website/content/docs/language-guide/08-imports.md?code=true#L138 https://tangled.org/stavola.xyz/mlf/blob/52d38883/website/content/docs/language-guide/08-imports.md?code=true#L175

There are also other keywords that need a semi-colon, I just picked def as an example.

Yeah... I think I could review all the semicolon usage and perhaps drop them. I waffled a bunch on the syntax, so its no surprise to me that some stuff isn't super consistent.

I think my thought process here was "well there is an equals sign here so it should feel like a normal declaration a lá Rust," but in retrospect perhaps that doesn't exactly follow.

I thought about this some more and I think I'll keep it this way since syntactically it is similar to Typescript (interface and type defs) and Rust (structs and type aliases). We may revisit this in the future though, as I can easily see there being the need to do a holisitic review once we get our hands dirty with real world usecases.

Sign up or Sign in to add to the discussion.