simple speed optimization request
Re: simple speed optimization request
@remi_meier
Fabulous suggestions IMHO, and the parser as a some kind of library would indeed be insanely awesome.
Fabulous suggestions IMHO, and the parser as a some kind of library would indeed be insanely awesome.
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: simple speed optimization request
Can't some plugin-like functionality be achieved now by adding pre-processors to the IDE tools?
An enhanced plugin system would be great though -- a community-driven plugin forum would be awesome -- but this would probably need its own big discussion to work out the details.
I've had a few ideas for handy PB plugins but I always held off because I thought there was talk of overhauling the IDE tools system.... maybe I'm wrong.
An enhanced plugin system would be great though -- a community-driven plugin forum would be awesome -- but this would probably need its own big discussion to work out the details.
I've had a few ideas for handy PB plugins but I always held off because I thought there was talk of overhauling the IDE tools system.... maybe I'm wrong.
Re: simple speed optimization request
Would the plug-in system be in addition to or a replacement of freak's proposed IDE automation?
http://www.purebasic.fr/english/viewtop ... 50#p343150
I do think it may be time to reconsider what exactly a "beginner" is.
Many children today, including mine, are starting with java.
I see no reason for PureBasic to be held back for "beginners" sake.
Given you cannot please all people, all the time, enabling a plugin system could reinvigorate interest and add features that a small team could not achieve otherwise.
Thanks for PureBasic!
http://www.purebasic.fr/english/viewtop ... 50#p343150
Hi Fred,Fred wrote: I don't want of a 'so called' modern programming language because it doesn't fit with beginners.
I do think it may be time to reconsider what exactly a "beginner" is.
Many children today, including mine, are starting with java.
I see no reason for PureBasic to be held back for "beginners" sake.
Given you cannot please all people, all the time, enabling a plugin system could reinvigorate interest and add features that a small team could not achieve otherwise.
Thanks for PureBasic!
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: simple speed optimization request
This thread shows exactly why so many feature request posts remain without a comment. There are simply too many people here who cannot accept anything other than "yes, right away" as an answer. As soon as I post anything different, all i get is personal attacks in response.
Well, I don't have to put up with that. If you rather like your posts unanswered, that is fine with me.
@Danilo:
I make a living writing enterprise level software (in Java, not that it matters). How much have you accomplished lately with your awesome pro skillz except trolling around this forum? (Consider that a rhetoric question.)
Well, I don't have to put up with that. If you rather like your posts unanswered, that is fine with me.
@Danilo:
I make a living writing enterprise level software (in Java, not that it matters). How much have you accomplished lately with your awesome pro skillz except trolling around this forum? (Consider that a rhetoric question.)
quidquid Latine dictum sit altum videtur
Re: simple speed optimization request
I have accomplished nothing because i spend my time trolling around here.freak wrote:@Danilo:
I make a living writing enterprise level software (in Java, not that it matters). How much have you accomplished lately with your awesome pro skillz except trolling around this forum? (Consider that a rhetoric question.)
-
- Enthusiast
- Posts: 468
- Joined: Sat Dec 20, 2003 6:19 pm
- Location: Switzerland
Re: simple speed optimization request
Of course it can. The problem is the parser for the PBkenmo wrote:Can't some plugin-like functionality be achieved now by adding pre-processors to the IDE tools?
language which is needed by most tools. You may want
to look at how much work was required to get a reasonably
working lexer for PB. PB has so many corner cases in its
syntax that it is nearly impossible to write a parser for it
that will parse the exact same way as the compiler does.
(I was tempted to code one many times, but always
backed off because of the work involved and the lack
of specification.)
IMO this is the reason why there will never be reliable
source-level tools available for PB.
Then again, tools working on PB source directly will never
implement stuff like efficient function-inlining, constant-
propagation or common sub-expression elimination because
they'd be required to parse the source, create some IR,
transform this IR and somehow be able to create PB source
again. No one will get that to work reliably.
Tools like my (now defunct) Optimizer work on the ASM
level directly. This would theoretically allow one to do anything,
but it is well known that optimizing on the lowest-level will never
be as fruitful as optimizing at a higher level like the IR. There
were many optimizations which were just impossible to
do there.
It would have nothing to do with it as far as I can tell. Myskywalk wrote:Would the plug-in system be in addition to or a replacement of freak's proposed IDE automation?
proposal works together with the compiler and has nothing
to do with the IDE (except for optional integration).
Athlon64 3700+, 1024MB Ram, Radeon X1600
Re: simple speed optimization request
Yeah, it's not fun to do. I have my own parser working for the language elements of PB which i actually use.remi_meier wrote:Of course it can. The problem is the parser for the PB
language which is needed by most tools. You may want
to look at how much work was required to get a reasonably
working lexer for PB. PB has so many corner cases in its
syntax that it is nearly impossible to write a parser for it
that will parse the exact same way as the compiler does.
(I was tempted to code one many times, but always
backed off because of the work involved and the lack
of specification.)
IMO this is the reason why there will never be reliable
source-level tools available for PB.
I guess we had the same goals, but i didnt see your lexer before i was already done with mine

-
- Enthusiast
- Posts: 468
- Joined: Sat Dec 20, 2003 6:19 pm
- Location: Switzerland
Re: simple speed optimization request
Nobody saw it, I had to watch people building their ownRamihyn_ wrote:I guess we had the same goals, but i didnt see your lexer before i was already done with mine
lexers many many times since then. That's why I stopped
updating it some time ago. Well I guess not searching in
the forums for an existing solution is kind of standard in
the PB community. I wouldn't have trusted an external
solution myself

Then again, how many of those tools were successful?
I guess a good lexer would not have helped anyway

Btw, are you sure about the done part? I was done
several times

test cases which I could give to you

Athlon64 3700+, 1024MB Ram, Radeon X1600
Re: simple speed optimization request
Personally, I highly object to java being taught as a first programming language because there are far too many concepts one must learn before you understand what all but the most trivial programs are doing. So much of the early time for a java student who has never programmed before involves, "What does that mean right there--" "Don't ask that now, just copy it, you'll see later." And later could be months down the road, or longer!skywalk wrote:I do think it may be time to reconsider what exactly a "beginner" is.
Many children today, including mine, are starting with java.
I see no reason for PureBasic to be held back for "beginners" sake.
Whereas with something like purebasic, you can start with immediate results that can be explained plainly.
I used to teach programming through LogoWriter, and it had similar facets. Many students learn much more effectively if you can give them concrete 'type this, and that happens, here's what it's doing' examples earlier on.
The fact that we can produce functioning gui applications with less than a page of source code is something remarkable, and is of great value. Sure, that's going to leave out a lot of sanity checking, but for the purposes of learning the concepts this is invaluable, and it's easier to add things later than have things unexplained early on.
As for holding Purebasic back for "the sake of beginners", at the end of the day a hobbyist developer has to make what they personally believe in making.
If someone thinks the developers should be making something different, it probably won't accomplish much to just tell them the desired end result and insist "this is what it should be."
Better results could be met through understanding the goal and vision of the project as seen by the developers, and understand how something does (or does not) meet those desires.
Re: simple speed optimization request
this made me laugh because purebasic is closed source so how you can "explain plainly" if you never seen the main code ?Whereas with something like purebasic, you can start with immediate results that can be explained plainly.
best languages for beginners are python, lisp, ada, c, javascript+html5, php and pascal. those languages are simple and offer OOP as a option. if you begin with pb and want to try OOP you must learn another language.
Re: simple speed optimization request
void - I believe you "highly object" to poor teachers and not the subject or vehicle employed. The richness of a language cannot be at fault. So, to avoid injury or illogical outcomes, some training wheels may be deployed. But, isn't it great that once removed, the student can fly?void wrote:Personally, I highly object to java being taught as a first programming language because there are far too many concepts one must learn before you understand what all but the most trivial programs are doing.

void wrote:If someone thinks the developers should be making something different, it probably won't accomplish much to just tell them the desired end result and insist "this is what it should be."


I don't know how many times I have to say this...

When I see impassioned suggestions(danilo,remi-meier,etc) I am encouraged, regardless of the delivery. My wish is the developers feel the same.

The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: simple speed optimization request
I had never heard of any PB project or updates of your lexer during the last years, thats why i didnt even search for it on the forum. I simply didnt expect to find something usefulremi_meier wrote:Nobody saw it, I had to watch people building their own
lexers many many times since then. That's why I stopped
updating it some time ago. Well I guess not searching in
the forums for an existing solution is kind of standard in
the PB community. I wouldn't have trusted an external
solution myself

Define "succes"?remi_meier wrote:Then again, how many of those tools were successful?
I guess a good lexer would not have helped anyway![]()

I wrote them to find problems (bugs/crashes/performance hogs/resource leaks) in heavily multithreaded code where the PureBasic debugger doesnt even work anymore and my toolkit instantly pointed me at those problems. So for myself the tool was a necessity and it works perfectly.
But if you define "success" as being popular, widely used and highly praised - then no, they wherent any success at all

Too bad that there isnt any market for PB tools, or i would have cleaned it up, added real documentation and sold it for a few bucks as an advanced debugger replacement or an add-on.
Define "done"remi_meier wrote:Btw, are you sure about the done part? I was done
several times. Unfortunately I was too lazy to create
test cases which I could give to you

I wrote them for my own projects and they cover 100% of the language constructs i use and need.
Things like advanced macro use or full support of preprocessor commands would be just a waste of time for me to implement. Somebody who uses them in a non-compatible way to my lexer, will just say it is broken because it doesnt treat the code like "PB does".
Nowadays i use reflection in C# or play with Cecil to do even more interesting runtime or compilation time changes. PB is pointless to me now due to only the windows version being actively supported.
-
- Enthusiast
- Posts: 468
- Joined: Sat Dec 20, 2003 6:19 pm
- Location: Switzerland
Re: simple speed optimization request
Yeah, that is a problem of my laziness. I started it in 2006Ramihyn_ wrote:I had never heard of any PB project or updates of your lexer during the last years, thats why i didnt even search for it on the forum. I simply didnt expect to find something useful
and the only (other) user of the lexer was in the German
forums, so I was too lazy to mark updates and fixes in the
English forums too. The last update was made in 2009.
I meant in widespread use. As you pointed out, this wouldRamihyn_ wrote:Define "succes"?remi_meier wrote:Then again, how many of those tools were successful?
I guess a good lexer would not have helped anyway![]()
be the only reason to try to support every little quirk of PB

Yeah, there is not even enough demand for free tools. IRamihyn_ wrote:Too bad that there isnt any market for PB tools, or i would have cleaned it up, added real documentation and sold it for a few bucks as an advanced debugger replacement or an add-on.
made quite a few myself and albeit they fulfill quite
specialized needs, again I saw many people just doing
it on their own. I think my average tool has ~2 users
in the first year (including myself

You are right of courseRamihyn_ wrote:Define "done"remi_meier wrote:Btw, are you sure about the done part? I was done
several times. Unfortunately I was too lazy to create
test cases which I could give to you
I wrote them for my own projects and they cover 100% of the language constructs i use and need.

how much work is needed to get a "compliant" PB
lexer. If we had the one that PB uses itself, there would
be nothing in the way of widespread use of a tool with
very high quality.
Cheers
remi
Athlon64 3700+, 1024MB Ram, Radeon X1600
Re: simple speed optimization request
I think you made it way too complicated. The lexer should return only simple tokensremi_meier wrote:I was just trying to hint at how much work is needed to get a "compliant" PB lexer.
like operators, identifiers, keywords, numbers, strings.
You did care for *pointers, %01010 and p-ascii in your lexer if i see it correctly,
but this stuff should be done in the parser imo.
Makes it much easier and the following is no problem:
Code: Select all
p=10:ascii=2
a = p-ascii ; p-ascii
b = p%%1000 ; % %1000
c = p**p ; * *p
Debug a
Debug b
Debug c
-
- Enthusiast
- Posts: 468
- Joined: Sat Dec 20, 2003 6:19 pm
- Location: Switzerland
Re: simple speed optimization request
Of course you are correct, but that would imply that aDanilo wrote:I think you made it way too complicated. The lexer should return only simple tokensremi_meier wrote:I was just trying to hint at how much work is needed to get a "compliant" PB lexer.
like operators, identifiers, keywords, numbers, strings.
You did care for *pointers, %01010 and p-ascii in your lexer if i see it correctly,
but this stuff should be done in the parser imo.
Makes it much easier and the following is no problem:Code: Select all
p=10:ascii=2 a = p-ascii ; p-ascii b = p%%1000 ; % %1000 c = p**p ; * *p Debug a Debug b Debug c
parser is required for it to be useful. My initial goal was
to be able to extract functions and variables, meaning
identifiers. Many (most?) lexers do some easy preparsing
anyway.
The first problem with that was of course the "$ C0FFEE"
or "% 10110". I needed to decide that both (especially
the HEX one) are numbers and not identifiers. So I needed
to look at the previous tokens too. In the same category
of problems is the part about '*p' being a different identifier
than 'p' and therefore treating * as an operator and returning
'p' as the identifier was unacceptable. Oh, and this dragged
in yet another problem:
Code: Select all
Define*p
'*' would be an operator again. Same with ".p-ascii" etc.
You see my goal was to provide a simple lexer which is
usable by itself. I could have added a trimmed-down parser
which made those decisions in another pass but you would
have to prove to me that this would have been simpler

I wouldn't argue for this approach if the intended use of the
lexer was together with a parser, but building a parser for
PB is again a much much greater task. And I just wanted
something useful

Athlon64 3700+, 1024MB Ram, Radeon X1600