tfw computers have optimized for dumb languages and compilers
Name:
Anonymous2017-01-28 4:44
You can do exactly the same thing in C with goto and jmp_buf.
For how long do you plan to keep making these posts about micro-optimizing your assembly code? This is stuff that 14-year-olds find interesting after they've discovered ASM for the first time and subsequently grow out of when they realize it has no bearing on writing real software. You're basically still masturbating with bit-twiddle kiddy shit while the grown-ups have moved on to fucking their ENTERPRISE-grade vaginas.
Name:
Cudder !cXCudderUE2017-01-28 5:54
>>10 Yes, setjmp/longjmp works but it's still more bloated than literally 2 instructions.
they realize it has no bearing on writing real software
If "real software" means bloated, slow, unreliable masses of complexity that barely work, I don't care about that. Open your mind and see what computers can really do.
Name:
Anonymous2017-01-28 7:57
yeah, software is unreliable because people don't microoptimize every single fucking thing to the level of a single CPU cycle. meanwhile, your solution has one flaw that is pretty serious from the perspective of a software project that is supposed to be used by more than one person or maybe on a one specific system: it's restricted to x86.
>>14 yes, but you have to write machine-specific code for each system, which is something you avoid as much as possible when going for portability. sometimes you can't avoid it and sometimes you shouldn't (careful asm is probably the best way to ensure constant-time performance in crypto) but in general, portable is better than machine-specific
Here, not only does this work on multiple platforms but it handles any UTF-8 code points, making it globally aware, unlike your US imperialist glibc trash with its assumption that every "character" is 8 bits.
YES this program requires the end user to press ENTER when finished, seeking affirmative consent that they are ready to continue. A stark contrast to the rape culture of "getch".
*mic drop*
func main() { reader := bufio.NewReader(os.Stdin) r, _, e := reader.ReadRune() if e == io.EOF { ... } ...
r, _, e = reader.ReadRune() if e == io.EOF { ... } ...
r, _, e = reader.ReadRune() if e == io.EOF { ... } ... }
>>19 if e == io.EOF if e == io.EOF if e == io.EOF if e == io.EOF if e == io.EOF if e == io.EOF if e == io.EOF if e == io.EOF if e == io.EOF Congratulations, you completely missed the fucking point.