StarBootics wrote:I'm not asking it it will be needed or not. What I'm asking is if it will be possible otherwise 100 000 lines (maybe more) will simply go to waste. That's my point.
Interfaces are working in SpiderBasic and it is possible in C as well.
It‘s just a struct with vtable with function pointers.
I also never understood the 'PureBasic' is simple comments. Yes, if you constrict yourself to what it can deliver out of the box and stay with basic programs and samples. Go out of that comfort and you soon bump your head into ugly win32 API's or CocoaMessages because of a missing build-in function or this, that, such so or even... POINTERSSSS the scare of many programming textbooks. I always saw PB as C-like with strong standard libraries and safe strings. It's closer to that then let's say VB6. It's syntax isn't as what I considered to be Basic, hence there is not one Basic.
While I'm at it, my 'negatives' (don't take it too negative):
As above, extend structures to support procedures that handle it's data
For one, I dread the many () used for too many things. Wish the compiler also allowed let's say [] in certain cases (arrays?)
Lack of inline arrays declaration are another ouch-point for me which I think would be easy to fix. Apparently not.
ByVal/ByRef choice for procedures (would make it more Basic rrright? No more messing with those dangerous pointers )
Recently: gadget library does not support multi-monitor-DPI situations.. pain to handle it yourself.. combo API and PB libraries..
Gadget library could do with a few additions, for one an advanced table control and some modern styled control variations.
Integer-key Map
Maybe some PB libraries could be open sourced to speed up bug fixes and stuff. Just a thought.
Maybe PB could start an official GitHub repository for 3rd party additional maintained libraries, unit tested and all. A lot of the time people are reinventing the wheel or copying old code hoping it works and is stable.
Windows Callback get messy real quick, add support for something like procedure OnHotKey(wp, lp) message #wm_hotkey . SetWindowCallback can only be called once. What if another modules also needs it (there's the window parameter which helps somewhat)? Target easy reusability.
GUI designer is lacking (multi select actions don't do much). Let us add some custom info to a gadget (maybe GadgetData added to the properties table). It also breaks on scale <> 100%.
Why the saddeness ? All PureBasic feature will be supported in the C backend unless proved to be impossible (which is very unlikely). For now, the current limitations are:
- no level to 'Break' (should be resolved somewhen)
- no Gosub (should be resolved soon)
- no label address (?LabelName) outside of Datasection (could be resolved somewhen, not sure if it worths it).
Then that pretty much it, all common stuffs like prototype, interface etc works indeed.
And again: we DON'T plan to drop the current asm backend, plain and simple.
Fred wrote:
- no label address (?LabelName) outside of Datasection (could be resolved somewhen, not sure if it worths it).
I'm sure some people is using labels in the body of procedures or outside the data section anyway for many tricks or extensions. I'm one of them, I have at least two uses probably more, one is a sort of poor man try/catch and I've used it extensively.
So please try to keep it if possible.
Fred wrote:Why the saddeness ? All PureBasic feature will be supported in the C backend unless proved to be impossible (which is very unlikely). For now, the current limitations are:
- no level to 'Break' (should be resolved somewhen)
- no Gosub (should be resolved soon)
- no label address (?LabelName) outside of Datasection (could be resolved somewhen, not sure if it worths it).
Then that pretty much it, all common stuffs like prototype, interface etc works indeed.
And again: we DON'T plan to drop the current asm backend, plain and simple.
The sadness was due to the fact that big changes into a programming language such as the new C Backend can mean big changes into the language it self. I remember when changes in the language in the earlier version of PureBasic (the introduction of Modules for example) was literally a game changer but it also means that the good old ways of writing code as to change as well. I'm not afraid of change, what I'm afraid is regressions.
And you pointed some out that will probably resolved.
Thanks for your answer.
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Fred wrote:- no level to 'Break' (should be resolved somewhen)
Hopefully this can be resolved as soon as possible, rather than sometime in the future. It's a major feature to have a Break level, and without this it will ruin a lot of nested loops that currently depend on it. Until this is resolved, I won't even be able to begin testing any new betas because a few of my loops have "Break 2" and "Break 3" in the same processing code.
Fred wrote:- no level to 'Break' (should be resolved somewhen)
Hopefully this can be resolved as soon as possible, rather than sometime in the future. It's a major feature to have a Break level, and without this it will ruin a lot of nested loops that currently depend on it. Until this is resolved, I won't even be able to begin testing any new betas because a few of my loops have "Break 2" and "Break 3" in the same processing code.
Yes, I have many nested loops that Break 2, but no Break 3 as yet.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
for (uint8_t i=0; i<10; i++)
{
for (uint8_t x=1; x<100; i++)
{
goto break2; // This Bkeak 2 in PB.
}
}
break2:;
It's the plan, it's just not implemented yet.
User_Russian wrote:
Fred wrote:no label address (?LabelName) outside of Datasection (could be resolved somewhen, not sure if it worths it).
Why? GCC allows you to find out the address of the label.
See this screenshot.
The label is located at address 0x2000030E and the variable has the same value. Everything works fine.
Fred wrote:no Gosub (should be resolved soon)
Write what difficulties have arisen. It may be possible to find a solution.
I know, but it's GCC specific and I would like to avoid this to be able to use other compiler as well. If I get no other choices we could be tied to GCC, but I want to explore all possibilities.
@Saki: From the manual for the "Goto" command: To exit a loop safely, you always must use Break instead of Goto. Something about releasing the stack correctly, IIRC.
Conditional While/Wend and Repeat/Until loops could easily and elegantly replace multi-level breaks.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!Please visit my YouTube Channel
TI-994A wrote:Conditional While/Wend and Repeat/Until loops could easily and elegantly replace multi-level breaks.
It can be elegant, but if one of the exit conditions is only combined with a handful of other specific conditions (i.e. nested deep in some IF's), placing that whole pile into the conditional loop test can be ugly, confusing, and slower since the condition is tested with every iteration... And is no longer elegant.