<story><title>Abstraction is expensive</title><url>https://specbranch.com/posts/expensive-abstraction/</url></story><parent_chain><item><author>dlivingston</author><text>&amp;gt; Even assembly language is an abstraction&lt;p&gt;Is this true? I thought assembly mapped 1-to-1 with actual HW instructions. If so, assembly wouldn&amp;#x27;t be an abstraction, it would be an interface.</text></item><item><author>ghaff</author><text>The headline is sort of misleading. It is (appropriately) primarily about inappropriate abstractions. As you say, some abstractions are unavoidable. Even assembly language is an abstraction.</text></item><item><author>nine_k</author><text>Lack of abstraction is also expensive: try writing something large in assembly.&lt;p&gt;I&amp;#x27;d say that lack of a &lt;i&gt;language &amp;#x2F; system of notions adequate to the subject area&lt;/i&gt; is expensive. The desire to describe things in a way that&amp;#x27;s efficient for a particular class of problems leads to invention of various frameworks. Say, Rails makes you &lt;i&gt;hugely&lt;/i&gt; productive at solving a particular type of problems (see [Shopify]), though it&amp;#x27;s less than helpful if you try to apply it to unfitting problems (see [Twitter]).&lt;p&gt;[Shopify]: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;tomaszs2.medium.com&amp;#x2F;how-shopify-handled-1-27-million-requests-s-during-black-friday-cyber-monday-8a4b1d0dd1f9&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;tomaszs2.medium.com&amp;#x2F;how-shopify-handled-1-27-million...&lt;/a&gt; (Sorry for a Medium link)&lt;p&gt;[Twitter]: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.theregister.com&amp;#x2F;2012&amp;#x2F;11&amp;#x2F;08&amp;#x2F;twitter_epic_traffic_saved_by_java&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.theregister.com&amp;#x2F;2012&amp;#x2F;11&amp;#x2F;08&amp;#x2F;twitter_epic_traffic_...&lt;/a&gt;</text></item></parent_chain><comment><author>constantcrying</author><text>&amp;gt;I thought assembly mapped 1-to-1 with actual HW instructions.&lt;p&gt;Assembly encodes a wide varity of abstractions (it is a human readable format after all) and lots of assembly instructions have a clear relation to an instruction on the hardware, but definitely not all.
E.g. a CPU does not understand what a &amp;quot;label&amp;quot; is and the semantics of a labels and jumping to them is removed by the assembler.&lt;p&gt;But &lt;i&gt;not even the assembled binary&lt;/i&gt; actually maps to executed instructions. The CPU is actually a virtual machine which presents itself as e.g. an x86 ISA interpreter, but internally it uses microcode executed in various performance enhancing ways to speed up the process.</text></comment>
<story><title>Abstraction is expensive</title><url>https://specbranch.com/posts/expensive-abstraction/</url></story><parent_chain><item><author>dlivingston</author><text>&amp;gt; Even assembly language is an abstraction&lt;p&gt;Is this true? I thought assembly mapped 1-to-1 with actual HW instructions. If so, assembly wouldn&amp;#x27;t be an abstraction, it would be an interface.</text></item><item><author>ghaff</author><text>The headline is sort of misleading. It is (appropriately) primarily about inappropriate abstractions. As you say, some abstractions are unavoidable. Even assembly language is an abstraction.</text></item><item><author>nine_k</author><text>Lack of abstraction is also expensive: try writing something large in assembly.&lt;p&gt;I&amp;#x27;d say that lack of a &lt;i&gt;language &amp;#x2F; system of notions adequate to the subject area&lt;/i&gt; is expensive. The desire to describe things in a way that&amp;#x27;s efficient for a particular class of problems leads to invention of various frameworks. Say, Rails makes you &lt;i&gt;hugely&lt;/i&gt; productive at solving a particular type of problems (see [Shopify]), though it&amp;#x27;s less than helpful if you try to apply it to unfitting problems (see [Twitter]).&lt;p&gt;[Shopify]: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;tomaszs2.medium.com&amp;#x2F;how-shopify-handled-1-27-million-requests-s-during-black-friday-cyber-monday-8a4b1d0dd1f9&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;tomaszs2.medium.com&amp;#x2F;how-shopify-handled-1-27-million...&lt;/a&gt; (Sorry for a Medium link)&lt;p&gt;[Twitter]: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.theregister.com&amp;#x2F;2012&amp;#x2F;11&amp;#x2F;08&amp;#x2F;twitter_epic_traffic_saved_by_java&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.theregister.com&amp;#x2F;2012&amp;#x2F;11&amp;#x2F;08&amp;#x2F;twitter_epic_traffic_...&lt;/a&gt;</text></item></parent_chain><comment><author>nine_k</author><text>First of all, you normally use symbolic labels, not offsets for jumps; the assembler will calculate them for you, and a linker will possibly build a relocation table based on them. Then, any good assembler has macros. Also, data &amp;#x2F; text blocks, etc that are not code but an abstraction which the linker later uses.&lt;p&gt;Writing machine &lt;i&gt;code&lt;/i&gt; directly, as a byte stream, is fun, but is exhausting.</text></comment>