make my own language

just to the point, can i make my own programming language?
there are many programming language, i just want to make my own. how can i?

Comments

  • : just to the point, can i make my own programming language?
    : there are many programming language, i just want to make my own. how
    : can i?
    :
    Yes, you can. First you need to decide if you want an imperative, functional, or OOP language. Then if you want to have a stack-based language or some other memory-model; the variable typing model (weak or strong, static or dynamic, etc.); compiled, interpreted, or hybrid language; traditional or event-driven.
    Then you need to define several standard statements: loops, conditional statements, basic input-output statements, and possibly declaration statements. Several other statements may necessary based on your first choices. For example: for a strong static-typed language you also need to have conversion functions.
    Finally you can start to write your compiler or interpreter.
  • : Yes, you can. First you need to decide if you want an imperative,
    : functional, or OOP language.
    Too many language designers think that these are mutually exclusive. If you want to design a general purpose language, just picking one paradigm isn't, in my view, going to make for a particularly good language. Not every paradigm fits all problems. I resented C# 1.0 for going down the "OOP only" root (and still dislike Java for that very reason), and was very happy when C# 2.0 made a functional style of programming somewhat easier.

    : the variable typing model (weak or strong, static or dynamic, etc.);
    Plus what kinds of polymorphism are going to be supported, if applicable. Also, it ain't as simple as static vs. dynamic anymore. See for example papers on hybrid type systems and gradual typing.

    : compiled, interpreted, or hybrid language;
    That's more of an implementation choice than a language design one; a language I'm invovled with has have been partially implemented in both ways.

    : Finally you can start to write your compiler or interpreter.
    Being invovled in the process of developing a large and complex language, I'd kinda warn against trying to do all the design first and then implement. Things got a *lot* easier for the designers when there was a prototype implementation of the language to play with. That's not saying don't get the groundwork done first, but don't see the need to have every bit of the language set in stone. Sometimes you just have to use a language to get a feel for how well it works and then tweak things.

    A lot of what I said here applies to designing languages for serious use, rather than a toy language to get the ideas of how to do it and how to build a compiler or interpreter sorted out in your head. But they're worth knowing if you want to design a language for today rather than a language of 20 years ago.

    Jonathan
    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
  • Okay, thanks for showing me how to make a programming language. Seems to be a really hard work. Maybe i'll do this work when i have enough knowledge and experience (and enough money, of course).
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories