Hacker News new | past | comments | ask | show | jobs | submit | weird_user's comments login

I think you misunderstood this. This is not an illusion of objects from different angles, but an unintuitive transformation of geometry.


They didn’t misunderstand. If you look at the images included in the paper (this link has them inline: https://journalofillusion.net/index.php/joi/article/view/983...) you can see that it is an illusion that can be created with 3D printed objects.


The linked STL is a different Kokichi Sugihara illusion - by the same creator as this new class of illusions, and part of a body of work in this field that this appears to be a continuation of.

https://en.wikipedia.org/wiki/Kokichi_Sugihara


But it is. Those are objects that are mirror symmetric, and the apparent direction they're facing depends on viewing angle, creating the illusion that they haven't actually been mirrored.



and youtube video of the 'reveal':

https://www.youtube.com/watch?v=n--zawliqvA


> Galaxies, like people, are made of ordinary matter, and we can use the laws of physics to predict how they should move.



It's still a useful generic exercise for beginners. Although I recommend starting with a simpler syntax like sexpr, you can get more practice with less code.

For a deeper exercise, I recommend compiling to machine code instead of stopping at bytecode [1]; you can learn assembly along the way, which is more satisfying than compiling to C.

[1]: https://github.com/byo-books/pretty_laughable_lang/


I agree that compiling to machine code is super satisfying, but there's a lot of upfront work you have to do before you can run your first "hello world": architectures, calling conventions, object file formats, linking.

That's why I no longer object to compiler tutorials stopping at assembly or even C, as long as the phases not present in interpreter tutorials like Bob Nystrom's brilliant one are non-trivial: type checking, optimizations, lowering.


One thing you can do is implement a JIT compiler.

Here's Martin Jacob's code to execute arbitrary memory. If you malloc a byte array and insert opcodes directly at indexes, you can construct machine code and execute it.

https://gist.github.com/martinjacobd/3ee56f3c7b7ce621034ec3e...

Since your C program is already in memory, you have access to the C standard library and don't have to worry about linking or object formats but you'll have to worry about parameter passing and FFI.

My toy JIT compiler based on this idea is here https://github.com/samsquire/compiler but it is incomplete.


Compiling to LLVM IR is much easier than machine code and would still be satisfying I think.


Fun fact: The demo image is an example of the hand-in-waistcoat gesture[1].

[1] https://en.wikipedia.org/wiki/Hand-in-waistcoat


You mean the astronaut shot?


What does the device in the lower right corner do? Age reversal?


You mean the meat grinder¹? You can click stuff for their reference, for that one it’s the teacher spanking the student.

¹ https://youtube.com/watch?v=YR5ApYxkU-U&t=138s


How hard can it be to turn a book into a course instead? I guess it's also hard because courses and books are consumed by different audiences.


actually, our original windows programming in c course translated petsold's book into a course and all the punters hated it! i don't think it is a good book anyway, and i eventually got funding to completely re-write it, to good effect.


While writing a book is not particularly profitable, the author could probably earn more by self-publishing rather than working with a publisher, since the author has done most of the marketing anyway.


I think you are likely correct on this but I do think having deadlines helped me make sure I actually finished. If I was to write another I would self publish.


A good way to have deadlines is to presell the book, and promise these deadlines to people who paid. Example: buy now for 50% of the final price, two chapters already ready, and I promise one new chapter every two weeks.

I use this strategy, and I’m always amazed that people trust me enough to deliver as promised :)


Given the amount of high profile kickstarter failures (or delays), i'm surprised that people would continue to do pre-orders and such! I guess if the cost is small, it won't be a loss for the backer even if it was delayed.


I not only self publish but I print and warehouse my latest book and only sell it from my website. Still can't sell more than 2,000, but I cover my costs.


I think I made significantly more working with pragmatic bookshelf than I would have self publishing. That may be particular to pragmatic though, as they have a fairly loyal reader base.


Interesting! I wonder how big their read base is. Other commenters mentioned sales numbers around 2000, you must have made a far larger sale to compensate for the lower loyalty.


Rightly or wrongly, I find there's still a certain aura to going with an established publisher where it's justified or not. I've done both.


Compiling to machine code is not that hard once you get to the IR or bytecode phase, check out this toy compiler:

https://github.com/byo-books/pretty_laughable_lang/


Is that really true? I would expect that going from IR to native code would be the hardest part because you have to worry about architecture and supporting different ISA’s. IR can be simple because it is abstract and hides lots of the dirty details of the hardware.


Generating code is not all that hard. Generating fast code is a challenge. Decoding instructions on some architectures is hard. If you have a nice general IR naively generating native code can be just a table lookup with a register tracking/allocation routine.


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

Search: