The Lisp debugger

oo101 7 days ago [-]

There are a few ways in which the shared objects method you suggest does not match the full power of Lisp debugging.

First of all, when a C program crashes, it just crashes. There is no REPL. There is only a core dump. So any live-debugging you plan to do is after the fact. After you have seen a crash, you would now begin to prepare for the next crash by launching your process via GDB or restarting your process and attaching a GDB to it. Whether a similar crash would occur again or not or when it would occur again depends on the nature of the bug. Now contrast this with Lisp debugging when your program crashes, it stops there and offers you an REPL to interact with the program right then. There is no need to wait for the next crash.

Secondly, when you debug with GDB, you would be dealing with syntaxes: The syntax of C that we are so familiar with. The GDB syntax to investigate the problem that we may be less familiar with. When the Lisp debugger offers the REPL to you, you are working with Lisp again. Your compiler, debugger, program, etc. all are part of the same unified environment where you just execute Lisp code to debug your issue.

Finally, putting your code in shared objects and reloading them requires you to go through the complete write-build-test-debug cycle. And then what do you do if your shared object itself crashes? With Lisp you skip the write-build-test part when all you want to do is debug an error. You jump straight to the debug part of the cycle and begin investigating the runtime state. And it works the same in a uniform manner whether your main program crashes or a dependency crashes.

— A Road to Common Lisp

— Hacker News

.

.

2022.05.05 Thursday ACHK

數學教育 7.5.1

Genius 4.2.1 | A Fraction of Algebra, 2.1

這段改編自 2010 年 4 月 24 日的對話。

.

另外,他提的另一個,有關學習數學的要點是,即使假設你在大學中,學到的數學,在日常生活中沒有用,單單是為獲取,那些嶄新的元素概念本身,就已經能夠令你有超能力;令你有一些,常人沒有的思考工具、比喻語言。

.

(安:但是,這個講法可能有一個問題。

雖然,你剛才列舉了數個例子,來示範如何將高深數學,間接應用到人生處世,但是,一般人未必有那種能力。所以我想問,你又是如何去跨過這個難關呢?)

.

什麼難關?

.

(安:去翻譯那些抽象數學概念,到其他範疇,或者日常生活。)

.

那不是「難關」。你的意思是,一般人也沒有那個能力,而我有。所以,那是超能力;我當年一定是,用了一些秘技,才獲取之。

天才之道,點滴累積。其實並沒有所謂的「秘技」。只要一步一步地,學習數學,就自然建構出,一個相對接近完整的數學思考體系,生成「翻譯抽象數學概念到其他範疇」等能力。

所以,我猜想你的疑問是,其實我所講的「點滴累積」,或者「一步一步地」,雖然理想上是,基本的要求,但是現實中是,大部人也做不到。那就代表著,大部人可能也會遇到,一個共通的「難關」。那個「難關」究竟是什麼?我又是如何克服它,而做到「一步一步地」「點滴累積」的呢?

.

你問題的最簡化版本是:「如何學習數學,開創人生?」

有起碼以下三個先決條件:

1. 對數學(及其他學問人生),有極大興趣;

2. 遇到合理的老師和書籍:

重點是,數學概念或運算上的主要步驟,亳無違漏。支節可免,但主旨必須。細節可以無師自通,大節必靠前人指點。平地自己行,斜地靠梯級。平地可跳步,梯不可跳級。

3. 極超大量的背誦和練習:

數學是理科,所以其背誦方法,不是「死背」零碎隨機的資料,而是「生背」息息相關的訊息。融匯貫通地背誦的唯一方法是,極超大量的操練。

.

你所講的「難關」,就是以上的第二點。老師有分好老師和差老師。大部分也是差老師。而差老師再分兩類:不懂數學和不懂教學。

— Me@2022.05.02 11:48 PM

.

.

2022.05.03 Tuesday (c) All rights reserved by ACHK