7 ms·
The advantage of Nano is that it is written in C, has zero required dependencies other than libc, and the compiled binary is 200 kilobytes. This makes it possib
by int_19h 9y ago
The advantage of Nano is that it is written in C, has zero required dependencies other than libc, and the compiled binary is 200 kilobytes. This makes it possible to include it in the base system, even on very tiny distros.
- deathanatos 9y agoWhy is C an advantage? (I get "no dependencies", but that seems orthogonal to being written in C. Specifically, what does C bring that isn't minimal dependencies, or a small binary?)
- ktta 9y agoIt isn't, except for the fact that most people who can code low level programs know it. But what you don't want into consideration is pretty much the important part of shipping a software you want to proliferate easily.
- megous 9y agoStatically linked C programs are the easiest to ship. Copy and run. No runtime required.
- schrodinger 9y agoSame with go
- pjmlp 9y agoA feature of any AOT compiled language since compilers exist, nothing C specific.
- rmrfrmrf 9y agoJava and .NET would like a word with you.
- atilaneves 9y agoYou can embed their runtimes. I'm not saying that's desireable, just that it's possible.
- pjmlp 9y agoWhen correcting someone on Internet be sure to know what you are talking about. ExcelsiorJET, JamaicaVM, Aonix PERC, IBM Websphere Real Time, Xamarin on iOS, .NET Native, Bartok.
- jcelerier 9y agoyes, good idea, let's make a modern console-based text editor that comes with IBM Websphere Real Time
- tedunangst 9y agoC compiler backend support is pretty broad.
- noobermin 9y agoProbably the biggest understatement I've ever seen on HN.
- deleted 9y ago[deleted]
- defined 9y agoSupported on virtually every OS and embedded platform in existence.
- exikyut 9y agoAbstractly, very much yes. In the context of nano and editors, you also have to contend with POSIX, tty I/O, etc.
- int_19h 9y agoIt adds a massive new dependency to the build process for base system. C is itself a massive dependency, but it's already there for pretty much everyone. This matters more for distros and OSes where building things from source - either everything, as in e.g. Gentoo, or at least the base system, as in the BSDs - is pretty common and expected.
- jlebrech 9y ago>>> C is itself a massive dependency the C standard library?
- petre 9y agoMicro also has zero drpendencies after it's compiled. And Go makes cross compiling easy as childsplay: just set two env vars, type go build and you're done. I'd love a working replacement for Sublime Text written in Go rather than all of these Electron based editors. Lime Text is kind of alpha quality.
- ericfrederich 9y agoAs easy as childsplay as long as your target is supported. I cannot run Go code on my router which runs OpenWRT... Nano works there just fine.
- petre 9y agoGo was likely never intended to run on space constrained platforms like Broadcom MIPS, but point taken.
- lewiseason 9y agoWhat?
- int_19h 9y agoFun fact: on Linux, mac OS and BSDs, it does that by invoking syscalls directly. Syscalls are not considered a stable API on those systems by their respective developers. This means that your precompiled zero-dependency binary will just stop working next time Apple changes or removes a syscall: https://github.com/golang/go/issues/16570 https://github.com/golang/go/issues/16570. Coincidentally, code written in C doesn't have that problem.
- coldtea 9y ago>The advantage of Nano is that it is written in C, has zero required dependencies other than libc, and the compiled binary is 200 kilobytes. The advantage for whom? Surely not the user.
- nl 9y agoHaving been stuck on a system where the only editor was Ed, I'd say nano availability can be a big win for the user.
- zimpenfish 9y agoWhen I was a lad, I had to port ed in order to have a console-based editor. (True story - A5000 with RISCOS back in about 1993)
- joosters 9y agoCan we start a !Zap vs !StrongEd argument here? :) (Zap wins, of course!)
- pjmlp 9y agoThe advantage for anyone trying to find out-of-bound exploits in text buffer handling.