Made a brainfuck->lambda "compiler" in 46 SLOC, 69 with lambda->C included.
Gonna embed this into the post just like last time(defun compile-thing (thing)
(compile nil `(lambda ()
(declare (optimize (safety 0) (speed 3) (debug 0)))
(let ((data (make-array (expt 2 16) :element-type '(unsigned-byte 8) :adjustable nil))
(pointer 0))
(macrolet ((ref () `(aref data pointer))
(p-arif (i) `(setf pointer (logand (1- (expt 2 16)) (,i pointer))))
(d-arif (i) `(setf (ref) (logand 255 (,i (ref))))))
(declare (type (simple-array (unsigned-byte 8) 1)))
(tagbody
,@thing))))))
(defun make-the-list (thing)
(let ((stack '(main))
(next-tag (gensym)))
(loop for char across thing
if (equalp char #\[) do
(push (gensym) stack)
and collect `(if (zerop (ref)) (go ,next-tag)
(go ,(car stack)))
and collect (car stack)
else if (equalp char #\])
collect `(if (zerop (ref))
(go ,next-tag)
(go ,(car stack)))
and do (progn
(pop stack)
(push next-tag stack)
(setf next-tag (gensym)))
and collect (car stack)
else collect (case char
(#\>
'(p-arif 1+))
(#\<
'(p-arif 1-))
(#\+
'(d-arif 1+))
(#\-
'(d-arif 1-))
(#\,
'(setf (ref) (char-code (read-char))))
(#\.
'(princ (code-char (ref))))))))
(defun compile-to-c (thing)
(apply #'concatenate (append '(string) '("int i=0; char d[30000] = {};")
(loop for op in thing
collect (if (atom op)
(concatenate 'string "
" (string op) ":
")
(case (car op)
(incf "i++;")
(decf "i--;")
(setf "d[i]=getchar();")
(princ "putchar(d[i]);")
(d-arif (if (equalp (cadr op) '1+)
"d[i]++;"
"d[i]--;"))
(if (concatenate 'string
"
if(d[i]==0)
{goto " (string (cadr (caddr op))) ";}
else {goto " (string (cadr (cadddr op))) ";}"))))))))
Notices by Iska (iska@catposter.club), page 14
-
Iska (iska@catposter.club)'s status on Wednesday, 27-Dec-2023 06:22:57 JST Iska -
Iska (iska@catposter.club)'s status on Saturday, 23-Dec-2023 18:23:36 JST Iska @dcc@annihilation.social
@splitshockvirus@mstdn.starnix.network
@vncresolver@botsin.space I already modified my firepiss to reject deletes -
Iska (iska@catposter.club)'s status on Saturday, 23-Dec-2023 17:38:44 JST Iska @splitshockvirus@mstdn.starnix.network @vncresolver@botsin.space @eric@pl.starnix.network lmao they deleted the post
This is why you ignore deletes -
Iska (iska@catposter.club)'s status on Thursday, 21-Dec-2023 13:45:12 JST Iska @coolboymew@shitposter.club reminds me of tails
-
Iska (iska@catposter.club)'s status on Thursday, 21-Dec-2023 13:45:07 JST Iska @coolboymew@shitposter.club stormtrooper car
-
Iska (iska@catposter.club)'s status on Thursday, 21-Dec-2023 11:29:41 JST Iska @theorytoe@ak.kyaruc.moe @coolboymew@shitposter.club @olmitch@shitposter.club I'm sure I've seen playthroughs tho, I watched a ton of playthroughs and "longplay"s when I was a kid.
-
Iska (iska@catposter.club)'s status on Thursday, 21-Dec-2023 11:29:37 JST Iska @theorytoe@ak.kyaruc.moe @coolboymew@shitposter.club @olmitch@shitposter.club based (never played unleashed)
-
Iska (iska@catposter.club)'s status on Thursday, 21-Dec-2023 11:29:35 JST Iska @theorytoe@ak.kyaruc.moe @coolboymew@shitposter.club @olmitch@shitposter.club oh I've played rush, absolute bangers
-
Iska (iska@catposter.club)'s status on Thursday, 21-Dec-2023 04:07:30 JST Iska @coolboymew@shitposter.club IIRC this image is at least 2 years old
-
Iska (iska@catposter.club)'s status on Tuesday, 19-Dec-2023 22:12:27 JST Iska people be like "be gay do crime :heheevil: being a war criminal is so cool!"
The same people on march 3rd, 2024 when I release a nuclear bomb on Uganda with my sex dungeon located there :blobcat_hiss:
:akko_dots: -
Iska (iska@catposter.club)'s status on Monday, 18-Dec-2023 18:57:58 JST Iska "trad" guys on poa.st reposting japanese porn on the same profile :blobcatcode:
-
Iska (iska@catposter.club)'s status on Monday, 18-Dec-2023 03:41:49 JST Iska @coolboymew@shitposter.club good format, have a template?
-
Iska (iska@catposter.club)'s status on Saturday, 16-Dec-2023 19:49:49 JST Iska what the hell is the podcast race
-
Iska (iska@catposter.club)'s status on Saturday, 16-Dec-2023 16:42:18 JST Iska @dcc@annihilation.social not willingly bruv
-
Iska (iska@catposter.club)'s status on Saturday, 16-Dec-2023 16:39:32 JST Iska can't use imap gmail
now can't use html gmail:blobcat_hiss: -
Iska (iska@catposter.club)'s status on Saturday, 16-Dec-2023 07:54:31 JST Iska @coolboymew@shitposter.club ryan gosling cat isekai?
-
Iska (iska@catposter.club)'s status on Saturday, 16-Dec-2023 05:14:14 JST Iska @sysrq@lab.nyanide.com @dcc@annihilation.social @splitshockvirus@mstdn.starnix.network @branman65@poa.st @meso@the.asbestos.cafe irish mentioned go go gadget @amerika@noagendasocial.com
-
Iska (iska@catposter.club)'s status on Saturday, 16-Dec-2023 03:48:52 JST Iska @splitshockvirus@mstdn.starnix.network @meso@the.asbestos.cafe "wehrashit is best military to exist"
loses stalingrad by shooting themselves in the foothow do fashcels even cope -
Iska (iska@catposter.club)'s status on Saturday, 16-Dec-2023 03:48:51 JST Iska @branman65@poa.st @splitshockvirus@mstdn.starnix.network @meso@the.asbestos.cafe :kekgiga: keep coping bro
-
Iska (iska@catposter.club)'s status on Saturday, 16-Dec-2023 03:48:49 JST Iska @branman65@poa.st @splitshockvirus@mstdn.starnix.network @meso@the.asbestos.cafe implying I'm a tankie