Live data from Hacker News

Show HN: Fresh – A new terminal editor built in Rust

sinelaw.github.io

11–20 of 158 posts

Re: Show HN: Fresh – A new terminal editor built in Rust

#11

> Efficiency: Uses a lazy-loading piece tree to avoid loading huge files into RAM I once started writing a text editor on Linux, and first went down a similar route: a piece table over a mmap()'d file. But I abandoned using mmap, because Linux file systems typically don't have mandatory locking enabled, so you can't be sure that the file data won't be modified by another program. (Then I got bogged down in Unicode ha…

I considered using mmap to help manage the caching but what if your file is hosted on S3 or whatever? (Something I'm planning to support eventually)

So I opted for explicit management of chunks, also gives me more control and consistent cross platform behavior.

Re: Show HN: Fresh – A new terminal editor built in Rust

#12

I'm a little annoyed that for a Rust based tool the recommended installation command is to use npm. Why? Is Cargo not good enough? Cargo seems exceptionally well to me.

I get the frustration, but I think the npm option actually makes sense here. A lot of users who’d benefit from a fast Rust tool aren’t Rust developers and won’t have Cargo installed. Shipping it through npm lowers the barrier while still giving everyone the performance benefits. It’s not a knock on Cargo, just a way to make the tool more accessible.

Given the fairly shoddy security story with NPM, I genuinely don't understand the hesitation to publish a binary and have a README instruction to curl/wget it into `/usr/local/bin` or `~/.local/bin`. If it's going through NPM that publishing step has to be done already, unless the NPM build is pulling down rust to compile it all as a native extension.

Eventually it'd wangle it's way into homebrew or the unstable branch of another package registry.

But that's me, because I really dislike installing binaries via a language's package manager, because they don't get updated unless I frequently run the upgrade commands for each package manager.

Re: Show HN: Fresh – A new terminal editor built in Rust

#13
I tried it, I like it a lot, but I did find an issue straight away.

I'm on MacOS and I have remapped the fn and command keys so it can be more like Windows (I can't undo 20+ years of muscle memory, and also I just don't wanna)

Anyway, Fresh seems to ignore the remapping - it's back to the command key for copy/paste and the command palette.

Is there a way to access the dropdown menus by keyboard? I can see F underlined for File but no modifier key seems to make it happen

Re: Show HN: Fresh – A new terminal editor built in Rust

#15

I tried it, I like it a lot, but I did find an issue straight away. I'm on MacOS and I have remapped the fn and command keys so it can be more like Windows (I can't undo 20+ years of muscle memory, and also I just don't wanna) Anyway, Fresh seems to ignore the remapping - it's back to the command key for copy/paste and the command palette. Is there a way to access the dropdown menus by keyboard? I can see F underline…

I'll need to look into this, not sure what remapping does to the incoming key events.

Also I'm already working on a ui for customizing the key bindings so you could do whatever you wanted. (Currently managed by undocumented json)

Thanks for reporting!

Re: Show HN: Fresh – A new terminal editor built in Rust

#16
post #12

Earlier quoted context omitted.

I get the frustration, but I think the npm option actually makes sense here. A lot of users who’d benefit from a fast Rust tool aren’t Rust developers and won’t have Cargo installed. Shipping it through npm lowers the barrier while still giving everyone the performance benefits. It’s not a knock on Cargo, just a way to make the tool more accessible.

Given the fairly shoddy security story with NPM, I genuinely don't understand the hesitation to publish a binary and have a README instruction to curl/wget it into `/usr/local/bin` or `~/.local/bin`. If it's going through NPM that publishing step has to be done already, unless the NPM build is pulling down rust to compile it all as a native extension. Eventually it'd wangle it's way into homebrew or the unstable bran…

That (security ) is something I also worry about. I'd like to get off npm if only for this reason. It's a hack to get started.

The other thing it gives you is the ability to easily upgrade and uninstall so just a script to copy stuff is not on par.

Re: Show HN: Fresh – A new terminal editor built in Rust

#17

I'm a little annoyed that for a Rust based tool the recommended installation command is to use npm. Why? Is Cargo not good enough? Cargo seems exceptionally well to me.

I did it because not everybody has cargo installed. I'm using cargo-dist to create this npm package.

I've been wanting a generic package manager for a while that is cross-platform. I wonder how one could find funding for such a project. Thinking about users from various OS' installing tools and software from your niche package manager, yeah that bad boy is going to grind to a halt if you have no key funding.

Re: Show HN: Fresh – A new terminal editor built in Rust

#20
post #12

Earlier quoted context omitted.

Given the fairly shoddy security story with NPM, I genuinely don't understand the hesitation to publish a binary and have a README instruction to curl/wget it into `/usr/local/bin` or `~/.local/bin`. If it's going through NPM that publishing step has to be done already, unless the NPM build is pulling down rust to compile it all as a native extension. Eventually it'd wangle it's way into homebrew or the unstable bran…

That (security ) is something I also worry about. I'd like to get off npm if only for this reason. It's a hack to get started. The other thing it gives you is the ability to easily upgrade and uninstall so just a script to copy stuff is not on par.

Thing is… who is regularly running `npm update` or `cargo update` to keep local software up to date?

I wouldn’t, because I might be in a repo and it starts upgrading all my local dependencies, and I’m not gonna add a text editor as a dev dependency. I’ll happily take the binary, or a tar.gz with the binary in it, though.

(Btw I love how it’s following the old DOS aesthetic)

Post reply on HN