comatose_kid


Ray Tracer written in Arc (ajaykapal.com)
20 points by comatose_kid over 2 years ago | link
cached 10 days ago

14 points by comatose_kid over 2 years ago | link | top
cached 13 days ago
And I hereby propose that all the Arc haters be called Narcs.

9 points by comatose_kid over 2 years ago | link | parent | top
cached 23 days ago
While I agree with your sentiment, it is possible that the subset of people who complain about 'non hacker' stuff on news.yc doesn't intersect with the subset of people who complain about some feature that Arc lacks....

4 points by comatose_kid over 2 years ago | link | top
cached 10 days ago
Hi everyone, I've written a ray tracer in Arc with two goals in mind: Begin learning a lisp-like language, and implement a ray tracer (duh).

I'm sure the code could be nicer - I welcome suggestions from all of the experienced Lispers that frequent this site.


3 points by comatose_kid over 2 years ago | link | parent | top
cached 23 days ago
Thanks. Incidentally, your .emacs advice didn't work for me (I'm on emacs 23.0.50.2 if that matters), but this did:

(autoload 'arc-mode "arc" "Arc mode." t)

(add-to-list 'auto-mode-alist '("\\.arc$" . arc-mode))


3 points by comatose_kid over 2 years ago | link | parent | top
cached 10 days ago
Good question. Here are a few things that tripped me up:

1) An easy way to call differing functions based on the data type of an argument (polymorphism). Ruby has a nice approach as shown here (see the section marked 'Duck Typing'): http://www.ibm.com/developerworks/java/library/j-ruby/

2) I spent a while chasing a bug in an 'if' statement because I neglected to surround multiple statements with a 'do' statement.

3) It wasn't obvious to me how to build a bitmap array. I naively created an array filled with zeros for each scanline. I would then push this scanline onto another var. But it turned out all of the scanlines pushed this way were pointing to the same scanline. This was a problem until I found out how to copy a var in Arc (use copy!).

4) It's not clear to me how you modularize code, so everything is in one file.

5) Coding style. I have none when it comes to Arc, and there are few examples. For example, I didn't realize that an Arc convention is to append an asterisk to global variables (This follows the Lisp convention I think).

6) Spent time figuring out how to make my vector operations take list arguments without quotes (This was my initiation into the world of macros). Then realized that this was not necessary since these functions would have variables passed in arguments, not literal lists.

7) Errors were not specific (understatement).

8) No raw file output, or low level bit operators. So I added these to the base language.


3 points by comatose_kid over 2 years ago | link
cached 9 days ago

3 points by comatose_kid over 2 years ago | link
cached 2 days ago

2 points by comatose_kid over 2 years ago | link | top
cached 11 days ago

        ...  
   ..  .    ...
  .  . .   .
  .  .      ...

2 points by comatose_kid over 2 years ago | link | parent | top
cached 2 days ago
Thanks Kenny and Sacado. I'll try to digest your code/ideas later this evening.