5

(heading)How a programming language is created? Because I want to make my own.(heading)

I am learning C and next I will learn C++, SQL,DS&A, Assembley, Lex&Yacc,Operating Systems, Computer Arcticture, Computer Networks because I think it's enough for my goal. The only reason I am learning this, to make my own C++ clone with my own knowledge. But I really don't know how can I create my own programming language like C++ from scratch. Like what are the first steps to began with. As I know that C, first step is Preprocessor then Compiler then Assembler then (Loader/Linker).

Anyone please give me a step by step guide like learn this language first then this then this. So I can finally reach that amount of knowledge which I can implement to create my own programming language like C++.

Comments
  • 1
    http://lisperator.net/pltut/

    This is javasceipt but the theory is the same. I once made a lamguage in C#
  • 1
    I made my own language with F#. I started with C++ but switched to it since the compiler needed to be cross platform and was a bit difficult. There is an equivalent of flex and yacc for .net core so i didnt start from scratch.
    Anyway functional languages are a lot easier to reason with when building a language. If ypu are willing to give it a shot try Ocaml or even haskell
  • 2
    There is this thing called LLVM which you can rely on.
  • 1
  • 1
    Good luck and welcome to devRant
  • 1
    Hey, basically you do need to know by yourself what you want to write. An interpreter or a whole compiler.
    A very fast quickstart:
    https://programiz.com/article/...

    If you do stand out only for interpreter there are a lot of guides out there.

    If we would talk about compiler itself, then you definetly need assembly/machine code knowledge.

    Also, dont forget:
    http://matt.might.net/articles/...
    :) It is not that hard to write a fully functioning interpreter. It is a very hard work to write a whole compiler. (Writting a simplistic OS kernel in this place is probably even easier than writing a whole compiler)

    Just my 2cents.
  • 0
    @maladiec Thank you friend, Your articles are great as well as other resources people have mentioned on my question.
    By taking help from all of these resources I will try to create a programming language that compile to JavaScript.
Your Job Suck?
Get a Better Job
Add Comment