Teknologi Umum v2.0
Ronny Gunawan ️

assembly itu perlu

biar kita selalu tau code yang kita tulis efisien atau goblok

botak licin

kan udah bisa di automasi pake compiler.

buat apa bikin compiler canggih2 kalo masih manual

wkwk

Ronny Gunawan ️
botak licin

kan udah bisa di automasi pake compiler.

ok rephrase: belajar assembly itu perlu

buat wawasan

once you know assembly, you'll look at code differently

botak licin

yes, kalo mau low-level programming, beneran low level

Ronny Gunawan ️

bukan gitu

AI, explain why knowing basic concept of assembly makes us see our C++ code differently

TEKNUM™
Ronny Gunawan ️

AI, explain why knowing basic concept of assembly makes us see our C++ code differently

Assembly language is a low-level language that is used to communicate directly with the computer's hardware. It is a tedious and complex language because it involves writing instructions in binary format, which can be difficult to comprehend and take longer to write.
On the other hand, C++ is a high-level language that allows developers to write programs using familiar English-like syntax. C++ code is then compiled into binary instructions that the computer can understand.
When we have an understanding of assembly language, we gain a deeper understanding of how our C++ code is translated into binary and how our code interacts with the computer's hardware. This knowledge can help us optimize our code for performance and write more efficient programs.
Furthermore, knowing assembly can also help us to identify any potential security vulnerabilities in our code, as we can see exactly how data is stored, processed and moved around the computer's memory.
Overall, having knowledge of assembly can give us a better appreciation of how our C++ code works at a lower level and how it interacts with the hardware, which can ultimately help us to write better, more optimized, and more secure programs.

botak licin
botak licin

yes, kalo mau low-level programming, beneran low level

apalagi kalo mau pake feature cpu, gak semua bahasa punya feature intrinsic atau api ke sana, musti pake assembly

TEKNUM™
Ronny Gunawan ️

does it also apply to writing golang code or C# code?

Yes, even though GoLang and C# are higher-level languages, understanding assembly language can still be useful for developing programs in those languages.
For example, GoLang and C# are both compiled languages, which means that the code written in these languages is translated into binary instructions that the computer can understand. Therefore, having a basic understanding of assembly language can help developers to optimize their programs and identify performance bottlenecks.
In addition to this, understanding assembly language can also help developers to better understand how the GoLang and C# compilers work and how the generated code interacts with the computer's hardware.
Overall, while assembly language is not necessary to write programs in GoLang or C#, having some knowledge of it can be advantageous for developers who want to develop more efficient, optimized, and secure programs.

TEKNUM™
Ronny Gunawan ️

it helps developers to decide which approach to take because the developers who understand assembly can visualize its target binary right?

Yes, that is correct. Having a solid understanding of assembly language can help developers to visualize the target binary code and anticipate how their written high-level code will be translated into lower-level binary instructions.
With this understanding, developers can make more informed decisions about the design and implementation of their programs. For example, they can identify and avoid coding practices that may result in suboptimal performance or security vulnerabilities at the assembly level.
Furthermore, understanding assembly language can help developers to write more optimized assembler code and debug low-level issues more easily. In this way, knowledge of assembly can be a valuable and powerful tool for software developers.

Jason Wihardja

Leaky abstraction as usual

TEKNUM™
botak licin

is it kind of abstractions leak if we have to tweak inside assembly ourself?

Yes, that's a good point. If we need to write assembly code ourselves to optimize or tweak our program, it means that we're effectively bypassing some of the abstractions provided by higher-level languages like C++. This can make our code less portable, harder to write and understand, and more prone to bugs and errors.
However, in some cases, it may be necessary to write assembly code for specific low-level tasks where higher-level abstractions simply aren't suitable. For example, if we need to write optimized code for numerical calculations or real-time audio processing, it may be necessary to write some assembly code to achieve the required level of speed and precision.
In general, it's important to strike a balance between using higher-level abstractions to write clean, maintainable code, and writing low-level code when necessary to achieve specific performance or functionality requirements.

Jason Wihardja

Kalo mau do something to the max, ya harus nyelam ke leaky abstraction2 itu

Compiler stuff included

Ronny Gunawan ️
botak licin

is it kind of abstractions leak if we have to tweak inside assembly ourself?

ngga harus sampe tweak assembly. cukup understand aja

Jason Wihardja

Yes, ga tweak, tapi setidaknya it doesn't hurt to know

botak licin

kalo compiler nya canggih, harusnya udah di optimisasi semua hal2 yang butuh manual optimised hand-written code

botak licin

tapi gak semua bahasa punya compiler secanggih itu

Ronny Gunawan ️

tapi ada hal2 yang masih perlu kita decide kaya deciding mau allocate di stack atau heap, mau mutable atau immutable, mau pass by value atau by reference, mau fixed size atau dynamic size, mau zero cost abstraction atau abstraction biasa

bahkan ada hal yang memang harus leaky yaitu hal2 yang berhubungan dengan vector dan SIMD

Jason Wihardja

Contohnya kayak in general kalo js ngelakuin spread, itu udah universally known sebagai slow. Padahal setelah nyelam ke code lower level, diketahui bahwa yang slow di engine v8 aja, yang mana engine lain ga significant slowdown nya. At least compared to v8

Ronny Gunawan ️
botak licin

ini ga perlu assembly mah, udah bisa direpresent oleh compiler

kalo ngga paham saya ngomong apa ngga usah didebat

Ahmad Tohir

bulan2 lalu baca2 elf nya pas abis di compile masih garuk2 kepala, agak mumet ya wwkkwk

Ronny Gunawan ️

pahami, cerna, barulah didebat

botak licin
Ronny Gunawan ️

kalo ngga paham saya ngomong apa ngga usah didebat

wkwk, maksudnya gimana om yang butuh asm?

Ahmad Tohir

tapi kalo udah liat asm nya emang jadi beda cara pandang ngoding di high level

botak licin

gw juga kemarin pas dilihatin gimana asm nya looping di rust dan go, kelihatan dimana zca yang dimaksud, wkwkwk,

botak licin

jadi perlu belajar assembly?,
*ga perlu, gak ada duitnya
*wkwkwk

Ronny Gunawan ️
botak licin

jadi perlu belajar assembly?,
*ga perlu, gak ada duitnya
*wkwkwk

apakah kalo kamu belajar bahasa inggris lantas sehari2 ngomongnya jadi inggris?

belajar != memakai

botak licin
Ronny Gunawan ️

belajar != memakai

ilmu tapi gak diterapin ya buat apa, wkwk

Ronny Gunawan ️

mungkin penjelasan simplenya gini. mana yang lebih efisien? C++ dev yang paham how assembly works atau yang ngga paham? golang dev yang ngerti how goroutine & channel work under the hood atau pernah ngebenchmark vs dev yang ngga ngerti? C#/java dev yang ngerti cara kerja GC vs yang ngga ngerti?

botak licin

ilmu tapi gak diterapin ya buat apa, wkwk

diterapinnya dalam decision making. bukan actually literally ngoding dalam bahasa assembly

ngerti GC bukan berarti bisa bikin GC sendiri

ngga harus hal low level

Ronny Gunawan ️

misal ada orang yang ngoding golang, ngga pernah pake pointer, perasaan kamu gimana?

botak licin

apalagi compiled language, harusnya udah di representasiin oleh compiler.
kecuali mau access intrinsics api, yang belum tentu semua bahasa provide

Ronny Gunawan ️
Ronny Gunawan ️

misal ada orang yang ngoding golang, ngga pernah pake pointer, perasaan kamu gimana?

atau orang ini begitu dikasih tau soal pointer, segala sesuatu dibikin pointer. perasaan kamu gimana?

Ronny Gunawan ️

you have to explain lower levelnya kan

memang ngga sampe asm

botak licin

explain in human language, yes
in asm, ga harus

Ronny Gunawan ️
botak licin

explain in human language, yes
in asm, ga harus

beberapa hal ngga bisa dijelasin in human language

even with visualization, belum tentu orangnya paham. yang ada orangnya NGERASA PAHAM, SOK PALING PAHAM, TERUS NGEDEBAT ORANG YANG SEBENRNYA LEBIH PAHAM