Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB vs C++
#11
Quote:Mango: You don't say Einstein? Smile
I deserve that...
Quote:Well, your comparision isn't quite fair. You're comparing a fairly decent optimizing compiler that creates pmode flat apps to qb. A real mode compiler from the 80s which has no optimizing ability. Try comparing it to QuickC from the same time, you'll see that there's barely any difference.
Interesting...I think I *am* a dunce...

Quote:But sure, it's not exactly a discovery. QB is slow as hell, but people here don't use ti for speed do they? They use it either becuase of their extreme lazyness is in the way of learning something new. Or simply for fun.
I guess this describes me to a 't'. Lazy, and programming for fun...

Quote:You don't have to stop using qb just becuase you learn something new.

no...and I *really* didn't want to give the impression that I was dissing QB...I really *like* QB. I was just surprised see a 40x performance difference. 40x is kinda hard to ignore. Regarding my impressions with C...I'm really surprised at how many similarities there are between C++ and QB. I knew GW-BASIC and when I got QB it was an eye-opening experience...I expected the same with C++...however it is apparent tha QB was designed with C++ very much in mind...It's too bad that a 32-bit optimized QB compiler doesn't exist. It's really nice to write windows-ignorant programms that use the processor, rather than waiting for user input all the time...which seems to be the case with VB. I was pleasantly surprised that C offers direct processor interaction and easy DOS-level output.

Thanks for the replys...learning lots just now...
Reply
#12
Yeah, though C/C++ is my language of choice when writing a bit more advanced stuff. But when i'm just messing about i use C and asm + qb. It's a pretty good combination.
oship me and i will give you lots of guurrls and beeea
Reply
#13
Quote:It's too bad that a 32-bit optimized QB compiler doesn't exist.

So far every alternative QB compiler I've looked at has lacked features that I consider crutial (like expression evaluation in all contexts, or SUBs, FUNCTIONs and TYPEs). So I'm writing a fully featured (it will even supports PowerBASIC-style pointers) one that compiles for a 32 bit protected mode dos extender. It won't optimize at all (this will be only my second serious attempt at a compiler), but even so it should be faster than QB.

Oh BTW, if any of you are going to write your own compiler, I've got a preprocessor that you'll probably like (and that I don't mind if you use). So far it inserts '$INCLUDEd files, removes line numbers to a separate field, splits colon-separated commands to separate lines, and converts this single-line IF:
Code:
IF asdf+1 THEN sub1 b: IF d THEN sub2 ELSE IF e THEN sub3 ELSE ELSE sub4 ":IF z THEN sub5"
To this:
Code:
IF asdf+1 THEN
  sub1 b
  IF d THEN
    sub2
  ELSE
    IF e THEN
      sub3
    END IF
  END IF
ELSE
  sub4 ":IF z THEN sub5"
END IF
among other things. If anyone is interested in using it, let me know and I'll send the current source code, but I'll have to write some documentation for it.
Reply
#14
I've got something that takes all ":" NOT in quotes and NOT labels and makes them one liners.
Also converts line names to line numbers, too.

Want me to try to find it?
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#15
The C IDE usually also contains a disassembler, where you can see how your code is translated into ASM. It seems all code are directly converted into 32bit-ASM and then assembled. This of course gains much more speed than writing exe-commands (QB).
Reply
#16
Agamemnus, my preprocessor is already done, and it does more than that - I'm happy with it. But thanks anyway.

Neo, assembler is no faster than machine code (what QB's compiler generates, "EXE commands") - they are essentially the same thing. Assembly is just a more user-friendly way of representing machine code.

QB can also generate an assembly listing (with "BC /A", if I'm not mistaken), but it won't actually assemble.
Reply
#17
Hey Sterling. I'm interested in your project.

can you mail it to me as I'm in a fix right now. ;*(
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#18
good luck with c++ and hope to see you around because i was thinking of learning c++ before i got too far in qb
Reply
#19
You know what?
People programs stuff in waves.
Now it seems to be qb compilers. Why not combine your skills?
I would be pleased to contribute to a qb 32bit compiler, but of course, we'd have different ideas about the syntax etc.
But good luck. Qb is dying, but maybe qb++ and qb32 is not Wink
Reply
#20
Quote:People programs stuff in waves.
Yeah, I've noticed that too. I remember not too long ago when the qb community went through it's gui/shell phase. Now they're frowned upon by many as a waste of time, and shells are rediculed as wannabe OSs.

This compiler phase seems to be dwindling already - trying to write a qb compiler teaches you that BASIC syntax is easy on the programmer and hard on the compiler, and gives you an appreciation for the simplicity (especially from the compiler's perspective) of C. But I'm not going to give up.

Quote:Now it seems to be qb compilers. Why not combine your skills?
The last few times I tried to cooperate with somebody else on a project, it just sorta died. There was a serious lack of planning and comunication. I think I have a lot to learn in that respect. But I would be willing to try.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)