Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This[1] emacs inspired editor, written in Go, also uses termbox (pure go port: https://github.com/nsf/termbox-go) - great little library.

I'm rewriting a python command line utility using it and it makes writing text based interfaces much easier.

[1] https://github.com/nsf/godit (screenshot: http://nosmileface.ru/images/godit-linux1.png)



I actually contributed quite a bit to a fork of godit called vigo [0]. It gave me lots of insight into how text editors work.

When I went to start writing Iota, I found that there was no termbox-type library in Rust, so I created a wrapper [1]. My goal is to create a pure-Rust version, similar to termbox-go. It's a long way from that, but it will get there!

[0]: http://github.com/kisielk/vigo [1]: http://github.com/gchp/rustbox.


Cool! So, you're a perfect position to compare your experiences writing text editors in both languages :)

(Although Go is more mature at this point)


I guess you could say that!

I initially found it much harder to work with Rust, as the language is more strict in a number of ways. But once I began to understand how it works, and began to grasp some of its concepts such as ownership and lifetimes I found it much more powerful than Go.

Go has a larger community right now, many more libraries and resources openly available. That's probably one of Rust's downsides right now however its catching up, especially with the launch of crates.io. I don't think it will be long in maturing following the 1.0 release.

Saying that, both are enjoyable to work with. But for me Rust wins out!


Well, I had an implementation of termbox for `bisschen` (a mail viewer on top of notmuch), but that was pre-cargo and I don't work on it anymore:

https://github.com/skade/bisschen/tree/master/src/libtermbox


Makes me think, when guile-emacs will be done, rust will be mature enough so we (by we I mean they) can rewrite emacs c core in it.


Why?

Guile-emacs is an user facing change, actually bring something new to the table emacs mode authors.

What would rewriting the core of probably one of the most mature OSS software projects bring other than risk?


I was mostly kidding.


What's the advantage of using the limited termbox interface over (n)curses, or just using the low-level terminfo library directly?


Termbox can be implemented on non-POSIX platforms, whereas terminfo/termcap do not. See https://github.com/nsf/termbox-go which runs on Windows.

NB: The C implementation doesn't support Windows, AFAIK, which means this Rust library doesn't either, at least as long as it is based on bindings and not a pure Rust implementation of termbox.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: