Recent Posts

Pages: [1] 2 3 ... 10
1
Scripting Languages / Re: Scriptbasic Build Linux
« Last post by John on May 21, 2019, 04:49:21 PM »
For me everything gets created properly except the directory in obj. Using SB-dev-cleanup.
2
Scripting Languages / Re: Scriptbasic Build Linux
« Last post by AIR on May 21, 2019, 04:26:48 PM »
I don't have that issue, the required structure is created for me.
3
Scripting Languages / Re: Scriptbasic Build Linux
« Last post by John on May 20, 2019, 05:28:26 PM »
The only issue with creating a new extension module after running the initial setup is the  bin/mod/obj directory for it needs to be created first. After that, it compiles fine.

No problem, I can continue using this method if I don't want to start over with a fresh build.

Thanks for the  build details!
4
Scripting Languages / Re: Scriptbasic Build Linux
« Last post by AIR on May 20, 2019, 03:55:23 PM »
If you have run the full setup first, then yes.

The reason being that the full setup run generates header files that are needed by modules (like basext.h).  That's why the source tree in git consists mainly of .c files; the headers are generated by the setup script.  An advantage of this approach is that you only need to edit .c files if you want to add something to the core, unless you're introducing a new keyword, in which case you need to modify a couple of other files.  But no header files.

Anyway, so if you already have executed setup by itself, you can then do ./setup --module=testing, for example.

That's the first step I use when creating a new module.  Then I generally nuke everything except the interface.c file.  If you configure that correctly (read the comments in the generated interface.c file) you don't have to mess around with headers, include files (meaning .bas files with the exported functions), the .jim/.jam files, or "make" files since they are all auto-generated for you by the setup script.

Also, as you've seen in a couple of the modules I've built, you can provide .c/.h source files for code you're trying to wrap (slre is an example) and they will be parsed and compiled along with your own module code into the final module library. 


AIR.
5
Scripting Languages / Re: Scriptbasic Build Linux
« Last post by John on May 20, 2019, 02:57:54 PM »
AIR,

Would it be difficult to add creating a bin/mod/obj/(new ext. mod) directory if a ./setup --module=(new ext. mod) is done for the first time?
6
Code Challenges / Re: fibonacci(4784969)
« Last post by John on May 18, 2019, 06:29:19 PM »
Looks good Pete!

Is this written in your BASIC?

Is the BIGINT library like GMP?

How long does it take for the 1 mil digit Fibo?
7
Code Challenges / Re: fibonacci(4784969)
« Last post by petelomax on May 18, 2019, 02:13:29 PM »
Code: Text
  1. include mpfr.e
  2.  
  3. mpz res = NULL, prev, next
  4. integer lastn
  5. atom t0 = time()
  6.  
  7. function fibonampz(integer n) -- resumable, works for -ve numbers, yields mpz
  8. integer absn = abs(n)
  9.     if res=NULL or absn!=abs(lastn)+1 then
  10.         if res=NULL then
  11.             prev = mpz_init(0)
  12.             res = mpz_init(1)
  13.             next = mpz_init()
  14.         else
  15.             if n==lastn then return res end if
  16.         end if
  17.         mpz_fib2_ui(res,prev,absn)
  18.     else
  19.         if lastn<0 and remainder(lastn,2)=0 then
  20.             mpz_mul_si(res,res,-1)
  21.         end if
  22.         mpz_add(next,res,prev)
  23.         {prev,res,next} = {res,next,prev}
  24.     end if
  25.     if n<0 and remainder(n,2)=0 then
  26.         mpz_mul_si(res,res,-1)
  27.     end if
  28.     lastn = n
  29.     return res
  30. end function
  31.  
  32. string s = mpz_get_str(fibonampz(4784969))
  33. integer l = length(s)
  34. s[40..-40] = "..."
  35. ?{l,s}
  36. ?elapsed(time()-t0)
  37.  
8
Scripting Languages / Re: SB π
« Last post by petelomax on May 18, 2019, 01:59:47 PM »
sorry wrong thread
9
Scripting Languages / Re: SB π
« Last post by John on May 03, 2019, 05:41:35 PM »
I was able to compile from the latest IUP source and Gtk3 a release for the Raspberry Pi.

RPi IUP Online Dictionary
10
Scripting Languages / Re: SB π
« Last post by John on April 30, 2019, 08:16:45 PM »
I installed the RTIMULibCal tool which is pretty cool.


pi@RPi3B:~/rpicalc/RTEllipsoidFit $ RTIMULibCal
RTIMULibCal - using RTIMULib.ini
Settings file RTIMULib.ini loaded
Using fusion algorithm RTQF
Using min/max compass calibration
Ellipsoid compass calibration not in use
Accel calibration not in use
LSM9DS1 init complete

Options are:

  m - calibrate magnetometer with min/max
  e - calibrate magnetometer with ellipsoid (do min/max first)
  a - calibrate accelerometers
  x - exit

Enter option: m

Magnetometer min/max calibration
--------------------------------
Waggle the IMU chip around, ensuring that all six axes
(+x, -x, +y, -y and +z, -z) go through their extrema.
When all extrema have been achieved, enter 's' to save, 'r' to reset
or 'x' to abort and discard the data.

Press any key to start...


Min x: 1000.00  min y: 1000.00  min z: 1000.00
Max x: -1000.00  max y: -1000.00  max z: -1000.00
Pages: [1] 2 3 ... 10