288 karma · joined Sep 11, 2012 (14y ago) · 70 submissions
1.
Show HN: Aex-GL – OpenGL ES 2.0 Implementation from Scratch(github.com ↗)
1 points · by quincunx · 1y ago · discuss
2.
Show HN: Carburetta – C/C++ Fused Scanner and Parser Generator(carburetta.com ↗)
5 points · by quincunx · 1y ago · discuss
comment 3y ago · link · parent
https://www.youtube.com/@WeijuWu
Wei-ju Wu lays out how to code directly on the hardware in an accessible manner and, importantly, from C, instead of 68K, with lots of examples. Then, if (or rather: when) you have to, you can always step down a level into 68K assembly to get better performance.
comment 3y ago · link · parent
Definitions are more grey, muddy and dependent on context; in that line of thought, I feel the parent you're responding to is accurate enough to not warrant criticism or even downvotes.
comment 3y ago · link · parent
comment 4y ago · link · parent
I think OP is (probably?) referring to 8-bit C64 era technology, where framebuffers/video ram are at a fixed location in memory?
comment 4y ago · link · parent
For instance, AWS EC2 Global View insists I switch away from Firefox, that's just one example, but there are more.
Anyone know why? I've always viewed Firefox as the de-facto standard, why the recent breakage? Why is it deemed acceptable, by AWS of all orgs?
comment 4y ago · link · parent
Is the Java written in the 90's still the same Java written today? I feel the mentioned Lindy effect equally applies to dialect. C++ today is radically different to C++ from the 90's. I'd venture COBOL from the 90's is likely quite similar to COBOL today.
comment 4y ago · link · parent
Been a while since I read it, but iirc one of his examples is of fellow captives telling themselves they'll be free before the new year, then the new year comes, still not free, and those would be the first ones to go (your "giving up").
But the alternative I never took as "resisting" - but "purpose." Frankl's own purpose being the study of people under such extreme conditions, but his point (again, iirc) being that having that indefinite, daily, purpose is what keeps people alive and brings meaning.
Now, granted, it's been a while since I read it, but can you provide some color to this notion of "resisting" ? It'd be interesting if you took something completely different away from it (or if I remember it incorrectly and should be corrected.)
comment 5y ago · link · parent
comment 5y ago · link · parent
You mean why I felt it was preposterous? Well allow me to demonstrate my naivety...
I would have expected 50% to be "socialist Europe" type spending, and indeed, a bit of googling reveals France is at about 60% of GDP right now, Germany at about 50%, Netherlands at 47%... That 60% of all income is determined by the policies and decision making of politicians, apparatchiks and bureaucrats is, I find, shockingly close to a planned economy.
So why preposterous? Because the US, on so many fronts, positions itself in contrast to Europe - free market ideology, small government rhetoric, fiscally conservative. Anyway, obviously, I was wrong.
comment 5y ago · link · parent
Looks like it already blipped the 50% mark in WW2 and is quite close now. Seems to (visually) be leveling though.
comment 5y ago · link · parent
comment 5y ago · link · parent
I feel the key insight behind both SpaceX and Tesla is that both the napkin engineering from first principle and then having the force of will to personally see it through /are/ the most important thing. Both qualify as engineering.
Happy to have my fairy tale hero's journey view of success corrected.
comment 5y ago · link · parent
If you're so inclined, examine rex.c, and you'll see (e.g. rex_nfa_make_ranged_trans() for example) that the engine internally works with ranges of uint32 for this very unicode reason.
The front-end regex parser and driver code, however, are not there yet, so prior to code emission, these beautiful ranges of uint32 codepoints are back-translated into rote uint8 tables. Such is the fate of wanting to ship. It'll come.
comment 5y ago · link · parent
Carburetta is designed for developer productivity and hence "least surprise"; and so combines the classical distinction of scanner ("lex") and parser ("yacc") but fuses those capabilities together.
This simplifies development as the generated driver code can do more housekeeping and the code in Carburetta becomes more expressive. It is not the goal to improve on the algorithms / state of the art academics of parsers. Instead, it is the goal to improve productivity while using predictable and well known approaches / not reinventing the wheel, however noble that can be. Algorithms here are NFA -> DFA -> scantable for the scanner, and LALR for the parser; these are old, well established algorithms.
That said, have a look at xlalr.c if you'd like to go exotic and disambiguate grammars (multi symbol reductions determined at runtime), but a conscious choice was made to stick with straight LALR for least surprise. Ambiguous grammars, I find, become difficult to think about. xlalr.c is therefore not used for the main parser generation, but the classic lalr.c is favored. You should be able to understand everything that's going on using only base textbook materials (e.g. dragon book.) The xlalr.c algorithm will be phased out eventually, I believe it is currently only used internally (Carburetta, due to the bootstrap problem, is a bit of a chimera, and does not always use itself.)
That said, there is direct support for some of the ambiguities you speak of; e.g. for instance, the infamous "typedef name" ambiguity on identifiers in C can be implemented with <prefix>stack_accepts() and $chg_term(terminal). Have a look in the manual (HTML version is online) for those.
RawParser is cool, but seems to have different goals in mind.
24.
Show HN: Carburetta – C/C++ Fused Scanner and Parser Generator(carburetta.com ↗)
3 points · by quincunx · 5y ago · 6 comments
comment 5y ago · link · parent
Freedom Day (25 April) is a national holiday, with state-sponsored and spontaneous commemorations of the civil liberties and political freedoms achieved after the revolution. It commemorates the 25 April 1974 coup and Portugal's first free elections on that date the following year.
Nice bridge.
comment 6y ago · link · parent
"You complain that in your part of the world there is a scant supply of books. But it is quality, rather than quantity, that matters; a limited list of reading benefits; a varied assortment serves only for delight. He who would arrive at the appointed end must follow a single road and not wander through many ways. What you suggest is not travelling; it is mere tramping." - Seneca, Letters to Lucilius, #45
This is such a powerful idea to me, from about 2000 years ago, that reading everything is like drifting aimlessly never arriving anywhere; it's just so recognizable.
comment 6y ago · link · parent
I'd imagine Another World creates an off-screen single-bit deep bitmap and uses that as a mask. I sent you an email if you'd like to explore more, however the original programmer probably just remembers what he actually did.
Also note that non-overlapping polygons can be grouped together in both approaches by line-blitting with XOR destination (adjacent polygons share an edge and so the edge is XOR blitted twice); so there are substantial speed-ups to be had.