7 ms·
This is in Rust? I was expecting Ed to be in C…
by iav 3y ago
This is in Rust? I was expecting Ed to be in C…
- snvzz 3y agoSame. I was hoping for ISO C99, to maybe port to AmigaOS. But it's rusty.
- rob74 3y agoIf you want AmigaOS, maybe you should switch to vim (https://amitopia.com/vim-was-originally-developed-for-the-amiga/ https://amitopia.com/vim-was-originally-developed-for-the-am...)?
- snvzz 3y agoI am well aware of vim. But there's some issues. Vim is heavy, and the Amiga version was abandoned, so it's not been maintained for a long time. What I am looking for is a less shitty, open replacement for AmigaOS's provided 'ed' editor.
- flgstnd 3y agoi thought i like rust, compiling this program was very weird. it took multiple minutes on full CPU load and even after cargo finished there was still a build process using one CPU core on 100% until i killed it.
- sidju 3y agoThat sounds strange. Could you give reproduction instructions? (OS, architecture, rust version) Maybe there's some kind of upstream bug I should report.
- flgstnd 3y agoI used x86_64 GNU/Linux, NixOS, cargo 1.78.0-nightly (ccc84ccec 2024-02-07). When deleting the target directory and running `cargo build`, all the dependency crates build pretty fast. But then the build script takes ages. And somehow runs twice. In the target/debug/build dir are 2 different build-script-build executables, that produce the same outputs (compressed_syntaxes/theme). I thought it might be related to the `cargo:rerun-if-changed` stuff in the build.rs but it's the same with those lines commented out.
- sidju 3y agoI can confirm that it created two binaries of basically every dependency and I don't know why (tried to look into it but couldn't find anything), but at least in my case both don't run. (I looked at the running process ID and command line while reproducing. It was the same binary running in the same process the whole time for me.) There is a bit of a gotcha that if you build a debug build the build script will be less optimized. This makes a debug build take nearly 4 minutes total on my computer due to how much processing is done in the build script. A release build only takes roughly 2 minutes total due to the optimized build script. (The "cargo:rerun-if-changed" tells cargo under which circumstances it is necessary to rerun the build script. It doesn't change its behavior on a fresh build.) Please check if it really does run twice, and thus changes process ID and command line. (I run `top`, press shift+v for process tree, c for command line and go look at the cargo process to find the build-script run.)
- breather 3y agoWhy make the same mistake twice?
- sidju 3y agoSorry to disappoint. Would have been difficult to make it this feature rich and have as explicit errors if I wrote it in C. Reasons for choosing rust were: - Error handling style, easy to include context - Easy to import and use syntax highlighting library - Some level of inherent UTF-8 validation and support - Easier to make the ed-runtime support pluggable IO and UI