Can you create a programming language in PureBasic?

Everything else that doesn't fall into one of the other PB categories.
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Post by Marco2007 »

srod wrote:I always like writing my own tools - just for the challenge! :wink:
We like that :D
PureBasic for Windows
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

you could have a look at bint32 by Eros Olmi http://www.jose.it-berater.org/smfforum ... pic=1178.0
CSAUER
Enthusiast
Enthusiast
Posts: 188
Joined: Mon Oct 18, 2004 7:23 am
Location: Germany

Post by CSAUER »

I wrote a scripting language 1 1/2 years ago with OO support written in PB.
I posted this test run:
http://www.xideas.de/purebasic/WASAGOS_ ... esting.zip
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PB4.1 - Win: MacBook black 2008 2,4 GHz, 4 GB RAM, MacOSX 10.5/VMWare/WinXP
PB4.1 - Mac: MacMini G4 1,4 GHz, 512 MB RAM, MacOSX 10.4
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

Marco2007 wrote:
srod wrote:I always like writing my own tools - just for the challenge! :wink:
We like that :D
+100 :D
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
TheCorruptor
New User
New User
Posts: 9
Joined: Fri Aug 28, 2009 12:35 am
Location: PA>USA

Making your own language, updates?

Post by TheCorruptor »

Please bear with me Iam just a novice but want to learn. sharkbate24 did you ever find any good information on making your own compiled computer language from purebasic or have any good links with samples ? I have always been interested in doing this and any usefull and simple information is very hard to come by. Iam not looking to make a language to compete against PureBasic I want to do this for a learning experience and to get better at learning programming and theory behind it. Also is there a way to make your own commands in PureBasic so the compiler would see these as native commands and only add the ones you use in your code and not add all the commands in the exe ? Without using DLL's or Lib's. How could I do this ? Any info is greatly appreciated. Thanks for any help anyone can give me on my long search for answers. :D
Teng
User
User
Posts: 21
Joined: Thu Aug 27, 2009 12:13 pm

Re: Making your own language, updates?

Post by Teng »

TheCorruptor:

If you're a novice why jump the gun by making a compiled language? Why not try your hand at making an interpreted or scripting language instead, probably way easier before you start aiming higher. You probably need to know fasm thoroughly as well as the full PE format specification, not to mention lexical tools like lex or yacc or bison. Scary stuff!! :shock:

I'm interested in making a programming language too btw, as far as I can tell only Game Maker allows the average newbie a fast an easy way to implement a scripting language in your own game/application with the 'execute_string()' function. That program was and still is awesome.

I currently only know how to convert expressions from infix to postfix. I guess that's my first step in making a scripting language. If you still want to make a compiled language many ppl recommend this book a.k.a the dragon book :

http://www.amazon.com/Compilers-Princip ... 0201100886
rrpl
Enthusiast
Enthusiast
Posts: 121
Joined: Fri Apr 18, 2008 7:22 am
Location: Australia

Post by rrpl »

sharkbate24 wrote:
I'm still studying PureBasic, and I saw a link to thinBasic somewhere from this forum. I then read that thinBasic was created in PowerBasic or something, so now it made me wonder, is it possible to create a programming language in PureBasic? Would be awesome
Yeah it would be great to create such a thing; but just even attempting to do so will give you some idea of just how great Fred is!!

Isn't ThinBasic an interpreted language anyway? So maybe an interpreted/scripting language is all you really want to do. This is certainly possible using Purebasic and there are some basic examples around in the forums on how to start. I don't think I'll be trying to create one anytime soon, PureBasic is just so easy to use once you get used to it.
:)
"What you are is what you have been. What you’ll be is what you do now.” -Buddha
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

The only reason making a compiler is seen as hard is that all books about the subject teach you to make an industrial-quality compiler instead of a simple one.
On the contrary, tutorials on interpreters teach only simple ones, so interpreters seem easier.
The truth is: Compiling is easy if you don't care about efficiency. Once you do, it becomes hard. Interpreting is also easy if you don't care about efficiency. Once you do, that too, becomes hard.

Also, compiling tends to become much harder when the language you want to compile has complex features (like dynamic typing) while in interpreted language the difficulty is not so much dependent on the language to interpret.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

I agree with Trond; writing a compiler need not be difficult at all.

Writing a good compiler on the other hand... :wink:
I may look like a mule, but I'm not a complete ass.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

The great thing is, a crappy compiler will easily beat a less crappy interpreter when it comes to program speed. So can be an amateur baker and still have you cake. Just don't take a "byte" out of it...
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Trond wrote:The great thing is, a crappy compiler will easily beat a less crappy interpreter when it comes to program speed. So can be an amateur baker and still have you cake. Just don't take a "byte" out of it...
Aye, in a "word", it could be quite a "long" haul whilst ActiveXly involving oneself in such a venture! :wink:
I may look like a mule, but I'm not a complete ass.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Wow, four puns in a row, here we call that a "quad-pun". I'm not exactly "doubled" over laughing yet, but whatever "floats" your boat...

This is certainly a new "type" of puns. I'll have to "compile" a list!
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Well I don't want to "string" this along too much, but his "array" of non-stop puns is a bit of a "hash" really. Course I could be COMpletely barkingly mad here, but I can at least "console" myself that my "preferences" are for compiled languages. The "process" of writing an interpreter is NOT one I would normally "drag and drop" into this kind of "thread", but there you are!

:)
I may look like a mule, but I'm not a complete ass.
eesau
Enthusiast
Enthusiast
Posts: 589
Joined: Fri Apr 27, 2007 12:38 pm
Location: Finland

Post by eesau »

Wow, this thread is turning really entertaining. Maybe I'll just grab some Kentucky "Fred" Chicken while I read it!

...

*crickets*
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

eesau wrote:Wow, this thread is turning really entertaining. Maybe I'll just grab some Kentucky "Fred" Chicken while I read it!

...

*crickets*
hehe. A freak-ishly good suggestion. :)
I may look like a mule, but I'm not a complete ass.
Post Reply