Recent Posts

Pages: [1] 2 3 ... 10
Toolbox / LibUI Multi-Platform GUI&Gfx Library
« Last post by Mike Lobanovsky on August 11, 2019, 03:40:26 PM »
LibUI that Armando once pointed me to so generously has just now entered its late alpha stage and is more or less ready for deployment on the three major 64-bit platforms -- Windows, macOS, and GUI Linuxes.

Recent 14 days have been fun for me coding on 3 platforms simultaneously building LibUI shared libraries with VS2013, LLVM/Clang, and gcc, respectively. MSVC was a breeze, Clang more or less so too, while gcc proved "the great offender" with its default -fPIC setting that compiles every console executable into funny shared objects unless given an explicit -no-pic command line parameter. ;D

The libraries turned out to be pretty little thingies about 350KB large on all the platforms, which kept all my test executables linked against them down to mere 15 thru 25KB. The libraries already offer a unified and pretty decent set of common controls (buttons, checkboxes, option buttons, labels, frames, single line and multiline textboxes, combo- and listboxes, tab controls, progress bars, up-down spinners, trackbars, etc.) They also feature most common dialogs: open/save file dialogs, color pickers, font choosers, info and error message boxes, and date-time pickers. They also offer rich text boxes and anti-aliased canvases for drawing using Direct2D under Windows, and OpenGL, under macOS and Linux. All the controls utilize the platforms' native GUI frameworks to ensure excellent and rich look and feel of user app GUIs. More controls will be added in the future.

While the libraries themselves were compiled using the best of the best compilers on all the platforms (nearly 3/4 of the code is written in C++/ObjC), my main concern was to mate them with my 64-bit machine code compiler that doesn't support OOP and can only communicate with the libraries through an ANSI C interface. And much to my surprise, I succeeded!

What you are seeing below are test cases using LibUI shared libraries in the most critical mode of my compiler's operation: just-in-time compilation. If it's capable of doing that, it will sure be able to compile statically to executable files as well.

So as you understand, there's just one more part missing from that stack to assemble a decent multiplatform 64-bit alternative to PowerBASIC, which is a DDT PB-compatible lexer. :D

(Okay okay, keep quiet, I am still a (re)tired language developer... ;))
Scripting Languages / Re: HASH Extension Module
« Last post by John on August 02, 2019, 10:20:05 AM »
As things stand ScriptBasic is in last place with the English insane Dictionary anagram challenge.

Our only hope to save face is getting the HASH extension module to work.

it dies reading 7901 keys from the built hash of 10,000.

This may be a case of HASH not recognizing the end of the iteration.

Scripting Languages / HASH Extension Module
« Last post by John on July 28, 2019, 09:51:18 PM »

I'm trying to get the hash extension to work for the anagram challenge on the RPi forum. It doesn't seem to be working as expected and I'm getting a seg fault.

Code: Script BASIC
  1. INCLUDE hash.bas
  3. hh = HASH::New()
  5. flen = FILELEN("tail.dat")
  6. OPEN "tail.dat" FOR INPUT AS #1
  7. fraw = INPUT(flen, 1)
  8. SPLITA fraw BY "\n" TO wordlist
  9. CLOSE(1)
  11. FOR lstidx = 0 TO UBOUND(wordlist)
  12.   SPLITA wordlist[lstidx] BY "" TO wordarray
  13.   FOR wrdidx = 0 TO UBOUND(wordarray)
  14.     IF wordarray[wrdidx] < "a" OR wordarray[wrdidx] > "z" THEN GOTO NextWord
  15.   NEXT
  16.   SPLITA wordlist[lstidx] BY "" TO thisword
  18.   FOR i = 0 TO UBOUND(thisword)
  19.     FOR j = i + 1 TO UBOUND(thisword)
  20.       IF thisword[i] > thisword[j] THEN
  21.         temp = thisword[i]
  22.         thisword[i] = thisword[j]
  23.         thisword[j] = temp
  24.       END IF
  25.     NEXT
  26.   NEXT
  27.   FOR x = 0 TO UBOUND(thisword)
  28.     sortword &= thisword[x]
  29.   NEXT
  30.   IF HASH::Exists(hh, sortword) = undef THEN
  31. ' IF anagram{sortword} = undef THEN
  32. '   anagram{sortword} = wordlist[lstidx] & ":"
  33.    HASH::SetValue hh, sortword, wordlist[lstidx] & ":"
  34.   ELSE
  35. '   anagram{sortword} &= " " & wordlist[lstidx] & ","
  36.    strdta = HASH::Value(hh, sortword)
  37.     HASH::SetValue(hh, sortword, strdta & " " & wordlist[lstidx] & ",")
  38.   END IF
  39.   sortword = ""
  40. NextWord:
  41. NEXT
  43. HASH::Start hh
  44. NextKey:
  45. HASH::Next(hh)
  46. ' thiskey = HASH::ThisKey(hh)
  47. thisana = HASH::ThisValue(hh)
  48. IF thisana = undef THEN GOTO Done
  49. ' PRINT thisana,"\n"
  50. IF RIGHT(thisana, 1) = "," THEN
  51.   PRINT LEFT(thisana, LEN(thisana) - 1), "\n"
  52. END IF
  53. GOTO NextKey
  55. Done:
  57. HASH::Release hh

Attached is the tail for the British Insane Dictionary. (last 10,000 words)

HERE is what I'm trying to reproduce but using the HASH module rather than an associative array.

Translators / Re: MBC
« Last post by jack on July 21, 2019, 03:57:48 AM »
hello AIR  :)
I do most of my hobby programming on macOS and I am very interested in MBC, unfortunately I seem to be missing some headers, for starters I am missing col.h
can you help me with that?
Translators / Re: MBC
« Last post by John on July 20, 2019, 08:17:27 AM »
Hi Mike,

Always good to hear from you and hope you're doing well.

I just wanted to thank you again for working with Peter Verhas and getting its license issues worked out.
Translators / Re: MBC
« Last post by Mike Lobanovsky on July 20, 2019, 12:07:06 AM »
Hi Armando,

Since v9.3.0, James Fuller's bc9 goes, with Kevin Diggins' blessings, under a MIT license.

Do you think you could be interested in doing the same for your MBC port while the man is still around?
Scripting Languages / Re: SB π
« Last post by John on July 19, 2019, 01:23:51 PM »
Good News[

Peter Verhas has joined us on the RPi forum.

What is your thoughts about changing the name of setup to something like mksb?
Code Challenges / Re: fibonacci(4784969)
« Last post by John on July 12, 2019, 07:13:11 PM »
undef is a variable type in SB.

The UNDEF statement will free any resources to the var(s) and set the var type to undef.

Making all the variables in the function LOCAL didn't help.
Code Challenges / Re: fibonacci(4784969)
« Last post by AIR on July 12, 2019, 06:56:43 PM »
According to the docs, if you undef an array the memory allocated to it is freed.
Does the same apply to strings?
If so, maybe undef'ing the SB variables after printing the value of 'b' would address the leak that's occurring when you run the fibo example in an endless loop.
Code Challenges / Re: fibonacci(4784969)
« Last post by John on July 09, 2019, 10:59:58 PM »
That's good enough for me.
Pages: [1] 2 3 ... 10