Author Topic: Lisp in Basic  (Read 208008 times)

0 Members and 1 Guest are viewing this topic.

JRS

  • Guest
Re: Lisp in Basic
« Reply #45 on: August 01, 2014, 12:41:20 PM »
Hi Mike,

The point I was trying to make was we don't have to use a FOR/NEXT to initialize all dimensions of an array and that array structures are dynamic and free form and hold any type of data or a reference to another array. You are absolutely correct that SB arrays are NOT C standard arrays and can't be accessed in the traditional way. What we have as a helper is the SPLITA/SPLITAQ functions as a C way of initializing arrays structures quickly.

You will see that SB takes the side of ease of use and interpreter intelligence over optimal performance. 10 years ago when we were running on single cores and sub ghz speeds, the difference may have been detectable.

OT - I just looked at Rene's GUI under Win8 and it looks like Microsoft is going back to its Win2K roots. :-(
« Last Edit: August 01, 2014, 01:58:42 PM by John »

JRS

  • Guest
Re: Lisp in Basic
« Reply #46 on: August 01, 2014, 03:56:18 PM »
Quote from: Mike
BTW what will be the timing to split a string of 1Mln+1 bytes? This last benchmark doesn't correlate well with the preceding ones.

In the last example, the primary dimension is only 1001 elements and was pre-built unsing SPLITA. This was unneeded as the FOR/NEXT could build the index on the fly and add the b mixed array once the element was created to proved the second dimension.

Code: [Select]
b[0] = 0
b[1] = 1.23
b[2] = "ABC"

FOR x = 0 to 1000
  a[x] = b
NEXT

PRINT UBOUND(a),"\n"
PRINT UBOUND(a[500]),"\n"

PRINT a[10,0],"\n"
PRINT FORMAT("%g",a[100,1]),"\n"
PRINT a[1000,2],"\n"

jrs@laptop:~/sb/sb22/sblisp$ time scriba dim.sb
1000
2
0
1.23
ABC

real   0m0.011s
user   0m0.008s
sys   0m0.004s
jrs@laptop:~/sb/sb22/sblisp$

Here is the same code with the SPLITA used to per-inialize the a array.

jrs@laptop:~/sb/sb22/sblisp$ time scriba dim.sb
1000
2
0
1.23
ABC

real   0m0.007s
user   0m0.000s
sys   0m0.004s
jrs@laptop:~/sb/sb22/sblisp$
 

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #47 on: August 01, 2014, 07:55:50 PM »
[OT]

Why, it's a rather nice attempt to create a functional GUI set in an OpenGL environment. Windows (and Linux, for that matter) forms and common controls are non-existent within the OGL canvas. Each interactive OGL application has to create its own HUD's (Head-Up Displays) to compensate for that missing functionality.

It's pretty much the same as what Charles is doing in his O2 Controls and Control Panels effort. And Rene's ideas of consistency with the Windows environment he's working in are not bad at all. It's another question if Windows 8(.1) GUI is suitable for a desktop PC at all tho.

[/OT]

JRS

  • Guest
Re: Lisp in Basic
« Reply #48 on: August 01, 2014, 08:10:28 PM »
OT

I missed that Rene's UI was OpenGL (TBGL) and was detracted by how ugly the Windows 8.x UI looks. I'm in no hurry to go there. Who knows were PC's will end up in the food chain. Personally most of my development efforts are in business web applications. The cloud providers like Amazon are proving the server room hardware so trying to make a buck these days as a VAR is challenging.



 
« Last Edit: August 01, 2014, 08:32:17 PM by John »

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #49 on: August 01, 2014, 08:44:01 PM »
[OT CTD.]

I'm pretty sure desktops are going to hold on for quite some time. IMO it's more a question of how much more of their most common human tasks all these newer and simpler handheld gadgets and gimmiks are going to be able to mimic. It's going to be sorta eternal, like television vs. computer.

Sure if there were any choice, Win 8's Metro theme would be the last one on my mind to select for my everyday use. It looks like one more of those enhanced contrast options for handicapped users to me. Or else signifies serious handicaps in the minds of MS design department staff.

[/OT]

JRS

  • Guest
Re: Lisp in Basic
« Reply #50 on: August 01, 2014, 11:10:56 PM »
Mike,

Any progress to report with SBLisp?

Is there anything I can do to help?

I created a Bitbucket repository for the SBLisp project and added you as a contributor and gave you write privileges.

John

« Last Edit: August 01, 2014, 11:56:18 PM by John »

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #51 on: August 02, 2014, 11:16:56 AM »
Thanks John.

I've fixed one more problem in Lisp print (QB45's Str$() has weird formatting for non-negative numbers), and I've also added DoLss (it was indeed a matter of changing > to <). I haven't found anything else of interest yet. But I think I've seen a recursive GoSub somewhere and I think this may cause all sorts of headaches for SB. I lost the exact spot however and can't find it again easily 'cause of all this medieval bloat in the original code.

P.S. 10:00 a.m.; Sat Aug 2, 2014; Minsk

.
« Last Edit: August 02, 2014, 11:43:26 AM by Mike Lobanovsky »

Charles Pegge

  • Guest
Re: Lisp in Basic
« Reply #52 on: August 02, 2014, 11:45:12 AM »
Refuge


Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #53 on: August 02, 2014, 12:06:19 PM »
!!! Shelter !!!

Seems like we're changing from Potato Land into Banana Land. And yes, our skins and hair are getting darker too.

:D :D :D

JRS

  • Guest
Re: Lisp in Basic
« Reply #54 on: August 02, 2014, 12:11:46 PM »
Quote from: Mike
I've fixed one more problem in Lisp print (QB45's Str$() has weird formatting for non-negative numbers), and I've also added DoLss (it was indeed a matter of changing > to <). I haven't found anything else of interest yet. But I think I've seen a recursive GoSub somewhere and I think this may cause all sorts of headaches for SB. I lost the exact spot however and can't find it again easily 'cause of all this medieval bloat in the original code.

Thanks for the update Mike!

Is SBLisp able to evaluate an expression yet?

The level of recursion in SB can be 0 = (until you run out of memory) or you can set a max so you don't seg. fault / exception err) and this is part of the SB basic.conf settings. A scriba -D will display to the terminal your current SB compiled configuration settings.
« Last Edit: August 02, 2014, 12:18:36 PM by John »

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #55 on: August 02, 2014, 12:17:09 PM »
No, not yet. It still doesn't recognise numbers correctly and mistakes them for primitives. I'm also seeing that some (but not all) hash codes in the SB table differ from their equivalents in QB45.

We're not dealing with true SB recursion here as these are not true functions. These are just recursive pieces of QB45 code which have their own scope (remember the "p" bug?). I strongly doubt Peter would go that far in his implementation of this ancient BASIC functionality. I certainly didn't. Neither did Charles, to the best of my knowledge. thinBasic doesn't have all this GoTo/GoSub mess at all.

JRS

  • Guest
Re: Lisp in Basic
« Reply #56 on: August 02, 2014, 12:19:54 PM »
That HASH routine seemed suspicious to me.

Have you tried Dave's debugger with SPLisp?


Charles Pegge

  • Guest
Re: Lisp in Basic
« Reply #57 on: August 02, 2014, 12:23:33 PM »

Effective Water cooling: :)


JRS

  • Guest
Re: Lisp in Basic
« Reply #58 on: August 02, 2014, 12:34:57 PM »
I have one of those but powered to circulate the water and rotating disks to smooth your feet. A requirement for under the desk. (wishing it were Milla)  ;D

JRS

  • Guest
Re: Lisp in Basic
« Reply #59 on: August 02, 2014, 12:44:00 PM »
In SB FALSE=0 and TRUE=-1. In QBLisp TRUE=NOT(FALSE).

Might be an issue.