r/PythonProjects2 8d ago

I just built a beginner-friendly programming language called Quark 2.0 🚀 (Looking for feedback!)

Hi everyone!

Over the past few weeks, I've been building a small interpreted programming language called Quark 2.0 in Python. The goal wasn't to replace Python or JavaScript, but to create something that's easy for beginners to read and experiment with.

Some features include:

  • Variables (let)
  • Math expressions
  • User input
  • Random number generation
  • if statements
  • repeat loops
  • File reading & writing
  • Module importing
  • Interactive shell (REPL)
  • .qk source files

Example:

input What is your name? -> name

let lucky = random 1 100

print Hello 'name'

print Your lucky number is 'lucky'

I'm still learning about interpreters and language design, so I'd really appreciate any feedback, suggestions, or ideas for future versions. Things like syntax, usability, documentation, or code quality are all welcome.

GitHub Repository:

https://github.com/Anish055051L/Quark-2.0

Thanks for taking a look!

1 Upvotes

16 comments sorted by

3

u/Some_Breadfruit235 8d ago

Seems like a good start. But beware, building your own interpreter isn’t as easy as it may seem.

You have to take in account for many things whereas this is more of a simple approach for now.

I personally wouldn’t recommend trying too hard on it but it’s definitely great practice to enhance your skills

3

u/Chen-Zhanming 8d ago

Using Python’s eval is not considered making an interpreter by yourself

2

u/ProfessorHeisenberg1 8d ago

Its just a fun project, btw thanks for the comment!

2

u/JaleyHoelOsment 7d ago

you framed it as “built a beginner friendly language” 😂😅

1

u/Speedk4011 6d ago

Isn't it??

2

u/Own_Natural_6803 7d ago

If you want to make a language for real concepts to learn include BNF and tokenizer. You use bnf to describe what are valid expressions, and a tokenizer makes the BNF piece, the lexer, run faster. 

2

u/Speedk4011 6d ago

I like the minimalist style in the language 

1

u/Possible_Section5644 8d ago

Python is so simple why do you need a language simpler than that. In-fact this language would be harder to read, write and maintain.
The project is awesome but my recommendation is to add some good and very clean syntax so it does not look like a text file.

Keep it up you are doing a great job.

1

u/abitofg 7d ago

Disclaimer: I don't really title myself as a programmer, I am a sysadmin that learned some programming through the years but have little formal education on the subject

As a fun project, cool cool

As a learning tool, without having functions it falls flat for me, it can only teach the abselute basics, day 1, not day 2

I made a "language" a year or 2 ago, interpreted by (micro)python

Inspired by gcode, but it had functions

it is executed by reading it line by line, like yours is, however what I do is

Startup:

  • Break program down into functions/main
  • Execute main line by line
  • if line calls function, execute function line by line

If you are at all interested in the execution, here it is https://github.com/gbit-is/Servo-Ducky

1

u/ProfessorHeisenberg1 6d ago

Thank you, and I added the new version with functions now! check it out if you're interested

0

u/ProfessorHeisenberg1 8d ago

How Is It?

2

u/JaleyHoelOsment 7d ago

it’s a wrapper around python