Hello
Has anyone tried the True Basic compiler?
i wonder how good it is ?
Its link is as below
https://www.truebasic.com/ (https://www.truebasic.com/)
I did have a quick look long time ago. If I remember well it was too limited. Bad quality/price ratio.
There is demo to download. Depending of your context, maybe it will fit the bill for your need.
Another alternative for you might be PureBASIC (https://www.purebasic.com/)
There is also a demo to download.
Thanxx Pierre
their sales department didn't even reply my email -- i believe that it is dead already
it looks outdated and lots of stuff are missing and i'm not going to use it.
i will go along with FB and O2 to convert PB programs to 64bits
Purebasic has a funny syntax expecially the for loop and do not really looks like basic.
Thanxx Raul for the info
looks like there is no support for this language and its website has no activity!
i was just searching for a replacement language for PB in order to do 64bits programming.
Hello Chris.
I've been watching Free BASIC, but it's extremely slow for string handling.
I would like to investigate: Open Watcon and Xamarin.
In the channel of this video you can find good programming tutorials.
C ++ Programming
https://www.youtube.com/watch?v=Rub-JsjMhWY&feature=youtu.be
Regards
Extremely slow? What have been you doing to test it?
Thanxx Raul
Open Watcom looks good except no development since 3 years ago, i will take a spin at it
while Xamarin i won't want to go into it as it belongs to MS, as MS killed many products it took over
Hello Jose,
Maybe I'm wrong.
123456789 * 123456789 * 123456789 * 123456789 * 123456789 * 123456789 * 123456789 * 123456789 * 123456789 * 123456789 *
If I repeat this string 100 times, I have a text with 10,000 characters. if I change the * by 0. 1000 changes are made.
In PB and in SED this is instantaneous.
In CSED_FB and CSED it takes 7 seconds with a Core I3 computer. I assumed that these two editors are compiled with FB.
Also, I read a comment of yours, in which you mention that, in FB, the string part is written in C. But, this does not affect you, since you do not use many strings.
Please, tell me if I'm wrong.
Regards
Raúl
> I assumed that these two editors are compiled with FB.
Wrong assumption. They're written in PowerBasic. Your "test" isn't even useful to test PB strings speed because the replacement is being done calling a procedure of the Scintilla control, not using PB's strings. If you want to test FB string speed then use the FB compiler and write a test using FB code.
The truth is that FB strings are faster than PB strings.
Thank you very much.
The world of computing advances very quickly, and it is difficult to change to a different language. However PB programmers will one day have to look for other alternatives. I thank you for clarifying this aspect of FreeBASIC. I will take it into account once more.
regards
BTW I have tried your test with CSED in my computer and the replacements are instantaneous.
Text Editors SED, CSED and CSED_FB I like them a lot, and I congratulate you for them.
But, you will have noticed that when changing many characters the line "File Edit Search .." blinks a lot.
In a file built with 1212121212. In an HP folio core I5 with Windows 8.1, ten thousand changes with CSED takes 1 min 5 sec, while a million changes with PB are done in 7.8 sec. With SED, when trying a million changes, it stops after 64,564 changes in 4.8 seconds.
Regards
> blinks a lot.
This could be avoided by disabling menu redrawing while doing the replacements.
Your test only reveal that INSTR works faster in PB that in FB, but when testing for strings speed, the simpler and most revealing test is string concatenation.
PowerBasic:
#COMPILE EXE
#DIM ALL
FUNCTION PBMAIN () AS LONG
DIM start AS DOUBLE
start = timer
DIM s AS STRING
DIM i AS LONG
FOR i = 1 TO 100000
s += "test string"
NEXT
DIM endx AS DOUBLE
endx = timer
print endx - start
print LEN(s)
waitkey$
END FUNCTION
19.08 seconds in my computer.
FreeBasic:
DIM start AS DOUBLE = timer
DIM s AS STRING
FOR i AS LONG = 1 TO 100000
s += "test string"
NEXT
DIM endx AS DOUBLE = timer
print endx - start
print LEN(s)
SLEEP
0.007 seconds in my computer
For a million, 0.089 seconds with FreeBasic. With PowerBasic, I have needed to close the application after waiting for a long time. Try it yourself.
'To concatenate strings, PB is 3.5 times slower than FB with strings of less than 2Kb
'PB/FB = 0.0344/0.007 = 4.9 strings<8Kb
'PB/FB = 0.024/0.007 = 3.4 strings<2Kb
#COMPILE EXE
#DIM ALL
FUNCTION PBMAIN () AS LONG
'DIM s2(100000) AS STRING
DIM s2(10000000) AS STRING
DIM start AS DOUBLE
start = TIMER
DIM s AS STRING
DIM i AS LONG
'FOR i = 1 TO 100000
FOR i = 1 TO 1000000
s2(10000000) += "test string"
'IF LEN(s2(10000000))>32000 THEN '0.15 seg
'IF LEN(s2(10000000))>16000 THEN '.047seg
'IF LEN(s2(10000000))>8000 THEN '.03seg / FOR i = 1 TO 1000000' '.344
'IF LEN(s2(10000000))>4000 THEN '.03
IF LEN(s2(10000000))>2000 THEN '.03seg to 0.015 seg / FOR i = 1 TO 1000000' 0.24 seg
s2(10000000) = ""
END IF
NEXT
DIM endx AS DOUBLE
endx = TIMER
PRINT endx - start
PRINT LEN(s)
WAITKEY$
END FUNCTION
#IF 0
'DIM s2(100000) AS STRING
DIM s2(10000) AS STRING
DIM start AS DOUBLE = TIMER
DIM s AS STRING
FOR i AS LONG = 1 TO 100000
s2(10000) += "test string"
'IF LEN(s2(10000))>32000 THEN '0.007seg
IF LEN(s2(10000))>16000 THEN '0.007seg
s2(10000) = ""
END IF
NEXT
DIM endx AS DOUBLE = TIMER
PRINT endx - start
PRINT LEN(s)
SLEEP
#ENDIF
Hi Chris and Jose
I have training in Chemical Engineering, and not in systems, so sometimes it costs me a lot of work to program in PB, and in the forums I don't understand too much.
For several years I have been writing a program for chemical engineering, and now I would like to incorporating .DLL files made in C. But I am not sure which compiler to use. So I searched again for Watcom C, and found that in github is continuing its development for multi-platform and 64-bit. I leave you this link and I hope it will be useful to you.
Best regards
https://github.com/open-watcom/open-watcom-v2/releases
WOW i don't know for this topic.
something is really strange
..i must ty it on Oxygen basic
QuoteFor a million, 0.089 seconds with FreeBasic. With PowerBasic, I have needed to close the application after waiting for a long time. Try it yourself.
Jose..
I get strange error when i tried to compile your code ...
can you tell me why ?
QuoteError 519 in D:\PBWin\WinAPI\StringSpeed.bas(17:001): Missing declaration: WAITKEY
Line 17: WAITKEY$
on pbwin10
Because it was written for the console compiler. Replace it with a MsgBox if you want.
Ahh i see...ok !
Jose
i made this test with PBWin with messagebox and give me 62 sec
but results with Oxygen are not good ... 159 seconds
in both JIT and exe mode
and in Freebasic 0.023 seconds ...it is amazing !
How is possible that FB is that much faster ?
Jose i tested how fast all 3 compilers fill 100000 size string array and come to this
Oxygenbasic - 0.31 sec
Powerbasic - 3.09 sec
FreeBasic ...crush ???
Oxygen Basic:
'con cat strings in o2
$ filename "strSpeed.exe"
include "rtl32.inc"
Declare Function GetTickCount Lib "kernel32.dll" () As INT
DIM start AS int
DIM endx AS int
DIM strArray[100000] as string
start = GetTickCount()
string s = "test string"
DIM i AS int
FOR i = 1 TO 100000
strArray[i] = s
NEXT i
endx = GetTickCount()
print "Current value is: " + STR((endx-start)/1000)
Power Basic :
#COMPILE EXE
#DIM ALL
FUNCTION PBMAIN () AS LONG
DIM start AS DOUBLE
start = TIMER
DIM s AS STRING : s = "test string"
DIM sArr(100000) AS STRING
DIM i AS LONG
FOR i = 1 TO 100000
sArr(i) = s
NEXT
DIM endx AS DOUBLE
endx = TIMER
MSGBOX "Current value of X% is: " & STR$(endx-start)
END FUNCTION
Free Basic :
DIM start AS DOUBLE = timer
DIM sArr(100000) as string
DIM s AS STRING : s = "test string"
FOR i as long = 1 TO 100000
sArr(i) = s
NEXT
DIM endx AS DOUBLE = timer
print endx - start
print LEN(s)
SLEEP
I use your CSED_FB
This program simply crush ...???
Use
DIM SHARED sArr(100000) as string
or a variable-length array.
DIM start AS DOUBLE = timer
DIM sArr() as string
REDIM sArr(100000) as string
DIM s AS STRING : s = "test string"
FOR i as long = 1 TO 100000
sArr(i) = s
NEXT
DIM endx AS DOUBLE = timer
print endx - start
Each language does things in a different way. Jumping from one to another everyday it's the best way of never being proficient with any of them.
The best variant to compare the speed of application generated by compilers is to write data intensive, non-OS related activities.
For example, calculation of long equations in the loop, working with big chunk of arrays of numbers and etc. without any code optimisations - i.e. using pure language semantics.
Strings are different story, as C++, PB and FB may differently process string data, so results may vary.
The real fights are: number crunching, accessing and manipulating arrays and matrices.
Coming back to True Basic - yes, I've tried this just because of I'm fan of BASIC language in mind :)
A decade ago, my friend asked my to help with lots of TrueBasic examples from his Theoretical Physics course in university, so I ordered TB Bronze disk to compile and run examples.
Well, this version does not creates the a standalone executable, but uses an external DLL, like VB.
I haven't had a chance to check the exe file, but it seems run faster.
TrueBasic 6 Gold - quote from their web site:
Quote
Platforms: Windows XP, Vista (32- and 64-bit), 7, 8, 8.1, 10
Building on the power and capabilities of Silver Edition, Gold is a complete tool for creating new programs in elegant and easy-to-understand True BASIC. Gold Edition includes more than 2,000 pre-written libraries in both compiled form and original source code. New libraries are included for SQL database use, sockets, PostScript integration, and linking compiled C libraries into your BASIC programs.
A features-loaded Basic.