notes on SICP

… three foci of phenomena: the human mind, collections of computer programs, and the computer. Every computer program is a model, hatched in the mind, of a real or mental process. These processes, arising from human experience and thought, are huge in number, intricate in detail, and at any time only partially understood. They are modeled to our permanent satisfaction rarely by our computer programs. Thus even though our programs are carefully handcrafted discrete collections of symbols, mosaics of interlocking functions, they continually evolve: we change them as our perception of the model deepens, enlarges, generalizes until the model ultimately attains a metastable place within still another model with which we struggle....

February 24, 2024 · 4 min · un01s

codes of interest

Sometimes you just want to hear these flipping sound. Here is the code for both Flip 7-segment digits and FlipDot. FlipDigits FlipDots Another interesting thing is LED display of tixy.land. Rust FFI and cbindgen: integrating embedded rust code in C. Distinguishing an interpreter from a compiler, Jan 26, 2023. This leads to the excellent course, UCB CS294-113: Virtual machine and managed runtimes.

January 25, 2023 · 1 min · un01s

Quine program

Definition of Quine A quine program, or quine, is a program that outputs its own source code when runs without taking any input. It is called self-replicating program. Quines are possible in any Turing-complete programming language, as direct consequence of Kleene’s rescursion theorem. Detour Quine’s paradox on self-reference. "Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation. Another paradox: If the human brain were so simple that we could understand it, we would be so si mple that we couldn't....

September 4, 2022 · 1 min · un01s

Toit Imports

Toitlang uses import to use code from other libraries. local import starting with . $ tree . └── my_lib ├── my_lib.toit ├── other.toit └── sub └── sub.toit Assume we are importing sub.toit into my_lib.toit. import .sub.sub Shorten version: import .sub global import import math Then for customizations, import math as m import math show sin cos

March 3, 2022 · 1 min · un01s

Reading Toit Code (002)

After toit_start(), we have toit_esp32.cc to read. The first one is toit::start(). Toit here is just a namespace. As we know that toit supports OTA (over-the-air update) through WiFi and esp32 device is set to be a station (STA instead of AP). What we have here is as follows: RtcMemory::set_up(); FlashRegistry::set_up(); OS::set_up(); esp_partition_find_first(); setup_program(support_ota); Scheduler::ExitState exit_state; VM vm; vm.load_platform_event_sources(); int groud_id = vm.scheduler()->next_group_id(); exit_state = vm.scheduler()->run_boot_program(program, null, group_id); OS::tear_down(); FlashRegistry::tear_down(); After these, esp32 may go to deep sleep....

March 1, 2022 · 1 min · un01s