??Log 3: How I created my own programming language? [SPECIAL EDITION]
SAKSHAM JOSHI
?? Creator of SRON | Advanced C & C++ Expert | Self-Taught Compiler Engineer | Striving for Excellence
Disclaimer: If you haven't read the previous article, you may not fully understand this one. Click here to read!
Saksham Rapid Object Notation (SRON) is a high-level, procedural, dynamically typed, and compiled + interpreted programming language that provides an easy and expressive syntax along with exceptional speed, surpassing Java, Python, C#, JavaScript, and even C in many cases.
In the previous article, I explained how datatypes like Int, Double, Char, String, Bool, and List are implemented in SRON. I also discussed how variables are managed and how arguments are passed to functions. In this article, I will reveal the reason behind SRON being compiled + interpreted and much more.
After implementing datatypes and other components, it was time to define the syntax clearly: attributes, keywords, identifiers, instruction sets, functions, etc. But suddenly, I got a message on my college's official WhatsApp group saying, "Saksham, call me," from our respected teacher Dr. Naveen Tewari . I was very worried about what might be wrong. I called him, and he asked if I was willing to take a job at a software consultancy firm.
To be totally honest, I had zero belief that SRON could be developed by a person like me, and I had already declined many internships offers before. Also, I hadn't attended any campus placement drives. So, I said yes. He asked for my resume, and after 30 minutes, I got a call from NavUday Software Pvt Ltd . Their HR interviewed me on the call, and after that, the founder himself, respected Mr. Ravi Patni Sir, interviewed me. He selected me and asked me to join from the next day. I was very excited about my first job.
I was working well, but due to this, I was not working on SRON, though its ideas and thoughts always surrounded my mind. My family wanted me to leave the job and focus on my studies, but I knew very well that practical experience is vital. After 5 days, I felt back pain, eye itching, and lack of sleep. My health was declining gradually, but suddenly my very good friend Mr. Swarn Shauryam Swarnkar called me and told me his awesome business idea. Now, I had four big reasons to leave my job:
1. SRON
2. Family
3. Health
领英推荐
4. A great idea to become my own boss.
I left my job and joined his startup. We worked very hard, brainstormed, and consistently moved forward. We were ready to raise funding, but due to some reasons, we were unable to do so. Gradually, our motivation shut down. I swore not to leave SRON anymore and started working on it again.
Now, it was time to dive into programming. I was not understanding how other programming language's compilers or interpreters work. I borrowed a book on Compiler Designing from my campus library, but I couldn't understand even a bit from it. Then, a quote from my physics teacher, respected Mr. Ravi Bisht Sir, came to my mind:
"Take help only if it is the last chance."
So, I returned the book and started using my own mind to figure out how I could do it. I think this is the reason my IQ increased from 73 to 129. I got the idea to first split the code into different parts like variables, operators, keywords, numbers, strings, characters, etc. (which we call 'tokens'). Then, iterate over the tokenized code and find out errors like if the variable or function exists or not, if the variable name is correct or not.
During its development, I realized that if SRON became a fully interpreted programming language, the execution time as well as memory usage would be high. Also, the power usage and complexity of the project would be too much, making debugging and updates difficult. So here comes one of my best decisions in SRON's journey: to make it a compiled + interpreted programming language like Java.
To make it interpreted, some sort of bytecode is needed, like Java's bytecode which runs on the Java Virtual Machine (JVM). But how did I make the bytecode? How SRON's compiler generates bytecode? How is SRON's interpreter optimized to such a level? You will get these answers in the next article, releasing on July 14, 2024.
Thanks for reading this Article. If you have learned something, be awesome enough to subscribe to this newsletter.