Author Topic: Lisp in Basic  (Read 208252 times)

0 Members and 2 Guests are viewing this topic.

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #375 on: August 12, 2014, 01:32:36 AM »
No, nothing of the sort in Windows' OOTB stock. Perhaps Billy has grown too old and shy to advertise his system timings that easily. :)

I can only throw in a quick FBSL script to shell start the sblisp.exe and time its exit on task completion with GetTickCount(). I'll need about 10 minutes to get the result.

JRS

  • Guest
Re: Lisp in Basic
« Reply #376 on: August 12, 2014, 01:42:32 AM »
I have a free-ware timer (like Linux time) I will send you tomorrow. Bed time, turned into a pumpkin long ago.

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #377 on: August 12, 2014, 01:47:38 AM »
Here you are.

.

JRS

  • Guest
Re: Lisp in Basic
« Reply #378 on: August 12, 2014, 01:53:25 AM »
Can you do the same for FBSL?

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #379 on: August 12, 2014, 02:05:16 AM »
Yes, I can. You can goto bed now. When you wake up, you will see the results you're anticipating. But be forewarned (I'm going to use that figure of speech of yours as often as I can): FBSL has lots of ways to improve on this code. It's me that's pulling it to wait till you catch up. I'm a generous man, you know. :D

Good night!



[UPD] Here you are again, and have sweet dreams! :)

.
« Last Edit: August 12, 2014, 02:31:52 AM by Mike Lobanovsky »

JRS

  • Guest
Re: Lisp in Basic
« Reply #380 on: August 12, 2014, 08:31:04 AM »
Thanks Mike.

Code: [Select]
Calculate percentage difference
between V1 = 13.797 and V2 = 10.734

( | V1 - V2 | / ((V1 + V2)/2) ) * 100

= ( | 13.797 - 10.734 | / ((13.797 + 10.734)/2) ) * 100
= ( | 3.063 | / (24.531/2) ) * 100
= ( 3.063 / 12.2655 ) * 100
= 0.249725 * 100

= 24.9725% difference

Quote
FBSL has lots of ways to improve on this code. It's me that's pulling it to wait till you catch up. I'm a generous man, you know

We both do. That's what makes this project so much fun. Easy to get there and multiple ways of doing it.



Just got a response back from Arthur and will see if he would like to participate with our new effort. He seems interested in what we are doing.
« Last Edit: August 12, 2014, 11:54:28 AM by John »

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #381 on: August 12, 2014, 11:57:14 AM »
Code: [Select]
Calculate percentage difference
between V1 = 13.797 and V2 = 10.734

( | V1 - V2 | / ((V1 + V2)/2) ) * 100

= ( | 13.797 - 10.734 | / ((13.797 + 10.734)/2) ) * 100
= ( | 3.063 | / (24.531/2) ) * 100
= ( 3.063 / 12.2655 ) * 100
= 0.249725 * 100

= 24.9725% difference

You missed your chance for the moment of true glory. I thought you would do it in BASIC LISP. :P

Where's my time app, please?

JRS

  • Guest
Re: Lisp in Basic
« Reply #382 on: August 12, 2014, 12:34:29 PM »
Quote
You missed your chance for the moment of true glory. I thought you would do it in BASIC LISP

Too lazy. Used an online difference tool.


Quote
Where's my time app, please?


.
« Last Edit: August 12, 2014, 01:11:24 PM by John »

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #383 on: August 12, 2014, 02:36:51 PM »
Quote
ptime-10.zip (23.94 kB - downloaded 1 times.)

Well thanks. Looks like a cheap odd job -- been there with my two GetTickCount() scripts already.

Here comes some "free fizz" from my dinner table to yours. This is an exact same thing built around the Windows high res timer and FBSL's 64-bit long integers a.k.a. QUAD's.

Its current accuracy is 1 microsecond (.001 milliseconds). Potential accuracy is .001 nanoseconds, accurate to the last decimal place displayed.

The picture shows the result of calculating the 24th Fibonacci number in FBLisp (Freestyle BASIC Lisp). Grab your calculator and enjoy yet another shining moment of triumph but don't forget to raise a glass to Peter Verhas. :-*

[EDIT] I must have been absolutely drowsy to have "champagne" misspelt so badly... :)
[EDIT2] OMG I misspelled it again! :-[  So "fizz" be it...

.
« Last Edit: August 12, 2014, 11:32:16 PM by Mike Lobanovsky »

JRS

  • Guest
Re: Lisp in Basic
« Reply #384 on: August 12, 2014, 03:54:27 PM »
Here is my run on Ubuntu 64 bit on my Intel® Pentium(R) CPU P6200 @ 2.13GHz × 2 laptop.

Code: [Select]

GC start GC done.
GC start GC done.
46368
(quit)
Bye!

real 1m43.305s
user 1m43.078s
sys 0m0.036s
jrs@laptop:~/sb/sb22/sblisp$

Quote
Grab your calculator and enjoy yet another shining moment of triumph but don't forget to raise a glass to Peter Verhas.

               



Thanks for the Windows process timer.

Quote
FBLisp (Freestyle BASIC Lisp)

I like it!

Should get the FreeBASIC group buzzing.
« Last Edit: August 12, 2014, 05:17:28 PM by John »

JRS

  • Guest
Re: Lisp in Basic
« Reply #385 on: August 12, 2014, 07:38:59 PM »
I thought I would take a shot at converting GOSUB's to SUB's. Well that didn't work out too well. I noticed that within GOSUB's it does GOTO's to other GOSUB's and other things I don't want to talk about. So, it looks like this is the way it is unless someone wants to unravel this. I understand some of these non-standard program flow decisions were made for efficiency and speed and pushed the limits of QB while writing the Lisp interpreter.

I might have a peek at the source of MIT/GNU Scheme and see how it's designed. (core interpreter)

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #386 on: August 12, 2014, 10:24:30 PM »
Quote
Here is my run on Ubuntu 64 bit on my Intel® Pentium(R) CPU P6200 @ 2.13GHz × 2 laptop.
Not bad by the looks of it.

Code: [Select]
real 1m43.305s
user 1m43.078s
sys 0m0.036s
I always wanted to have such a thing in Windows but I couldn't figure out how. MS Windows discloses dozens of statistical parameters relevant to ring 3 (user space) but none relevant to ring 1 (kernel space). So yes, here I envy you and my envy is black. :)

Quote
Should get the FreeBASIC group buzzing.
I don't give a damn about FreeBUZZIC's buzzing. Freestyle BASIC Script Language has been around since June 2001. I am in my own right with the letters F, B, S, and L in this very succession. I've yet to see them trying to register the FB abbreviation against Zuckerberg's  FaceBook, hehe...

Quote
I thought I would take a shot at converting GOSUB's to SUB's.
Hmmm, not sure if you've seen my comments on this issue in the last paragraph of my earlier message here.

JRS

  • Guest
Re: Lisp in Basic
« Reply #387 on: August 12, 2014, 11:43:10 PM »
I'm playing with this at the moment.

Quote
Embeddable Common Lisp (ECL) is a LGPL Common Lisp implementation aimed at producing a small-footprint Lisp system that can be embedded into existing C-based applications. It is able to create stand-alone ELF executables from Common Lisp code and runs on most platforms that support a C compiler.

Because it compiles Common Lisp to C, it also features an FFI system, including support for inline C to be used or generated from Common Lisp. Inline C FFI combined with Common Lisp macros and custom SETF expansions yield a compile-time preprocessor.

http://ecls.sourceforge.net/

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #388 on: August 13, 2014, 12:14:37 AM »
Is there any benchmark data in this page in your browser? I can't see anything there...

JRS

  • Guest
Re: Lisp in Basic
« Reply #389 on: August 13, 2014, 12:34:35 AM »
Looks blank from here as well.

I was able to build ecl from scratch and the test suite which created hundreds of .lsp function libraries. Now I have to figure out how to make all this stuff work.  :o

THIS looks helpful.