6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Sep 22, 2024 4:42 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Jul 09, 2024 11:50 pm 
Offline

Joined: Sat Dec 12, 2015 7:48 pm
Posts: 143
Location: Lake Tahoe
Yet another new implementation of an old language for a limited environment; an 8 bit Apple in this case. They say if you really want to understand a computer language, write your own compiler/interpreter for it. Since I've always been fascinated what others see in LISP, I can now say I've scratched that itch.

Should you find yourself awake at 3 AM and unable to get back to sleep, this may be the cure. An S-expression parser/evaluator/printer written in PLASMA, a byte code compiler/VM running on an 8 bit 6502 at 1 MHz. See what I did by naming it DRAWL?

A terrible video showing it in action: https://youtu.be/wBMivg6xfSg

A quick description of the interpreter and floppy disk image to play along: https://github.com/dschmenk/PLASMA/blob ... c/DRAWL.md

If there are any LISP die-hard fans here, please be kind.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 10, 2024 6:26 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
Nice! I am only a theoretical fan of Lisp, but I appreciate what you've built there.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 10, 2024 2:19 pm 
Offline

Joined: Sat Dec 12, 2015 7:48 pm
Posts: 143
Location: Lake Tahoe
Thanks Ed. Although I appreciate the formalism and simplicity of LISP, I believe I'll remain a theoretical fan as well!


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 25, 2024 6:51 pm 
Offline

Joined: Sat Dec 12, 2015 7:48 pm
Posts: 143
Location: Lake Tahoe
Well, I couldn't leave well enough alone. So I implemented the rest of LISP 1.5 including some later extensions. Pretty complete and not as weird as you might think. Works surprisingly well on an Apple II. I may change my mind about LISP (except the parenthesis - see what I did here?)

I wouldn't write a full application in LISP 1.5, but it can make for a pretty cool programmable calculator. I've implemented 32 bit integers and 80 bit floating point with transcendentals by way of the SANE library. Hexadecimal input/output and bit-wise operators makes it pretty useful. Echo to a printer for hard copy, but can also be used in an emulated environment to capture output externally.

Video of DRAWL in action: https://www.youtube.com/watch?v=MdKZIrfPN7s
Updated GitHub docs: https://github.com/dschmenk/PLASMA/blob ... c/DRAWL.md
Blog: http://schmenk.is-a-geek.com/wordpress/?p=365


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 08, 2024 5:48 pm 
Offline

Joined: Tue Jul 24, 2012 2:27 am
Posts: 674
As a Common Lisper & semi Lisp historian this looks great! Having that intermediate VM certainly makes tons of sense. Bookmarked and will reference it.

_________________
WFDis Interactive 6502 Disassembler
AcheronVM: A Reconfigurable 16-bit Virtual CPU for the 6502 Microprocessor


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 09, 2024 12:58 am 
Offline

Joined: Sat Dec 12, 2015 7:48 pm
Posts: 143
Location: Lake Tahoe
I've wrapped up DRAWL by incorporating extensions like macros and strings. Also added a few Apple II functions for screen and keyboard interactivity. Dare I say it's close to a real programming language. The macros really help make the code less weird. There's one that provides a way to write functions such as this,

Code:
(DEFPRO DUMMYFUNC (ARG1, ARG2) ; ARGUMENTS
             (LOCAL1, LOCAL2)  ; LOCAL VARS
                               ;
             (SETQ LOCAL1 (+ ARG1 ARG2))
             (SETQ LOCAL2 (* ARG1 ARG2))
             (PRINT LOCAL1 LOCAL2)
             (RETURN (- LOCAL2 LOCAL1))
)

by cleaning up a lot of the extra verbiage needed to get something defined. Strings and associated functions certainly makes it feel like a general purpose language.

I believe DRAWL is a pretty palatable version of LISP 1.5 - before it got too big. It doesn't take much to understand the language, but a much greater investment to be productive in it.


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 13, 2024 9:43 pm 
Offline

Joined: Tue Jul 30, 2024 6:20 pm
Posts: 72
I've spent over a decade mostly in Common Lisp, except for the last few years. I've been enjoying C and asm more lately/ But yeah, once you are used to sexps, every syntax seems completely arbitrary and foolish.

I'm looking for something to do with my new fpga 65c02 toy, and will definitely check this out. Away from my Apple ][ unfortunately and indefinitely...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron