Author Topic: ScriptBasic 3.0 Open Items  (Read 36848 times)

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
ScriptBasic 3.0 Open Items
« on: August 13, 2010, 09:20:46 PM »
Here is a list of tasks for the 3.0 release. If you have some time to contribute to the ScriptBasic project, your efforts will count in a big way towards making ScriptBasic an industry standard scripting language.

  • Finish mini-XML extension module
  • Finish make build system
  • Create ScriptBasic program to parse the C source and generate current HTML docs
  • Finish math functions in the core interpreter that are now non-functioning stub C functions (Tom and Armando are looking into this.)
  • Finish remote debugger preprocessor
  • Create IDE/Debugger with new GUI extension module
  • Create Windows install for binary only distribution
  • Migrate new make build system to Linux and OS X
  • Create distributions for all major platforms
  • Add Rlib reporting engine as a ScriptBasic extension module. (John is working on this with a prototype done with GTK-Server as a POC)


If any of the above items are within your skill level and you're able to help with the project, please respond with what task you would like to work on.
« Last Edit: December 07, 2010, 09:02:04 PM by support »

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: ScriptBasic 3.0 Open Items
« Reply #1 on: August 17, 2010, 01:28:26 AM »
To get the ball rolling towards a 3.0 release, I'll take on the task of generating the HTML documentation from the C source files. This was done by a Perl script in the 2.1 version and will now be done with a ScriptBasic (scriba) script.

Don't be shy, select a task from the above list and help the ScriptBasic open source project along.


dons333

  • Guest
Re: ScriptBasic 3.0 Open Items
« Reply #2 on: November 04, 2010, 01:13:31 PM »
I'm interested in Scriptbasic. I cut my teeth on BASIC back in the 80's. I would love to be able to help some, but I'm afriad my programming skills are remedial with regards to the help you require.


mesbas

  • Guest
Re: ScriptBasic 3.0 Open Items
« Reply #3 on: December 07, 2010, 12:05:19 PM »
 ::) Don't give up yet!

I'd like to help out a little, if I can.

I was looking at the Reserved Word List and noticed a bunch of "Not Implemented" functions at the end.

Some look pretty simple. Most are pretty ambitious projects.

The CVI function, on the surface, looks pretty simple.
But a 2 byte return assumes either unsigned short with a range of 0 - 65535 or a signed short with a range of (-32768) - 32767.
Which one of those is correct?
Same for CVD, CVL and CVS.
 
The MKI function really has me stumped.  Does (2 byte) in the description refer to the argument or the answer?
I assume it means convert a signed or unsigned integer to a string of whatever length is required.

I'll look at the source to see if I understand the way existing things are handled.

Tom

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: ScriptBasic 3.0 Open Items
« Reply #4 on: December 07, 2010, 12:20:48 PM »
Thanks Tom!

I have been wanting to get the stub functions going since 2006. That is so cool you're chipping away at the 3.0 task list. I will be happy to test and document (best if done in C source so I can auto generate) your contributions and get them included in the distribution.

I'll send Armando an  e-mail and see if he can comment on your questions.

« Last Edit: December 07, 2010, 12:33:34 PM by support »

Airr

  • Guest
Re: ScriptBasic 3.0 Open Items
« Reply #5 on: December 07, 2010, 06:29:42 PM »
Not sure how Peter originally envisioned these, but I can tell you how it's set in MBC/BCX/etc (hope you don't mind).

CVI - signed short return value

MKI - signed short parameter, 2-byte fixed length string return value.

Even though it's old and not C, you might want to look at This Old MS KB Article for some tips.

Writing those functions is really simple; we use memmove in place of the hmemcpy Microsoft suggests in the article, and of course C instead of VB for the actual functions....

A.

mesbas

  • Guest
Re: ScriptBasic 3.0 Open Items
« Reply #6 on: December 08, 2010, 07:08:21 AM »
I can see returning a signed short for the CVI.
The argument string will have to be between "-32768" and "32767".
Those are the min and max for a signed short.

Going back using MKI can't be limited to a 2 byte return value.
How do you represent the number 32767 as a 2 byte string?
A 2 byte string could only contain numbers from -9 to 99.

Maybe I'm a little confused, how can you stuff a 5 character string into a 2 character container.

Tom

PS

OK, OK, OK
I got it now!!!

The MKI function and the CVI function are compliments to each other.
The 2 byte string created by MKI is a representation of the number, and not meant to be readable by a human.

I see the light!!  Thank you Airr.
« Last Edit: December 08, 2010, 07:27:29 AM by mesbas »

mesbas

  • Guest
Re: ScriptBasic 3.0 Open Items
« Reply #7 on: December 31, 2010, 08:19:51 AM »
Something to ponder after we ring in the new year.

Regarding the, yet to be implemented, TAN() function:
This function historically gives you the tangent of an angle measured in radians.
   Eg:  tangent = TAN(radians)

Since most angles are measured in degrees, another function is needed to convert degrees to radians.
   Eg:  radians = RAD(degrees)

So……  We can either change the definition and functionality of our TAN() function, to accept degrees directly, or add a new RAD() function.

If we change the TAN() function to use degrees directly, what happens to those folks that only have the radians value?  Do we add another function to convert radians to degrees?

My vote is to create the new RAD() function.
I,m not a mathematician so guidance is requested.

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: ScriptBasic 3.0 Open Items
« Reply #8 on: December 31, 2010, 12:06:49 PM »
Quote from: Tom
My vote is to create the new RAD() function.

+1


mesbas

  • Guest
Re: ScriptBasic 3.0 Open Items
« Reply #9 on: January 03, 2011, 04:35:15 AM »
I created the new RAD() function.
I also implemented 11 of the unimplemented math functions.
How do I submit the code for testing?

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: ScriptBasic 3.0 Open Items
« Reply #10 on: January 03, 2011, 03:07:53 PM »
That's great news Tom!

Do you have any SB script(s) you used to test this with?

Can you post (as an attachment) the files you changed and any notes you wish to share?

I would be happy to test and create a new Ubuntu build for testing. If your doing this on Windows, creating a scriba.exe for folks to test with would be great.

I'm in the process of setting up a developers site only that will give us online source editing, FTP, MySQL DB, console mode access and source control options. (level of access will increase as one becomes more involved in the project)

John
« Last Edit: January 03, 2011, 05:52:50 PM by support »

mesbas

  • Guest
Re: ScriptBasic 3.0 Open Items
« Reply #11 on: January 07, 2011, 01:42:43 PM »
Sorry! I don't do windows development.
I'm still trying to get cygwin working on my windows 7 box, but it's really not a priority.

I've attached the 4 files that were modified.
They're big files, that developers site or diff files for patching, would be easier ways to go.

Put notimp.h, syntax.h and syntax.def into the scriptbasic directory.
Put mathfunc.c into the scriptbasic/commands directory.
I only modified the base files, so syntaxer.pl has to be run to create syntax.c and notimp.c.
After that, from the source directory of an already installed and working scriptbasic, I only do:
    make clean
    make
    ./install.sh

I'm doing this on Fedora release 14 running kernel 2.6.35 on an x86_64 processor.
Depending on your OS or something else, you may have to do it differently.

mesbas

  • Guest
Re: ScriptBasic 3.0 Open Items
« Reply #12 on: January 07, 2011, 01:48:12 PM »
Because of the 4 file attachment limit, the SB test program is included here.

Everything works fine for me.  I was able to compile the test program into an executable.

This is a first for me, so lets hope there arn't many problems.

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: ScriptBasic 3.0 Open Items
« Reply #13 on: January 07, 2011, 04:06:11 PM »
Thanks Tom for the help with ScriptBasic. I understand your reluctance to invest any time with Windows. I have only visited my Windows XP partition twice in the last few months. It becomes obvious that Windows is a bloated kludge with more layers than an onion. Linux just works and I'm not always pulling out my wallet to upgrade a package or pay for another year of subscription services. I hope Microsoft wakes up to the fact that their screwed knowing that people have an option outside their monopoly. I posted your MathTest script so others can get an idea what your enhancements bring to the table. My plan over the next month or so is to put in place a solid source control system. I'm still looking at all the options. I don't want to do this more than once.

Code: [Select]
'
' Given the starting value of 34 degrees, calculate radians.
' Given the radian value, calculate TAN, COTAN, SECANT and COSECANT.
' Given the TAN, COTAN, SECANT and COSECANT values,
' calculate the ATAN, ACTAN, ASECANT and ACOSECANT.
'
degval = 34
radval = RAD(degval)
zerval = 0

tanval = TAN(radval)
cotval = COTAN(radval)
secval = SECANT(radval)
cseval = COSECANT(radval)

ataval = ATAN(tanval)
actval = ACTAN(cotval)
aseval = ASECANT(secval)
acoval = ACOSECANT(cseval)

hsinv = HSIN(radval)
hcosv = HCOS(radval)
htanv = HTAN(radval)
hsecv = HSECANT(radval)
hcosc = HCOSECANT(radval)
hcotv = HCTAN(radval)

print "\nThe following 8 functions accept radians as their argument, so we "
print "use the\nnew RAD() function to convert ",degval," degrees to ",radval," (",str$(radval),") radians.\n\n"

print "Tangent\t\tCotangent\tSecant\t\tCosecant\n"
print "TAN()  \t\tCOTAN()  \tSECANT()    \tCOSECANT()\n"
print tanval," \t",cotval,"\t",secval," \t",cseval,"\n"
print str$(tanval)," \t",str$(cotval)," \t",str$(secval)," \t",str$(cseval),"\n\n"

print "Arctangent\tArccotangent\tArcsecant\tArccosecant\n"
print "ATAN()    \tACTAN()  \tASECANT()\tACOSECANT()\n"
print ataval," \t",actval," \t",aseval," \t",acoval,"\n"
print str$(ataval)," \t",str$(actval)," \t",str$(aseval)," \t",str$(acoval),"\n\n"

print "There are 6 Hyperbolic functions. They also accept radian arguments.\n\n"
print "H-Sine\t\tH-Cosine\tH-Tangent\n"
print "HSIN()\t\tHCOS()  \tHTAN()\n"
print hsinv," \t",hcosv," \t",htanv,"\n"
print str$(hsinv)," \t",str$(hcosv)," \t",str$(htanv),"\n\n"

print "H-Secant\tH-Cosecant\tH-Cotangent\n"
print "HSECANT()\tHCOSECANT()\tHCTAN()\n"
print hsecv," \t",hcosc," \t",hcotv,"\n"
print str$(hsecv)," \t",str$(hcosc)," \t",str$(hcotv),"\n\n"

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: ScriptBasic 3.0 Open Items
« Reply #14 on: January 08, 2011, 02:09:47 AM »
Tom,

Scriba is giving me a segmentation fault with any script I run. I followed your instructions in your post.

Is there any chance you use something 64 bit specific? (running Ubuntu 32 bit here)

I'm able to get the command line options if I don't pass a script and -D and -v both work. I didn't see any warnings or errors with the make.

John

Code: [Select]
root@Laptop:/usr/src/scriptbasic# perl syntaxer.pl
root@Laptop:/usr/src/scriptbasic# make clean
rm -rf bin/exe/*
rm -rf bin/include/*
rm -rf bin/lib/*
rm -rf bin/make/*
rm -rf bin/obj/*
rm -rf bin/var/*
root@Laptop:/usr/src/scriptbasic# make
gcc  -w -c -o bin/obj/basext.o basext.c
gcc  -w -c -o bin/obj/builder.o builder.c
gcc  -w -c -o bin/obj/buildnum.o buildnum.c
gcc  -w -c -o bin/obj/confpile.o confpile.c
gcc  -w -c -o bin/obj/conftree.o conftree.c
gcc  -w -c -o bin/obj/dynlolib.o dynlolib.c
gcc  -w -c -o bin/obj/epreproc.o epreproc.c
gcc  -w -c -o bin/obj/errcodes.o errcodes.c
gcc  -w -c -o bin/obj/execute.o execute.c
gcc  -w -c -o bin/obj/expression.o expression.c
gcc  -w -c -o bin/obj/filesys.o filesys.c
gcc  -w -c -o bin/obj/getopt.o getopt.c
gcc  -w -c -o bin/obj/hndlptr.o hndlptr.c
gcc  -w -c -o bin/obj/hookers.o hookers.c
gcc  -w -c -o bin/obj/httpd.o httpd.c
gcc  -w -c -o bin/obj/ipreproc.o ipreproc.c
gcc  -w -c -o bin/obj/lexer.o lexer.c
gcc  -w -c -o bin/obj/logger.o logger.c
gcc  -w -c -o bin/obj/lsp.o lsp.c
gcc  -w -c -o bin/obj/match.o match.c
gcc  -w -c -o bin/obj/memory.o memory.c
gcc  -w -c -o bin/obj/modumana.o modumana.c
gcc  -w -c -o bin/obj/myalloc.o myalloc.c
gcc  -w -c -o bin/obj/mygmtime.o mygmtime.c
gcc  -w -c -o bin/obj/options.o options.c
gcc  -w -c -o bin/obj/reader.o reader.c
gcc  -w -c -o bin/obj/report.o report.c
gcc  -w -c -o bin/obj/scriba.o scriba.c
gcc  -w -c -o bin/obj/sym.o sym.c
gcc  -w -c -o bin/obj/syntax.o syntax.c
gcc  -w -c -o bin/obj/thread.o thread.c
gcc  -w -c -o bin/obj/uniqfnam.o uniqfnam.c
gcc  -w -c -o bin/obj/md5.o md5.c
gcc  -w -c -o bin/obj/environ.o commands/environ.c
gcc  -w -c -o bin/obj/external.o commands/external.c
gcc  -w -c -o bin/obj/extops.o commands/extops.c
gcc  -w -c -o bin/obj/file.o commands/file.c
gcc  -w -c -o bin/obj/function.o commands/function.c
gcc  -w -c -o bin/obj/goto.o commands/goto.c
gcc  -w -c -o bin/obj/if.o commands/if.c
gcc  -w -c -o bin/obj/let.o commands/let.c
gcc  -w -c -o bin/obj/mathfunc.o commands/mathfunc.c
gcc  -w -c -o bin/obj/mathops.o commands/mathops.c
gcc  -w -c -o bin/obj/print.o commands/print.c
gcc  -w -c -o bin/obj/string.o commands/string.c
gcc  -w -c -o bin/obj/time.o commands/time.c
gcc  -w -c -o bin/obj/while.o commands/while.c
ar -r bin/lib/lscriba.a  bin/obj/basext.o bin/obj/builder.o bin/obj/buildnum.o bin/obj/confpile.o bin/obj/conftree.o bin/obj/dynlolib.o bin/obj/epreproc.o bin/obj/errcodes.o bin/obj/execute.o bin/obj/expression.o bin/obj/filesys.o bin/obj/getopt.o bin/obj/hndlptr.o bin/obj/hookers.o bin/obj/httpd.o bin/obj/ipreproc.o bin/obj/lexer.o bin/obj/logger.o bin/obj/lsp.o bin/obj/match.o bin/obj/memory.o bin/obj/modumana.o bin/obj/myalloc.o bin/obj/mygmtime.o bin/obj/options.o  bin/obj/reader.o bin/obj/report.o bin/obj/scriba.o bin/obj/sym.o bin/obj/syntax.o bin/obj/thread.o bin/obj/uniqfnam.o bin/obj/md5.o bin/obj/environ.o bin/obj/external.o bin/obj/extops.o bin/obj/file.o bin/obj/function.o bin/obj/goto.o bin/obj/if.o bin/obj/let.o bin/obj/mathfunc.o bin/obj/mathops.o bin/obj/print.o bin/obj/string.o bin/obj/time.o bin/obj/while.o
ar: creating bin/lib/lscriba.a
mkdir bin/var/standard || echo
gcc  -w -c -o bin/var/standard/scribacmd.o variations/standard/scribacmd.c
gcc  -w -c -o bin/obj/lmt_none.o lmt_none.c
gcc  -w -o bin/exe/scriba bin/var/standard/scribacmd.o bin/obj/lmt_none.o bin/lib/lscriba.a -lc -lm -ldl -lpthread
bin/exe/scriba -v
ScriptBasic v2.1
Variation >>STANDARD<< build 1
Magic value 859002424
Node size is 16
Extension interface version is 11
Compilation: Jan  8 2011 02:01:00
mkdir bin/var/httpd || echo
gcc  -w -c -o bin/var/httpd/websrv.o variations/httpd/websrv.c
mkdir bin/var/httpd || echo
mkdir: cannot create directory `bin/var/httpd': File exists

gcc  -w -c -o bin/var/httpd/service.o variations/httpd/service.c
gcc  -w -o bin/exe/sbhttpd bin/var/httpd/websrv.o bin/var/httpd/service.o bin/obj/lmt_none.o bin/lib/lscriba.a -lc -lm -ldl -lpthread
gcc  -w -c -o bin/obj/stndlone.o stndlone.c
ar -r bin/lib/libscriba.a  bin/obj/basext.o bin/obj/builder.o bin/obj/buildnum.o bin/obj/confpile.o bin/obj/conftree.o bin/obj/dynlolib.o bin/obj/epreproc.o bin/obj/errcodes.o bin/obj/execute.o bin/obj/expression.o bin/obj/filesys.o bin/obj/getopt.o bin/obj/hndlptr.o bin/obj/hookers.o bin/obj/httpd.o bin/obj/ipreproc.o bin/obj/lexer.o bin/obj/logger.o bin/obj/lsp.o bin/obj/match.o bin/obj/memory.o bin/obj/modumana.o bin/obj/myalloc.o bin/obj/mygmtime.o bin/obj/options.o  bin/obj/reader.o bin/obj/report.o bin/obj/scriba.o bin/obj/sym.o bin/obj/syntax.o bin/obj/thread.o bin/obj/uniqfnam.o bin/obj/md5.o bin/obj/environ.o bin/obj/external.o bin/obj/extops.o bin/obj/file.o bin/obj/function.o bin/obj/goto.o bin/obj/if.o bin/obj/let.o bin/obj/mathfunc.o bin/obj/mathops.o bin/obj/print.o bin/obj/string.o bin/obj/time.o bin/obj/while.o bin/obj/stndlone.o
ar: creating bin/lib/libscriba.a
ld -shared -o bin/lib/libscriba.so  bin/obj/basext.o bin/obj/builder.o bin/obj/buildnum.o bin/obj/confpile.o bin/obj/conftree.o bin/obj/dynlolib.o bin/obj/epreproc.o bin/obj/errcodes.o bin/obj/execute.o bin/obj/expression.o bin/obj/filesys.o bin/obj/getopt.o bin/obj/hndlptr.o bin/obj/hookers.o bin/obj/httpd.o bin/obj/ipreproc.o bin/obj/lexer.o bin/obj/logger.o bin/obj/lsp.o bin/obj/match.o bin/obj/memory.o bin/obj/modumana.o bin/obj/myalloc.o bin/obj/mygmtime.o bin/obj/options.o  bin/obj/reader.o bin/obj/report.o bin/obj/scriba.o bin/obj/sym.o bin/obj/syntax.o bin/obj/thread.o bin/obj/uniqfnam.o bin/obj/md5.o bin/obj/environ.o bin/obj/external.o bin/obj/extops.o bin/obj/file.o bin/obj/function.o bin/obj/goto.o bin/obj/if.o bin/obj/let.o bin/obj/mathfunc.o bin/obj/mathops.o bin/obj/print.o bin/obj/string.o bin/obj/time.o bin/obj/while.o bin/obj/lmt_none.o -lc -lm -ldl -lpthread
root@Laptop:/usr/src/scriptbasic# cd bin/exe
root@Laptop:/usr/src/scriptbasic/bin/exe# ls -l
total 1020
-rwxr-xr-x 1 root jrs 529394 2011-01-08 02:01 sbhttpd
-rwxr-xr-x 1 root jrs 507943 2011-01-08 02:01 scriba
root@Laptop:/usr/src/scriptbasic/bin/exe# mv /usr/bin/scriba /usr/bin/scriba-2.1
root@Laptop:/usr/src/scriptbasic/bin/exe# mv /usr/bin/sbhttpd /usr/bin/sbhttpd-2.1
root@Laptop:/usr/src/scriptbasic/bin/exe# cp scriba /usr/bin
root@Laptop:/usr/src/scriptbasic/bin/exe# cp sbhttpd /usr/bin
root@Laptop:/usr/src/scriptbasic/bin/exe# exit
logout
jrs@Laptop:~$ cd SB/test
jrs@Laptop:~/SB/test$ scriba -v
ScriptBasic v2.1
Variation >>STANDARD<< build 1
Magic value 859002424
Node size is 16
Extension interface version is 11
Compilation: Jan  8 2011 02:01:00
jrs@Laptop:~/SB/test$ scriba MathTest.bas
Segmentation fault
jrs@Laptop:~/SB/test$
« Last Edit: January 08, 2011, 02:35:19 AM by support »