Is it possible to write a programming language with an existing one? I want to create a game creation program, and have it use it's own language for additional programming. Something similar to Game Maker.
Name:
Anonymous2005-05-18 15:44
Yes, but that's not necessarily the best choice.
Usually the best way to do this is to embed an existing scripting language, like LUA, Python, Ruby or Javascript or something.
This is a good choice because you already have a well-established language, with syntax familiar to other developers, and plenty of existing documentation on how to embed it.
But if you insist on your own language or syntax, look into grammars and something like flex/bison.
Name:
Christy McJesus!DcbLlAZi7U2005-05-18 18:21
It's very much possible, but a bad idea for most of the reasons >>2 mentioned and then some. Python is a good choice, some commercial games have successfully used it for the higher level logic after doing the performance code in C++.
Name:
Anonymous2005-05-19 6:49
I thought Lua was pretty much the default choice for an embedded language. Why python? (honest question)
>>5
Either you need to learn how to read, or go troll elsewhere.
Name:
Anonymous2005-05-21 9:05
>>6
I was making a [insert big word here] comment on the state of programming languages. >_>
Name:
Anonymous2005-05-24 4:18
It is entirly possible to write a programming language in anouther language. How ever you have to ask yourself do you really want to work out the binary code (or assembly if your not going to complete the job yourself) yourself. Plus the fact that you asked the question probably means you wouldn't be-able to produce a scripting language which requires computer theory, such as (mainly) stacks and hash tables.
Imbeding a existing scripting language, or using a tool such as dlopen (unix) or openlibrary (Windows) to dynamicly include library files, instead of worry about scripts.
Perhaps you should spend more effort on the game and introduce the this feature later? A game can require a lot of work, and it isn't worth going off on a tangent for a simple feature.
Bootstraping a new programming language with -itself- used to be all the rage years ago... (example: Wirth's Pascal)
Name:
Anonymous2005-05-31 5:33
It's a witty way to do stuff
Name:
Anonymous2005-05-31 21:33
More like it's a good way to prove the language is actually useful.
Name:
Anonymous2005-06-04 10:58
>>13
I see where are you coming from. In fact, I usually look for the following once I read a language:
- I like to be able to implement functions like those the language's base library provides. For example, you can do my_printf in C, but you can't do my_WriteLn in Pascal (correct me if wrong).
- I like to be able to do stuff. Any kind of stuff. For example, you can do linked lists in C, but you can't do them in Basic (correct me if wrong).
Name:
Christy McJesus!DcbLlAZi7U2005-06-05 11:09
Since we're on this line of discussion:
Lisp has a mere 7 axioms, the rest of Lisp is written in Lisp. w00t
Name:
Anonymous2005-06-05 22:25
I keep hearing good things about Lisp, but I'd rather have two teeth taken than write in Lisp syntax...
Name:
Anonymous2005-06-06 1:04
sounds to me like you basicly want to make a program that contains a scripting language, yes you can do that.
Name:
Anonymous2005-06-06 3:15
yes. i wrote a simple game that contains a forth interpreter in python. forth is the easiest language ever to write an interpreter for. it would probably be easier ond result in a better language if you used an existing scripting language though. i know that python and scheme have c++ bindings, probably some other languages too.
Try it out, it's worth it once you get used to the parentheses flying everywhere. Even if you never use it it'll give you an interesting point of view on language appreciation. (I tried to make the preceding sentence sound non-pretentious but I couldn't manage it...)
Name:
Anonymous2005-06-07 0:40
joy > lisp
it has even less syntax than lisp
Name:
Anonymous2005-06-07 1:28
you can't actually _do_ anything with joy though because the higher level combinators (i.e. most of the useful ones) work on the entire stack thus destroying any state information.
Anonymous #26 meant no matter what LISP has, useful stuff gets done in C (C++ if objects are really necessary), like always. Save for web sights, which can be done in PHP or Perl.
Name:
Christy McJesus!DcbLlAZi7U2005-06-08 6:03
Well I sure as hell don't do much in C. It's a low level language, trying to treat it as a high level language is the reason we have buffer overrun vulnerabilities in *everything*
Also the guy who shares my office keeps crunching on something. It's one of those really annoying slow crunches that people make when they're trying to eat quietly. *chhhommmp... munnnch... guulllp* If you're going to annoy me do it like a man, faggot.
Also in the interests of creating drama, I shall now bring up the subject of Java.
uhm. compiler theory is possibly the hardest part of computer science. it looks like he doesn't even know where to begin to look, so he's extremely unlikely to get anything working
Name:
Christy McJesus!DcbLlAZi7U2005-06-08 12:29
>>34
He only wants an extension language, why go to the extreme of compiling things?
Name:
Anonymous2005-06-08 14:25
oh god seriously are you a retard or are you trolling? if the former, how do you manage to breath?
>>36
The answer to your question would depend on who you're talking to. Abuse less pronouns.
Name:
Anonymous2005-06-09 12:02
>>38
Save for you who (strangely enough) are not Anonymous, it would then become:
oh god seriously is Anonymous a retard or is Anonymous trolling? if the former, how does Anonymous manage to breath?
which would pretty much be the same :)
Name:
Christy McJesus!DcbLlAZi7U2005-06-09 14:33
>>39
I was going to say something about using pronouns on a thread full of Anonymous, but I realised it would be silly for the reasons you mentioned :)