4 ms·
4 in c. 11 in assembly. Not so bad, really. https://i.imgur.com/r2WRnZk.png https://i.imgur.com/r2WRnZk.png
by lylejantzi3rd 3y ago
4 in c. 11 in assembly. Not so bad, really.
https://i.imgur.com/r2WRnZk.png https://i.imgur.com/r2WRnZk.png
- dijit 3y agoI was about to make a joke about how many lines are required for an electron hello world but it was even more than I expected. 11 for the HTML document template 7 for the boilerplate package.json 3 more for the scripts addition to package.json 3 more for the “devdependencies” 20 for main.js from: https://electronjs.org/docs/latest/tutorial/quick-start https://electronjs.org/docs/latest/tutorial/quick-start A fairer assessment would be C++ with Qt to be honest though.
- SubjectToChange 3y agowrite a hello world application in gtk or qt and see how much assembly you get.
- GhostWhisperer 3y agolet's move the goal posts to doing it in brainfuck since we're at it
- SubjectToChange 3y agoWhat goalpost did I supposedly move?
- 5- 3y agox86_64 assembly, gtk3, 21 lines / 19 instructions build with e.g. gcc hw.s `pkg-config --libs gtk+-3.0` .globl main;main: push %rbx xor %esi, %esi xor %edi, %edi call gtk_init@PLT lea .HW(%rip), %r8 xor %edx, %edx xor %esi, %esi mov $2, %ecx xor %edi, %edi xor %eax, %eax call gtk_message_dialog_new@PLT mov %rax, %rbx mov %rax, %rdi call gtk_dialog_run@PLT mov %rbx, %rdi call gtk_widget_destroy@PLT xor %eax, %eax pop %rbx ret .HW:.string "Hello World!"
- SubjectToChange 3y agoAre you sure you couldn’t wrap that up in another library and just do everything in a single call?
- 5- 3y agoyou jest, but in fact you could. https://wiki.libsdl.org/SDL2/SDL_ShowSimpleMessageBox https://wiki.libsdl.org/SDL2/SDL_ShowSimpleMessageBox
- wiseowise 3y agoThat’s super ironic that you’ve shown screenshot from a web application.
- lylejantzi3rd 3y agoWhy, thank you!