关于学习语义

发布于 2024-10-19 11:38:59 字数 186 浏览 3 评论 0原文

我必须做一些与语义相关的事情。我正在阅读Semantics Engineering with PLT Redex,我发现它有点难以理解,这不是我思考做计算机科学的方式。我记得我对阅读 CSAPP 这本书感到多么兴奋。但对这个或语义领域不是很兴奋!虽然我认为原因是我还没有理解它,但它有什么意义。或许。但我想我需要一些建议来引导我摆脱困境:如何先于语义的学习?

I have to do something related with semantics. and I am reading the Semantics Engineering with PLT Redex, I find it a little hard to understand, it is not the way I thought about doing computer science. I remembered how much I am excited about reading CSAPP book. but not ver excited about this one, or the field of semantics! While I think the reason is that I am not yet understanding it, what's the point of it. Maybe. But I think I need some suggestions to lead me out of the way: how to precede the learning of semantics?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尬尬 2024-10-26 11:38:59

什么是语义:语义通常与语法形成对比。语法描述了语言的各个部分如何排列。语义描述了这些安排的作用。它描述了它们有什么作用。

从编写语言的人的角度来看,语法是词法分析器、解析器和抽象语法树的规范。语义是 Eval / Apply 循环的规范。

为什么语义很有趣:语法是一个已解决的问题。虽然它非常复杂,但一旦您编写了一些好的解析器,它们就会开始看起来相同。赋予语言意义并让该意义产生有用的、简洁的、清晰的工具的过程是一个更深层次的主题。这只是一种观点,但计算机科学领域的学者普遍认为语义创造了语言。

一些语义概念:面向对象编程是一种语义符号。 SmallTalk 和 Java 的语法彼此非常不同,但共享“对象”的语义,即由一组定义的方法操作的封装数据。函数式编程是另一种语义思想。

我不是一名学者,而且我没有跟上最近的语义学教学,所以我不能很好地解决现在正在教授的内容,但作为一名程序员和对计算机科学感兴趣的人,我发现这个主题既令人着迷又高度适用。

What is semantics: Semantics is usually contrasted with syntax. Syntax describes how pieces of a language may be arranged. Semantics describes what those arrangements do. It describes what effects they have.

From the perspective of one who writes a language, syntax is the specification for the lexer, parser and Abstract Syntax Tree. Semantics is the specification for the Eval / Apply loop.

Why is semantics interesting: Syntax is a solved problem. While it is pleasingly complex, once you have written a few good parsers they all start to look the same. The process of giving a language meaning and having that meaning lead to a useful, concise, and clear tool is a much deeper subject. It is just an opinion, but it common among academics in the Computer Science field to say that semantics make the language.

Some Semantic Concepts: Object oriented programing is a semantic notation. SmallTalk and Java have very different syntax from each other, but share the semantics of "object" as encapsulated data operated on by a defined set of methods. Functional programing is another semantic idea.

I am not an academic, and I have not kept up with the recent pedagogy of semantics, so I cannot address well what is now being taught, but as a coder and one interested in Computer Science, I find the topic both facinating and highly applicable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文