Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why don't you code in assembly?

Name: Anonymous 2012-12-30 1:55

 

Name: Anonymous 2012-12-30 2:00

I like to be able to maintain my code with minimal effort. This isn't going to happen if I spend equal amounts of time studying my code as writing it.

Name: Mentifex 2012-12-30 2:02

http://www.scn.org/~mentifex/mindforth.txt

free open-source AI Mind Strong AI in 32/64-bit Forth

would have taken centuries to program.

Name: Anonymous 2012-12-30 2:06

I have better things to do than be a faggot.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2012-12-30 3:08

I do.

How else can you get an HTML5 tokenizer in <2KB?

Name: Anonymous 2012-12-30 4:49

I tried but I wasn't able to outperform gcc on O3, what with function inlining and all. It's better at symbolic manipulation at that level than I am. However I think I could beat it with a symbolic assembler.

Name: Anonymous 2012-12-30 4:55

>>3
holy fuck

this is incredible

Name: Anonymous 2012-12-30 5:43

>>5

nobody cares about filesize unless it matters in performance
nobody cares about performance unless it's noticeable

tfw haven't written in anything other than python and jabbascript in 2 years

Name: Anonymous 2012-12-30 5:51

>>3
This guy must be insane

Name: Anonymous 2012-12-30 7:52

>>8
You must be Hatchling level.

>>9
Aren't we all?

Name: Anonymous 2012-12-30 8:38

The first programming language I learned was Toy, about a week ago:
http://www.kernighan.com/toysim.html

The second programming language I learned was JavaScript, about a day ago.

I think I prefer JavaScript, but I'm waiting until I finish reading D is for Digital before I decide what the best programming language is.

Name: Anonymous 2012-12-30 8:57

>>11
READ SICP

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2012-12-30 9:03

>>6
Either you're very inexperienced with Asm or the code was really simple/short.

Name: Anonymous 2012-12-30 10:18

JNZ YOURMOM

Name: Anonymous 2012-12-30 12:01

>>11
I think I prefer JavaScript
fuck off

Name: Anonymous 2012-12-30 14:48

>>15
being this butthurt over other people's language choices
implying JabaScripy isn't masterrace

Name: Not >>15 2012-12-30 15:48

>>16
Please learn how to write proper prose instead of using quotations of phrases that have never been said before, friend from /g/.

If you want to use those pseudo-quotations because you think they're funny, I'm sorry for you. /prog/ is a very bitter board and doesn't appreciate that kind of humor.

That's why you should go and have some fun at /g/, I'm sure they're more friendly and would appreciate your humor.

Name: Anonymous 2012-12-30 15:56

>>17
LLLLLLLLLLLELLLLLLLLLLLLLLLLLLEEEEEEEEEEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
EGIN LE FAGSHIT

Name: Anonymous 2012-12-30 15:57

>>16
Back to /g/, please.

19 Name: ``faggot'' : 2012-12-30 15:50
>>18
LELELELE XDD EGGING XDDDDD

>>19
Fuck off.

Name: Anonymous 2012-12-30 15:58

>>18-19
Come on, /frog/.

Name: Anonymous 2012-12-30 17:49

>>13
It was a very short routine. The naive recursive fibs function. I got my implementation pretty tight and I was using eax to pass the n function parameter, but it still wasn't faster than gcc. After looking at gcc's output, I saw that it had inlined the recursive calls by several layers, and used the other registers within the main body. I could have done the same thing, but I don't know, it would have felt like I was going to far. When you start with an optimal algorithm it isn't hard to streamline it in assembly by hand. But it seems with suboptimal code, symbolic manipulation at the higher level can improve the algorithm.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2012-12-31 1:08

>>21
recursive
You're doing it wrong.


fib
   xor eax, eax
   mov ecx, [esp+4]
   inc eax
   inc ecx
   cdq
fibloop
   add eax, edx
   xchg eax, edx
   loop fibloop
   ret

Name: Anonymous 2012-12-31 3:05

>>22 looks pretty clean, and i recognise the a=a+b / b=b+a loop =) even though i have hardly seen any asm..
I don't suppose you could explain how it breaks out of the loop?

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2012-12-31 4:51

>>23
Look up the loop instruction in the x86 instruction set reference.

Name: Anonymous 2012-12-31 5:09

>>22
Pig disgusting Intel syntax.

Name: the smartest person on /prog/ 2012-12-31 5:12

Because it's not 1991 and software is expected to be modular and portable and not written in archaic machine-specific dialects by basement dwelling schizophrenics with aspergers.

Name: Anonymous 2012-12-31 5:40

>>25
Go back to worshipping /g/nu.

Name: Anonymous 2012-12-31 5:43

>>22
Yes, I know. I use the naive fibs function as a way to test how good an implementation is at doing lots of function calls.

Name: Anonymous 2012-12-31 6:09

I still don't get why people say Cudder is a troll when most of their posts seem constructive.

Name: Anonymous 2012-12-31 6:13

fibs thread? fibs thread.

Prove the following:

fn2 + fn+12 = f2n+1

And then use its correctness to write an O(log(n)) fibs algorithm.

Then implement it as compactly as possible in assembly.

Name: Anonymous 2012-12-31 6:31

>>30
How about you implement Google in Brainfuck?

Name: Anonymous 2012-12-31 6:34

>>30
Whoa, how the fuck.

Name: Anonymous 2012-12-31 6:45

>>31,32
I'll give hints if you get stuck. Good luck!

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2012-12-31 6:52

>>30
This is O(1):

 fld PHI
 fild d[esp+4]
 call pow
 fld PHI2
 fild d[esp+4]
 call pow
 fsub
 fld SQRT5
 fdiv
 fistp d[esp+4]
 mov eax, [esp+4]
 ret


(Implementation of pow and definition of the constants left as an exercise for the reader.

Name: Anonymous 2012-12-31 6:57

>>33
Nah, I'm a mathematician, I should be able to do this.

Name: Anonymous 2012-12-31 7:04

>>34
I remember that thread.

>>35
The proof is especially tricky, despite not requiring many prerequisites.

Name: Anonymous 2012-12-31 7:17

>>36
I got 31/120 on the Putnam Competition. You'd think that's bad, but consider how the median grade is 1/120.

Name: Anonymous 2012-12-31 7:26

>>37
That sounds like fun.

Name: Anonymous 2012-12-31 9:26

>>7
holy fuck
you're a fagshit

Name: Anonymous 2012-12-31 17:33

>>30
bumping for neo prog, I mean text only /g/

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List