Distinguishing a program's return value from its s...
# two-minute-week
k
Distinguishing a program's return value from its side effects https://archive.org/details/akkartik-2min-2021-04-10 Further adventures in bootstrapping a computer up from machine code. Things to notice in this iteration: * Boots into an interpreter like old microcomputers * Menu at the bottom imitating WordStar Likely next episode: running programs outside the programming environment like Turbo Pascal. Previous episode: https://futureofcoding.slack.com/archives/C0120A3L30R/p1614240046005000 Main project page: https://github.com/akkartik/mu
šŸ‘šŸ¼ 1
šŸ™Œ 1
šŸ‘šŸ½ 1
šŸ‘ 5
j
what if you were to take one more step away from the teletype model?
k
Yes! I've been trying to do that. There's no escape sequences here and no scrolling. Printing in any direction is equally fast and convenient. Some constraints influencing the current state: • Text grid is more manageable for writing tests. Though vector primitives are also doable. Raw pixels get too unwieldy. • Fixed width font simplifies text rendering. • I haven't managed to get the mouse working yet. Ideas most appreciated.
šŸ‘ 2
j
One random direction: what if there's no
print
? Maybe, instead, the last return value is "drawn" to a vector canvas that understands text and shapes as first class entities. So
(circle 10)
at the REPL returns a circle, which is drawn to the canvas, etc.
šŸ‘ 2
k
First (red) pixel on the (center of the) fake screen.
😊 1