Skip to Content
深入理解運算原理|從簡單的機器到無所不能的程式
book

深入理解運算原理|從簡單的機器到無所不能的程式

by Tom Stuart
November 2017
Beginner to intermediate
344 pages
7h 2m
Chinese
GoTop Information, Inc.
Content preview from 深入理解運算原理|從簡單的機器到無所不能的程式
294
|
8
不可能建置。我們沒有選擇,只能雇用一組人,以人力執行、反組譯這些程式來測試它
們,並且操控作業系統來剖析它們的動態行為。
手動審查速度慢、費用高、容易錯,另外的缺點是每個程式只能執行很短的時間、提供
動態行為有限的快照。所以就算沒有人出錯,偶爾也會有不良品誤進網路,因此手上就
會有一大堆憤怒的客戶。所幸我們有無法決定性,可以解決這個問題。
在這所有的困難底下,是兩個根本的問題。第 1 個是我們沒有能力窺視未來,無法看到
程式執行之後的結果;找出程式做了什麼的唯一通則,就是實際執行它。儘管有些程式
夠簡單而可以直覺預測它的行為,但通用語言始終會容許行為無法透過分析其原始碼來
預測的程式
19
2 個問題是,當我們真的決定執行某個程式時,並沒有可靠的方式能知道要多久才能
執行結束。唯一概略的解決方案就是執行然後等待,但因為我們知道以通用語言編寫的
程式可以不停止的永久循環,所以總有一些程式的無限制等待時間實在太久。
為什麼會這樣?
我們已經在本章看到,所有通用系統都夠強大的可以參照它們自己。程式運算數值,數
值可以表示字串,而字串是程式指令的寫入方式,因此程式完全有能力在它們自己的原
始碼上運作。
這種自我參照的能力,讓編寫能可靠預測程式行為的程式變得不可能。只要編寫了特定
的行為檢查程式,我們總是能夠構建更大但卻潰敗的程式:新的程式將核對器合併成
副常式,用來檢查它自己的原始碼,然後立刻執行核對器即將執行的完全相反的工作。
這些自相矛盾的程式相當稀少,而不是我們實際寫過的東西,但它們只是基本問題的症 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

JSON實務手冊

JSON實務手冊

Tom Marrs

Publisher Resources

ISBN: 9789864766000