DEV Community

Nolabjfjdj
Nolabjfjdj

Posted on

I’m building PyQ: Python concepts, translated into French

I’m building PyQ: Python concepts, translated into French πŸ‡«πŸ‡·

What if you could write Python-style code entirely in French?

That’s the idea behind PyQ, an independent programming language I’m currently developing.

The idea

PyQ brings many of Python’s concepts and syntax into French.

For example, Python uses:

print("Hello, world!")

In PyQ, this becomes:

afficher("Bonjour, monde !")

Some other examples:

Python β†’ PyQ

print β†’ afficher
if β†’ si
else β†’ sinon
elif β†’ sinon si
while β†’ tantque
return β†’ retourner
True / False β†’ vrai / faux
and / or / not β†’ et / ou / non
try / except / finally β†’ essayer / sauf / enfin

The goal is to make Python-style programming feel natural to French-speaking developers and learners.

PyQ is its own language

PyQ isn't a Python-to-PyQ converter.

It has its own lexer, parser, AST and interpreter.

Python is currently used to implement the interpreter, but PyQ itself has its own language syntax and execution model.

For example:

**nom = "Monde"

si nom == "Monde":
afficher("Bonjour " + nom + " !")**

What can PyQ currently do?

The language already supports several programming concepts, including:

  • Variables and basic types
  • Mathematical operations
  • Conditions
  • Loops
  • Lists
  • Dictionaries
  • Functions and parameters
  • Local scopes
  • Logical operators
  • Comments with #
  • Error handling
  • Runtime errors with line numbers

I’m currently working toward PyQ 1.0.

Why make another language?

There are plenty of programming languages already, so PyQ isn't trying to replace Python.

The project is mainly an experiment in language design and accessibility: what would Python-style programming look like if the language itself were designed around French keywords?

That also raises some interesting questions about programming-language design and whether translating familiar programming concepts can make them more approachable for people who are more comfortable programming in French.

The project

PyQ is open source and available on GitHub:

https://github.com/Nolabjfjdj/PyQ

I’d be interested in hearing what other developers think about the concept, especially the syntax and the idea of adapting Python-style programming to another natural language.

Thanks for reading!

Top comments (0)