TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Synesthesia – Optimizing brainfuck compiler implemented as Nim macros

33 点作者 jeff_ciesielski超过 6 年前

3 条评论

mratsim超过 6 年前
I&#x27;m playing a lot with VM, interpreters, JIT and recently compilers in Nim.<p>Here is a JIT brainfuck VM: <a href="https:&#x2F;&#x2F;github.com&#x2F;mratsim&#x2F;jitterland" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mratsim&#x2F;jitterland</a><p>Nim macros are extremely useful for assemblers and emulators as contrary to many codebases which needs to use an intermediate code generation step via text files [1][2][3] you can directly use them with type checking and all Nim facilities while keeping an easy to read syntax: <a href="https:&#x2F;&#x2F;github.com&#x2F;numforge&#x2F;laser&#x2F;blob&#x2F;e898f027&#x2F;laser&#x2F;photon_jit&#x2F;x86_64&#x2F;x86_64_ops.nim" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;numforge&#x2F;laser&#x2F;blob&#x2F;e898f027&#x2F;laser&#x2F;photon...</a><p>[1]: Xbyak - <a href="https:&#x2F;&#x2F;github.com&#x2F;herumi&#x2F;xbyak&#x2F;blob&#x2F;v5.751&#x2F;gen&#x2F;gen_avx512.cpp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;herumi&#x2F;xbyak&#x2F;blob&#x2F;v5.751&#x2F;gen&#x2F;gen_avx512.c...</a><p>[2]: NNPack + PeachPy - <a href="https:&#x2F;&#x2F;github.com&#x2F;Maratyszcza&#x2F;NNPACK&#x2F;blob&#x2F;af40ea7d&#x2F;src&#x2F;x86_64-fma&#x2F;relu.py" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Maratyszcza&#x2F;NNPACK&#x2F;blob&#x2F;af40ea7d&#x2F;src&#x2F;x86_...</a><p>[3]: Apache Milagro Crypto - <a href="https:&#x2F;&#x2F;github.com&#x2F;apache&#x2F;incubator-milagro-crypto&#x2F;blob&#x2F;d43ac938&#x2F;version3&#x2F;c&#x2F;config64.py" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;apache&#x2F;incubator-milagro-crypto&#x2F;blob&#x2F;d43a...</a>
def-超过 6 年前
Related: <a href="http:&#x2F;&#x2F;howistart.org&#x2F;posts&#x2F;nim&#x2F;1&#x2F;index.html" rel="nofollow">http:&#x2F;&#x2F;howistart.org&#x2F;posts&#x2F;nim&#x2F;1&#x2F;index.html</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;def-&#x2F;nim-brainfuck" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;def-&#x2F;nim-brainfuck</a>
fjfaase超过 6 年前
Similar implementation in JavaScript: <a href="http:&#x2F;&#x2F;www.iwriteiam.nl&#x2F;Ha_bf_online.html" rel="nofollow">http:&#x2F;&#x2F;www.iwriteiam.nl&#x2F;Ha_bf_online.html</a>