NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
▲500 Lines or Less A 3D Modeller (aosabook.org)
forgotpwd16 2 days ago [-]
The entire "Architecture of Open Source Applications" is amazing, and among those "500 Lines or Less" is imo the most enjoyable. Many, that can perhaps be considered fundamental (e.g. databases, crawler, etc), projects from plan to implementation, Most in Python, but also CLisp, Clojure, JS, Julia.
omoikane 2 days ago [-]
The code appears to be here (about ~903 lines):

https://github.com/aosabook/500lines/tree/master/modeller/co...

mathisfun123 2 days ago [-]
"one bite everyone knows the rules"
drsalt 2 days ago [-]
is that a saying? what does it mean
mathisfun123 2 days ago [-]
Just Google it you'll see
drsalt 2 days ago [-]
i duckduckgo'd it and nothing came up
mathisfun123 2 days ago [-]
Just Google it you'll see
7bees 1 days ago [-]
Not sure why the other guy is trying to be so cute about this, but I gather:

* It's a catch-phrase related to a guy from Barstool Sports that reviews pizza places, on a YouTube channel called One Bite Pizza Reviews

* The idea is that you take one bite and review the pizza, and this is a "rule"

* The catch-phrase is used ironically; you may say it and then take multiple bites

* The guy you're replying to apparently thinks this is similar to "500 lines or less" being more than 500 lines, but can't just say this with words

https://www.reddit.com/r/barstoolsports/comments/6szlym/one_...

mathisfun123 19 hours ago [-]
> Not sure why the other guy is trying to be so cute

I'm not trying to be cute, I'm trying to remind people in 2026 that we have the technology to answer dumbass questions on your own.

knollimar 2 days ago [-]
Using a big library like OpenGL and then playing code golf seems at ends. Cool writeup but these always confuse me
yorwba 2 days ago [-]
The point of the "500 lines" book is to make programs small enough to be understood: https://aosabook.org/en/500L/introduction.html

It's not about golfing as much functionality as possible into those lines, at the cost of rendering it incomprehensible.

forgotpwd16 2 days ago [-]
There isn't much attempt at code golf really, and OpenGL is a standard graphics API. Plus project is a 3D modeller, not renderer.
ablob 2 days ago [-]
so printf("%i", 42) is fine and dandy golfing, but glTriangle(x, y, z) is too much? The next thing you're gonna tell me is that a true golfer manually invokes syscalls.
swiftcoder 2 days ago [-]
OpenGL has a tiny API surface compared to the other 3D APIs. Of course, that means it has a painfully complicated state machine hiding under the hood...
jasonjmcghee 2 days ago [-]
Another great read is Daniel Hooper’s write up on his SDF 3D modeler ShapeUp.

https://news.ycombinator.com/item?id=40239164

It’s about 2k lines and was built in a week… but it uses raylib which is a fundamentally different task, but i still find it interesting.

Krei-se 2 days ago [-]
Beware brave traveler, this great read will make you think oh that's not so hard!

In the jungle of 3000+ lines spaghetti renderer-code you will be tangled in RenderTargets and concatenated ShaderCode with your boots in quicksands of BindGroups.

Only the noble get to see the light after fixing their struct alignment traps!! 10/10 though, can recommend to get caught up

vconnor 2 days ago [-]
You didn’t even read the article to notice they went for old-style fixed function OpenGL, you know, the one that doesn’t have shader or bind groups or render targets?

What is the point of your sarcastic comment then?

nnevatie 2 days ago [-]
Is this released in 2026? It looks like it came from 20 years ago, to be quite honest.
jamessb 2 days ago [-]
The "500 lines or less" book that this is a chapter from was published in 2016 (according to OpenLibrary [1], and the commit dates in the source repo [2])

[1]: https://openlibrary.org/books/OL39940112M/500_Lines_or_Less

[2]: https://github.com/aosabook/500lines

bentt 2 days ago [-]
We must preserve pages and projects like this. In 5 years this will look like hand editing x86 ASM to most programmers.
mikevannelli 17 hours ago [-]
[flagged]
italiansolider 2 days ago [-]
Based legacy Open-GL enjoyer.
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 12:51:50 GMT+0000 (Coordinated Universal Time) with Vercel.