Live data from Hacker News

Blessed: Curses-like library with high level terminal interface API for Node.js

github.com

1–10 of 15 posts

Re: Blessed: Curses-like library with high level terminal interface API for Node.js

#3
post #2

What's the point of implementing something like this completely in Javascript? Isn't this a good example of something that should be developed in a lower-level, faster language?

Personally, I avoid languages that require a runtime when developing CLIs. Nothing worse than telling your users "just make sure that you're running the right version of Ruby/Python/Node."

Re: Blessed: Curses-like library with high level terminal interface API for Node.js

#4
post #2

What's the point of implementing something like this completely in Javascript? Isn't this a good example of something that should be developed in a lower-level, faster language?

This and other JS CLI libraries are typically used by JS projects that have tooling. Like when create-react-app scaffolds a project and asks you questions to customize it, etc. it's using libraries like this one. For a JS project it's just an easy npm install away as a dependency, and you know your users will have nodejs anyways.

Speed rarely matters for imperative user-facing tools. You're going to be waiting for a user to type and respond far, far longer than making some system calls to write to the shell.

Ink is a more interesting and maintained library to consider though: https://github.com/vadimdemedes/ink It lets you write react-like apps that output to the terminal instead of HTML.

Re: Blessed: Curses-like library with high level terminal interface API for Node.js

#5
post #2

What's the point of implementing something like this completely in Javascript? Isn't this a good example of something that should be developed in a lower-level, faster language?

There's similar libraries for python[1], golang[2], rust[3]. Drawing on the terminal isn't that resource intensive so I'd stay in whatever ecosystem I have a reason to be in.

1. https://github.com/willmcgugan/rich

2. https://github.com/gizak/termui

3. https://github.com/fdehau/tui-rs

Notably absent is the JVM. Another victim of startup time I imagine.

Re: Blessed: Curses-like library with high level terminal interface API for Node.js

#6
post #5
post #2

What's the point of implementing something like this completely in Javascript? Isn't this a good example of something that should be developed in a lower-level, faster language?

There's similar libraries for python[1], golang[2], rust[3]. Drawing on the terminal isn't that resource intensive so I'd stay in whatever ecosystem I have a reason to be in. 1. https://github.com/willmcgugan/rich 2. https://github.com/gizak/termui 3. https://github.com/fdehau/tui-rs Notably absent is the JVM. Another victim of startup time I imagine.

An actively developed and mature text UI library for the JVM:

https://github.com/mabe02/lanterna

Re: Blessed: Curses-like library with high level terminal interface API for Node.js

#9
post #2

What's the point of implementing something like this completely in Javascript? Isn't this a good example of something that should be developed in a lower-level, faster language?

As the other response pointed out it’s not a big deal. Needing a runtime is a small bummer though node is easily installable everywhere now.

What I really like about blessed was it’s api. At one point I made my own fork and was going to try to maintain it. Then I thought I’d try to port it to nim. These days I just use one of the excellent text ui libs in go which is great mostly because of the ecosystem.

Re: Blessed: Curses-like library with high level terminal interface API for Node.js

#10
post #2

What's the point of implementing something like this completely in Javascript? Isn't this a good example of something that should be developed in a lower-level, faster language?

As the other response pointed out it’s not a big deal. Needing a runtime is a small bummer though node is easily installable everywhere now. What I really like about blessed was it’s api. At one point I made my own fork and was going to try to maintain it. Then I thought I’d try to port it to nim. These days I just use one of the excellent text ui libs in go which is great mostly because of the ecosystem.

That's interesting. I see a runtime like this as a dealbreaker, but different strokes for different folks I suppose.
Post reply on HN