APL (124 120120 116)
This is way too long. It does grade school multiplication.
N←{↓⌽↑⌽¨⍵}⋄⎕←(S⍴'⋄S↓'-'),,A/A⊂⍨0≠A←⍨∨\×A←{∨/M←9<T←0,⍵:∇(1⌽M)+T-M×10⋄⍵}⊃+/N↑⍨⌿2L⍴E,(L-1)+⍳L←⊃⍴E←⌽Y∘ר⊃X Y←N⍎¨¨A~¨'-'⊣S←1=+'⊣S←1≠+/'-'∊¨A←⍞⍞ Explanation:
N←{↓⌽↑⌽¨⍵}:Nis a function that, given a vector of vectors, makes all the vectors the same length, padding with zeroes at the front. It does this by reversing all inner vectors (⌽¨), turning the vector of vectors into a matrix (↑), reversing this matrix (⌽), and turning it back into a vector of vectors (↓).S←1=+S←1≠+/'-'∊¨A←⍞⍞: Read two lines of input, as characters (⍞⍞), store them in A, and count how many minuses there are in the input.Sis zero or one depending on whether the result will be negativepositive.X Y←N⍎¨¨A~¨'-': In A (our input) without (~) the minuses, evaluate each separate character (⍎¨¨), run it through the N function and save the two vectors in X and Y. If the input was12332, we now haveX=1 2 3 Y=0 3 2.L←⊃⍴E←⌽Y∘ר⊃X Y: For each digit in the first vector, produce a vector with the digits from the second vector multiplied by that digit. Reverse this vector of vectors so that the least significant one is at the front. Store this vector in E and its length in L.+/N↑⍨⌿2L⍴E,(L-1)+⍳L: Shift all of these vectors left, padding with zeroes on the right, by their index. Run them through N again so that they're all the same length. Then add all these vectors together. I.e.:
1 2 3 3 2 ------ 2 4 6 (shift 0) 3 6 9 (shift 1) -------- 3 8 13 6 (before carry) 3 9 3 6 (after carry)
A←{∨/M←9<T←0,⍵:∇(1⌽M)+T-M×10⋄⍵}: Carry the ones. As long as there are still 'digits' higher than 10 (∨/M←9<T←0,⍵), add one to the next significant digit (∇(1⌽M)+T) and remove 10 from the offending digit (-M×10).'-',A/A⊂⍨0≠A⍨∨\×A: Remove any leading zeroes from the result vector, and add a minus in front.⎕←(S⍴'-'),S↓: Output itRemoveScharacters from the front, prefixed with a minusi.e. if the result wasis supposed to be negativepositive then remove the minus again.