S
Skybuck Flying
Hello,
As "we" already explored in another thread called "Flexible Instruction Set
Encoding" intel/amd did not implement a flexible instruction, nor do those
people that replied in that thread think it was an interesting or valuable
idea.
Today I woke up and just had an incredible smart and interesting idea how to
write scalable code in Delphi 2007 !
What I want to achieve is turn some classes which use 32 bit integer math
into generic classes so that they can use 32 bit math or 64 bit emulated
math or even 64 "real" math and now comes the tricky part while maintaining
only one code base for the "generic classes" !
So that when I need to extended or bug fix the classes I only need to do it
at one place !
And now here is the idea which I present to the whole fucking world:
The idea is to:
1. Use Delphi's 2007 operator overloading to implement math classes for
example:
TSkybucksInt32
TSkybucksInt64Emulated
TSkybucksInt64
TSkybucksUint32
TSkybucksUint64Emulated
TSkybucksUint64
2. Make the classes use one of these skybuck math classes. Actually there
should be a generic class or something like that.
Maybe something like:
TSkybuckGenericIntegerClass
Then the rest can be derived from that.
3. Now at runtime the class can decide which math it needs, 32, 64 emulated
or 64 bit and then it can instantie this class.
Sounds good to me.. but will it work ? and will it be fast ? These two
points need to be investigated:
1. Will operator overloading intro call overhead ? (Maybe not)
2. Is it possible ?
Suppose it's all good and possible then the other class can work as follows
for example:
// concept code:
SomeClass := TSomeClass.Create;
if FileSize <= 32 bits then
begin
SomeClass.MathClass := TSkybucksInt32; // full speed 32 bit math ! OH
YEAH !
end else
if (FileSize > 32) and (FileSize <= 64 bits) then
begin
if (Operating System is 32 bit) then
begin
SomeClass.MathClass := TSkybucksInt64Emulated; // slower emulated 64
bit math !
end else
if (Operating System is 64 bit) then
begin
SomeClass.MathClass := TSkybucksInt64;
end;
end;
Some questions remain:
1. Is it necessary to create an instance of skybuck's ints ?
2. Would it be better to pass it via a constructor parameter (Normally I
don't like doing this) ?
These will be explored below:
Open questions remain:
3. Can records be inherited ?
4. Possibly can records be polymorphic ? <- not sure if that is required.
Now SomeClass could be written to use code as such:
type
TsomeClass = class
private
GenericInteger1 : TSkybucksGenericInteger;
GenericInteger2 : TSkybucksGenericInteger;
GenericInteger3 : TSkybucksGenericInteger;
public
procedure DoSomeCalculations;
end;
This class declaration/definetion or whatever shows that these generic
integer possible need to be created before the someclass can be used to
perform calculations, so it might be necessary to initialize these generic
fields. Doing this via a constructor parameter is an option or alternatively
a special initialization procedure.
I don't like passing things to constructor parameters... maybe I'll make an
exception for this case, and yes I think this could be smart so that when
SomeClass is cleaned up it automatically cleans up the generic fields as
well example:
Now things become clear:
TSkybucksGenericMath class need to be a class of classes... as to pass the
type of the required class to this constructor:
So Skybucks generic math class becomes a class of classes declared as
follows:
TSkybuckGenericMathClassess = class of TSkybucksGenericMath; // something
like this ? I am not sure... yes probably.
let's go on:
constructor TsomeClass.Create( MathClass : TSkybucksGenericMathClassess );
begin
inherited Create;
GenericInteger1 := TSkybucksGenericMathClasses.Create;
GenericInteger2 := TSkybucksGenericMathClasses.Create;
GenericInteger3 := TSkybucksGenericMathClasses.Create;
end;
Usage example: (Real easy ofcourse
var
SomeClass : TSomeClass;
begin
if filesize > blablabla and blablablabla then
begin
SomeClass := TSomeClass.Create( TSkybucksInt64Emulated );
end else
blablablabla
end;
Looking pretty good, looking much better !
Now what if parts of the code needs only half of the bits ?! to do something
wacky...
Could be nice if the generic math classes could return something...
Excellent !
for example:
TsomeClass = class
private
mHalfGenericInteger1 : TSkybuckGenericMath;
etc;
end;
Now each Skybucks int implementation could have a function which returns a
new class type which represent half of the bits, example:
TSkybucksInt64Emulated = class(TSkybuckGenericMath)
private
public
function HalfGenericInteger : TSkybucksGenericMathClassess;
end;
function TSkybucksInt64Emulated : TSkybucksGenericMathClassess;
begin
result := TSkybucksInt32;
end;
Now SomeClass can simply do it's thing:
procedure TSomeClass.DoSomeCalculations;
begin
mGenericInteger3 := mGenericInteger2 * mGenericInteger1;
// generic classes might have extra functions to return lower or upper
half bits, could be handy !
mHalfGenericInteger := mGenericInteger3.ReturnUpperHalf;
// alternatively type casting might be used but this will create complex
and more code and possibly buggy code... I don't like it... but here
// is some concept
// code:
mHalfGenericInteger1 := MathClass.HalfGenericInteger(
mGenericInteger1 ); // explicit typecast conversion overloaded operator
needed.
end;
as I already explored in the past, Delphi's 2007 explicit typecast
conversion operator overloading is a bit dangerous and might not always do
what the programmers wants... and it's lot s of work to implement all
possible type cast variations.
But it might work... not all typecast operator overloaders needed
There two ways to return half of the bits.
Ofcourse the function idea is preferred... because it can return whatever
you want:
ReturnUpperHalf
ReturnLowerHalf
^^^ very nice !
Well there you have it folks !
Skybuck just presented a concept to the whole fucking world !
How to:
1. Write Scalable Classes with Scalable Math !
2. How to keep the speed incredibly high !
(Math class constructors should be kept to absolutely minimum for maximum
speed)
(User classess should be created/destroyed only once if possible, otherwise
use recycle pools for objects if required)
Is the world ready for Skybuck's concepts ?
Two possibilities:
1. Delphi 2007
2. C++
Questions:
1. Is Skybuck's concept new ? In that case: To fucking bad, now it can't be
patented because I just published it !
Ofcourse there are always people saying no, but those people should read
this concept really carefull.. because some things might look same.. but is
it really the same ?! Carefull reading is required !
2. Can Delphi 2007 currently implement this concept ? This remains to be
seen, I shall explore this myself.
There are two variations of Delphi 2007, .NET and Win32. .NET has better
operator overloading support, I don't use .NET I like win32. I NEED IT
FOR WIN32 !!!!!
3. Can C++ implement these concepts ? I would be surprised if it cannot !
This will have to be explored by other people, I don't write code in C++, if
Delphi can't do I might explore C++ but don't count on it !
If Delphi 2007 for Win32 can not implement because of missing operator
overloading support for classes, or because of missing inheritance for
records than clearly the Delphi language would GREATLY benefit from these
features because it allows to do everything I wrote above... and that in
that case a request for these features should not even be necessary.
It should be TOP PRIORITY =D LOL Might even make writing a 64 bit Delphi
compiler much easier !
Might even make changing the VCL to support 64 bit A SNAP !
Only one code bases needed ! and possible even fully runtime scalable !
That last possibility might be over their head.
Borland might simply hard code it for a 64 bit Delphi version:
var
MathClass : TSkybuckGenericIntegerClassess = TSkybuckInt64;
Code changes for VCL:
Replace all integer declarations whith GenericInteger and add a
MathClass.Create statement to VCL constructors !
FUCKING NICE !
Well I am done writing about this new concept.
I shall go exlore after I have fucking breakfast LOL.
HAHAHAHAHA
Oh man another great idea while I woke up.
**** I had some good ideas while lieing in BED.
Fucking Winston Churchile was write... BEST IDEA COME IN BED LOLOLOLOL.
Skybuck's Software Development Company would have an insane ammounts of BEDS
in it's building some PEOPLE CAN SLEEP ON IT =D and have great ideas when
they wake up ! or have a fucking rest !
Me thinks definetly worth it ! =D =D =D
Bye,
Skybuck.
As "we" already explored in another thread called "Flexible Instruction Set
Encoding" intel/amd did not implement a flexible instruction, nor do those
people that replied in that thread think it was an interesting or valuable
idea.
Today I woke up and just had an incredible smart and interesting idea how to
write scalable code in Delphi 2007 !
What I want to achieve is turn some classes which use 32 bit integer math
into generic classes so that they can use 32 bit math or 64 bit emulated
math or even 64 "real" math and now comes the tricky part while maintaining
only one code base for the "generic classes" !
So that when I need to extended or bug fix the classes I only need to do it
at one place !
And now here is the idea which I present to the whole fucking world:
The idea is to:
1. Use Delphi's 2007 operator overloading to implement math classes for
example:
TSkybucksInt32
TSkybucksInt64Emulated
TSkybucksInt64
TSkybucksUint32
TSkybucksUint64Emulated
TSkybucksUint64
2. Make the classes use one of these skybuck math classes. Actually there
should be a generic class or something like that.
Maybe something like:
TSkybuckGenericIntegerClass
Then the rest can be derived from that.
3. Now at runtime the class can decide which math it needs, 32, 64 emulated
or 64 bit and then it can instantie this class.
Sounds good to me.. but will it work ? and will it be fast ? These two
points need to be investigated:
1. Will operator overloading intro call overhead ? (Maybe not)
2. Is it possible ?
Suppose it's all good and possible then the other class can work as follows
for example:
// concept code:
SomeClass := TSomeClass.Create;
if FileSize <= 32 bits then
begin
SomeClass.MathClass := TSkybucksInt32; // full speed 32 bit math ! OH
YEAH !
end else
if (FileSize > 32) and (FileSize <= 64 bits) then
begin
if (Operating System is 32 bit) then
begin
SomeClass.MathClass := TSkybucksInt64Emulated; // slower emulated 64
bit math !
end else
if (Operating System is 64 bit) then
begin
SomeClass.MathClass := TSkybucksInt64;
end;
end;
Some questions remain:
1. Is it necessary to create an instance of skybuck's ints ?
2. Would it be better to pass it via a constructor parameter (Normally I
don't like doing this) ?
These will be explored below:
Open questions remain:
3. Can records be inherited ?
4. Possibly can records be polymorphic ? <- not sure if that is required.
Now SomeClass could be written to use code as such:
type
TsomeClass = class
private
GenericInteger1 : TSkybucksGenericInteger;
GenericInteger2 : TSkybucksGenericInteger;
GenericInteger3 : TSkybucksGenericInteger;
public
procedure DoSomeCalculations;
end;
This class declaration/definetion or whatever shows that these generic
integer possible need to be created before the someclass can be used to
perform calculations, so it might be necessary to initialize these generic
fields. Doing this via a constructor parameter is an option or alternatively
a special initialization procedure.
I don't like passing things to constructor parameters... maybe I'll make an
exception for this case, and yes I think this could be smart so that when
SomeClass is cleaned up it automatically cleans up the generic fields as
well example:
Now things become clear:
TSkybucksGenericMath class need to be a class of classes... as to pass the
type of the required class to this constructor:
So Skybucks generic math class becomes a class of classes declared as
follows:
TSkybuckGenericMathClassess = class of TSkybucksGenericMath; // something
like this ? I am not sure... yes probably.
let's go on:
constructor TsomeClass.Create( MathClass : TSkybucksGenericMathClassess );
begin
inherited Create;
GenericInteger1 := TSkybucksGenericMathClasses.Create;
GenericInteger2 := TSkybucksGenericMathClasses.Create;
GenericInteger3 := TSkybucksGenericMathClasses.Create;
end;
Usage example: (Real easy ofcourse
var
SomeClass : TSomeClass;
begin
if filesize > blablabla and blablablabla then
begin
SomeClass := TSomeClass.Create( TSkybucksInt64Emulated );
end else
blablablabla
end;
Looking pretty good, looking much better !
Now what if parts of the code needs only half of the bits ?! to do something
wacky...
Could be nice if the generic math classes could return something...
Excellent !
for example:
TsomeClass = class
private
mHalfGenericInteger1 : TSkybuckGenericMath;
etc;
end;
Now each Skybucks int implementation could have a function which returns a
new class type which represent half of the bits, example:
TSkybucksInt64Emulated = class(TSkybuckGenericMath)
private
public
function HalfGenericInteger : TSkybucksGenericMathClassess;
end;
function TSkybucksInt64Emulated : TSkybucksGenericMathClassess;
begin
result := TSkybucksInt32;
end;
Now SomeClass can simply do it's thing:
procedure TSomeClass.DoSomeCalculations;
begin
mGenericInteger3 := mGenericInteger2 * mGenericInteger1;
// generic classes might have extra functions to return lower or upper
half bits, could be handy !
mHalfGenericInteger := mGenericInteger3.ReturnUpperHalf;
// alternatively type casting might be used but this will create complex
and more code and possibly buggy code... I don't like it... but here
// is some concept
// code:
mHalfGenericInteger1 := MathClass.HalfGenericInteger(
mGenericInteger1 ); // explicit typecast conversion overloaded operator
needed.
end;
as I already explored in the past, Delphi's 2007 explicit typecast
conversion operator overloading is a bit dangerous and might not always do
what the programmers wants... and it's lot s of work to implement all
possible type cast variations.
But it might work... not all typecast operator overloaders needed
There two ways to return half of the bits.
Ofcourse the function idea is preferred... because it can return whatever
you want:
ReturnUpperHalf
ReturnLowerHalf
^^^ very nice !
Well there you have it folks !
Skybuck just presented a concept to the whole fucking world !
How to:
1. Write Scalable Classes with Scalable Math !
2. How to keep the speed incredibly high !
(Math class constructors should be kept to absolutely minimum for maximum
speed)
(User classess should be created/destroyed only once if possible, otherwise
use recycle pools for objects if required)
Is the world ready for Skybuck's concepts ?
Two possibilities:
1. Delphi 2007
2. C++
Questions:
1. Is Skybuck's concept new ? In that case: To fucking bad, now it can't be
patented because I just published it !
Ofcourse there are always people saying no, but those people should read
this concept really carefull.. because some things might look same.. but is
it really the same ?! Carefull reading is required !
2. Can Delphi 2007 currently implement this concept ? This remains to be
seen, I shall explore this myself.
There are two variations of Delphi 2007, .NET and Win32. .NET has better
operator overloading support, I don't use .NET I like win32. I NEED IT
FOR WIN32 !!!!!
3. Can C++ implement these concepts ? I would be surprised if it cannot !
This will have to be explored by other people, I don't write code in C++, if
Delphi can't do I might explore C++ but don't count on it !
If Delphi 2007 for Win32 can not implement because of missing operator
overloading support for classes, or because of missing inheritance for
records than clearly the Delphi language would GREATLY benefit from these
features because it allows to do everything I wrote above... and that in
that case a request for these features should not even be necessary.
It should be TOP PRIORITY =D LOL Might even make writing a 64 bit Delphi
compiler much easier !
Might even make changing the VCL to support 64 bit A SNAP !
Only one code bases needed ! and possible even fully runtime scalable !
That last possibility might be over their head.
Borland might simply hard code it for a 64 bit Delphi version:
var
MathClass : TSkybuckGenericIntegerClassess = TSkybuckInt64;
Code changes for VCL:
Replace all integer declarations whith GenericInteger and add a
MathClass.Create statement to VCL constructors !
FUCKING NICE !
Well I am done writing about this new concept.
I shall go exlore after I have fucking breakfast LOL.
HAHAHAHAHA
Oh man another great idea while I woke up.
**** I had some good ideas while lieing in BED.
Fucking Winston Churchile was write... BEST IDEA COME IN BED LOLOLOLOL.
Skybuck's Software Development Company would have an insane ammounts of BEDS
in it's building some PEOPLE CAN SLEEP ON IT =D and have great ideas when
they wake up ! or have a fucking rest !
Me thinks definetly worth it ! =D =D =D
Bye,
Skybuck.