Hacker Newsnew | past | comments | ask | show | jobs | submit | akc's commentslogin

I had no idea dessert bars were so dangerous.


that "place" you refer to - are you speaking about your early days in Russia, or the US? Because I assure you discrimination is alive and well in both places.


How does one go about finding an attorney in these situations?


What do rendering times in Go look like, compared to a similar C implementation?


I don't have anything to compare to, but Go seems quite fast. I would guess no worse than 2x C in this case, but I'm pulling that number out of my butt.

Actually I was originally going to write this in C but it started to be a PITA and I had the spontaneous idea that maybe Go would be the right choice for this (never used it before). It totally was. No way I would've had this level of results so quickly in C.

Being a big fan of Python and C, Go seems like a really good middle ground. Really happy to have learned it.


As someone trying to learn the basics of rendering, I was really pleased to see your project pop up on the github explore email today. It's very easy to follow, even for a non-Go programmer like me.

Performance question from a no-Go programmer though - does returning objects from functions incur a cost? For example "func Reflect() Ray {}" or "func Add() Vector" - do they create a new object on the heap? If so is that an issue in Go?


I actually tried changing all of my Rays to *Rays, passing pointers instead of values, and it made no significant difference in rendering times.


I took a look at your code as I've been writing go for side projects for the last few months and like to compare styles.

You nailed the idiomatic go approach to development imho. Very nice.


I'm very very impressed by your code quality especially when this is just your first Go project. I'm an experienced Go developer btw. You're just so good.


One interesting benefit I see is the ability to easily parallelize the work. Take a look at the render implementation here - https://github.com/fogleman/pt/blob/master/pt/render.go#L28


It was SO easy! The only tricks were GOMAXPROCS and not using the shared rand functions because they are synchronized.


I'm interested in more information about why you decided to alter GOMAXPROCS and what your results were from testing.

I've had a play with this myself and found that it cause sporadic and unpredictable crashing (very different style of application though - I was building a webserver). However this was an earlier iteration of Go (possibly Go 1.1 but likely 1.2) so things may have improved since then, or you might have found a saner way of tweaking it.


When GOMAXPROCS > 1, your program goes from "everything is executed sequentially" to "everything is maybe executed in parallel." This can expose data race bugs in your code that aren't present when GOMAXPROCS = 1.

(I'd suggest using Go's race detector.)


You know, that's entirely possible. I was playing around with different methods of passing data between goroutines for increasing performance and I knew one of the methods I was testing wasn't idiomatic Go. However since I wasn't getting race conditions normally i assumed that the GOMAXPROCS fault wasn't down to my shonky code.

The weird thing is I thought I'd read somewhere that said Go defaulted to a process per CPU core (like the OP has hardcoded ib this project). I'm guessing that isn't the case then? It sadly wouldn't be the first time I've misread something! :(


GOMAXPROCS defaults to 1, meaning unless you change that value, your code will not run in parallel by default.


I have zero experience with rendering but I have never had an issue adjusting GOMAXPROCS for web apps.


Have a look at http://kidoman.io/programming/go-getter-part-3.html

Did this last year comparing Go 1.2 with C/C++ (and lots of other languages contributed by others.)

The original version: http://kidoman.io/programming/go-getter.html


So you're saying it's a lossy format.


what's your site?


Can I PM that to you?


sod it - cant find PM on HN. www.englishforums.com (that's the old version, we're updating in a couple of months)


I for one didn't know about Digital Ocean before I put this survey out, and now I do, and am really grateful as a result.


Digital Ocean is great.... I've been using them for a bunch of stuff. Make for great dab/staging servers and low cost platforms.


For small stuff, their entry level 5$ a month droplet is perfect and pretty much beats anything else I've come across. Having SSD backed storage is nice too.


added.




Watching these answers stream in on the spreadsheet really makes me think of what a realtime reddit or stack exchange could look like. Adding live interaction from observers (likes, comment streams, etc).


maybe you've heard of quora ;-)


I'm curious as to how they were able to line up the NYT coverage http://t.co/qCFneXpJwV with the launch announcement. Any idea who reps them, PR-wise?


it's the former CTO of Facebook. My guess is no rep needed.


No rep needed if all they want is coverage. If they want to craft the message, they still need PR. The job just changes from selling the story to getting the right people to cover it in the right way.

That's why Apple still takes PR very seriously even though the media are going to cover all of their product launches anyway.


I think he meant "No rep needed [to get NYTimes to publish to their schedule]", not an overall piece of business advice


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: