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

推荐订阅源

The Register - Security
The Register - Security
云风的 BLOG
云风的 BLOG
U
Unit 42
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
D
Docker
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
S
Secure Thoughts
Hacker News: Ask HN
Hacker News: Ask HN
Vercel News
Vercel News
S
Security @ Cisco Blogs
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
I
Intezer
MongoDB | Blog
MongoDB | Blog
AI
AI
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
Y
Y Combinator Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
W
WeLiveSecurity
博客园 - 叶小钗
S
SegmentFault 最新的问题
N
News | PayPal Newsroom
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
DataBreaches.Net
小众软件
小众软件
Microsoft Azure Blog
Microsoft Azure Blog
Spread Privacy
Spread Privacy
H
Help Net Security
美团技术团队
博客园 - 司徒正美
T
Threat Research - Cisco Blogs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
K
Kaspersky official blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
V
Vulnerabilities – Threatpost
TaoSecurity Blog
TaoSecurity Blog
N
Netflix TechBlog - Medium
L
Lohrmann on Cybersecurity
J
Java Code Geeks
量子位
Martin Fowler
Martin Fowler
博客园_首页

某岛

AtCoder Beginner Contest 409 Luogu P5325. 【模板】Min_25 筛 UOJ #188. 【UR #13】Sanrd AtCoder Beginner Contest 371 AtCoder Beginner Contest 369 RPGMaker 2k3 百科 OneShot 的考古 2024“开创拓芯”游戏创享节的相关记录 CJ 回来后的戒断反应 Luogu P10221. [省选联考 2024] 重塑时光 Luogu P5308 [COCI2018-2019#4] Akvizna wqs 二分 歌唱王国 Lean 相关 BZOJ 3153. Sone1 The 2023 ICPC World Finals Luxor 新巴别塔 Sora 的想象与思考 Facebook Hacker Cup 2023 Round 1 AtCoder Beginner Contest 322 LLaMA 2 相关 HuggingFace AI Game Jam ACL 2023 Trans 相关… Luogu P2053. [SCOI2007] 修车 Luogu P1973. [NOI2011] NOI 嘉年华 Luogu P1933. [NOI2010] 旅行路线 Luogu P1954. [NOI2010] 航空管制 Luogu P2048. [NOI2010] 超级钢琴 Luogu P2046. [NOI2010] 海拔 Luogu P3227. [HNOI2013] 切糕 Luogu P8500. [NOI2022] 冒泡排序 Luogu P3629. [APIO2010] 巡逻 USACO 2018 February Contest, Gold Problem 2. Directory Traversal Luogu P3647. [APIO2014] 连珠线 IZhO 2017. Problem F. Hard route SPOJ TWOPATHS. Two Paths 换根 dp 洪恩电脑 —— 开天辟地 Facebook Hacker Cup 2022 Round 2 Codeforces Round #875 Luogu P5828 边双连通图计数 EC Final 拉格朗日反演定理 Luogu P5827. 点双连通图计数 无标号连通图 AtCoder Beginner Contest 284 Luogu P4708. 画画 Luogu P6295. 有标号 DAG 计数 BZOJ #2863. 愤怒的元首 HDU 3303. Harmony Forever 聊聊《明日方舟 Side Story 孤星》与《崩坏:星穹铁道》 SGU 208. Toral Tickets 后日谈,SHLUG 月度分享(上) 钢琴练习 EasyRPG x ChatGPT ControlNet 相关 The 1st Universal Cup, Stage 4, Ukraine EasyRPG —— Sliding Puzzle The 1st Universal Cup, Stage 3, Poland DP 优化练习 NOI 2009 TypeDB Forces 2023 Nas 买来做什么… The 1st Universal Cup, Stage 2, Hongkong The 1st Universal Cup, Stage 0, Nanjing Codeforces Round #850 舟游同人游戏 RM2k3 机能增强 —— EasyRPG Player 魔改版 《海之歌》设定与剧本 dfs 序求 lca Codeforces Round #844 P3768 简单的数学题 AtCoder Beginner Contest 281 ChatGPT 相关 AtCoder Grand Contest 059 AtCoder Beginner Contest 280 Codeforces Global Round 24 事实核查,以乌鲁木齐火灾为例 SPOJ MUSKET. Musketeers Pinely Round 1 Note about FTX Permutation ICPC World Final 2021 CodeTON Round 3 Codeforces Round #831 Educational Codeforces Round 138 NovelAI 法术指南 卡农 Educational Codeforces Round 135 Codeforces Round #819 瓦喵之夏 NOI 2022 Luogu P3765 总统选举 Luogu P3369 【模板】普通平衡树 网络国家 旋转卡壳 OFAC Sanctions && Tornado Cash BZOJ 1185. [HNOI2007]最小矩形覆盖 Codeforces Round #814
Global Game Jam 2023 参赛纪录
2023-02-07 · via 某岛

February 7, 2023

57. [20] When a program changes one or more of its own instructions in memory, it is said to have self-modifying code. MMIX insists that a SYNCID command be issued before such modified commands are executed. Explain why self-modifying code is usually undesirable in a modern computer.
—— THE ART OF COMPUTER PROGRAMMING VOLUME 1, FASCICLE 1, MMIX, A RISC Computer for the New Millennium, Page 28

递归、元编程、与自修改代码

作为一名 OIer,理所应当的,我十分喜欢含有 自我指涉 的程序,最简单的自我指涉可能就是递归了,在初一第一次看到递归程序时,我的感想是:哇,程序还能这么写!(要是能有人在更小的时候教我就更好了…)
长大后发现比递归更高级的自我指涉,是存在的,其中之一就是,元编程。。。

例如在 Pytorch 中,就有利用元编程方法生成各种模板的特化代码以优化效率的设计。。。
在开源机器人模拟软件 OpenRave 中、也有类似方法生成解动态运动学方程(Dynamics Kinetic Equation)的定制代码。(我是听老板说的。。。我可没办法求证。。囧。。。)

比元编程更高级的自我指涉程序也是存在的。。。。
就是上面 MMIX 里提到的。。。self-modifying code。。。。

self-modifying code 或许只能在汇编语言这个层级存在?因为它要去修改运行时这个代码本身所处在的存储空间。。在这类代码中,空间,规则,函数,一切的一切都是那么的不可考。。。自然会产生很多奇妙的事件。。。
(所以不会有人在生产环境中这么干吧。。。)

或许在一些解谜游戏中会产生这种 self-modifying code 。。。我不确定。。。但是我现在也没有特别好的 self-modifying code 的例子。。。
你看到的是,越接近底层,我们有时反而就越接近真理。。。

当然了。。。在动态语言里,我们可以使用 Eval 来 somehow 模拟这种 self-modifying code 的感觉。。。
(因为许多静态语言也都有一定的 reflection 能力了,所以看起来是否支持 Eval 是一个更好的区别动态语言和静态语言的 Critiria。。)

为什么喜欢自我指涉?

因为自我指涉通常伴随着悖论。。。而悖论的出现通常可以帮助你进行 debug 。。。从而获得洞见。。。(无理数、光电效应、etcs)
根据柏拉图的 洞穴理论,现在不搞点 bug 出来我们怎么去认识外面的世界啊。。。

WIP …

Posted by xiaodao
Category: 日常