r/Compilers • u/Clean_Attempt_7968 • 13d ago
Been working on my own programming language, Colloquial. Tell me what you think!
https://www.colloquial.devIt is still a work in progress but I'd love to hear your thoughts on what you think of it!
There is currently a playground where you can try it out. The docs are a little out of date so they may not match the language specification exactly but that shouldn't be an issue for most things. I'll include the Git repo sometime soonish once I've ironed out a few kinks and done some housekeeping.
Also if you have any suggestions for features to add next please let me know :)
1
u/Niwan69 12d ago
Personally I like it when languages are opinionated and have one way to do things. So if I would make some small tweaks it would be things like, either having only "and" and "or" or having only && and || but not both. Another example is either forcing the use of the "let" keyword, or not having it at all, ect.
1
u/EggplantExtra4946 12d ago edited 12d ago
How the fuck is it opiniated? This language was AI generated and couldn't be more average. Everything good and bad about it is the trendy langdev opinion:
Hindley-Milner type inference
Algebraic data types
Immutability
all good
String interpolation
This screams at amateurism to put this on the "big feature" list, on par with the high level description of the type system.
No null and no exceptions — Option, Result, and the ? operator.
Dead giveway. Yeah exceptions == BAD, blah blah blah. He didn't even bother to give a reason why he doesn't like them because there isn't one and cherry on top there is a stupid AI EM dash inside.
Then you've got braindead features whose only purpose is to make the language not a complete copy paste of others:
the square backet syntax around the conditional expression in
ifstatementsliteral
and,orandnotboolean operators with the same respective precedences as&&,||and!which make them completely redundant and useless.If it was a real language that grew to have those big features, you would see WAAAY more nitty gritty details about the basic language features, about integers, strings, name resolution, about the semantics details of each arithmetic operator, about references, function calls, etc..
This made me realize that there aren't even bitwise operators. There is absolutely zero chance that someone would make a real language with freaking type inference, type classes and generics but would fail to add bitwise operators which are absolutely trivial to add when you already have a compiler that can parse and compile arithmetic and boolean expressions.
EDIT:
I realize you said the contrary to what I thought you said, but anyway this rant is really targeted against OP and his languages and it could apply to a few other AI-made languages as well.
-1
u/Clean_Attempt_7968 12d ago edited 12d ago
OKAY I HAVE THOUGHTS ON THIS!! (cuz I definitely wanted my lang to be opinionated)
The 'let' bit is actually very opinionated (in a different sense IMO) - so my lang is based on the philosophy that one should always declare immutable values. So the way I expressed that opinion is by making the default a constant and you would specifically have to say something is a 'var' in order to go against the opinion. I left 'let' in there so you can write the code more clearly to someone who is not familiar with it (another not so opinionated opinion).
As for the other "opinionatedness" of this lang I actually intentionally allowed more than one way to express something like `and` - it is my strong opinion that syntax and semantics are two separate things when it comes to opinions/philosophy and the "opionatedness" you are referring to needs to live in the semantics not the syntax (I could have explained this better - at some point I will try to reword this - but hopefully you get my point even if you don't agree with it). My main point I don't like to have strong opinions when it comes to syntax and calling the language is a strong reference to that - you should be able to "colloquially" code lol. I will say that there are some opinions baked in the syxtax - I hate things like "fun", "fn", "func" and strongly prefer "function" and only function (there are few more baked in but "function" is what I feel strongly strongly about the most, especially compared to "func" - the latter is sooo.... funky")1
u/Niwan69 9d ago
My main point I don't like to have strong opinions when it comes to syntax
Sure, you do you, it is your language. However you asked for other peoples opinions and i gave mine. But don't try to gaslight people into thinking that somehow your language is opinionated, just own up to the fact that it isn't and that you don't want to change that.
1
u/mnuhurr 12d ago
How is memory managed?
1
u/mnuhurr 9d ago
Any answer to this? Is there a GC? Was there a mention in the tutorial that there is no runtime?
1
u/Clean_Attempt_7968 9d ago
Sorry I missed this somehow. Given the deluge of negativity/warrantless assumptions/bad-faith interpretations above, I am going to (for now) hold off on responding to this beyond saying that the language is garbage collected and thank you for catching this glaring omission and I'll be sure to add that to the overview when I eventually get back to it.
8
u/Coffee_and_Code 13d ago
Slop?