Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/braheezy/kilo
A terminal text editor written in Go
https://github.com/braheezy/kilo
Last synced: 17 days ago
JSON representation
A terminal text editor written in Go
- Host: GitHub
- URL: https://github.com/braheezy/kilo
- Owner: braheezy
- Created: 2023-06-26T03:03:57.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-02T00:34:07.000Z (over 1 year ago)
- Last Synced: 2024-11-10T13:35:25.559Z (3 months ago)
- Language: Go
- Homepage:
- Size: 208 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kilo
A Go implementation of the [kilo](https://viewsourcecode.org/snaptoken/kilo/index.html) text editor.Output of `kilo main.go`:
![](./kilo.png)
## Usage
Ensure [Go](https://go.dev/doc/install) is installed.On Linux, build and run the code:
make
## Thoughts
This was extremely beneficial, rather quick, and really fun to port the original C tutorial to Go. There were several instances where my implementation differs from the C implementation because of modern Go changes. For example, the C implementation uses static variables but those don't exist in Go so I used globals. The C implementation also does several things with pointers that would be considered unsafe today and Go requires more lines of code to safely do a similar task. Finally, Go has a drastically different approach to error handling.When the final feature (multi-line comment syntax highlighting) was complete, here's what `make count` had to say:
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Go 1 163 269 960
-------------------------------------------------------------------------------
Total: 1392Just about 1k SLOC as promised.