2
<p><span class="h-card" translate="no"><a href="https://chaos.social/@gsuberland" class="u-url mention">@<span>gsuberland</span></a></span> that&#39;s very interesting, but this language doesn&#39;t have math per se</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@mcc" class="u-url mention">@<span>mcc</span></a></span> a common approach I&#39;ve seen in various libraries (rather than languages specifically) is to have unit types as something you multiply by, matching how it works in maths itself.</p><p>e.g. in astropy you get a Unit type and a Quantity type, and multiplying a scalar by a Unit gives you a Quantity, such as 30*u.Hz = Quantity(30,Hz)</p>
<p>What are some syntaxes programming¹ languages have used for units?</p><p>I have a human-editable format where a human writes numbers, but might want to specify &quot;3&quot; vs &quot;3 hz&quot; vs &quot;3 samples&quot;. I want units to be string names, however</p><p>- Allowing the number to be separated from the unit by a space makes my parser hard<br />- Forcing them together, like 3hz, creates other problems, like hex support</p><p>¹ Would also be happy for syntaxes &quot;not normatively programming&quot; languages have used, like spreadsheet programs</p>
<p><span class="h-card" translate="no"><a href="https://f.duriansoftware.com/@joe" class="u-url mention">@<span>joe</span></a></span> awful</p>
<p>they call it a “conventional oven” because the temperature can’t go past 640 K</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@gamingonlinux" class="u-url mention">@<span>gamingonlinux</span></a></span> So they are getting a lot of users running away from Twitter to Mastodon and Bluesky, and they decided now it&#39;s the best time to go full on inserting ads and notifications begging for money so even more people run away from Twitter.</p><p>I don&#39;t understand what they&#39;re thinking.</p>
<p><span class="h-card" translate="no"><a href="https://social.noyu.me/@hikari" class="u-url mention">@<span>hikari</span></a></span> what if it&#39;s witch from mercury</p>
<p><span class="h-card" translate="no"><a href="https://social.noyu.me/@hikari" class="u-url mention">@<span>hikari</span></a></span> yeah</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@gamingonlinux" class="u-url mention">@<span>gamingonlinux</span></a></span> Trying to insult people, shows who you are.</p>