5 ms·
Peter Deutsch finished this when he was 17 years old. https://en.wikipedia.org/wiki/L._Peter_Deutsch https://en.wikipedia.org/wiki/L._Peter_Deutsch
by jonjacky 4y ago
Peter Deutsch finished this when he was 17 years old.
https://en.wikipedia.org/wiki/L._Peter_Deutsch https://en.wikipedia.org/wiki/L._Peter_Deutsch
- lisper 4y agoNot sure which is more impressive, that, or the fact that this Lisp ran in under 4k of RAM.
- daniel-cussen 4y agoDude that's cool for the time, for assembly, now it's way lower than that. Under 1000 bits. But that's only possible on the GA144 cores, MISC (minimal instruction set instead of RISC reduced instruction set). So so terse. I think the size of a program is grows asymptotically slower than for other architectures, just thought of that now.
- phtrivier 4y agoNo idea what the arch of a PDP would be like; but the manual mentions 4096 "registers". Would those register actually correspond to memory words in a more modern arch ? Was it possible in assembly to directly address each of those register (without the need for MOV-golfing ?)
- ngvrnd 4y agoDunno about the pdp-1, but the pdp-10 series machines allowed the registers to be addressed like memory, if I recall correctly- the registers were special and faster than the rest of memory, but one could put machine code in them and run it there. I guess using registers would have been tricky in that case though.
- aap_ 4y agoThe pdp-1 has two architectural registers: AC and IO and they're not addressable as memory. The PDP-10 has a similar internal structure but fetches and stores the accumulator from/to memory* for instructions that use it. * in the PDP-6 it really is external memory, in the later models (aka PDP-10) it was moved into the CPU
- FullyFunctional 4y agoA "register" is just a [core] memory word. ("The PDP-1 uses an 18-bit word size and has 4096 words as standard main memory", https://en.wikipedia.org/wiki/PDP-1 https://en.wikipedia.org/wiki/PDP-1). Terminology changed since then. I like how the assembly source code is small enough to include at the end of the manual. A bit of slogging finds you the source code and a pdp-1 assembler, enough to run it on simh or MESS, but even though there's a online PDP-1 emulator running SpaceWar!, I wasn't able to find a way to run Lisp 1 online. * http://www.softwarepreservation.org/projects/LISP/interlisp_family/ http://www.softwarepreservation.org/projects/LISP/interlisp_... * http://simh.trailing-edge.com/kits/lispswre.zip http://simh.trailing-edge.com/kits/lispswre.zip
- FullyFunctional 4y agoAdd: got it working with simh ("brew install simh; pdp1") using the instructions in the linked zip file. It is _really_ delicate, but I finally got fib working: (rplacd (quote sub) (quote (expr (lambda (a b) (plus a (minus b)))))) (rplacd (quote fib) (quote (expr (lambda (l) (cond ((greaterp l 1) (plus (fib (sub l 2)) (fib (sub l 1)))) (t l)))))) (fib 22) 5030 Why yes, it's all in octal fib(18) = 2584
- djmips 4y agohttps://www.masswerk.at/spacewar/inside/pdp1-instructions.html https://www.masswerk.at/spacewar/inside/pdp1-instructions.ht...
- retrac 4y ago> Was it possible in assembly to directly address each of those register (without the need for MOV-golfing ? Kind of. 12-bit address field in the instruction. It was an accumulator machine; the CPU only had one main register (as we use the term today) and all operations were between that implicit register and the address specified in memory.