Blog post !
Re: Blog post !
Extending structs with 'easy to use function pointers with auto-self-reference' also provide an alternative to the Module thing and you'll get multiple instancing capability for free... The Module, as is, is kind of lacking anyway in regard to scope handling (compared to same idea in Pascal (Unit)).
Re: Blog post !
We are not really talking about OOP. OOP with Classes, Methods, etc. was discussed 10 or 15 years ago andStarBootics wrote:This reminds me what Guimauve's Dev-Type program was generating back then. It's nothing new in town and to be honest I can't consider this OOP.
the result was it will not be supported by PureBasic. It is a waste of time to discuss this over and over again.
Maybe the PureBasic language is already considered finished, I don't know. If not, we can talk about new ideas.
That's why I was bringing Rust into the discussion: Rust has no classes, but it has some features that combine
data structures and functions that work with that data structures:
Something simple like Procedures for Data Structures could probably fit nicely into PureBasic's procedural approach. But that's just my opinion.

Code: Select all
Structure Rectangle
width.i
height.i
EndStructure
Procedure.i Area() For Rectangle
ProcedureReturn Self\width * Self\height
EndProcedure
Define rect.Rectangle
rect\width = 30
rect\height = 50
Print("the area of the rectangle is " + rect\Area() + " square pixels.")
Internally Self is just a pointer to the data structure type. In the example above it would be *Self.Rectangle (internal to the compiler only).
A call of a Data Structure Procedure would look like this inside the compiler:
Code: Select all
Define rect.Rectangle ; Inside compiler:
;
Debug rect\Area() ; Debug Area( @rect ) ; internal name: __procedure35
;
Define *r.Rectangle = AllocateMemory( SizeOf(Rectangle) ) ;
;
Debug *r\Area() ; Debug Area( *r ) ; internal name: __procedure35

The advantage is that everybody can just write new Procedures for existing data structures and add more and more functionality - just by writing simple, additional procedures in the usual PureBasic style.
Re: Blog post !
I agree!Danilo wrote:We are not really talking about OOP. OOP with Classes, Methods, etc. was discussed 10 or 15 years ago and
the result was it will not be supported by PureBasic. It is a waste of time to discuss this over and over again.
PB is 100% procedural and this new transpiler is just a step into reaching more CPU architectures.
I just hope that inline asm will be continued. (albeit just for the sake of legacy code)
Exciting times!
Re: Blog post !
Fred said "- Inline ASM won't be supported directly at start. We plan to add naked ProcedureASM : EndProdecure which will create an assembly file, use fasm and link it to the final exe without needed to do anything"sq4 wrote:I just hope that inline asm will be continued. (albeit just for the sake of legacy code)
Exciting times!
That sounds awesome to me because it means existing PB-asm code should mostly still be compatible.
gcc (the C compiler PB will be using) also supports its own form of inline asm, but it's a bit quirky!
Re: Blog post !
Danilo +1


- the.weavster
- Addict
- Posts: 1576
- Joined: Thu Jul 03, 2003 6:53 pm
- Location: England
Re: Blog post !
Very nice indeedDanilo wrote:Something simple like Procedures for Data Structures could probably fit nicely into PureBasic's procedural approach. But that's just my opinion.
Code: Select all
Structure Rectangle width.i height.i EndStructure Procedure.i Area() For Rectangle ProcedureReturn Self\width * Self\height EndProcedure Define rect.Rectangle rect\width = 30 rect\height = 50 Print("the area of the rectangle is " + rect\Area() + " square pixels.")

And similar to how Nim works which is another language that translates to C.
- StarBootics
- Addict
- Posts: 1006
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: Blog post !
Hello everyone,
I only hope that a hack like this will still be possible :
That out of the way, I have another question for Fred : Will all standard C language types be available, especially unsigned long ?
Best regards
StarBootics
I only hope that a hack like this will still be possible :
Code: Select all
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; AUTOMATICALLY GENERATED CODE, DO NOT MODIFY
; UNLESS YOU REALLY, REALLY, REALLY MEAN IT !!
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; Code generated by : Dev-Object - V1.4.3
; Project name : the project name here
; File name : File name here
; File Version : 0.0.0
; Programmation : In progress
; Programmed by : StarBootics
; Creation Date : 17-03-2021
; Last update : 17-03-2021
; Coded for PureBasic : V5.73 LTS
; Platform : Windows, Linux, MacOS X
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
DeclareModule Car
Interface Car
GetName.s()
GetSpeed.d()
GetFuel.d()
SetName(P_Name.s)
SetSpeed(P_Speed.d)
SetFuel(P_Fuel.d)
Free()
EndInterface
; Declare Free(*This)
Declare.i New(P_Name.s = "", P_Speed.d = 0.0, P_Fuel.d = 0.0)
EndDeclareModule
Module Car
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Structure declaration <<<<<
Structure Private_Members
VirtualTable.i
Name.s
Speed.d
Fuel.d
EndStructure
; <<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< The observators <<<<<
Procedure.s GetName(*This.Private_Members)
ProcedureReturn *This\Name
EndProcedure
Procedure.d GetSpeed(*This.Private_Members)
ProcedureReturn *This\Speed
EndProcedure
Procedure.d GetFuel(*This.Private_Members)
ProcedureReturn *This\Fuel
EndProcedure
; <<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< The mutators <<<<<
Procedure SetName(*This.Private_Members, P_Name.s)
*This\Name = P_Name
EndProcedure
Procedure SetSpeed(*This.Private_Members, P_Speed.d)
*This\Speed = P_Speed
EndProcedure
Procedure SetFuel(*This.Private_Members, P_Fuel.d)
*This\Fuel = P_Fuel
EndProcedure
; <<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< The Destructor <<<<<
Procedure Free(*This.Private_Members)
FreeStructure(*This)
EndProcedure
; <<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< The Constructor <<<<<
Procedure.i New(P_Name.s = "", P_Speed.d = 0.0, P_Fuel.d = 0.0)
*This.Private_Members = AllocateStructure(Private_Members)
*This\VirtualTable = ?START_METHODS
*This\Name = P_Name
*This\Speed = P_Speed
*This\Fuel = P_Fuel
ProcedureReturn *This
EndProcedure
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< The Virtual Table Entries <<<<<
DataSection
START_METHODS:
Data.i @GetName()
Data.i @GetSpeed()
Data.i @GetFuel()
Data.i @SetName()
Data.i @SetSpeed()
Data.i @SetFuel()
Data.i @Free()
END_METHODS:
EndDataSection
EndModule
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<< Code generated in : 00.001 seconds (131000.00 lines/second) <<<<<
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; <<<<<<<<<<<<<<<<<<<<<<<
; <<<<< END OF FILE <<<<<
; <<<<<<<<<<<<<<<<<<<<<<<
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Re: Blog post !
btw, I hope Fred changes the software title to something new, and charges us some money for it!$ (because it is literally a brand new software project)
I'm getting tired of feeling guilty for all these free software updates from Fred
He's got a family to feed and its incredible how much work he's done for us over the DECADES _at no expense to us_
PLEASE Fred, we want to pay for your BRILLIANT WORK!!!!!!!!! because without your brilliant work, many of us wouldn't have been able to find our own niches

And we want to _SUPPORT_ PB!!! SHUT UP AND TAKE OUR MONEY!!!
♥
I'm getting tired of feeling guilty for all these free software updates from Fred

He's got a family to feed and its incredible how much work he's done for us over the DECADES _at no expense to us_
PLEASE Fred, we want to pay for your BRILLIANT WORK!!!!!!!!! because without your brilliant work, many of us wouldn't have been able to find our own niches



And we want to _SUPPORT_ PB!!! SHUT UP AND TAKE OUR MONEY!!!


Re: Blog post !
I agree with Keya. The new version should be PureBasic v6.00 and come with a new license model. Fred could "grandfather" existing paid customers if he prefers (ie. not charge us) but make all new buyers have a renewal fee every year. It makes better business sense.
-
- Addict
- Posts: 1519
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: Blog post !
Especially for you and others who getting tired of feeling guilty.Keya wrote:I'm getting tired of feeling guilty for all these free software updates from Fred

Why aren't you sending donations to Fred?
Re: Blog post !
User_Russian: yes but that's just voluntary, so most people won't 

Re: Blog post !
I'm doing my part![img]https://uploads.tapatalk-cdn.com/202103 ... 7215d0.jpg[/img]
Edit: Ah crap, it should be animated...
Edit: Ah crap, it should be animated...
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: Blog post !
ProcedureASM() was one of my feature requests it would be really cool if its still an option once/if inline is back.
Re: Blog post !
User_Russian wrote:Especially for you and others who getting tired of feeling guilty.Keya wrote:I'm getting tired of feeling guilty for all these free software updates from Fred
Why aren't you sending donations to Fred?
I'm not 'walking on clouds' like some other people here but I'm certainly looking forward to each new update..
But user_Russian is correct - it is time to make another donation. Not because of future updates but because it is time. [donation made].
Stay strong and creative Fred & team!

Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
Re: Blog post !
I actually like this way, very clever.Danilo wrote:Code: Select all
Structure Rectangle width.i height.i EndStructure Procedure.i Area() For Rectangle ProcedureReturn Self\width * Self\height EndProcedure Define rect.Rectangle rect\width = 30 rect\height = 50 Print("the area of the rectangle is " + rect\Area() + " square pixels.")