Remarks on syntax #602
-
Hi folks, Just drive-by looking over this language, as I've done with hundreds of languages over the years. 😁 I just found a few things a little surprising, and thought I'd comment on these briefly.
Unfortunately, developers are busy people - onboarding a new language needs to be fast and intuitive for the majority of mainstream programmers who work in conventional mainstream languages. Don't get me wrong - I realize these are just one guy's opinions! I wouldn't bother commenting on syntax if it wasn't for all the exciting features you have, or have planned. There's plenty of things I already love about this language, just from glossing over the docs. This has real potential! But you could do a bit more to make this look more familiar and appealing on the surface. There's a gazillion languages out there, and (sadly) most devs will drive by in a rush unless it looks like something they already know. Cheers and good luck with your language! Really liking many of your ideas here. Can't say that for most languages these days. 😄 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 13 replies
-
|
Beta Was this translation helpful? Give feedback.
-
I was playing around with GPT-4 system prompts, and decided to see what it thinks. 😄 I gave it the following system prompt:
And then I asked:
To which it replied:
However, pay attention to how I phrased my question. If instead I ask:
The answer to that is very different:
As for the flexibility caveat, I decided to challenge it a bit further on that point:
To which it replied:
Now, GPT is generally very helpful and sometimes seems a little too agreeable - but it's also fairly rational and objective. And it has heard all the arguments, both for and against, so it's pretty interesting to see it hash things out. (Why am I doing this, well, actually I've just been having fun, seeing if I could turn GPT into a language designer. I've had it write out EBNF syntax and a bunch of other fun things as well. I don't personally have the time to build my own language, but I'm curious how far we are from being able to simply prompt our way to having an LLM design and build a compiler for a working language, so that's why. 😊) |
Beta Was this translation helpful? Give feedback.
-
Howdy! Thanks for all this input, and I'm glad I finally have some time to chime in. The thread's a bit long and my time is a bit short today, so I'll only respond to the original for now.
It's a balance between making a carbon-copy of an existing language's syntax, and making something that's better calibrated for the new language's use cases. Optimizing for one extreme over the other is usually a mistake. That said, onto the suggestions!
Hope that helps, and happy to answer more questions from here. Cheers! |
Beta Was this translation helpful? Give feedback.
-
Hi, I completely agree with point 6 regarding "Shortcalling". It's too easy to confuse it with other constructs, whether it resembles an array due to its syntax or looks like an anonymous struct when curly braces are used, and so on. For a language to be readable, there should be only one way to express a particular concept. Multiple representations can obfuscate the meaning and make the code harder to understand. We have IDEs nowadays that assist with typing, and we're no longer restricted by a certain number of characters per line. Don't sacrifice readability just to save a few keystrokes. |
Beta Was this translation helpful? Give feedback.
Howdy! Thanks for all this input, and I'm glad I finally have some time to chime in. The thread's a bit long and my time is a bit short today, so I'll only respond to the original for now.
It's a balance between making a carbon-copy of an existing language's syntax, and making something that's better calibrated for the new language's use cases. Optimizing for one extreme over the other is usually a mistake.
That said, onto the suggestions!
The safe default for a new language is always to require semicolons, because we always have the option…