fennecdjayOPGwion Language•

Sharing here since it could create some nice discussion. I'm still looking for contributors, PM me if you're interested.

2
1vader•

Since I never heard about the language or music programming in general for that matter I can't really comment too much on this but I'm wondering why you chose such weird syntax in places? Some things seem very strange and not at all similar to any other languages I know.

I can understand the choice for generics since the standard angled brackets used by many languages can easily lead to ambiguity. The old syntax was quite horrible though. The new one is ok, although I think Rust solved this a bit better using standard List<int> notation in places where it can only be a type but requiring List::<int> in other places like function bodies. There is also the option of just using square (List[int]) or round (List(int)) brackets used by some languages although this might not work well depending on other syntax in the language.

But what is up with that weird syntax for printing stuff?

Also, I think I prefer standard fun int f(int x = 1) for default argument values, though I guess the colon also works. Kind of clashes a bit with the generics syntax though.

And I'm wondering why you chose to use global private order instead of private global. The latter reads much more naturally and similar to English ("I declare a private global") and this is also what pretty much all other languages use.

I think generally you want to spend your "novelty budget" on better things than funky syntax if it doesn't serve a good purpose. Although I guess it doesn't really matter if you do it only for fun or personal use and it works for you.

Somewhat unrelated but instead of having a nonnull keyword for variable declarations I would instead have them be non-null by default and provide a nullable option, either using generics with something like Nullable<T>/Nullable:[T] (or some other word like Option in Rust or Maybe in Haskell, though that kind of requires proper sum types to sound and work properly, which are awesome as well btw) or using special syntax e.g. how Swift or C# do it with int? or ?int or a special nullable keyword if you really want to.

2
fennecdjayOPGwion Language•

Thanks for your input!

But what is up with that weird syntax for printing stuff?

That's simply chuck 's legacy.

That work what not that much about novelty than addressing a few issues I saw in the old grammar.

For the nonnull thing, It was inspired by the __attribute__((nonnull__) of C. In fact I started this project few years ago and had next to zero knowledge in programming language design, so I build up from what I had. I've already been thinking about nonnull by default, maybe I'll change that at some point.

Regardind access/storage modifiers, you might make a point, I'll investigate.

I'm pretty happy to get some criticism, thank you again!

1
umlcat•

Keep a separator between type and variable ID or function.

I strongly suggest you, to keep the -> declarator or use var as a separator.

The prefixes for "specifiers" or "attributes" are ok.

2
fennecdjayOPGwion Language•

My writing my not be clear. The -> was to access a child type only when declaring a variable. To access it otherwise, you would use ., as for accessing anything inside a variable or a type. Switching to '.' adds consistency IMO. In fact this comes from chuck (a feature I only discovered by reading their parser code) and, at least in my experience, was also due to a technical difficulty: there was an ambiguity in the parser that the introduction of var made possible to solve.

EDIT: thanks for your input.

1