Writing a Basic Interpreter

For everything that's not in any way related to PureBasic. General chat etc...
ColBoy
Enthusiast
Enthusiast
Posts: 143
Joined: Fri Feb 13, 2004 2:37 pm
Location: Ottawa, Canada
Contact:

Writing a Basic Interpreter

Post by ColBoy »

Does anybody have any pointers for writing a Basic interpreter. A) I've always wanted to write one B) I have a specific project in mind. Not sure at this stage whether to do it in Purebasic, as I am much more experience in VB.NET, Delphi and Python, but would love the speed performance I would get writing it in PB. At this point would just like some pointers to some texts that would prove useful, or some other tips. Thanks
Colin
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Writing a Basic Interpreter

Post by c4s »

Well, Trond wrote a very comprehensive tutorial about it so this site is exactly what you need: pbtut.blogspot.com

Here is the related thread:
http://www.purebasic.fr/english/viewtop ... 27&t=38931
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
ColBoy
Enthusiast
Enthusiast
Posts: 143
Joined: Fri Feb 13, 2004 2:37 pm
Location: Ottawa, Canada
Contact:

Re: Writing a Basic Interpreter

Post by ColBoy »

I think that's a little lower level than I wanted to go. Is much of this still relevant, even though I want to create an interpreter, rather than a compiler? Want this to be a pure language solution, i.e. no C, or ASM external calls. I don't think speed is going to be much of an issue here, especially in comparison to the speed of the interpreter on the original 4mhz machine.
Colin
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Writing a Basic Interpreter

Post by c4s »

Oh, sorry I misread it.
But informations about the "understanding of the source code" can still be interesting for you.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Re: Writing a Basic Interpreter

Post by Foz »

I would have a look at Tiny Basic as an example of how to implement it. You will be able to find many ports of the code in virtually whatever language you like.

I have been tempted to implement my own version for built in scripting purposes, but I am no where near needing that (yet). :)
X
Enthusiast
Enthusiast
Posts: 311
Joined: Tue Apr 04, 2006 6:27 am

Re: Writing a Basic Interpreter

Post by X »

DracScript is here on the forums too :)

On a side note, Trond seemed to have abandoned the scripting project and nobody took it up :( We need a scripting project from beginning to end, kinda like Trond's but finished. That would be cool.
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Re: Writing a Basic Interpreter

Post by utopiomania »

There's an obfuscated source for a Basic Interpreter in a recent anticracking thread here. The hackers here will
help you de-obfuscate it in no time. :)
Last edited by utopiomania on Sat Jun 12, 2010 12:01 am, edited 1 time in total.
User avatar
codewalker
Enthusiast
Enthusiast
Posts: 331
Joined: Mon Mar 27, 2006 2:08 pm
Location: Spain

Re: Writing a Basic Interpreter

Post by codewalker »

Did the question about writing the next os in purebasic already pass by . . . :mrgreen:
There is a difference between knowing the code and writing the code.
May the code be strong in your projects.
Post Reply