frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Kilo: A text editor in less than 1000 LOC with syntax highlight and search

https://github.com/antirez/kilo
100•klaussilveira•8h ago

Comments

thomasdziedzic•5h ago
How timely, I just finished going through a tutorial that builds a text editor like kilo from scratch: https://viewsourcecode.org/snaptoken/kilo/index.html

Would highly recommend the tutorial as it is really well done.

ok_dad•3h ago
Here’s a second recommendation for that tutorial. It’s the first coding tutorial I’ve finished because it’s really good and I enjoyed building the foundational software program that my craft relies on. I don’t use that editor but it was fun to create it.
90s_dev•4h ago
Reading through this code is a veritable rite of passage. You learn how C works, how text editors work, how VT codes work, how syntax highlighting works, how find works, and how little code it really takes to make anything when you strip away almost all conveniences, edge cases, and error handling.
nulld3v•4h ago
It also inspired this similar Rust project: https://github.com/ilai-deutel/kibi#comparison-with-kilo

Although it does cheat a bit in an effort to better handle Unicode:

> unicode-width is used to determine the displayed width of Unicode characters. Unfortunately, there is no way around it: the unicode character width table is 230 lines long.

90s_dev•4h ago
> It also inspired this similar Rust project

And these projects:

https://github.com/antirez/kilo/forks

lifthrasiir•2h ago
Personally, this is the reason I don't really buy the extreme size reduction; such projects generally have to sacrifice some essential features that demand a certain but necessary amount of code.
fuzztester•3h ago
on first look, the name sounds heavy, but the product actually turns out to be very light.

go figure.

;)

akkartik•3h ago
Funny story: using kilo was the final straw [1] in getting me to give up on terminals. These days I try to do all my programming atop a simple canvas I can draw pixels on.

Here's the text editor I use all the time these days (and base lots of forks off of): https://git.sr.ht/~akkartik/text2.love. 1200 LoC, proportional font, word-wrap, scrolling, clipboard, unlimited undo. Can edit Moby Dick.

[1] https://git.sr.ht/~akkartik/teliva

lor_louis•2h ago
Kilo is a fun weekend project, but I learned the hard way that it's not a good base uppon which you should build your own text editor.

The core data structure (array of lines) just isn't that well suited to more complex operations.

Anyway here's what I built: https://github.com/lorlouis/cedit

If I were to do it again I'd use a piece table[1]. The VS code folks wrote a fantastic blog post about it some time ago[2].

[1] https://en.m.wikipedia.org/wiki/Piece_table [2] https://code.visualstudio.com/blogs/2018/03/23/text-buffer-r...

userbinator•1h ago
The core data structure (array of lines) just isn't that well suited to more complex operations.

Modern CPUs can read and write memory at dozens of gigabytes per second.

Even when CPUs were 3 orders of magnitude slower, text editors using a single array were widely used. Unless you introduce some accidentally-quadratic or worse algorithm in your operations, I don't think complex datastructures are necessary in this application.

lifthrasiir•24m ago
The actual latency budget would be less than a single frame to be completely non-noticable, so you are in fact limited to less than 1 GB to move per each keystroke. And each character may hold additional metadata like syntax highlight states, so 1 GB of movable memory doesn't translate to 1 GB of text either. You are still correct in that a line-based array is enough for most cases today, but I don't think it's generally true.
jonstewart•2h ago
ed is the standard text editor.

DDoSecrets publishes 410 GB of heap dumps, hacked from TeleMessage

https://micahflee.com/ddosecrets-publishes-410-gb-of-heap-dumps-hacked-from-telemessages-archive-server/
276•micahflee•4h ago•65 comments

The Windows Subsystem for Linux is now open source

https://blogs.windows.com/windowsdeveloper/2025/05/19/the-windows-subsystem-for-linux-is-now-open-source/
1198•pentagrama•13h ago•776 comments

Have I Been Pwned 2.0

https://www.troyhunt.com/have-i-been-pwned-2-0-is-now-live/
435•LorenDB•7h ago•134 comments

What are people doing? Live-ish estimates based on global population dynamics

https://humans.maxcomperatore.com/
80•willbc•3h ago•24 comments

Jules: An Asynchronous Coding Agent

https://jules.google/
268•travisennis•8h ago•108 comments

A shower thought turned into a Collatz visualization

https://abstractnonsense.com/collatz/
74•abstractbill•4h ago•12 comments

Zod 4

https://zod.dev/v4
632•bpierre•14h ago•191 comments

GitHub Copilot Coding Agent

https://github.blog/changelog/2025-05-19-github-copilot-coding-agent-in-public-preview/
386•net01•13h ago•227 comments

Claude Code SDK

https://docs.anthropic.com/en/docs/claude-code/sdk
309•sync•11h ago•138 comments

Show HN: A free, privacy preserving, archive of public Discord servers

https://searchcord.io
21•searchcord•2h ago•11 comments

Launch HN: Better Auth (YC X25) – Authentication Framework for TypeScript

198•bekacru•14h ago•75 comments

Ann, the Small Annotation Server

https://mccd.space/posts/design-pitch-ann/
7•todsacerdoti•1h ago•0 comments

Run GitHub Actions locally

https://github.com/nektos/act
195•flashblaze•3d ago•77 comments

Kilo: A text editor in less than 1000 LOC with syntax highlight and search

https://github.com/antirez/kilo
100•klaussilveira•8h ago•12 comments

Terraform MCP Server

https://github.com/hashicorp/terraform-mcp-server
55•kesor•6h ago•9 comments

Game theory illustrated by an animated cartoon game

https://ncase.me/trust/
244•felineflock•12h ago•40 comments

Memory Consistency Models: A Tutorial

https://jamesbornholt.com/blog/memory-models/
23•tanelpoder•4h ago•2 comments

The forbidden railway: Vienna-Pyongyang (2008)

http://vienna-pyongyang.blogspot.com/2008/04/how-everything-began.html
158•1317•10h ago•40 comments

A man who visited every country in the world without boarding a plane (2023)

https://www.theguardian.com/travel/2023/aug/16/take-the-high-road-the-man-who-visited-every-country-in-the-world-without-boarding-a-plane
22•thunderbong•2d ago•4 comments

Remarks on AI from NZ

https://nealstephenson.substack.com/p/remarks-on-ai-from-nz
142•zdw•4d ago•73 comments

xAI's Grok 3 comes to Microsoft Azure

https://techcrunch.com/2025/05/19/xais-grok-3-comes-to-microsoft-azure/
113•mfiguiere•13h ago•103 comments

WireGuard vanity keygen

https://github.com/axllent/wireguard-vanity-keygen
67•simonpure•9h ago•9 comments

Patience too cheap to meter

https://www.seangoedecke.com/patience-too-cheap-to-meter/
32•swah•2d ago•12 comments

Too Much Go Misdirection

https://flak.tedunangst.com/post/too-much-go-misdirection
158•todsacerdoti•13h ago•76 comments

Biff – a batteries-included web framework for Clojure

https://biffweb.com
7•TheWiggles•2h ago•0 comments

Solving the local optima problem – NQueens

https://github.com/Dpbm/n-rainhas/blob/main/readme-en.md
4•ColinWright•3d ago•1 comments

Self-Hosting Moose with Docker Compose, Redis, Temporal, Redpanda and ClickHouse

https://docs.fiveonefour.com/moose/deploying/self-hosting/deploying-with-docker-compose
37•Callicles•6h ago•9 comments

Is-even-ai – Check if a number is even using the power of AI

https://www.npmjs.com/package/is-even-ai
217•modinfo•5h ago•106 comments

Glasskube (YC S24) is hiring in Vienna to build Open Source deployment tools

https://www.ycombinator.com/companies/glasskube/jobs/wjB77iZ-founding-engineer-go-typescript-kubernetes-docker
1•pmig•12h ago

Dilbert creator Scott Adams says he will die soon from same cancer as Joe Biden

https://www.thewrap.com/dilbert-scott-adams-prostate-cancer-biden/
321•dale_huevo•12h ago•374 comments