View Full Version : SlashBASIC design
Bad Sector
08-18-2005, 11:21 AM
For the last weeks i'm in the process of writing SlashBASIC, a BASIC-like language for 2D game development. Currently the compiler and the virtual machine are ready and the runtime library already contain mathematical, string and other utility functions.
While i know what features i'll need and use (originally the project started for "in-house" usage but soon i decided to make it a complete product - the reactions of some people when i showed the language and some very early results helped on that :-)), i wonder what features you would like to put in. I got some ideas from the "ideal language and environment" thread, but if you had to choose some features, which they would be?
Keep in mind that we're talking about a 2D game development language, not 3D. Also keep in mind that the fact you proposed something doesn't mean that it'll be included - i'm just in need for ideas :-).
Features that will exist in the first version of SlashBASIC will probably include: a 2D game engine (with low and high level functions - low level functions will allow you to draw things manually and do custom collision detection and response, while high level function will allow you to specify "classes" and how they will behave and create objects using them, etc), a math library with arithmetic, trigonometic and linear algebra (vectors, matrices) functions, 2D geometric functions, etc. Also other stuff will include an abstract filesystem (for accessing files inside datafiles, etc), a sound engine, utility functions for configuration, etc.
Currently i have very few things to show... except this (http://www.slashstone.com/gimme/sbasic.png) and this (http://www.slashstone.com/gimme/ide.png) screenshots from the IDE (the first is the greek version of the IDE -it's multilingual- and also has a console with the results of code). Both run under Linux. The final will run in Windows and Linux.
soniCron
08-18-2005, 01:07 PM
...if you had to choose some features, which they would be? Speed. It had better be blazing fast. How fast is it now, and how does it compare to other scripting languages? (http://shootout.alioth.debian.org/)
Martoon
08-18-2005, 01:26 PM
1. What soniCron said. It wouldn't need to be the fastest scripting language on the planet, but it would need to be fast enough, and the really speed critical things like rendering sprite lists, etc. should be handled by built-in features that are fast in their implementation.
2. A library plugin architecture. I'd want to be able to natively write a plugin to extend the functionality, and to download community-created plugins from the website.
3. If it's already Linux and Windows, why not OSX too? I personally see the Mac market as more valuable then the Linux market.
Bad Sector
08-18-2005, 03:34 PM
1. What soniCron said. It wouldn't need to be the fastest scripting language on the planet, but it would need to be fast enough, and the really speed critical things like rendering sprite lists, etc. should be handled by built-in features that are fast in their implementation.
It is fast enough to be used for 2D game development purposes :-). The final will be at least as fast as other solutions to 2D game development. There will be a lot of native-side stuff, so at the end you'll probably use the language only to tie them together and define most of the logic.
2. A library plugin architecture. I'd want to be able to natively write a plugin to extend the functionality, and to download community-created plugins from the website.
That'd be a bit tricky. Not because of implementation issues (dlsym and Linux and GetProcAddress -or whatever is called- under Windows will solve most of the case), but the engine may change the way it works (i had to rewrite the virtual machine of another scripting language i made in order to improve it's performance so i may do the same thing at the future for SlashBASIC) and i have to figure out how to provide enough transparency to the plugin writer :-/. I'm not sure if this will be available from day one, but if not, it'll be available as a free upgrade when it comes (i'm planning to give free upgrades to registered users for a year after their registration).
3. If it's already Linux and Windows, why not OSX too? I personally see the Mac market as more valuable then the Linux market.
Me too, but i don't own a Mac :-). SlashBASIC will eventually be available for MacOS X too, as long as i get a Mac system. I'll ask for a friend to lend me his Mac system to make SlashBASIC Mac-ready, but i won't be able to do extensive development on that part, so the first version won't be available for Mac (except if he lends me his machine for some weeks... er.. months :-P).
electronicStar
08-18-2005, 03:37 PM
Rather than a "basic" I'd prefer a good OOP language like JAVA for example. And multithreading.
Bad Sector
08-18-2005, 03:44 PM
Rather than a "basic" I'd prefer a good OOP language like JAVA for example. And multithreading.
You actually said it yourself: you describe Java here :-)
It is object oriented, it has multithreading and it is like Java :-)
princec
08-19-2005, 02:37 AM
Write it in Java :) Then it'll run on both. And the VM is already written for you, and it's faster than anything you could produce. All you'd need to do is compile your BASIC syntax into bytecode, which is super-easy.
Cas :)
baegsi
08-19-2005, 03:15 AM
There's already Blitzmax. What makes your Basic an alternative?
What I miss about Blitzmax is a good debugger and a full-featured IDE, including refactoring etc, comparable to Eclipse. If your Basic can provide that, I would take a look at it.
Speed is only a minor requirement for me.
Oh, and of course, before I would even consider switching my development language, I would like to see actual games that are made with your Basic. First I'd need a prove that your language is capable of making good games.
Good luck.
soniCron
08-19-2005, 09:01 AM
i wonder what features you would like to put in. I got some ideas from the "ideal language and environment" thread, but if you had to choose some features, which they would be? There might be some good results in this thread (http://forums.indiegamer.com/showthread.php?t=4165), once it becomes more populated. :)
Bad Sector
08-19-2005, 09:16 AM
There's already Blitzmax. What makes your Basic an alternative?
It's existance probably? I've only tried the trial version of BlitzPlus and i don't know what BlitzMax can do (i can assume only by seeing their product page - but i don't have any experience with that language). However i can see from the site that SlashBASIC's syntax or more "clean" (i mean you can understand easier what it does):
(in BlitzMax from what i've understood by looking other people's code)
type Vector
field x#
field y#
endtype
function addVectors(a:Vector, b:Vector):Vector
Local r:Vector
r.x# = a.x# + a.y#
r.y# = b.x# + b.y#
return r
endfunction
(in SlashBASIC)
type Vector
x as number
y as number
end
function addVectors(a as Vector, b as Vector) returns Vector
result.x = a.x + b.x
result.y = a.y + b.y
end
Oh, and of course, before I would even consider switching my development language, I would like to see actual games that are made with your Basic. First I'd need a prove that your language is capable of making good games.
I'm developing a game with the language as i develop it, so there will be at least one game available written in SlashBASIC. I plan to give the language for free for non-commercial usage, so i suppose that more games will appear :-)
Good luck.
Thanks ;-)
@soniCron:
Nice thread :-)
HairyTroll
08-19-2005, 09:41 AM
Your syntax seems very similar to Blitz. What does SlashBASIC offer that Blitz cannot? SlashBasic should offer the following functionality:
- Ability able to modify the base classes (methods/variables) of objects that are already in use.
- Ability able to drop new code into an already running image.
- Ability able to rip out and replace bits of the OO system on a per-class basis.
- Ability able to replace the whole OO paradigm if you happen to think of a new one.
- There is no difference between code and data.
- Have existing debuggers etc. work even after radically modifying the language because that is how the language was designed.
I am quoting Scott Shumaker, lead developer at Naughty Dog, on the advantages of using GOAL (Lisp) for their development.
Quote:
We could basically dynamically link per-function or variable. Effectively, you could hit a key while working in the IDE, and whatever function the cursor was on would instantly get compiled, sent across the network to the TOOL, linked and dropped into the game while it was running. The whole process took a fraction of a second. You could also do the same per-file. This feature was sort of like Edit and Continue, but you didn't have to broken in the debugger - it could be done while the game was running. This was insanely useful for programming gameplay, physics, and fx, as well as prototyping, visual debugging (just drop in some debug spheres or prints while you have the game in some interesting state), etc. We also used it for dynamic code streaming - so only a fraction of the executable code was loaded at any given time (to conserve memory).
The following example describes a scenario that should be possible in SlashBASIC:
A tester is 30 minutes into play-testing a game when the game drops to the debugger. The developer connects to the running game image on the Tester's PC from the developers machine. The developer determines the cause of the bug and then runs up and down the stack frames until he finds the point where the bug occured. He modifies the code at that point in the stack; perhaps modifying the contents of a varaible, modifying an existing object, recompiling a function etc. The developer then restarts execution at that point in the stack and the game continues on the Tester's machine as if nothing has happened.
Savant
08-19-2005, 09:43 AM
Keep in mind that BlitzMax has some object orientation capabilities so:
Type Vector
Field x#
Field y#
Method Add:Vector( In:Vector )
x :+ In.x
y :+ In.y
return self
End Method
End Type
Bad Sector
08-19-2005, 02:35 PM
Thanks for the suggestions :-)
@Savant:
There is plan to put OOP abilities in SlashBASIC, however this probably won't be available from day 0.
Currently i'm trying to implement what i saw in BlitzPlus, but in a way that i believe that is better :-). That doesn't mean that i won't implement your ideas (but it also doesn't mean that i will :-P). Ideas are always welcome and i appreciate your replies :-).
@HairyTroll:
This is a very nice idea, i like it! Unfortunatelly -yes, there is that part too- i don't know how to implement such a system. I will try to figure out some things could be implemented, but i don't think that this will be implemented in SlashBASIC soon (i may do some testing versions, however).
Some rough scenarios that came to my mind seem like those i had when i was creating Immortal Editor, the 3d world editor of my 3d game engine: i wanted to make the editor allow multiple people to edit a single level at the same time while someone could playtest it. This involved an internal editing language, similar to SQL which the "clients" were using to communicate with the "server" which was doing the actual editing work. Unfortunatelly it proved to not be worth the effort so i removed all the code.
ggambett
08-19-2005, 04:40 PM
My main question is... why BASIC? Could you give your language a less horrible syntax?
If you're going to clone a language, why not cloning Python? Which leads me to "why should I use your language instead of Python?". Embedding? So "why should I use your language instead of LUA?" Because it's a 2D engine and not only a scripting language? So why don't you make a 2D engine which uses LUA as its default (only?) scripting language? Now THAT would be great.
Bad Sector
08-19-2005, 05:09 PM
My main question is... why BASIC? Could you give your language a less horrible syntax?
I'm not defining the syntax by the name "BASIC", but the reverse. The syntax i thought reminds BASIC more than anything else (although someone told me that it reminds Python, btw - but from my little experience with Python i argue that). I'm not going to bound the syntax because i name it SlashBASIC and not add a feature because "it's not BASIC if it has that" :-).
However you may ask why i chose that syntax. For scripting, i can only think two syntaxes that i like are JavaScript-like (which i use in an embedded scripting engine i wrote - Nervebreak (http://nervebreak.sf.net/)) and BASIC-like, the "new" style without the 10-20-30 :-) (which i use here).
If you're going to clone a language, why not cloning Python?
We're entering in "religious" areas here, but, well, anyway, i'll say it: IMHO Python's syntax suck big time :-). I just want to shoot the guy who thought that scope must be defined by indentation :-).
Ok, i just had bad times when i was writing some Python code (it's still good for a console based calculator though; i use it very often instead of xcalc). I don't think that Python is an easy language and i want it to be easy.
Of course different people like different things.
Which leads me to "why should I use your language instead of Python?"
Python is not made for 2D game development :-). Of course you could use PyGame, but then again you could use C++ with Allegro, IGE, or any other library :-).
I think that i'm not the one who should decide which language you should use for your game. I can decide which language i will use for mine, but not for yours. I can say what SlashBASIC offers to you (when it's finished and released), but it's you who will decide if you'll use it or not, by looking what others offer and ask and what SlashBASIC offers and ask :-).
Embedding? So "why should I use your language instead of LUA?"
First of all, let me tell you my opinion that LUA has even worse syntax than Python (which was the reason i wrote Nervebreak at the first place). Secondly, SlashBASIC is not an embedding language. You don't take it and plug it in your game. You take it and write games with it.
It's not a library, it's a standalone program.
Because it's a 2D engine and not only a scripting language? So why don't you make a 2D engine which uses LUA as its default (only?) scripting language?
You probably don't understand what SlashBASIC is, which may be partly my fault: SlashBASIC is a 2D game development language, a complete package which you -will- use to write 2D games and which -will- include a Integrated Development Environment, a compiler and a runtime. Everything you will need will be in that package (from a coder's point of view - it won't include an image editing program for example :-)).
It is not a library :-).
Now THAT would be great.
What would be great and what not depends heavylly on what you ask and want from a package. From what you said, it seems to me that you ask something different than what SlashBASIC is.
Anyway, i hope that i answered your questions :-)
ggambett
08-19-2005, 05:21 PM
Heh, you may have gotten the wrong idea from my post :) I was speaking aloud and answering my own questions. I do understand SlashBASIC aims to be a complete RAD tool, not a scripting language or 2D engine alone. In the last iteration of my reasoning (the only real question, actually) is why BASIC syntax instead of Python or LUA syntax. The reason is now clear : you don't like them :)
Bad Sector
08-19-2005, 05:28 PM
In the last iteration of my reasoning (the only real question, actually) is why BASIC syntax instead of Python or LUA syntax. The reason is now clear : you don't like them :)
Yeah, i think i make that clear :D
Anyway, thanks to your post i answered some possible question that someone could ask :-).
vBulletin v3.6.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.