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

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

by Tom Stuart
November 2017
Beginner to intermediate
344 pages
7h 2m
Chinese
GoTop Information, Inc.
Content preview from 深入理解運算原理|從簡單的機器到無所不能的程式
程式的意義
|
21
確實有一份 Ruby 1.8.7 的一般規格,而且甚至已經成為 ISO 標準(ISO/
IEC 30170
2
)。雖然 MRI 依然被視為 Ruby 語言源自實作物的規格,但是
mruby 專案(
https://github.com/mruby/mruby
)也試著建構一個輕量、
可嵌入的 Ruby 實作物,它的目標很明確:符合 ISO 標準,而非 MRI
容性。
3 種選擇是使用形式語意的數學技巧來精準的描述程式語言的意義。這裡的目標是完全
清楚,並且以適合的方法分析或甚至自動分析的格式來撰寫規格,以便全面檢查一致性、
矛盾、或疏漏。在看過如何處理語法之後,我們將會檢視這些語意規格的形式之道。
語法
傳統的電腦程式是一長串字元。每種程式語言都有自己的一組規則,用來描述該種語言
會將哪一種字元字串視為合法的程式;這些規則指明了語言的
語法
syntax
)。
語言的語法規則能讓我們從無意義的一群程式當中(例如
>/;x:1@4
),分辨出可能合法
的程式(像是
y = x + 1
)。它們也提供了如何閱讀模稜兩可程式的實用資訊:舉例來
說,有關運算子優先權的規則能自動決定應該將
1 + 2 * 3
視為
1 + (2 * 3)
,而非視為
(1 + 2) * 3
電腦讀取程式當然在預期之中,而讀取程式需要
解析器
parser
):這是一種程式,它
能讀取代表程式的整串字元,為了確定讀取的內容合法有效,便依照語法規則加以檢
查,為了進一步的處理,再將它轉換成程式適合的結構化呈現。
有好幾種可以自動將語言的語法規則轉換成解析器的工具 ...
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