I propose a new programming language, CPC

  • Posted 3 hours ago by tom_gi
  • 2 points
I'm starting my own programming language for understanding and solving leetcode problems at Google. It is called compilable pseudocode, or CPC. True, the name is intentionally paradoxical; the goal is pseudocode rigorous enough to compile. The inspiration first came to me some time after a Google interview in 2023. The interviewer told me, "pseudocode is fine." Honestly, I had depth first search on a graph to detect cycles in Python on my mind, so I did not seriously pursue pseudocode. That was a mistake, because it shut down conversation with the interviewer, and cost me points. Hence, I propose CPC.

The purpose is that Google interviewers will not only comprehend your solution, they will see you are fluent in algorithmic thinking.

The idea is simple. Everything is a list. In CPC, a list is defined so that a child - albeit a prodigy - could easily understand: a list is a collection of items, in order, where each item has a position.

Take all the data structures that appear in leetcode, and abstract them away to their most common denominators in terms of lists. In other words, a hash table is a list where each item has a name and a value. Repeat this for every data structure so that there is as little jargon as possible in CPC.

Then the syntax for CPC is just the plain english describing the pseudocode. The code supports “wobble”. In other words, you can use plain english to describe a solution in more than one way.

Any thoughts? If there are supporters here, I propose we as a community proceed to derive CPC solutions to popular leetcode problems. Once we hit the 500 problem mark, we can publish CPC as an official compilable language.

1 comments

    Loading..