how to create a scripting language?

Posts: 110
Joined: 2002.04
Post: #16
Ok Im bothering to read this whole thread but I will throw in some useful info cause I have down a lot language writing and virtual machines etc.

The easiest ways to build a mature language you can easily maintain is to use tools to generate your parsers etc.
The old ones most people know are lex and yacc.

The thing is the world has moved on and there much more mature tools for language creation.

ANTLR is what people should be using.

List of existing grammars already done with it

Lots of stuff to learn from Smile

Ok on top of all that.

You can build a game engine in C++ or what ever and have a generic scripting language binding system.

The Gimp does just this.

It supports like at least 3 scripting langanges for plig ins etc that can all talk to each other and to C etc.

How do you do this?

You make a language bridge object... that all languages C included register there function with.

When C wasnt to call ruby it simply calls an object registered in the bridge object which dynamically translates the call to the receiving language.

To add support for a new language all you need to do its write the small amount of code needed to talk to the bridge.

Another trick... once you can talk to the bridge you can ASK it for all its object definitions... at which point your new language could dump or our make class files
based on what it finds.

All of this is really easy... but so far I have seen it done just once.

- Mac Lead ZeniMax Online Studios
- Owner Plaid World Studios
- Resume:
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Suggested Scripting Language Talyn 11 9,386 Dec 31, 2008 03:26 PM
Last Post: Carlos Camacho
  Scripting Language Woes (Lua) Bachus 2 5,354 Oct 14, 2008 09:48 AM
Last Post: Blacktiger
  Looking for a compilable scripting language BinarySpike 8 9,031 Apr 24, 2007 09:59 AM
Last Post: BinarySpike
  Scripting Language: Rolling Your Own Emehr 14 9,077 Feb 10, 2007 08:14 AM
Last Post: IBethune
  Scripting language recommendation? WhatMeWorry 6 5,416 Nov 11, 2006 10:09 AM
Last Post: Duane