What is your opinion on BASIC programming languages?
BlitzBasic began on the Amiga (wikipedia). BlitzMax, designed on fasm and gcc (cross-platform, use C/C++ code in Max), is Object-Oriented (with inheritance and polymorphism), but still holds that same BASIC nature, which was ever so pleasant with the previous languages.
BlitzMax is designed on-top of Modules, where code can be pre-compiled and included in the final build.
Hello World example:
SuperStrict
Framework BRL.StandardIO
Print("Hello, World!")
Classes (Max Types):
[EDIT: I added an alternative example for creating TCars, the used example is just my style; this example could be done better, but I would be taking up a lot more space on the page]
SuperStrict
Framework BRL.StandardIO
Import BRL.LinkedList
' This is by no means how it HAS to be done, you can use functions
' for creating an instance of a Type (an Object) or any other way
' you see fit to manage your Types
Type TCar 'A Type, or 'Class', for a car
Global _list:TList = New(TList) ' This variable is accessable by anything within TCar
Field vehicletype:String
Field color:String, year:Int
Method New() 'Called, automagically, when the object is created
_list.AddLast(Self) ' Add the newly created object to the list
End Method
Method Create:TCar(_vehicletype:String, _color:String, _year:Int)
SetVehicleType(_vehicletype)
SetColor(_color)
SetYear(_year)
Return(Self)
End Method
' Alternative to the Create method
'Function Create:TCar(_vehicletype:String, _color:String, _year:Int)
' Local car:TCar = New(TCar)
' car.SetVehicleType(_vehicletype)
' car.SetColor(_color)
' car.SetYear(_year)
' Return(car)
'End Function
Method SetVehicleType(_vehicleType:String)
vehicletype = _vehicletype
End Method
Method SetColor(_color:String)
color = _color
End Method
Method SetYear(_year:Int)
year = _year
End Method
Method Report()
' Automatic conversion from Integer to String
Print(vehicletype + ", " + color + ", made in " + year)
End Method
Function IterateList()
Local car:TCar
For car = EachIn _list ' Iterate through all TCars in TCar._list and call the Report Method
car.Report()
Next
End Function
End Type
Local mycar:TCar
' Create a few cars and call the Create Method
mycar = New(TCar).Create("SUV", "Blue", 1999)
mycar = New(TCar).Create("Truck", "Silver", 1997)
' Alternatives, using Create as a Function instead of a Method
'mycar = TCar.Create("SUV", "Blue", 1999)
'mycar = TCar.Create("Truck", "Silver", 1997)
TCar.IterateList()
Outputs:
SUV, Blue, made in 1999 Truck, Silver, made in 1997
BlitzMax's learning curve is very small, BlitzMax is very powerful because the amount of time, compared to languages like C/C++, it takes to produce some application/game.
Amongst the official modules, popular open source libraries like wxWidgets, libxml and Irrlicht have been wrapped for use in BlitzMax.
Thoughts? Would you use it?
EDIT: If you wouldn't use it, or have some sort of issue with BASIC languages, why?