frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Algorithms and Data Structures in TypeScript – Free Book (~400 Pages)

http://amoilanen.github.io/Algorithms-with-Typescript/
19•jsontwikkeling•1h ago
I started writing this book 10 years ago in JavaScript, got through a few chapters (asymptotic notation, basic techniques, start of sorting), and then abandoned it.

Recently I picked it back up, converted everything to TypeScript, and used AI (Zenflow [1] + Claude Opus 4.6) to complete the remaining chapters. I provided the structure, direction, and initial chapters; the AI generated the bulk of the remaining content under a spec-driven workflow.

The book covers roughly a first 1-2 year CS curriculum: sorting, dynamic programming, graph algorithms, trees, heaps, hash tables, and more. All code is executable, typed with generics/interfaces, and covered with tests.

I've thoroughly reviewed several chapters (sorting, DP, graphs) and done a high-level pass on the rest. Currently in beta — corrections and contributions are welcome.

MIT licensed. Inspired by Wirth's "Algorithms and Data Structures", SICP, and CLRS.

Code and tests: https://github.com/amoilanen/Algorithms-with-Typescript

[1] https://zencoder.ai/zenflow

Comments

BloodAndCode•24m ago
this is great timing for me — i actually have an algorithms & data structures course this semester. seeing implementations in typescript instead of the usual pseudo-code or java/python is really nice. makes it much easier to actually run the code and play with the ideas while learning. curious — did writing this in typescript change how you approached any of the classic structures? some of them feel a bit awkward with generics in certain languages.
jsontwikkeling•2m ago
Great to hear that. I actually think TypeScript is very fit for the purpose, even better than Python (lacks types) or Java (bulkier).

Type signatures document contracts directly:

  export function rabinKarp(text: string, pattern: string): number[]
Clear that it takes two strings and returns match positions. No separate explanation needed.

Interfaces model return types and ADTs cleanly:

  export interface ShortestPathResult<T> {
    dist: Map<T, number>;
    parent: Map<T, T | undefined>;
  }

  export function dijkstra<T>(graph: Graph<T>, source: T): ShortestPathResult<T>
It's also lightweight, flexible, has familiar C-like syntax, and unlike pseudocode — you can actually run everything.

Re: generics feeling awkward — in TypeScript they feel pretty natural. The type inference helps a lot, you rarely need to spell out type parameters at call sites.

Effect TS: A New Way to Structure TypeScript Apps

https://jsdev.space/meet-effect-ts/
1•javatuts•2m ago•0 comments

Eating your own dog food

https://en.wikipedia.org/wiki/Eating_your_own_dog_food
1•omeysalvi•3m ago•0 comments

A2A Protocol Ships v1.0: Production-Ready Standard for Agent-to-Agent

https://a2a-protocol.org/latest/announcing-1.0/
1•mindcrime•4m ago•0 comments

Run NanoClaw in Docker Sandboxes

https://nanoclaw.dev/blog/nanoclaw-docker-sandboxes/
1•outofdistro•4m ago•0 comments

Ask HN: How do you detect configuration drift between environments?

1•orkunk•4m ago•1 comments

Guzzle – The GUI LibFuzzer Wizard

https://github.com/jabberwock/guzzle
1•thejabberwock•5m ago•0 comments

Coding Agents Are Reshaping Engineering, Product and Design

https://twitter.com/hwchase17/status/2031051115169808685
1•gmays•5m ago•0 comments

Netflix Uncovers Kernel-Level Bottlenecks While Scaling Containers on Modern CPU

https://www.infoq.com/news/2026/03/netflix-kernel-scaling-container/
3•outofdistro•5m ago•0 comments

Agent.json – robots.txt for AI agent-to-website communication

1•charlkruger•6m ago•1 comments

The spec said "handle user input securely." Three teams interpreted this differe

1•Lliora•8m ago•0 comments

Finding a CPU Design Bug in the Xbox 360

https://randomascii.wordpress.com/2018/01/07/finding-a-cpu-design-bug-in-the-xbox-360/
1•mariuz•9m ago•0 comments

Pingtrace – One command to ping and trace networks

https://www.npmjs.com/package/pingtrace
1•skhell•9m ago•0 comments

Improving instruction hierarchy in frontier LLMs

https://openai.com/index/instruction-hierarchy-challenge/
1•gmays•10m ago•0 comments

AI policy's new power center

https://www.axios.com/2026/03/13/ai-policy-power-center-pentagon-anthropic
1•Brajeshwar•10m ago•0 comments

IPv6 support for cloning Git repositories

https://github.com/orgs/community/discussions/10539
2•stefankuehnel•10m ago•0 comments

Computer History Museum Presents Apple at 50: Five Decades of Thinking Different [video]

https://www.youtube.com/watch?v=w8wt0LBCjXM
1•ChrisArchitect•10m ago•0 comments

How the Eon Team Produced a Virtual Embodied Fly

https://eon.systems/updates/embodied-brain-emulation
1•hmokiguess•11m ago•0 comments

Amid xAI co-founder exits, Elon Musk hires key engineers from AI startup Cursor

https://www.businesstoday.in/technology/news/story/amid-xai-co-founder-exits-elon-musk-poaches-ke...
2•Zigurd•12m ago•1 comments

Joint statement of scientists and researchers on Age Assurance [pdf]

https://csa-scientist-open-letter.org/ageverif-Feb2026
1•speckx•13m ago•0 comments

Show HN: Oxyde – Pydantic-native async ORM with a Rust core

https://github.com/mr-fatalyst/oxyde
1•mr_Fatalyst•14m ago•0 comments

I traced $2B in nonprofit grants, lobbying records for age verification bills

https://old.reddit.com/r/opensource/comments/1rsfhf0/i_traced_2_billion_in_nonprofit_grants_and_45/
1•thunderbong•15m ago•1 comments

The Formation of Star Patterns on Lake Ice (2007) [pdf]

https://www.whoi.edu/cms/files/Victor_21243.pdf
2•mooreds•15m ago•0 comments

The Gap

https://codeplusconduct.substack.com/p/the-gap
1•mooreds•16m ago•0 comments

GitHub Sudo Mode

https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/sudo-mode
1•mooreds•17m ago•0 comments

A list of tech co-ops and resources concerning worker owned co-ops

https://github.com/hng/tech-coops
1•iamnothere•18m ago•1 comments

Betrayed by My Own Blog

https://ossama.is/writing/betrayed
3•jllyhill•19m ago•2 comments

Sir-Engine Cross Language Duplicate Detection

https://github.com/lflin00/SIR-ENGINE
2•lflin00•20m ago•1 comments

Show HN: Using AI to generate accurate illustrations for physiotherapy site

https://www.healandmove.fit
2•ashmil•21m ago•0 comments

Project Nomad: Offline Knowledgebase

https://github.com/Crosstalk-Solutions/project-nomad
2•marvin-hansen•23m ago•0 comments

Mario Meets Pareto

https://www.mayerowitz.io/blog/mario-meets-pareto
2•MetallicCloud•23m ago•0 comments