Deprecated: Array and string offset access syntax with curly braces is deprecated in /homepages/21/d38531796/htdocs/jose/smfforum/Sources/Subs.php on line 3825
Has anyone tried True Basic compiler ?

Author Topic: Has anyone tried True Basic compiler ?  (Read 6031 times)

0 Members and 1 Guest are viewing this topic.

Offline Raúl Ortega

  • Newbie
  • *
  • Posts: 6
  • User-Rate: +0/-0
Re: Has anyone tried True Basic compiler ?
« Reply #15 on: May 01, 2020, 05:06:58 PM »
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

« Last Edit: May 01, 2020, 05:11:44 PM by Raúl Ortega »

Offline Zlatko Vid

  • Jr. Member
  • **
  • Posts: 63
  • User-Rate: +0/-0
Re: Has anyone tried True Basic compiler ?
« Reply #16 on: May 02, 2020, 11:08:06 AM »
WOW i don't know for this topic.
something is really strange
..i must ty it on Oxygen basic

Quote
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.

Offline Zlatko Vid

  • Jr. Member
  • **
  • Posts: 63
  • User-Rate: +0/-0
Re: Has anyone tried True Basic compiler ?
« Reply #17 on: May 02, 2020, 11:13:48 AM »
Jose..

I get strange error when i tried to compile your code ...
can you tell me why ?

Quote
Error 519 in D:\PBWin\WinAPI\StringSpeed.bas(17:001):  Missing declaration: WAITKEY
  Line 17: WAITKEY$   

on pbwin10

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2487
  • User-Rate: +204/-0
Re: Has anyone tried True Basic compiler ?
« Reply #18 on: May 02, 2020, 04:19:35 PM »
Because it was written for the console compiler. Replace it with a MsgBox if you want.

Offline Zlatko Vid

  • Jr. Member
  • **
  • Posts: 63
  • User-Rate: +0/-0
Re: Has anyone tried True Basic compiler ?
« Reply #19 on: May 03, 2020, 08:18:53 AM »
Ahh i see...ok !

Offline Zlatko Vid

  • Jr. Member
  • **
  • Posts: 63
  • User-Rate: +0/-0
Re: Has anyone tried True Basic compiler ?
« Reply #20 on: May 03, 2020, 08:03:39 PM »
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 ?
« Last Edit: May 03, 2020, 08:14:11 PM by Zlatko Vid »

Offline Zlatko Vid

  • Jr. Member
  • **
  • Posts: 63
  • User-Rate: +0/-0
Re: Has anyone tried True Basic compiler ?
« Reply #21 on: May 03, 2020, 08:31:12 PM »
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:
Code: [Select]
'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 :
Code: [Select]
#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 :

Code: [Select]
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 ...???
« Last Edit: May 03, 2020, 08:42:42 PM by Zlatko Vid »

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2487
  • User-Rate: +204/-0
Re: Has anyone tried True Basic compiler ?
« Reply #22 on: May 04, 2020, 12:56:02 AM »
Use

DIM SHARED sArr(100000) as string

or a variable-length array.

Code: [Select]
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.
« Last Edit: May 04, 2020, 01:19:45 AM by José Roca »

Offline Aslan Babakhanov

  • Newbie
  • *
  • Posts: 25
  • User-Rate: +5/-3
Re: Has anyone tried True Basic compiler ?
« Reply #23 on: February 19, 2021, 12:02:06 PM »
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.