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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Running Advent of Code on a $2 microcontroller

90 点作者 kasperl超过 2 年前

4 条评论

ErikCorry超过 2 年前
Two different Smalltalk-on-embedded articles on the front page of Hacker news right now: This one (by me) and <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=34208753" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=34208753</a><p>Yes, Toit is pretty much a Smalltalk dialect.<p><i>Similarities</i><p>Blocks (closures passed to functions as a foundation of control flow)<p>Blocks have non-local return (you can return from the syntactically enclosing fn in a block).<p>Block arguments introduced with | | delimiters<p>Single inheritance object orientation<p>Dynamic typing but type safe<p>Named arguments<p>Uses virtual machine to run, including garbage collector.<p><i>Differences</i><p>Toit&#x27;s syntax is more like a cleaned up Python than Smalltalk.<p>Toit also has positional arguments.<p>Toit&#x27;s blocks are more lightweight than Smalltalk closures (no allocation)<p>Development is with source files and compiler, not image-based.<p>Toit has optional types, and if you use them they are checked. (Types are non-nullable by default.)<p>Toit has interfaces<p>Toit can build standalone executables, VM included<p>Toit has top level functions not attached as methods to some class.<p>Array (List) indexing is 0-based, not 1-based.<p>Quick intro here: <a href="https:&#x2F;&#x2F;docs.toit.io&#x2F;language" rel="nofollow">https:&#x2F;&#x2F;docs.toit.io&#x2F;language</a>
评论 #34216910 未加载
mowfask超过 2 年前
Has anyone else here done AoC on a microcontroller?<p>I&#x27;m still at it, using an STM32 part with 40KB of RAM. Have never touched Smalltalk, instead I&#x27;m using Rust. It&#x27;s going ok, though I&#x27;m only at day 12.
tantalor超过 2 年前
&gt; special CoordSet that wraps a regular Set, encoding objects into integers... we don’t need to implement decoding the integers and reifying the Coord objects<p>Wouldn&#x27;t it be much simpler to just keep a set of hashes? That&#x27;s basically what this is.
评论 #34212773 未加载
scotty79超过 2 年前
What a wonderful little language! Can I use it on PC?
评论 #34217044 未加载