Skip to content

Instantly share code, notes, and snippets.

View tdrhq's full-sized avatar

Arnold Noronha tdrhq

View GitHub Profile
I'm going to tell you my unconventional stack, and the reasoning for
it. You may or may not agree with it, but let's give it a try.
Most of the modern backend web frameworks were started maybe 15-20
years ago, and the same patterns have continued to be used. But things
have changed since then:
* Disk is a lot faster (NVMe)
* Disk is a lot more robust (EBS Io2)
* RAM is super cheap
(defun decompile (lines)
(let ((lines (mapcar (lambda (x)
(read-from-string (format nil "(~a)" x)))
lines)))
(let ((expr `(when (= z 0)
(return-from do-run choices)))
(inp 0))
(loop for line in (reverse lines) do
(destructuring-bind (cmd a &optional b) line
(let ((decl `(declare (type fixnum ,a))))
(let ((points (mapcar #'parse-integer (str:split "," (car (uiop:read-file-lines "~/builds/web/input"))))))
(let ((state (make-array 10 :initial-element 0)))
(loop for point in points do
(incf (aref state point)))
(loop for day below 256 do
(progn
(let ((new (aref state 0)))
(loop for i from 0 below 8 do
(setf (aref state i)
(aref state (1+ i))))
sdfsdfds
sdfsd
fsdf
dsf
sdf
sdfsd
fsd
fsd
fsd
fsdf