Page 3 of 4

Posted: Sun Dec 18, 2005 3:46 pm
by Trond
Nik wrote:
NetBeans has more Features than the Purebasic IDE
Absolutly true but in fact it doesn't matter because it's horrible to use because its so slow. If you let it run for lets say 3 hours while doing something else and maximize it again it took me 3 minutes to get up on the screen (on a 2.8 ghz PC). That's simply unacceptable Purebasic needs less than a second to come up again. So better a not that feature rich IDE I can work with than this slow crap.
bye Nik
Good point.

Posted: Sun Dec 18, 2005 5:39 pm
by thefool
Trond wrote:Well, you said it used ten seconds for you too, didn't you?
I said 5. A cold start of Delphi 2005, after a reboot takes 30+ seconds ;)
Closing it and opening it again then takes 10-15 seconds. So it has a MUCH slower startup. But when it runs then its very fast.

Posted: Sun Dec 18, 2005 5:41 pm
by thefool
-

Posted: Sun Dec 18, 2005 5:47 pm
by MrMat
Trond wrote:
Nik wrote:
NetBeans has more Features than the Purebasic IDE
Absolutly true but in fact it doesn't matter because it's horrible to use because its so slow. If you let it run for lets say 3 hours while doing something else and maximize it again it took me 3 minutes to get up on the screen (on a 2.8 ghz PC). That's simply unacceptable Purebasic needs less than a second to come up again. So better a not that feature rich IDE I can work with than this slow crap.
bye Nik
Good point.
That would be windows virtual memory manager being inefficient, not java.

Posted: Sun Dec 18, 2005 5:48 pm
by Trond
thefool wrote:
Trond wrote:Well, you said it used ten seconds for you too, didn't you?
I said 5. A cold start of Delphi 2005, after a reboot takes 30+ seconds ;)
Closing it and opening it again then takes 10-15 seconds. So it has a MUCH slower startup. But when it runs then its very fast.
Time for a new computer?

Posted: Sun Dec 18, 2005 5:55 pm
by Pupil
thefool wrote:
Joakim Christiansen wrote:You guys are so silly :wink:
And thanks for that very interesting comment.. (btw "so" should be spelled with 2 o's in this case..)
Are you absolutely sure of this, thefool?

Just added another interesting comment to the thread ;)

Posted: Sun Dec 18, 2005 6:13 pm
by thefool
-

Posted: Sun Dec 18, 2005 6:21 pm
by utopiomania
Heh, poor 2Player, seeing his otherwise interesting thread derail so badly.. :lol:

Image

Posted: Sun Dec 18, 2005 7:27 pm
by Trond
thefool wrote:
Time for a new computer?
Nope, your fag. Mine is way faster than yours. sorry 'bout that..




(i wrote fag as a joke. I have to write this otherwise im pretty sure you would misunderstand me, you maggot... ) :D
Now I don't think yours is way faster, partly because I've got an Athlon 2400+ but most of all because I measure in seconds and not clock cycles and since you speak so warmly of all those slow programs I assume you use them, and since you use slow programs, your computer will appear slower than mine, since I use faster programs, unless you've got a Cray superprocessor of course.

Posted: Sun Dec 18, 2005 8:39 pm
by thefool
i got an 64 bit 3800+ ;)
1 gbyte ram too. fast!

And i dont use slow programs, i use fast programs. Firefox, total commander, winamp, only a few running processes when system is idle, 1 antivirus wich holds the firewall too.. Pelle's C, etc you know.

Mine is way faster. At least I think this is way faster.
However some programs loadtime may not depend on processor and memory clock speed only, as the harddisk speed is also important. There both my 200 gbyte discs has 8 mbyte cache, and 9200 rpm (not 100% sure on that RPM speed though).

So i try to use the fastest programs i can, and always clean out what i dont use. Registry, temp files etc is cleaned on a weekly basis.

Posted: Sun Dec 18, 2005 8:58 pm
by Trond
thefool wrote:i got an 64 bit 3800+ ;)
1 gbyte ram too. fast!

And i dont use slow programs, i use fast programs. Firefox, total commander, winamp, only a few running processes when system is idle, 1 antivirus wich holds the firewall too.. Pelle's C, etc you know.

Mine is way faster. At least I think this is way faster.
However some programs loadtime may not depend on processor and memory clock speed only, as the harddisk speed is also important. There both my 200 gbyte discs has 8 mbyte cache, and 9200 rpm (not 100% sure on that RPM speed though).

So i try to use the fastest programs i can, and always clean out what i dont use. Registry, temp files etc is cleaned on a weekly basis.
Ok, but Java is still too slow for those of us who has a budget.

Posted: Sun Dec 18, 2005 9:02 pm
by thefool
Its not WAY faster, but still a bit.
Anyway i agree java IS much slower than compiled code, but still fast enough for many things.

For a virus scanner for example, i wouldnt like java. But for smaller utils and a bit larger utils like netbeans, imho it works okay.

Of course i would prefer Delphi as it IS faster when loaded.


btw i did not mean the fag thingy hehe :)

Posted: Sun Dec 18, 2005 9:03 pm
by Joakim Christiansen
This was not a discussion about java...

Posted: Sun Dec 18, 2005 9:05 pm
by thefool
now it is :D

Posted: Sun Dec 18, 2005 10:08 pm
by Trond
thefool wrote:Its not WAY faster, but still a bit.
Anyway i agree java IS much slower than compiled code, but still fast enough for many things.

For a virus scanner for example, i wouldnt like java. But for smaller utils and a bit larger utils like netbeans, imho it works okay.

Of course i would prefer Delphi as it IS faster when loaded.


btw i did not mean the fag thingy hehe :)
By the way, I've setup my virus scanner to scan files only on creation and not on run as is the usual setup. That really boosts the speed without sacrificing too much security. That being said, I haven't had virus (neither (fake) alarms) for years.

Just to bring the topic back on track I thought I could post an example that is a bit more advanced with variable=expression parsing. Type in the assignment on the prompt. Example: orange = apple * (5 + orange * apple).

Code: Select all

OpenConsole()

#Ind = "    "
#QUOTE$ = "'"
Global Look.s
Global Stream.s

;Logical not on 1 and 0 _only_
Procedure Not(b.b)
  ProcedureReturn -b+1
EndProcedure

;Cleanup then end
Procedure Finish()
  Input()
  End
EndProcedure

;Make sure a character is a visible one
Procedure.s VisibleToken(s.s)
  Select s.s
    Case #CR$
      s.s = "newline"
    Default
      s.s = #QUOTE$ + s.s + #QUOTE$
  EndSelect
  ProcedureReturn s.s
EndProcedure

;Report an error
Procedure Error(s.s)
  PrintN("Error: "+s+".")
EndProcedure

;Report an error then abort
Procedure Abort(s.s)
  Error(s.s)
  Finish()
EndProcedure

;Report what was expected and abort
Procedure Expected(expected.s)
  Abort("Expected: '" + expected + "', got " + VisibleToken(Look))
EndProcedure

;Output a tabbed string
Procedure Emit(s.s)
  Print(#Ind + s.s)
EndProcedure

;Output a tabbed line with linefeed
Procedure EmitLn(s.s)
  SetClipboardText(GetClipboardText()+s.s+Chr(13)+Chr(10))
  Emit(s.s)
  PrintN("")
EndProcedure

;Read a character into Look
Procedure GetChar()
  Look = Left(Stream,1)
  Stream = Right(Stream, Len(Stream)-1)
EndProcedure

;Match a specific input character
Declare EatWhite() ;forward
Procedure Match(s.s)
  If Look = s
    GetChar()
    EatWhite()
  Else
    Expected(s)
  EndIf
EndProcedure

;Recognize an alpha character
Procedure.b IsAlpha(s.s)
  ProcedureReturn (Asc(UCase(s.s)) > 64 And Asc(UCase(s.s)) < 91)
EndProcedure

;Recognize an addop
Procedure.b IsAddop(s.s)
  ProcedureReturn (s.s = "+" Or s.s = "-")
EndProcedure

;Recognize a decimal digit
Procedure.b IsDigit(s.s)
  ProcedureReturn (Asc(UCase(s.s)) > 47 And Asc(UCase(s.s)) < 58)
EndProcedure

;Recognize an alphanumeric
Procedure.b IsAlphaNumeric(s.s)
  ProcedureReturn (IsAlpha(s.s) Or IsDigit(s.s))
EndProcedure

;Recognize whitespace
Procedure.b IsWhiteSpace(s.s)
  Select s.s
    Case " "
    Case #TAB$
    Default
      ProcedureReturn 0
  EndSelect
  ProcedureReturn 1
EndProcedure

;Get an identifier
Procedure.s GetName()
  temp.s = ""
  If Not(IsAlpha(Look))
    Expected("Name")
  EndIf
  While IsAlphaNumeric(Look)
    temp + UCase(Look)
    GetChar()
  Wend
  EatWhite()
  ProcedureReturn temp
EndProcedure

;Get a number
Procedure.s GetNum()
  temp.s = ""
  If Not(IsDigit(Look))
    Expected("Integer")
  EndIf
  While IsDigit(Look)
    temp + Look
    GetChar()
  Wend
  EatWhite()
  ProcedureReturn temp
EndProcedure

;Skip whitespace
Procedure EatWhite()
  While IsWhiteSpace(Look)
    GetChar()
  Wend
EndProcedure

;Init
Procedure Init()
  SetClipboardText("")
  Stream = Input()+#CR$ : PrintN("")
  GetChar()
  EatWhite()
EndProcedure

;------------------------------
;D0 D1 = edx, ecx

Declare Expression() ;forward declaration for factor

;Parse and translate an identifier
Procedure Identifier()
  Name.s
  Name = GetName()
  If Look = "("
    Match("(")
    Match(")")
    EmitLn("call [f_" + Name + "]")
    EmitLn("mov edx, eax")
  Else
    EmitLn("mov edx, [v_" + Name + "]")
  EndIf
EndProcedure

;Parse and translate a math factor
Procedure Factor()
  If Look = "("
    Match("(")
    Expression()
    Match(")")
  ElseIf IsAlpha(Look)
    Identifier()
  Else
    EmitLn("mov edx, " + GetNum())
  EndIf
EndProcedure

;Recognize and translate a multiply
Procedure Multiply()
  Match("*")
  Factor()
  EmitLn("pop ecx")
  EmitLn("imul edx, ecx")
EndProcedure

;Recognize and translate a divide
Procedure Divide()
  Match("/")
  Factor()
  EmitLn("pop eax")
  EmitLn("mov ecx, edx")
  EmitLn("xor edx, edx")
  EmitLn("idiv ecx")
  EmitLn("mov edx, eax")
EndProcedure

;Parse and translate a math term
Procedure Term()
  Factor()
  While Look = "*" Or Look = "/"
    EmitLn("push edx")
    Select Look
      Case "*" : Multiply()
      Case "/" : Divide()
    EndSelect
  Wend 
EndProcedure

;Parse and translate an add
Procedure Add()
  Match("+")
  Term()
  EmitLn("pop ecx")
  EmitLn("add edx, ecx")
EndProcedure

;Parse and translate a subtract
Procedure Subtract()
  Match("-")
  Term()
  EmitLn("pop ecx")
  EmitLn("sub edx, ecx")
  EmitLn("neg edx")
EndProcedure

;Parse and translate an expression
Procedure Expression()
  If IsAddop(Look)
    EmitLn("xor edx,edx")
  Else
    Term()
  EndIf
  While IsAddop(Look)
    EmitLn("push edx")
    Select Look
      Case "+" : Add()
      Case "-" : Subtract()
    EndSelect
  Wend
EndProcedure

;Parse and translate an assignment statement
Procedure Assignment()
  Name.s = GetName()
  Match("=")
  Expression()
  EmitLn("mov v_[" + Name.s + "], edx")
EndProcedure

Init()
Assignment()
If Look <> #CR$ : Expected("Newline") : EndIf

Print(Stream)
Finish()