HN user

pierreyoda

113 karma

https://github.com/pierreyoda

Posts0
Comments29
View on HN
No posts found.

I've been working on a Hacker News TUI reader written in Rust [0].

I'm very proud of the way the architecture turned out - with most notably a components-driven architecture [1].

There's just a major performance roadblock in posts with many comments that I should be able to clear with some more multithreading. Then I just need to make it available in brew and other distribution solutions.

[0] https://github.com/pierreyoda/hncli [1]: https://www.newstackwhodis.com/blog/hncli-2-architecture

My go-to editor was Paint.Net on Windows too, it's really good. When I switched to macOS, I found Krita which is pretty nice. I have really basic needs and Krita is free, so your mileage may vary. It's presented as a painting app on the official website (and the specialized UI looks really good), but you shouldn't be lost on the default GUI configuration. It's available on Windows and Linux too (and I just saw there's a Steam version, but it's not free).

That's really interesting, I did not know about that, thanks for the link ! It's highly specific but could make a lot of cool "wow-effect" products or software suddenly viable, especially if it percolates to your average consumer hardware some way or another.

This is an excellent link, well known in the "community" around this.

To add to it, here's a famous and really clear sub-2 minutes representation of the scales involved if it helps make things clearer, for those who've never seen the scales involved: https://www.youtube.com/watch?v=xP5-iIeKXE8 (and that's "just" the Game of Life in the Game of Life).

I think I would enjoy helping push the state of the art in this field, but it's far beyond my abilities for the moment - which may never change without years of research in my free time, which I cannot realistically do before I'm retired basically.

If it wasn't, I would love to work on a new library specifically built for the kind of things like your idea, with the API aimed at working with metapixels-based "hardware", but with the lowest-level constructs (maybe by far) being thinks like RAM or CPU caches as building blocks - while still being able to zoom to the lowest level of cells in the renderer. But it's basically R&D and HPC combined if one wants to offer an interesting alternative to the established libraries.

From what I know of upcoming hardware, such a library may have to wait a couple of years and basically target (as in, full buy-in, maybe at the programming language-level, certainly in tooling) the next Apple Silicon-like (or beyond) breakthough in commonly accessible hardware for a nice, "free" performance boost. Maybe GPUs are next?

Very cool article!

If you want to know more about the hardware side of the Game Boy (Color), have a look at the Pan Docs: https://gbdev.io/pandocs/

It's been revamped in the recent years, in terms of presentation. I do kind of miss the old version which had a refreshing "old-school" UI like the RFCs of the IETF, but the newest version is IMHO much more usable when developing an emulator.

Great visual explanation, thanks.

"Old" gaming systems are so interesting in their architecture, and consequently tricks that game developers had to do to eke out the necessary performance out of the hardware! I feel like since PS3's Cell processor (regardless of what you think of it), game consoles have been increasingly following more classic (desktop-like) architecture in the entire hardware stack, which has been to be honest great for cross-platform game engines and applications.

That is why I love implementing emulators of older systems for fun. I recommend the classic CHIP-8 for starting, it's well documented and can be written to play practically any game ROM in a couple of days.

I personally then graduated to a Game Boy (Color) emulator, and in particular the PPU (graphics part) was really tricky to get right but I felt like the tile maps, as described in this video, were such a great solution for the time and it was a real joy to implement.

Subscribing to this channel, hope it will one day get into some details about the Audio Processing Unit which has so little resources (even in the reference Pan Docs [0]) that I fear I would need to straight up port code from reference open-source emulators (so probably C) to get it working with no major bugs.

[0] https://gbdev.io/pandocs/

This is incredibly cool, thanks to Don Hopkins for open-sourcing the original (C, C++ or Java implementations) micropolis codebase [1] !

As a shameless plug, I've been for the last few years re-implementing on and off this exact same project (based on the C++ codebase) in Rust, WebAssembly and Svelte! [2] Quite a bunch of buzzwords I know, but it's specifically made for me to have fun.

The map generation is working (or at least it was properly rendered when I was using React) and about ~50% of the codebase has been ported over to Rust, but there's still a lot of work to be done if anyone wants to help!

The end goal is notably to have tons of slick data visualisations with d3.js.

[1] https://github.com/SimHacker/micropolis [2] https://github.com/pierreyoda/micropolis-rs

Deno 1.9 5 years ago

Hmm, what did I miss, why do people hate them exactly?

In my experience, enums are far less type safe and convenient (usage in switch for instance, combined with a linter) than union types.

Unfortunately, I've found at my previous employer that JSDoc is incredibly limited and fails at some basic structures, has very limited generic support and will not understand "advanced" structures like type mappings.

Re-using types (structs or union types) is also a huge pain.

Rust complexity is a bit overblown. I also revert automatically to it now if I feel like Typescript (Node.js) won't cut it, even for < 1K LOCs.

I may be biased since I've been using it for almost 6 years, but you mostly don't need to worry about lifetime annotations which IMO is the really foreign part if you are already comfortable with functional languages, especially since the compiler is unbelievably useful.

Many well-known Rust crates also account for the majority of the best all-around libraries I've ever personally used in any language, and you can actually use them without a PHD in build systems thanks to Cargo.

Re-usability is superb thanks to traits (composition over inheritance) and generics, even if still immature domains tend to be overly generic for the end-user (HTTP networking for instance, though it's getting better fast).

A guide to Oauth2 7 years ago

Oh yeah definitely!

Rust would be awesome but I think I'd want it to be as accessible as possible. Tagged unions and proper error handling would make it much saner though that's for sure.

A guide to Oauth2 7 years ago

I'm currently in the middle of implementing an OAuth 2.0 authorization server following the RFC draft of the best current practice [1].

It's been a huge pain navigating all the interlinked (and sometimes contradicting) RFCs around, especially with a distinct lack of resources for actually implementing an authorization server. RFC6749 does not suffice on its own since it says nothing about authentication or tokens payload (not that it should). I did discover the whole RFC universe which are mostly fascinating and very well written.

Most google searches end up to Auth0 (nice SEO!), which I'm sure is a fine product, but usually only gives a very high-level overview of the corresponding spec and ends up like "see how this is all complicated? there's a SAAS for that...".

I'm seriously considering implementing a fully spec-compliant OAuth 2.0 + OpenID Connect Core 1.0 reference server implementation in Typescript, with full documentation quoted straight from the RFCs. The HOW is actually pretty straight-forward once you've figured out the WHAT and WHY.

[1] https://tools.ietf.org/html/draft-ietf-oauth-security-topics

How often do you need a whole collection of string manipulation functions? Never! It would just add to the size of dist folders everywhere, with no gain whatsoever.

I mean that's where proper tree shaking would void this argument. When you include lodash (or lodash-es more precisely) for instance only the used functions are in the final bundle with a modern bundler.

  > In the Python world, you can install an "extra" along with a    package. So you can make the deliberate decision to omit Unicode case folding from your CommonMark parser. Maybe something like that is possible with a crate?
This is definitely possible in Rust with Cargo crate features! [0]

For instance in a game library like quicksilver you can opt in to WebAssembly support, images, fonts, audio handling, etc. Then the image or audio library themselves can put formats and codecs behind feature flags for instance. Each crate then uses conditional compilation to branch out these features at compilation time. More commonly as an end-user, test modules use a special conditional compilation macro [1].

[0] https://doc.rust-lang.org/cargo/reference/manifest.html#the-... [1] https://doc.rust-lang.org/stable/rust-by-example/testing/uni...

On your last point, I feel like components this basic should really rather be addressed at the real theming level, i.e. in CSS.

Utility-first CSS frameworks are awesome if you get past your first impression. I've been using TailwindCSS [0] both at work and for all my personal projects ever since I read Adam Wathan's justification on it [1]. In TailwindCSS those constants are configured in one place and generated at build time (through Rollup/Webpack/PostCSS etc.). Consistency and theming for free basically.

Even Bootstrap has now a decent collection of them in v4.

[0] https://tailwindcss.com/ [1] https://adamwathan.me/css-utility-classes-and-separation-of-...

I will do that!

Problem is, I switched to Rust for my side projects like 5 years ago and Open Rodent's Revenge would probably benefit from something like CMake but it's so confusing compared to Rust's Cargo.

That sounds awesome, please do!

Testing Flutter myself, it's great but I'm not convinced about Dart so far, for instance (de)serializing JSON is a pain.

Wow, my shitty C++ Rodent's Revenge remake from highschool is there too!

I will submit a PR though as I since switched from Sourceforge to Github [1] and now use the MIT license.

In any case, great work! Only suggestion I could make is maybe make an "Engine" category for projects like OpenMW?

[1] https://github.com/pierreyoda/o2r