Replies: 2 comments 1 reply
-
On Tue, Jul 08, 2025 at 08:18:55PM -0700, zhaolei wrote:
Currently, kittens like icat are written in Go, but as far as I know, users can’t write their own kittens in Go.
I’m wondering if it would be possible to expose some APIs so that users could implement custom kittens in Go (by compiling Go code into C-shared libraries).
Native code kittens are not a path I want to go down, the drawbacks are
rather severe, including the ability to crash kitty, the need to build
the kitten for every platform kitty supports, and so on.
The advantage would be that we could leverage Go’s type safety, autocompletion, and performance
You can use mypy for type safety in python which gives you
autocompletion as well. I dont see how performance would be a concern
since kittens are meant for UI manipulation. Note that you can write the
main() part of the kitten (the part that runs inside a terminal window)
as a normal terminal program in any language you like. In your kitten's
main() simply run your compiled program using os.exec() or
subprocess.run()
|
Beta Was this translation helpful? Give feedback.
1 reply
-
And, I should mention that you can leverage all the kitten infrastructure that kitty's go kittens themselves use by import github.com/kovidgoyal/kitty into your go kitten that you run in the main() function. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, kittens like icat are written in Go, but as far as I know, users can’t write their own kittens in Go.
I’m wondering if it would be possible to expose some APIs so that users could implement custom kittens in Go (by compiling Go code into C-shared libraries).
The advantage would be that we could leverage Go’s type safety, autocompletion, and performance
Beta Was this translation helpful? Give feedback.
All reactions