5 ms·
Something similar, but you can play with the examples in the browser without any local setup https://shikaan.github.io/assembly/x86/guide/2024/09/08/x86-64-intr
by shikaan 1y ago
Something similar, but you can play with the examples in the browser without any local setup https://shikaan.github.io/assembly/x86/guide/2024/09/08/x86-64-introduction-hello.html https://shikaan.github.io/assembly/x86/guide/2024/09/08/x86-...
For full disclosure, I am the author - apologies for the shameless plug
- LtdJorge 1y agoIt's cool. Do you sanitize the untrusted input? As far as I can see, it directly assembles with NASM and runs the binary.
- tialaramex 1y agoIt might be similar to Matt Godbolt's experience with his "Compiler Explorer". Most of your users are not trying to set fire to the free system, and when somebody does, on purpose or by accident, you focus on being able to reliably recover, not prevent it. So e.g. maybe Clara T Vandal "cleverly" seizes control of a random Compiler Explorer build box, well, that box is no longer marked OK because of her changes, it gets automatically torn down and replaced, no real problem. Did Clara do 0.001¢ of Bitcoin creation without paying for it? Yeah, maybe, and Clara probably cost Matt 0.1 cents for the data centre fees but it's not a big deal.
- norskeld 1y agoLooking at the source code of the code-editor [1], it seems to be embedding https://onecompiler.com https://onecompiler.com via the iframe and delegating code compilation and execution to it. So I guess it's a question to onecompiler, whether they sanitize input or not. :) [1]: https://github.com/shikaan/shikaan.github.io/blob/main/_includes/code-editor.html https://github.com/shikaan/shikaan.github.io/blob/main/_incl...
- shikaan 1y agoExactly this. I have been planning on trying to glue up something with v86[1] as I did in OSle[2] but I did not get to it yet. In that case, everything would run locally and sandboxes, so you would not have to care. [1]: https://github.com/copy/v86 https://github.com/copy/v86 [2]: https://github.com/shikaan/osle https://github.com/shikaan/osle
- 90s_dev 1y agoThanks, I'll be using this. What I don't understand is why assembly feels so hard to learn in the first place? I mean, isn't it just a simple language with a few function calls (instructions) and types (operand sizes) and fixed number of variables (registers) and a small number of control flow operators, and that's it? Why does it feel so mysterious?
- breckinloggins 1y agoI can think of several reasons: 1. You are primed to think that it is mysterious because that’s all you usually hear about assembly. (“Roller Coaster Tycoon was written in 100% hand crafted assembly… what an absolute wizard!!”) 2. The language’s textual format is odd - columns vs nested indentation. Actually really nice once you get used to it, but it’s definitely alien at first. 3. Mnemonics and directives have short, cryptic spellings. x86 in particular has arbitrary looking register names as well. RV, AArch64, m68k etc do better here. 4. Mnemonics are inconsistently overloaded and encode lots of stuff. SIMD instructions tend to look like a cat sat on your keyboard. 5. Manually laying out memory is technically simpler than the abstractions provided by higher level languages (structs and classes, fancy generic types, pointer syntax), but it’s fiddly and you have to deal with alignment. 6. You have to do a lot of bookkeeping yourself. It’s like malloc/free turned to 11. 7. Register allocation is a hard problem for computers. It’s kinda tough for humans, too. 8. Lots of books and online stuff discuss assembly for use with high performance code, tight compute kernels, raw hardware access, and fiddly CPU configuration for OS startup and virtual memory configuration. This requires even more specialized registers, arcane instructions, and bit fiddling. This stuff - along with reverse engineering and security research/attacks - gets lumped into what people think of as “assembly language”. The resulting concept surface therefore looks much larger than it actually is. I highly recommend making a non-trivial program entirely in assembly at least once. I need to do it occasionally professionally but even when I don’t I usually have a hobby project or two cooking at home. Becoming as proficient in asm as - say - C or Python is quite the lovely expression of craft. You feel like a wizard (see point 1) while simultaneously learning what’s really going on. For people with a certain geeky disposition it pays lots of aesthetic, psychological, and professional dividends.
- duped 1y ago