Author Topic: Lisp in Basic  (Read 208091 times)

0 Members and 1 Guest are viewing this topic.

RobbeK

  • Guest
Re: Lisp in Basic
« Reply #930 on: October 06, 2014, 01:14:18 AM »
Hi all,

Found some patterns in the Magic 4² squares.
Code contains a generator and evaluator ,  I first started with 3 filtering mechanisms in the generator and 7 in the evaluator.
Solving the 20922789888000 squares took about 30' -- then I found a way increasing the filters in the generator up to all 10  8)

Written/compiled in GCL  (aka Austin Kyoto Common Lisp)

compiler output :
";; Note: Tail-recursive call of REMOVE* was replaced by iteration."   (the recursive list on list filter - the heart of the code)

Main calculating loop contains a listener, you can close the program at any time.
Use the batch file to run the program ,  Mike's JavaKiller comes with it , it will kill the unneeded javaw.exe on exit.

best Rob (took me a few hours to find the pattern - but it came suddenly  - it's based on a St-Andrew's cross  ;)
enjoy the speed
(you probably will have to "un 7zip" it on your disk before the batch file will find the executables )


.
« Last Edit: October 06, 2014, 01:45:12 AM by RobbeK »

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #931 on: October 06, 2014, 12:01:55 PM »
Thanks Rob,

Your program works very smoothly and does 7040 squares in exactly 33 seconds on my PC. Your tiny oxyblaster also does its merciless work flawlessly. (you could've compiled it completely standalone too btw)

:)

RobbeK

  • Guest
Re: Lisp in Basic
« Reply #932 on: October 10, 2014, 01:13:22 PM »
Hi Mike,

thanks,   those number patterns are much more difficult to code than fractals -- sadly, less spectacular  :(

Started studying more deeply Haskell,  -- another λ language  .. rather fascinating :
no iteration at all
completely "profound" lazy   (i think i found a soulmate  8)   )
but, very compact ...    translated a few things from Lisp / Scheme :

the single recursive fibo

fibo (a,b,0) = a
fibo (a,b,i)= fibo(b,a+b,i-1)

fib (x) = fibo(1,1,x)

----------------------------------------

working with lists it splits the list in the car and cdr as (x:xs)  --- list defined by using brackets

fact [1] = 1
fact (x:xs) = x*fact(xs)

----------------------------------------

defining mapping is very easy :  (named mmap, it already has map of course)

mmap f [] = []
mmap f (x:xs) = f x : mmap f xs

in the REPL

*Main> mmap (/ 2) [1..5]
[0.5,1.0,1.5,2.0,2.5]

well, interesting ...

consing is done by   ":"   p.e. 0 : [1,2]        -> [0,1,2]           (same as (cons 0 (list 1 2))         )


best Rob
« Last Edit: October 10, 2014, 02:00:46 PM by RobbeK »

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #933 on: October 10, 2014, 02:08:46 PM »
Rob,

Have you ever tried Brainf*ck, I wonder? :D

RobbeK

  • Guest
Re: Lisp in Basic
« Reply #934 on: October 11, 2014, 12:44:47 AM »
Hi Mike,


Brainf*ck  ...    wikipedia says it's Turing complete  ;)


http://www.turtle.dds.nl/nothing/              (somewhat dadaistic )

best Rob

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #935 on: October 11, 2014, 09:14:14 AM »
Yes Rob,

It is absolutely brainf*cking but it is Turing complete. Every decent language must have a BF interpreter of its own implemented for the amusement of its most inquisitive users. I have three of them, the best one being written in C -- damn, it has its own full-blown IDE! :D

And it is damned fast too.

Once upon a time when we all weren't yet acquainted with each other, John launched an ASCII Mandelbrot challenge on one of his innumerous sites based off of BF algorithm of doing same as a specimen to follow.

Naturally enough PowerBASIC was the fastest among the compilers. Charles was a close second with his Oxygen but he used a couple of dirty tricks to optimize the algo while nobody noticed. (If I had been among the contestants, I would have had him withdrawn from the race mercilessly! :D )

BASIC interpreters were doing very, very badly being some 5 to 10 times slower than BF. I must still have some snapshots somewhere on my disks that I took watching the show from aside with my bucket of popcorn in hand. :)

I'm still using this code as a regression test for my FBSL builds.

.

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #936 on: October 11, 2014, 10:54:42 AM »
Quote from: Rob
http://www.turtle.dds.nl/nothing/

A-a-a-ha-ha-ha-ha-ha-ha-ha-ha!!!!!

You made my day, Rob! ;D

See Equality: A Feministic Programming Language (sorry but the original site is already down :D )

.

Charles Pegge

  • Guest
Re: Lisp in Basic
« Reply #937 on: October 11, 2014, 11:44:58 AM »
Sounds like a dialectic of Marxist Programming Language :)

In contrast, to Monarchical programming languages, require a strict class hierarchy, and creates subjects instead of objects. Subjects participate in ceremonies instead of procedures, and return tributes. When subjects no longer participate in ceremonies, they are exiled to the heap, but occasionally, they are executed.

JRS

  • Guest
Re: Lisp in Basic
« Reply #938 on: October 11, 2014, 11:50:02 AM »
Quote from: Charles
In contrast, to Monarchical programming languages, require a strict class hierarchy, and creates subjects instead of objects. Subjects participate in ceremonies instead of procedures, and return tributes. When subjects no longer participate in ceremonies, they are exiled to the heap, but occasionally, they are executed.

A good definition of encapsulation.

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #939 on: October 11, 2014, 11:54:52 AM »
Pardon my poor English, guys, do you mean "they are executed" -- by an executioner?

Charles Pegge

  • Guest
Re: Lisp in Basic
« Reply #940 on: October 11, 2014, 12:11:37 PM »
Yes, when the monarch takes exception, they are decapsulated. In other words, their headers are detached.

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #941 on: October 11, 2014, 12:17:56 PM »
Or they are detached from their headers, ha-ha-ha-ha-ha!!!!

Thanks, Charles, for this refreshing and reassuring insight from a loyal patrial of British Empire!  ;D

RobbeK

  • Guest
Re: Lisp in Basic
« Reply #942 on: October 12, 2014, 07:45:50 AM »
Hi all,

"dirty tricks to optimize"  ...   sounds interesting, how can one ...  ??   pre-memoized tables somewhere ..  ?

BF :  rather a "tour de force" to generate such code from the keyboard ?

 ...   they are executed.   ::)   , or they keep hanging ?

best, Rob

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #943 on: October 12, 2014, 06:24:13 PM »
My annals are keeping it all safe, Rob. Code submissions, benchmarks published, site correspondence, screenshots -- everything that I ever happened to be interested in or stricken by. You may call it paranoia but that's the way I've always been, prepared to stand up to every single word I say every single moment of my life. I was born in the KGB hell, you know, and hell is where I still keep on living somehow. :)

Never mind though.

Tour de force? Judge for yourself: ;)

Code: [Select]
+++++++++++++[->++>>>+++++>++>+<<<<<<]>>>>>++++++>--->>>>>>>>>>+++++++++++++++[[
>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>>[-<<<<<->>>>>]<<<<<[->>>>>+<<<<<]>>>>>>
>>]<+<<<<<<<<[>>>>>>[->>+<<]<<<<<<<<<<<<<<<]>>>>>>>>>[>>>>>>>>>]<<<<<<<<<[>[-]<-
>>>>>>>>[-<<<<<<<<+>[<->-<<+>>]<[->+<]>>>>>>>>]<<<<<<<[->>>>>>>+<<<<<<<]<+<<<<<<
<<<]>>>>>>>>-<<<<<[-]+<<<]+>>>>>>>>[-<<<<<<<<->>>>>>>>]+<<<<<<<<[->>>>>>>>->[>>>
>>>[->>+<<]>>>]<<<<<<<<<[>[-]<->>>>>>>>[-<<<<<<<<+>[<->-<<+>>]<[->+<]>>>>>>>>]<<
<<<<<[->>>>>>>+<<<<<<<]<+<<<<<<<<<]>+++++[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>
+>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<[<<<<<<<<<]>>>>>>>>>[>>>>>>[-<<<<<<->>>>>>]+<
<<<<<[->>>>>>->>[-<<<<<<<<+>>>>>>>>]<<<<<<<<[->>>>>>>>+<<<<<<<<<<<<<<<<<[<<<<<<<
<<]>>>>[-]+>>>>>[>>>>>>>>>]>+<]]+>>>>>>>>[-<<<<<<<<->>>>>>>>]+<<<<<<<<[->>>>>>>>
-<<[-<<<<<<+>>>>>>]<<<<<<[->>>>>>+<<<<<<<<<<<<<<<[<<<<<<<<<]>>>[-]+>>>>>>[>>>>>>
>>>]>[-]+<]]+>[-<[>>>>>>>>>]<<<<<<<<]>>>>>>>>]<<<<<<<<<[<<<<<<<<<]>>>>[-]<<<++++
+[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>->>>>>>>>>>>>>>>>>>>>>>>>>>>-<<<<<<[<<<<
<<<<<]]>>>]

It takes less than 60 seconds to complete in the BF IDE but it takes over 5.5 minutes to do the same via John's ScriptBASIC -- on my PC.

(" ...   they are executed.   ::)   , or they keep hanging ?" -- Monsieur sait beaucoup sur la perversion? :D )

JRS

  • Guest
Re: Lisp in Basic
« Reply #944 on: October 12, 2014, 07:03:13 PM »
Here is the time using my BF2SB converter.

Code: Script BASIC
  1. bfname = COMMAND()
  2. bfsize = FILELEN(bfname)
  3. OPEN bfname FOR INPUT AS #1
  4. bfpgm = INPUT(bfsize, #1)
  5. pgm = Strip(bfpgm)
  6. pgmsize = LEN(pgm)
  7. dot = INSTR(bfname,".")
  8. sbname = LEFT(bfname, dot) & "sb"
  9. OPEN sbname FOR OUTPUT AS #2
  10. PRINT #2, "SPLITA STRING(30000,48) BY \"\" TO memory\n"
  11. cellptr = 0
  12. cmdptr = 1
  13. indent = ""
  14.  
  15. Next_Cmd:
  16.  
  17. cmd = MID(pgm, cmdptr, 1)
  18. IF cmd = ">" THEN
  19.   CALL Group
  20.   PRINT #2, indent & "cellptr += " & x & "\n"
  21. END IF
  22. IF cmd = "<" THEN
  23.   CALL Group
  24.   PRINT #2, indent & "cellptr -= " & x & "\n"
  25. END IF
  26. IF cmd = "+" THEN
  27.   CALL Group
  28.   PRINT #2, indent & "memory[cellptr] += " & x & "\n"
  29. END IF
  30. IF cmd = "-" THEN
  31.   CALL Group
  32.   PRINT #2, indent & "memory[cellptr] -= " & x & "\n"
  33. END IF
  34. IF cmd = "." THEN
  35.   PRINT #2, indent & "IF memory[cellptr] = 10 THEN\n"
  36.   indent &= STRING(2," ")
  37.   PRINT #2, indent & "PRINTNL\n"
  38.   indent = LEFT(indent, LEN(indent) - 2)
  39.   PRINT #2, indent & "ELSE\n"
  40.   indent &= STRING(2," ")
  41.   PRINT #2, indent & "PRINT CHR(memory[cellptr])\n"
  42.   indent = LEFT(indent, LEN(indent) - 2)
  43.   PRINT #2, indent & "END IF\n"
  44. END IF
  45. IF cmd = "," THEN PRINT #2, indent & "memory[cellptr] = ASC(INPUT(1))\n"
  46. IF cmd = "[" THEN
  47.   PRINT #2, indent & "WHILE memory[cellptr] > 0\n"
  48.   indent &= STRING(2," ")
  49. END IF
  50. IF cmd = "]" THEN
  51.   IF LEN(indent) > 2 THEN
  52.     indent = LEFT(indent, LEN(indent) - 2)
  53.   ELSE
  54.     indent = ""
  55.   END IF
  56.   PRINT #2, indent & "WEND\n"
  57. END IF
  58. IF cmdptr + 1 > pgmsize THEN
  59.   GOTO Bye
  60. ELSE
  61.   cmdptr += 1
  62.   GOTO Next_Cmd
  63. END IF
  64.  
  65. Bye:
  66. END
  67.  
  68. FUNCTION Strip(codein)
  69.   LOCAL codein,codeout,bfcmd, i
  70.   codeout = ""
  71.   FOR i = 1 TO bfsize
  72.     bfcmd = MID(codein, i, 1)
  73.     IF INSTR("><+-.,[]", bfcmd) THEN codeout &= bfcmd
  74.   NEXT i
  75.   Strip = codeout
  76. END FUNCTION
  77.  
  78. SUB Group
  79.   x = 0
  80.   WHILE MID(pgm, cmdptr + x, 1) = cmd
  81.     x += 1
  82.   WEND
  83.   cmdptr += x - 1
  84. END SUB  
  85.  

Code: [Select]
jrs@laptop:~/sb/sb22/bf$ time scriba tdef.sb
AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDEGFFEEEEDDDDDDCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
AAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDEEEFGIIGFFEEEDDDDDDDDCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBB
AAAAAAAAAAAAABBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDEEEEFFFI KHGGGHGEDDDDDDDDDCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBB
AAAAAAAAAAAABBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDEEEEEFFGHIMTKLZOGFEEDDDDDDDDDCCCCCCCCCBBBBBBBBBBBBBBBBBBBB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GHHIN                                 Q     UMWGEEEDDDCCCCCCCCCCCCBBBBBB
AAAABBCCCCCCCCCCCCCCCCCCCCCCCCCDDDDEEEEEEEEEEEEEEEFFFFFFGHIJKLOT                                     [JGFFEEEDDCCCCCCCCCCCCCBBBBB
AAAABCCCCCCCCCCCCCCCCCCCCCCDDDDEEEEEEEEEEEEEEEEFFFFFFGGHYV RQU                                     QMJHGGFEEEDDDCCCCCCCCCCCCCBBBB
AAABCCCCCCCCCCCCCCCCCDDDDDDDEEFJIHFFFFFFFFFFFFFFGGGGGGHIJN                                            JHHGFEEDDDDCCCCCCCCCCCCCBBB
AAABCCCCCCCCCCCDDDDDDDDDDEEEEFFHLKHHGGGGHHMJHGGGGGGHHHIKRR                                           UQ L HFEDDDDCCCCCCCCCCCCCCBB
AABCCCCCCCCDDDDDDDDDDDEEEEEEFFFHKQMRKNJIJLVS JJKIIIIIIJLR                                               YNHFEDDDDDCCCCCCCCCCCCCBB
AABCCCCCDDDDDDDDDDDDEEEEEEEFFGGHIJKOU  O O   PR LLJJJKL                                                OIHFFEDDDDDCCCCCCCCCCCCCCB
AACCCDDDDDDDDDDDDDEEEEEEEEEFGGGHIJMR              RMLMN                                                 NTFEEDDDDDDCCCCCCCCCCCCCB
AACCDDDDDDDDDDDDEEEEEEEEEFGGGHHKONSZ                QPR                                                NJGFEEDDDDDDCCCCCCCCCCCCCC
ABCDDDDDDDDDDDEEEEEFFFFFGIPJIIJKMQ                   VX                                                 HFFEEDDDDDDCCCCCCCCCCCCCC
ACDDDDDDDDDDEFFFFFFFGGGGHIKZOOPPS                                                                      HGFEEEDDDDDDCCCCCCCCCCCCCC
ADEEEEFFFGHIGGGGGGHHHHIJJLNY                                                                        TJHGFFEEEDDDDDDDCCCCCCCCCCCCC
A                                                                                                 PLJHGGFFEEEDDDDDDDCCCCCCCCCCCCC
ADEEEEFFFGHIGGGGGGHHHHIJJLNY                                                                        TJHGFFEEEDDDDDDDCCCCCCCCCCCCC
ACDDDDDDDDDDEFFFFFFFGGGGHIKZOOPPS                                                                      HGFEEEDDDDDDCCCCCCCCCCCCCC
ABCDDDDDDDDDDDEEEEEFFFFFGIPJIIJKMQ                   VX                                                 HFFEEDDDDDDCCCCCCCCCCCCCC
AACCDDDDDDDDDDDDEEEEEEEEEFGGGHHKONSZ                QPR                                                NJGFEEDDDDDDCCCCCCCCCCCCCC
AACCCDDDDDDDDDDDDDEEEEEEEEEFGGGHIJMR              RMLMN                                                 NTFEEDDDDDDCCCCCCCCCCCCCB
AABCCCCCDDDDDDDDDDDDEEEEEEEFFGGHIJKOU  O O   PR LLJJJKL                                                OIHFFEDDDDDCCCCCCCCCCCCCCB
AABCCCCCCCCDDDDDDDDDDDEEEEEEFFFHKQMRKNJIJLVS JJKIIIIIIJLR                                               YNHFEDDDDDCCCCCCCCCCCCCBB
AAABCCCCCCCCCCCDDDDDDDDDDEEEEFFHLKHHGGGGHHMJHGGGGGGHHHIKRR                                           UQ L HFEDDDDCCCCCCCCCCCCCCBB
AAABCCCCCCCCCCCCCCCCCDDDDDDDEEFJIHFFFFFFFFFFFFFFGGGGGGHIJN                                            JHHGFEEDDDDCCCCCCCCCCCCCBBB
AAAABCCCCCCCCCCCCCCCCCCCCCCDDDDEEEEEEEEEEEEEEEEFFFFFFGGHYV RQU                                     QMJHGGFEEEDDDCCCCCCCCCCCCCBBBB
AAAABBCCCCCCCCCCCCCCCCCCCCCCCCCDDDDEEEEEEEEEEEEEEEFFFFFFGHIJKLOT                                     [JGFFEEEDDCCCCCCCCCCCCCBBBBB
AAAAABBCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDEEEEEEEEEEEEFFFFFGHHIN                                 Q     UMWGEEEDDDCCCCCCCCCCCCBBBBBB
AAAAABBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDDDDDDDDEEEEEEEEEFFFFGH O    TN S                       NKJKR LLQMNHEEDDDCCCCCCCCCCCCBBBBBBB
AAAAAABBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDD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