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
> and done a high-level pass on the rest.
Why would I read your book if you have not read your book?
Edit: I now understand what is going on here. This is an attempt to promote Zenflow. The GitHub account (https://github.com/amoilanen/) is Anton Moilanen who is an employee at Zencoder, the creators of Zenflow.
The account (https://news.ycombinator.com/user?id=jsontwikkeling) was created 86 days ago the same day as this Show HN post was created: https://news.ycombinator.com/item?id=46290617
It would probably be worth the moderator's time to see if this post was part of a coordinated upvote ring as well.
As you can see I was never hiding and my identity can be viewed and verified quite openly
I just mentioned the tools I use normally and it is my personal project done on my personal time of which my employer is not aware.
I might not mention the tools I used but they did the bulk of the work so I thought appropriate to mention.
Promoting Zenflow or Claude Code was not my goal. They are mentioned purely for the attribution purposes
Just ask an LLM summarize it for you, lol
What was the point of first asking an LLM to expand prompt/"specs" into a book and then asking it to compress it back to a summary? Well, I'm glad you asked! To promote this Z*n tool, of course.
It was not the goal and I was posting in my personal capacity. I just used it together with Claude Code on my personal project. Because I work with it regularly it is natural that I used it.
I wanted to mention the tools I used including Claude Code. I hope it does not seem that I am here to promote Anthropic tools as well?
I just thought it appropriate to mention for the correct attribution, because the heavy lifting was done by the tools, not by me
The goal was to share the book which I finished and ask for review and feedback.
Feedback is clear, I should never had posted and will probably not post in the future.
Hopefully the book will be useful for those who find it, I will get feedback elsewhere and will finish reviewing it myself
It is your choice. I have read a good part of the book, also wrote a part of it and am in the process of finishing the review. The more reviews - the better. The book is officially in beta and this is fully transparent
what kind of author releases about a book they themselves have not read? Could you possibly care less about your readers and your own work?
The main goal of posting early was to gather feedback and peer review as soon as possible. I hope it can become a collaborative effort with external contributions.
The book is still a work in progress, and I have tried to be transparent about that. If you have specific concerns about the quality or suggestions for improvement, I would genuinely appreciate hearing them.
You shouldn't ask other people for feedback before you have done the bare minimum of reading your "own" book
Clear, sorry, my mistake. I just was excited to share and hoped it can be useful.
Though I genuinely wrote a substantial part of the book myself.
I will finish the review on Github in the coming days/weeks and will hopefully get some collaborators there
At least he's honest about it, the vast majority of AI people would just submit it as their own work having never read it at all.
He's being dishonest. He's attempting to promote Zenflow (a tool created by his employer Zencoder). He's produced AI slop (that he has not even read!) as a vehicle to promote Zenflow and get it in front of eyeballs on HackerNews.
I am just referencing the tools I used (also Claude Code, by the way) because the bulk of the work was done by them.
This is what I was taught: work should be attributed correctly. If I would not mention the tools it would seem if the book was written entirely by me which is not the case.
This is a book which was started by me, I did use the AI tools I normally use in my daily routine on my personal projects. They are secondary in this post though.
I posted in my personal capacity and my employer is not aware or connected to this - the book is entirely mine.
It is not AI slop. A large part of its content was written originally by me 10 years ago.
But if it has offended anyone and I should not had posted the work which I have not fully yet reviewed myself, then sorry
How would you know whether or not it is AI slop, you haven't reviewed it
Sorry, definitely my mistake for sharing too early.
This seems to be an entirely AI promoted post.
dang: Can we get stuff like this out?
It might seem so, but it is not an AI promoted post. The book was finished with the AI tools, but a bulk of it was written by myself plus the structure and direction.
And I am human, who first finished a similar course roughly 20 years ago, worked as a TA and taught students programming and algorithms
I didn't talk about the book.
I talked about the first 5 comments on the thread, all by new accounts.
It seems like an AI campaign. not organic up votes.
OK, I am not sure who these are. I would not promote my post like this. They are indeed new accounts
this is well structured and put together. i would think it serves as a good base for refreshing oneself on the fundamentals. and it has a satisfying bend towards being both concise and thorough.
[dead]
[flagged]
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:
Clear that it takes two strings and returns match positions. No separate explanation needed.Interfaces model return types and ADTs cleanly:
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.
[flagged]
[flagged]
Exactly - this is precisely why I built the project as an integrated repo centered around code and tests first, with the book as one of the produced artifacts rather than the other way around.
Having both an engineering and academic background, I felt there's underappreciated potential in bringing software engineering best practices - tests, type contracts, CI - into an algorithms textbook. Most CS teaching treats code as illustration. I wanted it to be the source of truth.
And agreed on structural typing for graphs. TypeScript lets you define a Graph<T> interface and defer the representation choice, which maps very well to how the topic is actually taught - abstract properties first, concrete implementations second.
[flagged]
[flagged]