惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
B
Blog
博客园_首页
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
B
Blog RSS Feed
M
MIT News - Artificial intelligence
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
量子位
V
V2EX
Y
Y Combinator Blog
Hugging Face - Blog
Hugging Face - Blog
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
I
InfoQ
博客园 - 【当耐特】

Kaffa.im

Kaffa.im - 寻找数据源头 Kaffa.im - 玩魔方 Kaffa.im - AI 在常见病上取代医生 Kaffa.im - 上 NextCloud,一站搞定个人数据同步 在 Windows 上 Bose SoundLink 音箱声音自动停止问题的解决 Kaffa.im - 交易的实质——浪随风向 Kaffa.im - 新手学电脑从入门到精通 Kaffa.im - 数字化转型之路(从数字化到数智化) Kaffa.im - 机器人简史 Kaffa.im - 安卓Frida逆向与协议分析 Kaffa.im - 数学的惊奇 Kaffa.im - 牌局心理学 Kaffa.im - Python计算机视觉实战 Kaffa.im - ALaunch v1.0 发布 Kaffa.im - Windows 音频设备控制之旅 Kaffa.im - 结构性优势 Kaffa.im - 尤瓦尔·赫拉利-真假信息与连接 Kaffa.im - 小狗钱钱 Kaffa.im - 短视频编导全能手 Kaffa.im - 爆品创新:新时代爆品打造法 Kaffa.im - 如何阅读一本书 Kaffa.im - 冰血暴第一季 Kaffa.im - 冰血暴第二季 Kaffa.im - 冰血暴第三季 Kaffa.im - 冰血暴第四季 Kaffa.im - 冰血暴第五季 Kaffa.im - 思维迭代的26个卓越方法 Kaffa.im - 再度唤醒世界:赖特诗选 Kaffa.im - 中国量化投资 Kaffa.im - Clojure Recipes
Racket Programming the Fun Way
Kaffa · 2024-10-28 · via Kaffa.im

Racket Programming the Fun Way
From Strings to Turing Machines

作者:James W. Stelly

An introduction to the Racket functional programming language and DrRacket development environment to explore topics in mathematics (mostly recreational) and computer science. At last, a lively guided tour through all the features, functions, and applications of the Racket programming language. You'll learn a variety of coding paradigms, including iterative, object oriented, and logic programming; create interactive graphics, draw diagrams, and solve puzzles as you explore Racket through fun computer science topics--from statistical analysis to search algorithms, the Turing machine, and more. Early chapters cover basic Racket concepts like data types, syntax, variables, strings, and formatted output. You'll learn how to perform math in Racket's rich numerical environment, and use programming constructs in different problem domains (like coding solutions to the Tower of Hanoi puzzle). Later, you'll play with plotting, grapple with graphics, and visualize data. Then, you'll escape the confines of the command line to produce animations, interactive games, and a card trick program that'll dazzle your friends. You'll learn how to: • Use DrRacket, an interactive development environment (IDE) for writing programs • Compute classical math problems, like the Fibonacci sequence • Generate two-dimensional function plots and create drawings using graphics primitives • Import and export data to and from Racket using ports, then visually analyze it • Build simple computing devices (pushdown automaton, Turing machine, and so on) that perform tasks • Leverage Racket's built-in libraries to develop a command line algebraic calculator Racket Programming the Fun Way is just like the language itself--an embodiment of everything that makes programming interesting and worthwhile, and that makes you a better programmer.

ISBN 9781718500822
出版社 No Starch Press
出版时间 2021年 1月
装帧 Paperback
页数 360

说明

Racket 的优势是,将 lisp + 常用数据类型 + 绘图 + GUI,因此可以很方便做出很多 2D 图形游戏。

适合作为讲述通用编程思想的语言。

在实战中,lisp 的表达能力确实强于 python、js,但 Python 视觉上更简洁,少了许多视觉障碍,而 Js 也可能是最开始学的 C 教学的缘故,大家也习惯大括号。

主要内容:讲解了 lisp 基础,比如

  • 原子类型 Atomic Data,number 和 strings
  • Lists
  • S-Expressions
  • List Functions
    • length
    • reverse
    • sort
    • append
    • range
    • make-list
    • null?
    • index-of
    • member
  • Defines, Assigns and Variables
  • Symbols, Identifiers and Keywords
  • Equality
  • Strings, Things
  • String Functions
    • string-length
    • substring
    • string-titlecase
    • string-upcase
    • string-downcase
    • string<=?
    • string=?
    • string-replace
    • string-contains?
    • string-split
    • string-trim
  • String Conversion and Formatting Functions
  • Vectors
  • Struct
  • Controlling output
    • write
    • display
    • print
  • Arithmetic
    • Booleans
    • Integers
    • Rationals
    • Reals
    • Complex Numbers
  • Numeric Comparison
  • Built-in Functions
    • abs
    • ceiling
    • floor
    • tan
    • atan
    • cos
    • sqrt
    • srq
    • log
    • exp
    • expt
  • Function
  • 绘图
  • GUI
  • 算法

很多 Python 书也是这种思路了。

本书的最大特点就和 Racket 一样,非常学术,实现了扑克牌游戏、A* 算法、Dijkstra 算法、八皇后问题、数独,甚至还有我喜欢的 15-Puzzle,也是用 A* 搞定的。

Racket 画个黄金螺线,那是最擅长的

Racket 就像一个老教授或一个顶级 Geek 一样,可以实现一切算法。但将 Racket 用到 Real world 中,会遇到现实粗砺的坑,现实会用人性打败他,会用数据量打败它,会用缺少必要中间件、分布式组件打败它,让 Racket 呆在它的教学领域是最好的选择。

精通的 Racket,能很快适应现代语言的基础特性,毕竟编程语言的爷爷在这里,比如新语言中出现 match 等,而反过来就不成立。