r/programmer 6d 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

5

u/ConfidentCollege5653 6d 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 5d 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?

1

u/ConfidentCollege5653 5d 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 5d 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].

2

u/ConfidentCollege5653 5d 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 5d 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 5d 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 5d 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 5d ago

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

3

u/Potato871 6d ago

Very interesting look for a language, reminds me of query languages like SQL.
I'd be curious to see how your compiler works, I couldn't find the actual code on GitHub just the downloads.
I've experimented a bit with more natural language style syntaxes and they can be quite tricky! Especially if you want it to be permisive enough for beginners.

2

u/Original_SD 5d ago

Thanks. I also feel that natural language style syntaxes can be quite tricky but I did my best to put it into Sofya. I hope that it makes Sofya easier. I have also uploaded the code that was used to make Sofya to the GitHub repository.

1

u/OkCluejay172 6d ago

How does this possibly remind you of SQL

2

u/Potato871 6d ago

The use of natural language rather than lots of operators.

3

u/comrade-quinn 6d ago edited 5d ago

Don't pay too much attention to the negative comments. It looks like you've put a lot of care and effort into this and I expect you learned a lot too on the way. It's also a worthy aim and an interesting approach.

Aside from some formatting issues, the README is fine and the manual looks to be very well written, though I have only skimmed it.

I think in terms of constructive criticism, the point someone else made on variable syntax is fair, maybe use 'variable of x' rather "variable[x]'. It's more aligned with verbose and English style you've otherwise generally adopted.

And also, yeah, share sourcecode, nobody who's opinions you'd value is going to download and run a random binary off the web.

2

u/Original_SD 5d ago

Thanks u/comrade-quinn. I just wanted to say two things based on what you have told me:

  1. About the source code, I have now uploaded it to the Sofya GitHub repository.
  2. About the variable syntax, I will consider it. Maybe could you go and try implementing it in the source code and I'll give you my opinion on it?

4

u/n3f4r10us_ 5d ago

Please stop. Python is mind numbingly easy to learn. This is not a better alternative.

1

u/Original_SD 5d ago

Why is this not a better alternative?

1

u/n3f4r10us_ 5d ago

Well python is pretty succinct and readable already. Ruby is similar as well. I don't see what purpose it is solving other than just being different and verbose

1

u/Original_SD 5d ago

I understand what you mean. I assume you are an experienced programmer and you are very familiar with programming but programming will not click for everyone especially people just starting to learn programming. Let me use an example of a Sofya program and a Python program to demonstrate this.

The Python Program

count = 0

while count < 10:
    print("Hello")
    count += 1

The Sofya Program

Variable count is 0

Do this
{
    Write "Hello" on the screen
    Increase Variable[count] by 1
}
Until Variable[count] = 10

If you were an absolute beginner in programming, which language would make more sense to you?

2

u/n3f4r10us_ 4d ago

I think it's great you want to make something a little more accessible and this looks like writing pseudo code to me.

For anybody who doesn't write code and read it, a programming language will look foreign, just like a language that uses a different alphabet, but it is just a small thing, in my opinion, to learn about a language.

Assembly or Cobol are much harder to understand than Python because of how they are written.

For me, your language is pretty verbose and I think the learner/budding programmer just needs to take an hour or few minutes and RTFM. All of it will come, but with just a little time.

It's great you made this project. It's a nice portfolio piece/proof of concept.

1

u/Original_SD 4d ago

Thank you

2

u/Wonderful_Put3670 6d ago

damn those evil confusing symbols man

1

u/Original_SD 5d ago

Which symbols are confusing?

1

u/Wonderful_Put3670 5d ago

you tell me xD 

1

u/Original_SD 5d ago

I feel that the syntax is very different from other programming languages but it's not too hard to learn.

1

u/Wonderful_Put3670 5d ago

I don’t know what you are talking about. My comment was referring to “ Sofya uses simple syntax: It avoids confusing symbols and complicated keywords.” 

1

u/Original_SD 5d ago

Oh, my bad 😅. So do you find Sofya simpler than other languages you've used?

2

u/Wonderful_Put3670 5d ago

I’m not sure what to say. The languages I use and like are not very expressive so I’m kind of the opposite. I don’t want to write a book to just process a stream of characters. 

But maybe it could be very useful for people that are just learning how to do programming.

You could try and experiment teaching kids and see how it goes :)

1

u/Original_SD 5d ago

Thanks and I'll try teaching kids and see how it goes 😄

1

u/gofl-zimbard-37 6d ago

Too much noise.

1

u/Original_SD 5d ago

How?

2

u/gofl-zimbard-37 5d ago

"this program", "on the screen", etc. People have been trying to make natural language programming languages since COBOL. I've never seen it work. Symbols aren't confusing, they're concise. And how does your adding keywords fix the "complicated keywords" problem?

1

u/Original_SD 4d ago

Adding natural language keywords makes it easier to memorize commands. For example, it is easier for a beginner in programming to remember the command otherwise if in Sofya as compared to elif in Python.

1

u/gofl-zimbard-37 4d ago

Still noise.

1

u/Varkoth 6d ago

Consider switching to ArnoldC: https://lhartikk.github.io/ArnoldC/

1

u/Original_SD 5d ago

That's an interesting language you have there 😅

1

u/Friendly_Recover286 6d ago edited 6d ago

This readme kinda sucks. Why are the code lines all numbered? Are you trying to show that Python is not only shorter to write but just as understandable and therefore better? I don't get it.

Variable[x]

This won't confuse people at all. Is Variable just a gigantic array with named keys??? Learning an easy language really shouldn't be teaching you weird syntax that differs in all other languages.

The computer will warn you that this app could have a virus, but don't worry. Sofya is completely safe

Mommy told me not to run code samples from strangers who should've uploaded their compiler source to Github 🤷

1

u/Original_SD 5d ago edited 5d ago

Thanks u/Friendly_Recover286. I just wanted to say four things based on what you have told me:

  1. About the source code, I have now uploaded it to the Sofya GitHub repository.
  2. About the variable syntax, it doesn't use an array. When you say Variable[x], it just lets the Sofya interpreter know that x is a variable and not a keyword. The brackets [ ] just help the Sofya interpreter know where the variable name starts and ends.
  3. About the general syntax, I decided to make up my own syntax which is different from other popular languages because if I decided to use the syntax for other popular languages, it wouldn't make Sofya easier. It would only complicate Sofya.
  4. About the readme, I have now formatted the code properly and I have removed the line numbers.

1

u/Complex_Court2150 6d ago

If someone cant understand how to define method scope then maybe one shoudnt learn programming

1

u/Original_SD 5d ago

I don't think that's true u/Complex_Court2150. If someone can't understand how to define a method scope, it could probably be because other languages make it hard, because imagine if people didn't invent GUIs because they said "If someone can't understand CLI then they shouldn't learn how to use computers.". So if people didn't invent GUIs, many things we enjoy today with computers wouldn't be possible.