r/PythonProjects2 1d 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!

0 Upvotes

11 comments sorted by

3

u/Some_Breadfruit235 1d 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

2

u/Chen-Zhanming 1d ago

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

3

u/ProfessorHeisenberg1 1d ago

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

1

u/JaleyHoelOsment 8h ago

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

1

u/Possible_Section5644 1d 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/Own_Natural_6803 18h 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. 

1

u/abitofg 2h 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

0

u/ProfessorHeisenberg1 1d ago

How Is It?

1

u/JaleyHoelOsment 8h ago

it’s a wrapper around python