TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Running Advent of Code on a $2 microcontroller

90 pointsby kasperlover 2 years ago

4 comments

ErikCorryover 2 years ago
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 未加载
mowfaskover 2 years ago
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.
tantalorover 2 years ago
&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 未加载
scotty79over 2 years ago
What a wonderful little language! Can I use it on PC?
评论 #34217044 未加载