frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

I built a Game Boy emulator in F#

https://nickkossolapov.github.io/fame-boy/building-a-game-boy-emulator-in-fsharp/
60•elvis70•1h ago

Comments

cermicelli•1h ago
Finally someone putting in actual human effort to learn something, and not a LLM helped me build X in Y minutes.

There is some hope for humanity after all I suppose.

hmokiguess•59m ago
F# is super fun, awesome work!
z500•47m ago
That's so cool! I love F#, but I wrote a little Smalltalk interpreter in it and I can confirm it isn't exactly a speed demon for that kind of thing if you use it as intended lol
tombert•40m ago
I've found that with F#, I get better performance if I do dumb imperative stuff, but keep the side effects within a function. At that point, the functions can basically be "pure" but you can get decent speed.

For example, I usually like using the `Map` data structure, and that's a pretty neat immutable structure and is usually fine for most stuff, but when performance becomes critical, it's easy enough to break into a boring imperative loop with a regular hash map. If I keep everything contained into one function, I usually can avoid feeling super dirty about it.

jackmott42•34m ago
With some care about what features to use and when, F# can be very fast. Which is nice, use functional paradigm when you want, or low level imperative code in hot loops if you need. But yeah if you use linked lists and sequences and immutable data types everywhere it sure isn't Rust.
__loam•44m ago
I'm actually starting a new project to create a gba emulator in zig, and also starting with chip8. I'm going to skip nand to tetris because I played Turing complete. Cool to see I'm on the right track!
MattCruikshank•39m ago
Sorry for the tangent - does anyone have some really zoomed in views of GB, GBColor, GBA screens in operation? I'd love for retro shaders to be able to more faithfully reproduce.

I mean, ideally, we'd run different color test patterns through, in different lighting conditions, to build a really detailed model, right?

Galanwe•23m ago
I guess buying the second hand devices wouldnt be that expensive.
yoyohello13•36m ago
I always find emulators written in functional languages impressive. It tends to be much easier to map hardware to an imperative language. I enjoy seeing the functional abstractions people come up with.
skrebbel•16m ago
Did you look at the code? F# has mutable variables/arrays and this uses that for eg memory.
debugnik•32m ago
Cool to see F# here! Emulators are a great way to learn a language. On first sight you chose well between more or less idiomatic F# for each job.

Some low hanging fruit to reduce allocations: the discriminated unions in Instructions.fs could be [<Struct>], reusing field names to reuse internal fields.

Also, minor nitpick but I'm confused about some of the registers. They are already of type byte, the setters with `a &&& 0xFFuy` don't add anything over `member val A = 0uy with get, set`. I'm guessing this changed over time.

Ginop•24m ago
I misread Fem-Boy and I was not understanding the context anymore lol
CSMastermind•3m ago
Insanely cool. I've had it in the back of my mind to write a Rust compiler for the game boy for a long time and everytime I see something like this I think about brushing off that project.

Does Postgres Scale?

https://www.dbos.dev/blog/benchmarking-workflow-execution-scalability-on-postgres
1•KraftyOne•58s ago•0 comments

Half a Month of Consolation Writing Advice

https://www.astralcodexten.com/p/half-a-month-of-consolation-writing
1•paulpauper•2m ago•0 comments

The 3rd Annual Blog Post Competition, Extravaganza, and Jamboree

https://www.experimental-history.com/p/the-3rd-annual-blog-post-competition
1•paulpauper•3m ago•0 comments

Cook Like an Engineer

https://www.exfatloss.com/p/cook-like-an-engineer
1•paulpauper•3m ago•0 comments

Reading the Book

https://www.natemeyvis.com/on-actually-reading-the-book/
1•jimsojim•3m ago•0 comments

Is Creativity a Young Person's Game?

https://thereader.mitpress.mit.edu/is-creativity-a-young-persons-game/
1•spking•4m ago•0 comments

Picture-in-picture is expanding to more viewers

https://support.google.com/youtube/thread/425771437/picture-in-picture-is-expanding-to-more-viewe...
1•Tomte•6m ago•0 comments

Shipping containerization, born at Port Newark, marks 70 years

https://www.ajot.com/news/shipping-containerization-born-at-port-newark-marks-70-years
2•Tomte•7m ago•0 comments

If Apple makes an iPad Neo, it's all over

https://www.techadvisor.com/article/3128472/if-apple-makes-an-ipad-neo-its-all-over.html
2•ndr42•9m ago•0 comments

VPNs and Residential Proxies Are Used in Abuse

https://ipinfo.io/blog/vpns-residential-proxies-abuse-findings-rsac-2026
1•speckx•9m ago•0 comments

Terminal AI Coding Agents Comparison Table

https://terminaltrove.com/compare/ai-coding-agents/
2•pelcg•11m ago•0 comments

What we learned at YC's AI alumni event: running AI-native companies

https://antonyevans.com/blog/engineering/c068-coo-job-is-building-ai-operating-system/
1•technotony•12m ago•0 comments

The Human Creativity Benchmark – Evaluating Generative AI in Creative Work

https://contralabs.com/research/human-creativity-benchmark
1•0bytematt•13m ago•0 comments

ReadBetweenTheWalls – AI Jargon Translator

https://www.readbetweenthewalls.com
1•creatorcuffee•14m ago•0 comments

When the Partnership Breaks, So Does the Company: The Jawbone Story

https://joshcarterpdx.substack.com/p/when-the-partnership-breaks-so-does
1•josh_carterPDX•14m ago•0 comments

Pedometer++ 8.0 Brings a Redesigned Apple Watch App

https://pedometer.app/blog/v8-new-watch-app
1•Amorymeltzer•16m ago•0 comments

Public content is the most average content

https://markferraz.com/perspective#essay-009
1•markferraz•16m ago•0 comments

Illegal cars on Market Street surge after Mayor Lurie welcomes Waymo

https://www.sfgate.com/local/article/cars-market-street-22234601.php
2•mikhael•18m ago•0 comments

AI Infrastructure–Not Models–Will Define the Next Decade of AI

https://alltechmagazine.com/ai-infrastructure-crisis-slowing-down-ai-progress/
1•dekhna•18m ago•0 comments

Haskell: Debugging

https://wiki.haskell.org/Debugging
3•tosh•21m ago•0 comments

UK votes to leave EU (2016)

https://www.bbc.com/news/uk-politics-36615028
1•downbad_•23m ago•2 comments

Reverse-Engineering Kasada in an Afternoon

https://www.kernel.sh/blog/detection
1•gguergabo•23m ago•0 comments

Under the canopy of drone nets covering Ukraine's frontlines

https://www.reuters.com/pictures/under-canopy-drone-nets-covering-ukraines-frontlines-2026-04-29
2•bryan0•23m ago•0 comments

The LLM Is Not a Junior Engineer

https://jacobharr.is/personal/llm-not-junior-engineer
3•speckx•24m ago•0 comments

Ekala's Nix Book

https://ekala-project.github.io/nix-book/
2•Meleagris•25m ago•0 comments

Elon Musk Seemingly Admits xAI Has Used OpenAI's Models to Train Its Own

https://www.wired.com/story/elon-musk-distill-openai-models-partly-xai/
4•louiereederson•27m ago•0 comments

Yrkit: A dev environment that runs on your phone – deploy included

https://yrkit.com
1•mwtheus•29m ago•1 comments

Building the compute infrastructure for the Intelligence Age

https://openai.com/index/building-the-compute-infrastructure-for-the-intelligence-age/
2•aghuang•29m ago•0 comments

Albert: A model-agnostic AI coding CLI with provider fallback

https://github.com/eriirfos-eng/ternary-intelligence-stack/tree/main/agent_albert_cli
1•rfi-irfos•29m ago•0 comments

GitHub Copilot silently inserts itself as a co-author

https://github.com/orgs/community/discussions/194075
5•krikou•30m ago•1 comments