Language design opinions

Hello, there
I’m going to try to make a new programming language, and I’m just interested in programming languages as it is

So,

what are your favorite aspects and/or features of programming languages?

Here are some prompts to get you thinking:

  • Would you rather have an entry-point (e.g. int main() {}) or not?
  • Curly brackets, colons and indentation, or a begin and end statement?
  • Have more built-in capability or lots of packages?
  • What about the ability to bridge (use one language inside of another)?
  • Do you like having the ability to delete functions, or assign variables to them? (E.g. readline = input(); del input)

You don’t have to answer any of those if you don’t want to, they’re just to get you started thinking about what you like

If there is a feature I have not mentioned that you like, mention it below :slight_smile:

Please don’t mention what you don’t like in programming languages or what programming languages you don’t like all together

6 Likes
  1. IMO no entrypoint (I feel like theres no point)
  2. curly brackets is a yes, colons and indentation second, definitely no need to descend into TI-BASIC level and have begin and end statements
  3. Lots of packages (but still include built-in-capability to an extent)
  4. Not quite useful in my use case (you could have an os.system, however, since you can run anything through shell)
  5. I think you should allow deleting all variables/functions/etc.

PS qwerty check amc notifications

2 Likes

No

Curly braces for sure

As long as it has basic features, lots of packages

Yes. Like using Lua in C/C++. (That’s, like, Lua’s entire purpose)

^

4 Likes
  1. my c++ heart says yes but my python nerd says no :pensive: I prefer if you did have an entrypoint because as a blanket statement I’d rather we always have curly brackets to indicate everything
  2. curly brackets but only that. No secondaries just curly
  3. I prefer having more built ins for basic things (about level of python) but also having a lot of customizability
  4. yeah sure
  5. hmmm I feel like memory management is a bit weird for high level programs but that’s cool
4 Likes

I read the first three and ngl thought you were a JavaScript programmer

1 Like

Got it. I shall include that as a feature

2 Likes

Some more questions…

  • Should there be separate print statements (e.g. print vs println)?
  • Should there be object messages (refer to SmallTalk) AND functions, or one or the other?
  • What should the input statement be? I like “prompt” or “input”, other suggestions are welcome
  • Should else-if be a single word (e.g. elif) or two (e.g. else if)?
  • What two programming paradigms do you prefer to write code in?
  • What are your favorite libraries to use in the language(s) you like?
  • Macros?
  • Anything else you’d like to mention?
1 Like
  1. Probably not, because it would only be more confusion
  2. IDK what smalltalk is so i’ll skip
  3. I think it should be input (used to input)
  4. two since it makes sense (else {if but without curly brace)
  5. Hmm… I like Python “assembly line”-type action. Take one thing, continuously tinker it, then spit it out.
  6. Libraries: Too many, but I usually like to use numpy, random, etc. I never really use advanced stuff since when I do python I usually make algorithms
  7. hmm… idk how macros would be implemented…
3 Likes

tbh I’ve done both and I highly prefer elif.

3 Likes

No

Not totally sure what you mean, but the language should have both objects and functions like Python or JS

input

PLEASE use “otherwise” rather than “else”. This has always bugged me in languages. “otherwise” is grammatically correct

Anyway, you can always go the lua route and just do otherwiseif lol (maybe a bit hard to read though)

Personally I like to use OOP, but functional programming is beautiful (I just have too much of a skill issue to write in it)

idk, Python flask to make websites, pygame for games, matplotlib for plots

cursor is nice too idk

Don’t know what those are

5 Likes

Other decisions:
Naming conventions (snake_case is nice)
OOP implementation
goto allowed?
How strongly or weakly typed, and dynamic vs static?
Pointer memory management
Builtin data structures
Threading, async, exceptions

Honestly, I would just copy python’s good aspects.

2 Likes

Since SmallTalk and messaging to objects in it aren’t totally understood, just ignore it for now. If you do want to check out SmallTalk, a tutorial is here. Check the header “Functions are not called; messages are sent to objects”

2 Likes

I was thinking about using otherwise (I didn’t want to for a while though because it’s 5 character’s longer than else) but I’ll do it

3 Likes

I’m going to have a system so that a progrmmar can control this.

E.g.

var thing1 = "Hello" // can be any type at any time, but starts out a string, can be any value
var thing2 := number 42 // must be a number no matter what, value can charge though
var thing3 ::= bool true // must a bool and its value must be true
// Note: writing "number" and "bool" will probably not be necessary, but will be acceptable

(P.S. the above is not the official syntax of the language, but it could be)

5 Likes

I can’t really explain what they are, but here’s a visual:

#define PRINT printf( // PRINT is a macro
#define END ); // END is a macro

int main ()
{
   PRINT "Hello, World!\n" END
   return 0;
}
4 Likes

IMO, var/let/const declarations are just annoying, the rest of that looks cool though.

4 Likes

think you this what i need i guest

1 Like

I prefer var and const because then I can define a variable without a value instead of having to use None or null etc

2 Likes

Ah yeah I saw a YouTube video about it, thought that’s what it meant but wasn’t sure

There won’t be a need for const, ::= means constant

1 Like

In that case it makes sense, I’d almost prefer:

var thing;
other = 17
# etc

To work, but that’s kinda a weird way to do it.

1 Like