Log in
Blog
Games
Forum
Gallery
Company
<< Making Lua run on the Xbox 360 and PS3 (native code)
|
Best April 1st Joke >>
Writing your own programming language with the DLR (Dynamic Language Runtime)
by
Benjamin Nitschke
31. March 2009 00:57
Image stolen from
this great article
In accordance to the very good blog with many useful links for IronPython at
ironpython-urls.blogspot.com
I will also try to post some useful links about my recent DLR (Dynamic Language Runtime for .NET) research.
I have been working a bit on the DLR before, mostly together with Silverlight, which was cool, but Silverlight was way too hard to work with and I still think it is not distributed enough. On that note if you are interested in Silverlight, check out the
. And even before that quite a bit with the
Visual Studio SDK
, early
IronPython
versions and other language implementations in .NET and even with native c code (but usually I just modified existing samples). I have also modified Lua for my own needs recently and made it run on the Xbox 360 and PS3 and modified some behaviour for my projects, since we use it for our upcoming game and I use it quite a lot together with IronPython on the tools I write at work.`
But my overall goal remains: Writing my own language, preferbly running on .NET and the DLR seems to be a good fit. Today after we finished the latest demo of our game for the GDC next week, I had finally some time and motivation to get this thing started again :) I probably should do some more XNA projects since I'm a DirectX/XNA MVP and I have still something I work on from time to time, but it is still a long way to go until this project is completely done.
Okay, to get things started again I searched for some new DLR information and samples on the net and here are some helpful links:
The Tools:
DLR - Dynamic Language Runtime, which runs on top of the CLR in .NET (even in Silverlight)
ANTLR v3 - The best tool ever for constructing your own interpreter/compiler/parser, etc.
And these are the most useful links to get started (and other links that interested me):
Five minute introduction to ANTLR 3
ANTLR 3 - FAQ - Getting Started
Test-Driven Development with ANTLR
Quick Starter on Parser Grammars - No Past Experience Required
How do I get case insensitivity?
Learning the basics and also some good blog posts:
Create your own language on top of the DLR - Detailed article about creating a language with the DLR
DLR - Build Your Own Language (without tears). Kinda fast paced article that skips a lot of steps, but at least it got me motivated.
Part 2
,
Part 3
,
Extra Tips
CLR Inside Out - IronPython and the Dynamic Language Runtime - Good article about the DLR, IronPython and DLR ASTs
Generate AST for the DLR (Code Project). Nicely written, easy to understand and gives a good overview of writing your own custom AST for the DLR. The sample itself is kinda useless because it always generates the same AST, but you will at least understand how code should be parsed and passed to the DLR as an AST. In this tutorial there is no parser or lexer, the generated AST is just static code, but at least the source code is easy to understand :) The article will also explain all the basics you need to understand ASTs and how the DLR uses them.
Building a DLR Language - Answering Some Questions - Also a very helpful blog. Goes into detail about whats going on under the hoods, investigates with Reflector. Be sure to also read the other posts of Martin Maly.
How to write a simple DLR host in C# using Hosting API
Building a DLR Language - ToyScript (Martin Maly's blog)
Jim Hugunin's Thinking Dynamic blog - The One True Object articles are interesting, also links to a lot of good DLR talks
DevHawk - Blog by Harry Pierson, one of the main guys behind IronPython
Martin Maly - Building a DLR Language (more general, see above for more comments)
Sapphire Steel blog: Antlr 3 and the Dynamic Language Runtime
DLR Hosting and related stuff...
Knowing .NET blog about IronPython and .NET
The .Net DLR makes building a new language implementation ridiculously easy
Building On The DLR - by Tomas Restrepo - An approach to create a simple language with the DLR
I still have a problem with the DLR - by mithrandir (Incanus On Rails) - A critice on how the DLR beta was written. I think most of the issues have been solved or not as bad as portraied there.
Darrell Hawley's blog, mostly about IronPython integration. Has some cool "Note to self" posts on there.
Another critice about the DLR, this time about the fact that it is not really open source since no contributions are accepted. Little bit too harsch.
The Weekly Source Code 11 - LOLCode DLR Edition (from 2007) - by Scott Hanselman's ComputerZen.com - fun read.
Another post like this from a year ago with helpful DLR links: Adventures in Compilers - Building on the DLR
Embedding the Dynamic Language Runtime - IronPython & .NET Applications - A nice tutorial by Michael J. Foord (at voidspace.org.uk)
Compiler Books:
Basics of Compiler Design by Torben Ægidius Mogensen - Free eBook - Easy and enjoyable read about a hard topic!
Compiler Construction by Niklaus Wirth - Also a free eBook (about Oberon)
Compiler Design and Implementation - Free eBook about some guy writing his own compiler - step by step
Compilers: Principles, Techniques, and Tools (2nd Edition) - A heavy 1000+ pages and kinda expensive book about a heavy topic, was written in 1986, but is still very useful and recommended
The Definitive ANTLR Reference: Building Domain-Specific Languages by Terence Parr - This is the book you should read when using ANTLR seriously. Very nice book; I plan to read it when I use ANTLR more.
Lots more Free Compiler Design / Construction Ebooks
And even more Free Compiler Books (newer)
Other useful DLR links:
Homepage of IronPython - The main usecase for DLR - quite a lot of releases, performance comparisons and a small, but active community
DLR Pad, a very simple app that lets you write and test code with a simple XAML WPF app using IronPython and IronRuby
IronPython and the Dynamic Language Runtime
Make Your Application Extendable Using the DLR - simple example on how to use IronRuby or IronPython in a little app.
Boo also uses ANTLR and is a very interesting project overall (mixture of C# and Python). I used it a bit 2 years ago, but I stopped because of the lack of a decent IDE (yes, I know about SharpDevelop, but that is not decent enough for me).
IronPython (and DLR) nightly builds. In case you want to be on the bleeding edge.
Silverlight Dynamic Languages SDK
Okay, back to improving my lexer and parser. I think I got the research aspect covered for now.
Tags:
Related posts
DLR Performance Comparisons
The last few days I was working a little bit with the DLR and got to a point today where I was won...
The year 2005 - Reviews of Games, Movies, Software and Programming Books
I'm working on a little other project right now and that will take a while before I can show anythin...
CR_Commenter Update v1.5 and testing out the Boo Language
I've updated my Commenter plugin for CodeRush today. I did some refactoring and was getting annoye...
Add comment
Cancel reply to comment
Name*
E-mail*
Website
b
i
u
quote
Comment
Preview
Comment
Notify me when new comments are added
Disclaimer: The opinions expressed in this blog are own personal opinions and do not represent the companies view.
© 2000-2010 exDream GmbH & MobileBits GmbH. All rights reserved.
Legal/Impressum
Search
Search
Include comments in search
Recent Blog Posts
CeBIT 2010 - A quick tour around the halls
Right Margin Line in Visual Studio 2008
Seattle 2010 - MVP Summit - Day 8 - Getting back to Germany
Seattle 2010 - MVP Summit - Day 7
Seattle 2010 - MVP Summit - Day 6
Seattle 2010 - MVP Summit - Day 5
Seattle 2010 - MVP Summit - Day 4
Seattle 2010 - MVP Summit - Day 3
Seattle 2010 - MVP Summit - Day 2
Seattle 2010 - MVP Summit - Day 1
Recent Games
Current Poll
Do you know what the Delta Engine is?
Not really
Yes, I got secret insider information
Please choose an answer.
Show Results
Poll Archive
You already voted this poll.
Your vote has been registered.
Do you know what the Delta Engine is?
Not really
74.4%
Yes, I got secret insider information
25.6%
Total Vote:
39
Show Poll
Categories
All
Conferences (30)
DLR (7)
Fun (44)
Game Development (187)
iPhone (30)
Lua (10)
Other (224)
Programming (203)
Racing Game (12)
Reviews (160)
Rocket Commander (50)
XNA (67)
Month List
2010
March (1)
February (10)
January (11)
2009
December (15)
November (13)
October (3)
September (5)
August (3)
July (3)
June (5)
May (6)
April (8)
March (19)
February (16)
2008
November (2)
October (1)
September (1)
May (2)
April (14)
March (1)
February (3)
January (4)
2007
December (2)
November (2)
September (2)
August (2)
July (10)
June (6)
May (9)
April (11)
March (10)
February (3)
January (1)
2006
December (4)
November (13)
October (1)
August (14)
July (5)
June (7)
May (9)
April (5)
March (8)
February (8)
January (2)
2005
December (9)
November (7)
October (5)
September (2)
August (5)
July (3)
May (2)
January (2)
2004
December (16)
November (12)
October (8)
Calendar
<<
March 2010
>>
Mo
Tu
We
Th
Fr
Sa
Su
22
23
24
25
26
27
28
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
Newsletter
Get notified when new posts are published on this blog.
Enter your e-mail
Thank you