BambooBasic Demo 1.2

Community Forums/Showcase/BambooBasic Demo 1.2

Dabhand(Posted 2012) [#1]
Well, about time I let people have a look at my current project, which is in fact a programming language called BambooBasic.

The syntax is heavily based on our very own BlitzMax, with a splattering from other languages I've used in the past, so, it's pretty comfy to use.

Basically, it's an attempt to englishify (Winks at Gfk) web development, most programmers will probably prefer to use the likes of PHP and HTML off the bat, and this is well understood, BambooBasic basically takes in a BASIC language, and spits out it's PHP equivalent, which, can be run via a web server either locally or uploaded to a remote host.

As an example, here is a high score table example:-



Note: The {'s and }'s arent part of the language, these allow code folding in the IDE and as such, are ignored by BambooBasic.

There are 383 commands available, as well as 56 keywords, which are outlined below:-



There is a Wiki available, which, outlines everything about the language, this is available at:-

http://bamboocoder.com/wiki/

Or, a forums located at:-

http://bamboocoder.com/forum/

If you've got anything to add other then "hey this is cool" or "hey, this is shite", then, I'd appreciate it if you used the forum so I dont have to go digging for anything which may be useful (like bugs, idea's etc etc)

If you write anything nifty and want to add it to the samples folder, then, either post the code here, or on the forum, or even email me and I'll sort it out!

As I mentioned, this is a demo, so, there's a few things missing, one is that you cannot extend the command set with your own, there is no inline PHP available, and when the program is built it outputs "Built using BambooBasic" at the bottom which must not be removed.

I am planning on releasing a full version of this with them restrictions removed, but from now till then, it's a demo, things may change, and I cannot guarantee when I release the full version everything will work exactly the same.

Last thing, the IDE is written in C# and requires .NET Framework 4, if your using Blide, then, you'll have it, the IDE isnt the best, it is what it is because I wanted something quick, it has all the usual IDE'y things in, but, it's just cobbled together, though, I am planning on putting more work into it, so, hopefully, I'll have a proper project driven IDE up and running (Going to start work on it over the Christmas period)

Here's the download:-

http://www.bamboocoder.com/front/bamdemo/BambooDemo_1_2.zip

There is an EULA in the download, which, naturally, you have to agree to before you use the software.

So, there we are... If in any doubt on something, pleassseeeee take a look at the Wiki first, I've put a massive amount of elbow grease into writing it, so, please use it! :)

Right, couch time for an hour, my arse is like a concrete block sitting on this faux leather chair!!!

Dabz

BTW, the back end is wrote in BlitzMax, and has been tested on Windows Vista, and Windows 8, havent a clue about XP or 7 mind!

EDIT: BambooBasic is now up for sale, please see website for details (With a limited off promo code on the "Purchase" page)

Last edited 2012


GaryV(Posted 2012) [#2]
the IDE is written in C# and requires .NET Framework 4


You had me up until that point. Does sound very interesting though. A modernized version of RunBASIC?


Dabhand(Posted 2012) [#3]

You had me up until that point.



Also runs from the command line too if thats any good! ;)


A modernized version of RunBASIC?



Do you know what it is... I looked all over the shop for something similar, and never came across this at all! :D

EDIT: Oh, it's gone, so cannot see what that was all about!

Dabz

Last edited 2012


GaryV(Posted 2012) [#4]
Do you know what it is... I looked all over the shop for something similar, and never came across this at all! :D
Not promoting this, only posting this because you asked.

Official site:
http://www.runbasic.com/

Forums:
http://runbasic.proboards.com/index.cgi?

Specialized hosting:
http://runbasichosting.com/

Wiki:
http://runbasic.wikispaces.com/


Dabhand(Posted 2012) [#5]

Oops! Google Chrome could not find www.runbasic.com



:/

Never mind, would of been nice to look at "the competition"!!! ;) hehehe

Anyway, aye, like I said, if you download the zip from my dropbox, in the /bin folder are two executables, one is for consoles, navigate to the folder then put in "bsgconsole -h" and it'll let you know all you need to know about building a BambooBasic file! :)

Dabz

Last edited 2012


GaryV(Posted 2012) [#6]
Never mind, would of been nice to look at "the competition"!!! ;) hehehe
Not sure why Chrome is blocking it for you, but url works fine here in Firefox and Opera.

Not sure how much competition it is, I can remember when the beta came out in '07. It never really caught on. Seems to be a popular trend now, as the people behind Dark BASIC now have an online programming language.

Last edited 2012


GaryV(Posted 2012) [#7]
Anyway, aye, like I said, if you download the zip from my dropbox, in the /bin folder are two executables, one is for consoles, navigate to the folder then put in "bsgconsole -h" and it'll let you know all you need to know about building a BambooBasic file! :)
I have and will check it out when I can get to a Windows machine.


Dabhand(Posted 2012) [#8]
Ah, sweet... Thanks! :)

Dabz


GaryV(Posted 2012) [#9]
I played around with this on my old netbook. This is very interesting. I don't have a use for it, but I do like it. Very good job on the Wiki.


BlitzSupport(Posted 2012) [#10]
Sounds really cool, and reminds me of playing with Brucey's OSMesa module on a Linux server -- except you wouldn't of course need to pay for a server that can run random Blitz executables. Interesting!


Dabhand(Posted 2012) [#11]
Thanks fella's!!! :)


I don't have a use for it, but I do like it.



Generally, this is aimed at hobbyist/novice->intermediate programmers who want to "write" stuff for the web, any professional or coder that's been around the block will no doubt use native stuff, much like, say, using BlitzMax instead of going straight in with C++ and the DirectX/OpenGL API's, it's handy, comfy and above all... Easy! :)


Very good job on the Wiki.



That really really really took took a lot of soul searching to get everything in there, and as sure as sure, was like climbing a mountain, you'd just get over a edge, and then wallop, there was another cliff face, but ultimately, it's been worth it!!! :)

Dabz


Steve Elliott(Posted 2012) [#12]
Cool project, well done! And yes documentation via Wiki is a nice touch.


Captain Wicker (crazy hillbilly)(Posted 2012) [#13]
Maybe I am just kooky, but doesn't this belong in the bb code archives?


GaryV(Posted 2012) [#14]
Maybe I am just kooky


You answered your own question... :)


GfK(Posted 2012) [#15]
Maybe I am just kooky
....not quite the word I had in mind, if I'm honest...

but doesn't this belong in the bb code archives?
No. It's not code.


Dabhand(Posted 2012) [#16]
Hey Dave, got your message on Facebook, and replied... lol, better late then never!!! :D

Dabz


slenkar(Posted 2012) [#17]
it can accept messages from outside sources right?

like

mysite.com/myphpscript.php?int=1?score=2?name=3

type thing


Dabhand(Posted 2012) [#18]
Yeah:-

Include bam.http

Print "Get example...~b~b"

If GetGlobal("name")
	Print "Your name is: " & GetGlobal("name")
EndIf 


Then, the URL will be something "http://localhost/test/index.php?name=Michael"

Which will output obviously:-


Get example...

Your name is: Michael


:)

Dabz


Dabhand(Posted 2012) [#19]
I totally forgot too mention too, it's pretty easy converting existing HTML to BambooBasic, as an example:-

http://bamboocoder.com/scripttests/templates/origo/

This involves CSS, but, the bamboobasic code behind it is:-



Dabz

Last edited 2012


GaryV(Posted 2012) [#20]
Just curious, any idea on price?


Dabhand(Posted 2012) [#21]
Hey Gary,i have it down as 48 dollars including Vat (hence the 8), i worked like a goodun yesterday to package it all up, and its now available for sale, there's a promo code on the purchase page which is located at home page (http://www.bamboocoder.com

Dabz


GaryV(Posted 2012) [#22]
So $40 for those of us in the US (not counting the special)?

Last edited 2012


Derron(Posted 2012) [#23]
So to sum up -- bamboo is a wrapper for php-commands?

The commands you listed in your first post seem to were taken off php.

Hope you take care of specialities like "mysql_real_escape_string" using an existing db-connection therefor you need to establish one before.
But do not establish db connections if not needed (+1mb ram for an easy call to the php-interpreter).

And as one of those who is able to write html ... and code a bit in perl/php...
HTMLHeading(3) ; print "© 2012 Your Name" ; HTMLEndHeading(3)

vs. 

<h3>&copy; 2012 Your Name</h3>

HTML is done with really a small set of commands (vastly learned).


Ok, to be honest: that does not count for php. They have hundreds of functions all written in an inconsistent style. But hey... you are providing 300+ commands - one has to "know" them too.

Another disadvantage is: you still need a php-capable server. Further: in php you are allowed to:

$string = 0;
$string = $string<=0 ? $string+5 : $string." times read";
print $string;
$string = $string<=0 ? $string+5 : $string." times read";
print $string;


If your language does not cover such things, you "cripple" the language in a way people may miss in later stages.



I favor the idea of wrapping "more complex" languages into easier ones. But wrapping it into more complex things (long commands of html) seems counter-productive to me.
As long as you only provide such simple samples... it looks "nice and readable" but as soon as complex html-structures have to be build (with many ifs/elses/switch) you will hate the "long commands" as they destroy the possibility to "see" the structure with "one view on it".
So sorry... 48$ (does not matter if us,australian...) is way to much (in _my_ opinion) for that language in its current incarnation.


Before I forget to mention: remember to include ajax/jscript so one can do more than just plain pages. If done properly you could also include "canvas" and therefor graphics... Maybe you then will be able to sell your product for some bucks more than <10.


PS: sorry if that only sounded rude and not encouraging, but from my point of view there seems no need for the current state of that language.

PPS: the name indeed... is nice and attractive for beginners.

bye Ron


edit: &copy; should not be needed in current charsets, just utf8 the whole thing and alt+numblock 0169 (on windows, linux does not accept that input) - or copy that sign: ©.
... ok your IDE should take care of utf8-encoded-sourcecodes then.

Last edited 2012


*(Posted 2012) [#24]
Seeing projects like this makes me want to resurrect me old language EBas, basically in the end it was a translator for any language to C but I think these days I can make it more refined so who knows I might bring it back :)


Dabhand(Posted 2012) [#25]
Hey Ron... I know you aren't being rude, your opinion is welcome, and really, opinions help shape stuff, so your good! ;)

This all started on the fact that i simply hate the combined syntax of html and php, i wanted something as comfy as blitzmax is, and that's how it all began! :)

I have a few extras up my sleeve, your idea of a html5 canvas and graphics is a good one, and ill definitely be looking at that.

i do know seasoned programmers wont need it, ive discussed this with a couple of people, one of my mates has a lass that does web design and she likes it, obviously no good to her, but, she was really keen on it, which was a major boost!

There is more work to do, im under no illusion about that, but this project has been a labour of love, and as such, im going to do the best i can for it, that might sound like a bit of bile, but its true! :)

Dabz


Hotshot2005(Posted 2012) [#26]
BOOMBOO Basic is oddest name in Programming language but it is just for HTML game or summat?


slenkar(Posted 2012) [#27]
hi I have a few questions

1. Does BB take care of those differences between browsers?
e.g. xmlhttpget is slightly different in some browsers

2.if im right this incorporates 3 different languages/systems into one
php,mysql and http ?

3.does it come with a small local server to test on? (think the MServer that comes with Monkey) it would need php and mysql of course
if not its not a big deal
4.security, are there any protections against SQL injection

Last edited 2012

Last edited 2012


Derron(Posted 2012) [#28]
BB just translates from "bamboo" to php.

2.) mysql has to be installed separately - and without being installed, the mysql-commands will spread around some errors

3.) mserver does not handle php - it is just a socket listener and responder


bye
Ron

edit:
4. dont think so - else it should accept prepared statements and therefor rely on PDO installed. Another "easier" approach is the usage of mysql_real_string_escape when querying the database.

edit2: for convience bamboo should offer a post/get-getter
getGet(keyname)
getPost(keyname)

within getGet and getPost XSS, sanitizing etc could be done. This would automagically clean/secure user-provided data.

Last edited 2012


Dabhand(Posted 2012) [#29]

BOOMBOO Basic is oddest name in Programming language but it is just for HTML game or summat?



It's for web development, using a dialect of BASIC, and it's Bamboo, but, BoomBoo! ;)


Does BB take care of those differences between browsers?



What Derron said, like I mentioned in the top of the post, it is meant to Englishify web development, like, well, BlitzMax Englishify's game development. It may "just" translate Bamboo to PHP, but no different then other BASIC's which translate too other languages. But then, I'm not hiding that fact, because that's the whole point of it really.


if im right this incorporates 3 different languages/systems into one
php,mysql and http ?



It incorportates PHP and HTML into one language, most servers come with mySQL either on remote servers, or packages such as XAMPP, which, isnt an issue really since you'll probably setup mySQL in a control panel or through phpMyAdmin.


does it come with a small local server to test on? (think the MServer that comes with Monkey) it would need php and mysql of course



It is recommended to install a package such as XAMPP to run and test applications locally, the installation of such a package is painless and contains everything you need. Occasionally, the remote server will have a different version of PHP then the one your running locally, but, I'm testing on the remote server which is hosted my HostGator, and, I've found no problems at all so far.


security, are there any protections against SQL injection



Not internally, and I wanted it that way, I want people to salt their own hashes, I want people to use tried and tested ways of protecting their data, this translates to PHP, so, PHP practices of protection will work fine, but, Derrons suggestion of adding a sanitizer is a top idea, which, I will implement straight after my dinner!!! :)

Dabz

Last edited 2012


Dabhand(Posted 2012) [#30]

So $40 for those of us in the US (not counting the special)?



Ooops, Gary, just spied that! :)

I buy materials all the time that is price excluding VAT, so, when I tally whatever up, I always add VAT and end up saying "X amount of pounds including VAT)", it's a habit, but then, I do hate it when you get a price for something, then go to pay for it and it's gained a few pounds on the sly!

Rectified accordingly! ;)

Dabz


Dabhand(Posted 2012) [#31]
Right, I've added this to the GetGlobal and PostGlobal commands, basically, if you want the value to be sanitized, you need to pass through a mySQL link:-

e.g.

GetGlobal(sString, SQLLink)
PostGlobal(sString, SQLLink)

So, when you do something like this:-

Include bam.http
Include bam.mysql

Local sqlLink = mySQLConnect("localhost","user","pass","bambase")

If !sqlLink
	Print "Connect Error : " & mySQLConnectErrorNumber() & " - " & mySQLConnectError()
	End
EndIf

Print GetGlobal("name",sqlLink) & "~b"

Print  mySQLRealEscapeString(sqlLink,GetGlobal("name"));

mySQLClose(sqlLink)


And use the URL: http://localhost/test/index.php?name=michael'smate\y

It will output:-

michael\'smate\\y
michael\'smate\\y

Obviously if you dont pass the mysql link through, you need to sanitize it yourself, this has been documented on the wiki, and will update the demo* as soon as the trouble and strife stops whining at me to go to the shops for some chocolate! :D

Dabz

*Done

Last edited 2012


TaskMaster(Posted 2012) [#32]
I haven't had a lot of time to look at this, but have a couple simple questions:

When you "compile" does it just output a PHP file that you put on your server?

Is it easy to reference one file from another, includes for example?


Dabhand(Posted 2012) [#33]

When you "compile" does it just output a PHP file that you put on your server?



Basically, you set an output directory in the build settings, which is usually something like "C:\xampp\htdocs\{name}", as well as setting a url that represents the path from which to execute the file in the browser, e.g. http://localhost/{name}.

Then, when you first build your program, it transfers a couple of default files over (Much like monkey does), then it builds the bamboo file(s) and that is plonked inside the "C:\xampp\htdocs\{name}" directory, then if you've ran the program using "Build and Run", it will automatically open the http://localhost/{name} path in the browser.

When your ready to throw it up on the server, you just FTP the "C:\xampp\htdocs\{name}" directory (Or it's contents) to the remote server... Done! :)


Is it easy to reference one file from another, includes for example?



Yeah:-

main.bam
Include "somefile.bam"

Print Hello()


somefile.bam
Function Hello()
Return "Hello"
EndFunction


Which, when run, will output "Hello"!

Dabz


Derron(Posted 2012) [#34]
@sanitizing.

Do not misuse mysql_real_escape_string, it is not meant for sanitizing user input!
It is meant for sanitizing values in a way it secures a mysql-query (that is why it needs mysql for working).

To get a clue how to do, check how the php frameworks do (eg. codeigniter input class).


bye
Ron


Dabhand(Posted 2012) [#35]
The mysql link in the parameter list is optional... The function prototype is this:-

GetGlobal(sString, sqlLink = Null)

If you don't want it sanitizing for mysql then just ignore the second parameter.

Dabz

Edit: I should of said, my apologies! :)

Last edited 2012


Yahfree(Posted 2012) [#36]
Now to translate a MVC framework :D


Dabhand(Posted 2012) [#37]
lol, at the minute, I'm concentrating on writing a project driven IDE, and obviously, fix any bugs that may crop up! ;)

Dabz


Steve Elliott(Posted 2012) [#38]

Seeing projects like this makes me want to resurrect me old language



Yeah, thanks for that Dabz :p haha...glad you managed it mate, I always got distracted by the stuff already out there. But I will give it another shot.


Dabhand(Posted 2012) [#39]

Yeah, thanks for that Dabz :p haha



lol, no probs! ;)

Been rushing about like a blue arsed fly today, wife's motor was in for a MOT and failed, so, it's parked in the garage and I've had to ferry her about after work, she does that bootcamp thing (fitness, not Windows on a Mac ;)), and there's a C.I.D. do shes at tonight so I have to run her there, and pick her up!!!

In between all that I've managed to start another IDE, this one will be cross platform, so, should get OSX and Linux onboard too, and I've also created a Twitter account under the guise of BambooBasic, which now has feeds on the site, so, if your interested enough, I wouldnt mind if people followed me or just generally checked the webiste to see what I'm up too! :)

Dabz

Last edited 2012


Captain Wicker (crazy hillbilly)(Posted 2012) [#40]
so let me get this straight. you have written an entirely new basic language?


Dabhand(Posted 2012) [#41]
Ive written a BASIC dialect that's based on an existing dialect, but used for a different purpose...

To be more specific! ;)

Dabz


Steve Elliott(Posted 2012) [#42]
It's a good achievement...even if some people don't understand what you've accomplished lol.

Last edited 2012