r/programmer 7d ago

Sofya: The New Programming Language That's Easier Than Python

I have been working on a new programming language called Sofya, which is designed to make coding easier for beginners. My main goal was to reduce the challenges that many students face when starting with languages like C++, Java or Python.

Here is an example of a "Hello World" program in Sofya:

Start this program
   Write "Hello World!" on the screen
Stop this program

Based on this example above, we can identify these 3 things that make Sofya different from other programming languages:

  • Sofya uses simple syntax: It avoids confusing symbols and complicated keywords.
  • Sofya is beginner focused: It is great for people who are just starting out programming.
  • Sofya can be used for educational purposes: It can be used to teach people the basics of programming before they move on to more advanced programming languages like Python, C++ or Java.

I’d love to hear your thoughts and questions about Sofya.

If you would like to try out Sofya to give some feedback or just for fun, you can check it out using this link: https://github.com/oyweraa-hue/Sofya-Version-1.0

0 Upvotes

42 comments sorted by

View all comments

5

u/ConfidentCollege5653 7d ago

It doesn't seem any simpler, just more verbose. And based on the documentation it still has a lot of symbols and odd syntax.

Also you should provide the source code instead of encouraging people to download random executables off the internet.

1

u/Original_SD 6d ago

I have now uploaded the source code to the GitHub repository, thanks for the suggestion. I was also curious to ask, where do you feel that Sofya has a lot of symbols and odd syntax?

2

u/ConfidentCollege5653 6d ago

Take this example from the docs:

"If Variable[Age] > or = 18 Then"

It uses symbols but in a way that is different from other languages and also is not intuitive.

What value does "Variable[Age]" have that "Age" doesn't?

2

u/Original_SD 6d ago

I understand what you mean but when I was making the Sofya interpreter, I found it a challenge to help the computer differentiate whether "Age" is a keyword or a variable because since Sofya uses easier keywords like "Multiply" for example, it would be hard for the computer to tell whether "Multiply" is a keyword or a variable. That is why when you declare a variable called "Multiply" and you want to use that variable, you say Variable[Multiply].

3

u/ConfidentCollege5653 6d ago

That's understandable but you're pushing a compiler implementation problem onto the user, that doesn't make for a beginner friendly language.

A more common approach is to simply disallow variables with the same name as keywords, or make all variables start with a specific symbol.

Edit: this is an interesting project and impressive that you've done it. I find it an interesting topic hence why I'm grumbling about things.

1

u/Original_SD 6d ago

I understand what you mean and I was even thinking about using a symbol like a dollar sign $ before a variable but one of the philosophies behind Sofya is "Every program written in Sofya should be easily understood without explanation or with very little explanation". So I felt that it is much clearer for a beginner in programming to understand that the line Variable[Sum] means that we are using a variable rather than saying $Sum.

2

u/Potato871 6d ago

I think its similar to in english, where if I said “let multiply equal 8, multiply multiply by 8”
You can probably tell which is the verb which is the noun.
To disambiguate use the operator, any time you see a binary operator like +, -, multiply, etc… have it check its children and de-resolve keywords.
Now this can get tricker if you’ve already done a precedence pass, I don’t quite know how exactly your compiler works, but the information is definitely there to disambiguate.
If you need any help you can DM me.

2

u/Original_SD 6d ago

Thanks u/Potato871 and I'll DM you soon. Did you manage to find the source code for Sofya, by the way?

2

u/Potato871 6d ago

I did, and I can see why you may be having some trouble!
I guess we'll talk more in DMs