1. 2

    … and I guess this is why software is so terrible.

    1. 7

      Funny thing is, though – software that is not subject to the commercial incentives is still terrible.

      1. 1

        How about all the free / open source infrastructure (from kernels thru daemons thru libs thru languages & compilers) the commercial sector builds their projects upon? Sure, these too are supported by corps with commercial incentives. But they’re not the “fast and cheap” apps that make it or don’t.

        I think we get pretty good software from people who do it for the love of doing it and are paid to keep working on it. Maybe it’s not perfect, but there’s a fair amount of software that doesn’t make me hate it all.

        1. 5

          I’m with jfb. Most OSS software has poor UI, poor documentation, poor security, and so on. It’s crap. Even if better than proprietary average, that wouldn’t be saying much since so much of it is crap. Software being crap is the default. Another phrasing is Big Ball of Mud.

          1. 5

            Part of the problem is that software quality is an aesthetic judgement, a multi-dimensional one, and so people’s views of what makes software “good” are necessarily going to vary.

            1. 2

              Well, maybe, maybe not. It’s definitely subjective in terms of what calls what people will make on it. There are objective attributes we can go by, though. Traditionally, those included things like size of modules, coupling, amount of interactions, what features were tested, how often they fail, how severe failures are, ease of making a change, ease of training new users if UX, and so on. I think the specific values considered acceptable will vary considerably project to project for good reasons. We often assess the same stuff in each one, though. Suggests some things are more objective than others.

              1. 3

                I largely agree with this, yes.

          2. 1

            I think they’re almost uniformly terrible, too.

            1. 1

              Do you have any examples of software you like? I see your POV a bit and was wondering if you had anything you liked.

              1. 3

                I liked the original Interface Builder a lot. I was also a fan of the classic Mac OS for a while. I enjoy Squeak. djb’s software is uniformly good. I use Emacs and I love it but that love is tempered by a strong dislike for emacs lisp itself. But as an environment, I couldn’t possibly surrender it.

                I admire a lot more software than I like – OpenBSD, for instance.

                ETA: Postgres, of course, is a very good piece of software.

                ETA’: I really, really like http://reederapp.com, an iOS/OS X RSS reader.

      1. 2

        Personally I think these small language are much more exciting than big oil tankers like Rust or Swift.

        I’m not familiar with either of those languages, but any idea what the author means by this? I thought Rust has been picking up quite a bit recently.

        1. 10

          I understood the author to be talking about the “size” of the language, not the degree of adoption.

          I’m not sure that I personally agree that C is a small language, but many do belive that.

          1. 3

            Your involvement with rust will bias your opinion - rust team hat would be appropriate here :)

            1. 11

              He is right though. C’s execution model may be conceptually simple but you may need to sweat the implementation details of it, depending on what you’re doing. This doesn’t make C bad, it just raises the bar.

              1. 9

                I had that opinion before Rust, and I’m certainly not speaking on behalf of the Rust team, so in my understanding, the hat is very inappropriate.

                (I’m also not making any claims about Rust’s size, in absolute terms nor relative to C)

                1. 4

                  Or you can just test his claim with numbers. A full, C semantics is huge compared to something like Oberon whose grammar fits on a page or two. Forth is simpler, too. Whereas, Ada and Rust are complicated as can be.

                  1. 5

                    I agree that there are languages considerably smaller than C. In my view, there is a small and simple core to C that is unfortunately complicated by some gnarly details and feature creep. I’ve expressed a desire for a “better C” that does all we want from C without all the crap, and I sincerely believe we could make such a thing by taking C, stripping stuff and fixing some unfortunate design choices. The result should be the small and simple core I see in C.

                    When comparing the complexity of languages, I prefer to ignore syntax (focusing on that is kinda like bickering about style; yeah I have my own style too, and I generally prefer simpler syntax). I also prefer to ignore the standard library. What I would focus on is the language semantics as well as the burden they place on implementation. I would also weigh languages against the features they provide; otherwise we’re talking apples vs oranges where one language simply makes one thing impossible or you have to “invent” that thing outside the language spec. It may look simpler to only present a floating 64-bit point numeric type, but that only increases complexity when people actually need to deal with 64-bit integers and hardware registers.

                    That brings us to Oberon. Yes, the spec is short. I guess that’s mostly not because it has simple semantics, but because it lacks semantics. What is the range of integer types? Are they bignums, and if so, what happens you run out of memory trying to perform multiplication? Perhaps they have a fixed range. If so, what happens when you overflow? What happens if you divide by zero? And what happens when you dereference nil? No focking idea.

                    The “spec” is one for a toy language. That is why it is so short. How long would it grow if it were properly specified? Of course you could decide that everything the spec doesn’t cover is undefined and maybe results in program termination. That would make it impossible to write robust programs that can deal with implementation limitations in varying environments (unless you have perfect static analysis). See my point about apples vs oranges.

                    So the deeper question I have is: how small can you make a language with

                    1. a spec that isn’t a toy spec
                    2. not simply shifting complexity to the user
                    3. enough of the same facilities we have in C so that we can interface with the hardware as well as write robust programs in the face of limited & changing system resources

                    Scheme, Oberon, PostScript, Brainfuck, etc. don’t really give us any data points in that direction.

                    1. 5

                      So the deeper question I have is: how small can you make a language with

                      1. a spec that isn’t a toy spec
                      2. not simply shifting complexity to the user
                      3. enough of the same facilities we have in C so that we can interface with the hardware as well as write robust programs in the face of limited & changing system resources

                      Scheme, Oberon, PostScript, Brainfuck, etc. don’t really give us any data points in that direction.

                      Good question. There are few languages with official standards (sorted by page count) that are also used in practice (well.. maybe not scheme ;>):

                      1. Scheme r7rs - 88 pages - seems to be only language without useful standard library
                      2. Ruby 1.8 - 341 pages
                      3. Ada 95 - 582 pages
                      4. Fortran 2008 - 621 pages - seems to be only language without useful standard library
                      5. C11 - 701 pages
                      6. EcmaScript - 885 pages
                      7. Common Lisp - 1356 pages
                      8. C++17 - 1623 pages

                      I know that page count is poor metric, but it looks like ~600 pages should be enough :)

                      1. 3

                        Here are the page counts for a few other programming language standards:

                        1. PL/I General purpose subset 443 pages
                        2. Modula-2 800 pages - base - 707 pages, generics - 45 pages, objects - 48 pages
                        3. Ada 2012 832 pages
                        4. Eiffel 172 pages
                        5. ISO Pascal 78 pages
                        6. Jovial J73 168 pages
                        1. 2

                          I know that page count is poor metric, but it looks like ~600 pages should be enough :)

                          Given that N1256 is 552 pages, yeah, without a doubt.. :-)

                          The language proper, if we cut it off starting at “future language directions” (then followed by standard library, appendices, index, etc.) is only some 170 pages. It’s not big, but I’m sure it could be made smaller.

                        2. 2

                          I’ve expressed a desire for a “better C” that does all we want from C without all the crap, and I sincerely believe we could make such a thing by taking C, stripping stuff and fixing some unfortunate design choices. The result should be the small and simple core I see in C.

                          That might be worth you writing up with hypothetical design. I was exploring that space as part of bootstrapping for C compilers. My design idea actually started with x86 assembler trying to design a few, high-level operations that map over it which also work on RISC CPU’s. Expressions, 64-bit scalar type, 64-bit array type, variables, stack ops, heap ops, expressions, conditionals, goto, and Scheme-like macros. Everything else should be expressable in terms of the basics with the macros or compiler extensions. The common stuff gets a custom, optimized implementation to avoid macro overhead.

                          “ What I would focus on is the language semantics as well as the burden they place on implementation. “

                          Interesting you arrived at that since some others and I talking verification are convinced a language design should evolve with a formal spec for that reason. It could be as simple as Abstract, State Machines or as complex as Isabelle/HOL. The point is the feature is described precisely in terms of what it does and its interaction with other features. If one can’t describe that precisely, how the hell is a complicated program using those same features going to be easy to understand or predict? As an additional example, adding a “simple, local change” show unexpected interactions or state explosion once you run the model somehow. Maybe not so simple or local after all but it isn’t always evident if just talking in vague English about the language. I was going to prototype the concept with Oberon, too, since it’s so small and easy to understand.

                          “but because it lacks semantics.”

                          I didn’t think about that. You have a good point. Might be worth formalizing some of the details to see what happens. Might get messier as we formalize. Hmm.

                          “So the deeper question I have is: how small can you make a language with”

                          I think we have answers to some of that but they’re in pieces across projects. They haven’t been integrated into the view you’re looking for. You’ve definitely given me something to think about if I attempt a C-like design. :)

                  2. 4

                    He also says that the issues with memory-safety in C are overrated, so take it with a grain of salt.

                    1. 13

                      He is not claiming that memory safety in general is not an issue in C. What he is saying is that in his own projects he was able to limit or completely eliminate dynamic memory allocation:

                      In the 32 kloc of C code I’ve written since last August, there are only 13 calls to malloc overall, all in the sokol_gfx.h header, and 10 of those calls happen in the sokol-gfx initialization function

                      The entire 8-bit emulator code (chip headers, tests and examples, about 12 kloc) doesn’t have a single call to malloc or free.

                      That actually sounds like someone who understands that memory safety is very hard and important.

                      1. 3

                        Not at all the vibe I got from it.

                      2. 4

                        I’m not familiar with either of those languages, but any idea what the author means by this?

                        I’m also way more interested in Zig than I am in Rust.

                        What I think he’s saying is that the two “big” languages are overhyped and have gained disproportionate attention for what they offer, compared to some of the smaller projects that don’t hit HN/Lobsters headlines regularly.

                        Or maybe it’s a statement w.r.t. size and scope. I don’t know Swift well enough to say if it counts as big. But Rust looks like “Rubyists reinvented C++ and claim it to be a replacement for C.” I feel that people who prefer C are into things that small and simple. C++ is a behemoth. When your ideal replacement for C would also be small and simple, perhaps even more so than C itself, Rust starts to seem more and more like an oil tanker as it goes the C++ way.

                        1. 3

                          I agree with your point on attention. I just wanted to say maybe we should get a bit more credit here:

                          “compared to some of the smaller projects that don’t hit HN/Lobsters headlines regularly.”

                          Maybe HN but Lobsters covers plenty oddball languages. Sometimes with good discussions, too. We had authors of them in it for a few. I’ve stayed digging them up to keep fresh ideas on the site.

                          So, we’re doing better here than most forums on that. :)

                          1. 2

                            Sure! Lobsters is where I first learned about Zig. :-)

                      1. 3

                        My first recommendation is to use a fast terminal with a bitmap font. The reason I say bitmap is because it will keep up with the display of a live capture.

                        In any reasonable terminal, bitmap shouldn’t be faster, because glyphs from vector fonts are rendered only once and cached into a glyph atlas in memory and then painted exactly like a bitmap. With Alacritty, that happens on the GPU :)

                        1. 3

                          In any reasonable terminal, bitmap shouldn’t be faster, because glyphs from vector fonts are rendered only once and cached into a glyph atlas in memory and then painted exactly like a bitmap.

                          Nah. In bitmap fonts, a pixel is either set or not. Vector fonts tend to generate partially covered pixels that are handled by alpha blending, which is more expensive than the and+or you use to blit a hard-edged shape.

                          The trend to push everything onto the GPU is quite harmful especially for those of us not running mainstream OSen.

                          1. 2

                            You don’t have to do alpha blending every time, just cache the glyph together with the background color.

                            1. 1

                              But do terminals actually do that? Background color can change any time at any cell.

                              I think that would be a silly way to spend memory.

                          1. 3

                            You should’ve checked before posting this very example - it has been fixed a month ago :^)

                            1. 4

                              Thanks, that’s great news! I don’t currently have access to an OpenBSD system, to be honest. Still, that means two and a half years to comply with POSIX over a one-character fix, so again I feel compliance is not always a priority.

                              1. 6

                                It is not always a priority. Why should posix compliance take precedence over everything else? Each such question is generally being dealt with on a case-by-case basis.

                                Implementing whatever posix comes up with is not a stated goal of the OpenBSD project.

                                And adding whatever OpenBSD invents is obviously not a stated goal of posix either. As one example, see arc4random(3).

                                1. 9

                                  Implementing whatever posix comes up with is not a stated goal of the OpenBSD project.

                                  goals.html gets confusingly close to stating just that though:

                                  Track and implement standards (ANSI, POSIX, parts of X/Open, etc.)

                                  http://www.openbsd.org/goals.html

                                  1. 4

                                    Yes, posix compliance is a goal. But that does not mean it’s at the highest priority of all the things the project does.

                                    1. 2

                                      We all agree it’s not the highest priority, and probably OpenBSD would not be what it is if it were. Thanks for contributing to such a fine project.

                          1. 14

                            I really hate browser notifications. I never click yes ever. It feels like preventing browsers from going down this hole is just yet another hack. The Spammers and the CAPTCHAers are fighting a continuous war, all because of the 2% of people who actually click on SPAM.

                            1. 7

                              I’m amazed there is no “deny all” setting for this

                              1. 5

                                My firefox has that in the settings somewhere:

                                [X] Block new requests asking to allow notifications

                                This will prevent any websites not listed above from requesting permission to send notifications. Blocking notifications may break some website features.

                                help links here: https://support.mozilla.org/en-US/kb/push-notifications-firefox?as=u&utm_source=inproduct

                                1. 2

                                  Did anyone find the about:config setting for this, to put in ones user.js? I am aware of dom.webnotifications.enabled, but I don’t want to disable it completely because there are 3 websites which notifications I want.

                                  1. 3

                                    permissions.default.desktop-notification = 2

                                2. 1

                                  there always has been in Chrome and Safari and since very recently, there’s also one in Firefox. It’s the first thing I turn off whenever I configure a new browser. I can’t possibly think of anybody actually actively wanting notifications to be delivered to them.

                                  Sure, there’s some web apps like gmail, but even there - I’d rather use a native app for this.

                                  1. 3

                                    I can’t possibly think of anybody actually actively wanting notifications to be delivered to them.

                                    Users of web-based chat software. I primarily use native apps for that, but occasionally I need to use a chat system that I don’t want to bother installing locally. And it’s nice to have a web backup for when the native app breaks. (I’m looking at you, HipChat for Windows.)

                                3. 5

                                  There is a default deny option in Chrome, takes a little digging to find though. But I agree that it’s crazy how widespread sites trying to use notification are. There’s like 1 or 2 sites that I actually want them from, but it seems like every single news site and random blog wants to be able to send notifications. And they usually do it immediately upon loading the page, before you’ve even read the article, much less clicked something about wanting to be notified of future posts or something.

                                  1. 1

                                    The only time I have clicked “yes” for notifications is for forums (Discourse only at this point) that offer notifications of replies and DMs. I don’t see a need for any other websites to need to notify me.

                                  1. 22

                                    So (1) nobody cared to improve the old tools, writing new ones is more fun, and (2) updating the old tools to reflect current reality would break old scripts, so the rational choice is to both let the old tool rot (thus quite possibly breaking anything that relies on it) as well as introduce a new tool that definitely isn’t compatible with the old scripts. Why do I feel like this line of arguing has a problem or two?

                                    Pray tell, what happens when the interface provided by the iproute2 utilities no longer reflects reality. Let them rot and write yet another set of new tools? Break them? Introduce subtle lies?

                                    Oh by the way, if you’re configuring IPv6 on linux, don’t use the old tools. They’re subtly broken and can waste you a lot of time. I’ve been there. Don’t mention it.

                                    Meanwhile, I’m glad that OpenBSD’s ifconfig can show more than one IP per interface. And I can use the same tool to set up my wifi too. It’s a tool meant to work.

                                    1. 12

                                      The BSDs are maintaining the kernel and the base system in locksteps. This is not the case for Linux distributions. Over the years, Linux developers started to do the same. That’s why we now have iproute2, ethtool, iw and perf, which are userland tools evolving at the same speed as the kernel (and sharing the version number).

                                      1. 8

                                        nobody cared to improve the old tools

                                        The people who want to use the old tools want them to keep working the same way they always have. They already work that way, so the people who want to use the old tools have no motivation to make changes.

                                        updating the old tools to reflect current reality would break old scripts

                                        It would also piss off the people who want to keep using the old tools, since by definition they would no longer keep working the same way.

                                        The names ifconfig and netstat are now claimed and cannot be re-used for a different purpose, in much the same way that filenames like COM1 and AUX are claimed on Windows and cannot be re-used.

                                        Meanwhile, I’m glad that OpenBSD’s ifconfig can show more than one IP per interface.

                                        My understanding is that OpenBSD reserves the right to change anything at any time, from user-interface details down to the C ABI. “The people who want to use the old tools” are discouraged from using OpenBSD to begin with, so it’s not surprising that OpenBSD doesn’t have to wrestle with these kinds of problems.

                                        1. 4

                                          the right to change anything at any time

                                          While this is true, I think you are taking it a little too literally. You won’t, for example, upgrade to the latest snapshot and find that ls has been replaced by some new tool with a completely different name, or that CVS has been replaced by GIT. And while POSIX doesn’t require (best I can tell) a tool named ifconfig it’s very unlikely you would find it replaced by something else.

                                          1. 5

                                            Right. And by following the discussions on tech@, I’ve gotten the impression that Theo (as well as many other developers) do deeply care about avoiding unnecessary chance to the user facing parts as tools get replaced or extended. Case in point, daemon configuration. The system got extended with the rcctl tool, but the old way of configuring things via rc.local and rc.conf.local still works as it always did. Nothing like the init system swaps on Linux. Still, extending or changing the behavior of a tool even at the risk of breaking some old script seems to be preferred to making new tools that require everyone to adapt.

                                            After a decade of using Linux as well as OpenBSD, I’d say that OpenBSD is way more committed to keeping the user facing parts finger compatible while breaking ABI more freely (“we live in a source code world”). In the Linux world I’ve come to expect ABI compatibility but user compatibility gets rekt all the time.

                                      1. 1

                                        Any idea how GDPR would relate to P2P software?

                                        Say I wrote some social network that runs as a P2P application. As I want the network to take off, I also host my own nodes. Users, by using the software, will broadcast all kinds of data into the network, which is then stored, cached, and redistributed by the nodes. It will be impossible to give users a “delete all my data” flip; nodes may be hosted by anyone, anywhere, anonymously. I could potentially delete user data from my nodes on demand, but even that may be difficult to arrange for in practice. If an encrypted hash->value store is used, it might actually require me to collect more data in order to identify the rightful “owner” of a given object. But collecting such data about users may be impossible, since much of it depends on what client they use and what nodes they connect through, how they authenticate, etc.

                                        1. 3

                                          The XMPP community is asking these questions right now and it’s interesting how this would affect distributed systems like Mastadon.

                                          1. 2

                                            If, by any chance, you happen to have links to relevant discussion, I’d be so grateful. :-)

                                          2. 1

                                            I think this actually is possible to handle. If a third party gives you a statement about GDPR-compliance then that’s possible.

                                            Also note that part of this actually isn’t a new legal problem in most European countries. Even though such topics come up again with GDPR. Informing people about collected data and in many countries the right to correction and deletion of data has been existing for decades. Also why not binding the EU in 1995 adopted the Data Protection Directive, which in large parts was implemented by various European countries.

                                          1. 2

                                            The architecture specifics of Electron have helped it succeed, but what really matters are results: a developer can make a desktop application using a single JavaScript codebase, and it compiles into a binary that works on every OS.

                                            This is obviously bullshit.

                                            1. 7

                                              “Works” and “every” obviously require scare quotes, at the very least, but I don’t think the overall point is wrong. Electron succeeded (as far as it has succeeded, at any rate, which IMO is certainly too far to be dismissed) because there are massive numbers of incurious web programmers in the world, and Electron enables them to ship an application that will at least execute on several distinct, popular OSs without having to learn anything at all about those OSs or any languages or concepts other than Javascript.

                                              Do you see a different high-level reason for its success?

                                              1. 7

                                                I think it’s disingenuous to call these web developers “incurious”. There are other practical reasons to use Electron. I had to make a similar decision at my company: how do I allocate limited resources when I need to provide a web app plus iOS and Android apps? Guess what: I chose to go with hybrid mobile apps which shared a lot of code with the web app and between iOS/Android.

                                                Does that make me incurious, or pragmatic?

                                                I’m not sure you understand the effort involved in developing applications for multiple platforms. It’s all very nice to proclaim that these lazy developers just need to learn another two-three languages and another two-three monstrous sets of APIs, damnit, but in reality, what’s needed is another two or three teams of developers.

                                                As a matter of fact, I don’t like Electron and I think companies like Slack can afford the extra developers, but that’s a different argument.

                                            1. 2

                                              Eliminate the moving parts (e.g. fans, HDDs) and you eliminate the noise — it’s not that complicated.

                                              That’s not true. I can hear one of my mice. I can hear not-the-fan-noise from my discrete GPUs. I can hear at least one of my SSDs. I can hear my monitor. I can hear my amp. I’ve had a noisy PSU too.

                                              I wonder why the author went with discrete parts especially given that they consider efficiency and are planning to move off the grid. There are CPUs in the 10W to 30W range that are significantly more efficient than the desktop chips that push a lot of heat for a modest increase in clock speed.

                                              Getting a passively cooled PC doesn’t need to be an ordeal that costs thousands of dollars and lots of time trying to find parts that fit; I have a Shuttle DS57U7 and a DS437. Similar builds can be had for a few hundred bucks sans RAM or storage. If such slim PCs are not an option, well, full sized passive workstations are available too.

                                              1. 2

                                                If such slim PCs are not an option, well, full sized passive workstations are available too.

                                                One can’t fault the aesthetics of this case, though! It’s available as a full build from https://www.quietpc.com/sys-db4.

                                              1. 4

                                                I don’t really trust the software or hardware I run so important passwords are on paper, which I tend to keep home (but sometimes take along if I’m travelling for days). If you find the right time and place to mug or rob me, you’ll get (part of) the keys. I’ll take that over “whoops, critical security vulnerability found in $popularSoftware, 10 million passwords leaked.”

                                                1. 2

                                                  Yours is most secure method. Next best is dedicated, embedded device. I had a hypothetical design that used hardware of an old electronic organizer. One could use it as a trusted path, secure initializer, password storage, TRNG, etc. Someone copied the idea visually for password management. Nothing else, though, esp like separation kernels or I/O mediation. Still might build it one day.

                                                1. 1

                                                  Why httpd? It’s only available for OpenBSD (and maybe other BSDs), and while I haven’t (yet) looked at the script, it would seem that it offeres no specific feature, which a more portable and lightweight server like darkhttpd would offer.

                                                  But otherwise, very interesting, I will consider maybe adopting and tweaking it to use on my site.

                                                  Also if the “pps” value is important, consider using cmark, since it’s known for it’s speed, that is beside it being commonmark compliant.

                                                  Edit: The choice makes sense from a OpenBSD perspective, and taking into consideration that it’s written for personal use, and not as a general replacment tool.

                                                  1. 7

                                                    Why httpd? It’s only available for OpenBSD (and maybe other BSDs), and while I haven’t (yet) looked at the script, it would seem that it offeres no specific feature, which a more portable and lightweight server like darkhttpd would offer.

                                                    I think the author is an OpenBSD user, and is probably trying to do as much with the base system (which includes httpd) and a minimum of additional packages as possible. darkhttpd is an additional package, and doesn’t come with a man page.

                                                    Also if the “pps” value is important, consider using cmark, since it’s known for it’s speed, that is beside it being commonmark compliant.

                                                    cmark hasn’t been ported to OpenBSD yet. Granted, the author could probably build it from source or do their own port, but that would defeat the point of the exercise.

                                                    1. 2

                                                      Yeah I guess I should write a manpage for darkhttpd at some point.

                                                      1. 1

                                                        is probably trying to do as much with the base system (which includes httpd) and a minimum of additional packages as possible

                                                        I understand that, but seeing that neither rsync, lowdown or entr are in the base system, it doesn’t seem too problematic. Especially since, this is my main point, httpd locks out all other systems from using it. To be fair, it’s a shell script and each to change, but it just seems like a weird design choice.

                                                        1. 5

                                                          I see what you’re talking about, but I don’t think it’s weird. I think the author is scratching their own itch, and documenting how they did it on the off chance that it’s useful or interesting to others. This isn’t an other-focused project with widespread adoption as a goal. If it were, then it would make more sense to just dump the output in a directory that could be transferred to a Apache2 or nginx host.

                                                          Personally, I’m more surprised that the author chose to build HTML and XML files directly from the shell script instead of creating templates and populating them using sed (and maybe awk). Now that would be badass.

                                                          1. 3

                                                            Yes, I’m an OpenBSD user. httpd(8) can be replaced with anything, it’s just for previewing. lowdown, entr, rsync are small and easy to install software:

                                                            # pkg_add lowdown entr rsync
                                                            

                                                            My HTML template is so tiny, I’ve decided to place it right into the shell script. Also it’s a bit faster than my version of my awk script.

                                                            Thank you!

                                                            1. 2

                                                              This is good stuff, and I had thought of extending it for my use case, but since I’m already getting what I want from Pelican I should stick with what works for me. Though I do use rsync to deploy; that’s baked into the Makefile. :)

                                                              1. 2

                                                                Cool! :)

                                                                One more point:
                                                                78.5MB ruby + jekyll + its dependences (25 gems)
                                                                0.82MB lowdown + rsync + entr

                                                      2. 6

                                                        The author mentions to use OpenBSD for servers and workstations, so why not? Portability isn’t so important for personal tools. And httpd is only used for the local preview feature and could easily replaced by any other http server, including python -m http.server. The 6 line httpd config is already included in the <160 lines of shell scripts.

                                                        The script is very short, reading such a thing before commenting generally improves sites like lobste,rs ;)

                                                        1. 2

                                                          I just finished reading it, since I couldn’t open it on my phone (the scripts content type is application/octet-stream making it un-openable on a phone). And as I guessed, it is easy to change, but I would still maintain that

                                                          cd "$DOCS" || exit
                                                          doas httpd -d -f "$conf"
                                                          ;;
                                                          

                                                          meaning that it requires root to run, as compared to darkhttpd which is fully functional without. It just seems like a simpler option, and again, I get it’s not a real problem, and I implied I would chance it if I were to use it anyways.

                                                          1. 3

                                                            meaning that it requires root to run

                                                            It requires root to drop privileges and chroot. I wouldn’t have it any other way.

                                                            Installing a third party daemon to avoid using the built-in features of the base system does not seem simpler really.

                                                            1. 1

                                                              Installing a third party daemon to avoid using the built-in features of the base system does not seem simpler really.

                                                              Well it does on a non-OpenBSD system (although one should remember that darkhttpd isn’t a daemon, but a single C file server, comparable to python -m http.server), which was the perspective I was looking at it. But from the authors point of view, his choice is reasonable.

                                                              1. 1

                                                                For systems with Ruby, the httpd function from the un package is the best choice. To require un and evaluate the httpd function:

                                                                $ ruby -run -e httpd
                                                                

                                                                Cute right?

                                                                Advantages over Python:

                                                                • multi-threaded
                                                                • supports SSL / TLS
                                                                • suitable for production deployment
                                                                • automatic indexes show modification time and file size
                                                                • don’t have to remember if it’s -m http.server or -m SimpleHTTPServer

                                                                More info: ruby -run -e help httpd

                                                                1. 2

                                                                  Folks, you are right, I’d use Python or Ruby on macOS, for example. Installing them on OpenBSD is not an option for me, they are huge.

                                                                  One of the reasons to replace Jekyll is having Ruby as a dependency. With my script all I need to build my site is: lowdown(1) and rsync(1). Also both can be replaced, but they are the fastest options I’ve tried so far.

                                                        2. 2

                                                          Being written by the OpenBSD team implies a certain amount of simplicity, correctness, security, and documentation. Ive never heard of darkhttpd. If those are only choices, I’d default on OpenBSD’s implementation unless I had good reason to do otherwise.

                                                          1. 2

                                                            I would agree that httpd would be a better choice, when it comes to actually hosting the content on the web, and one could only choose between the two. But

                                                            1. Neither is that the case (one has more options) and even then it would be bad design if necessitated the use of a server on a remote system, for static content
                                                            2. If I didn’t misunderand anything, httpd is used to locally debug and preview ones site. I would personally argue that in this case, security would be less important if the choice means the script isn’t usable on systems, httpd doesn’t run on (which I assume is something the author wants, since the script is written with POSIX compliance in mind)

                                                            So there seems to be a good reason, at least not to use httpd as the default server to locally preview ones site. And all I want, is to suggest darkhttpd since it actually is quite nice. suckless even recommends it, if that is a standard one can use. But in general it would be nice if one could use shell variables or something comparable to it

                                                            1. 2

                                                              I havent researched enough on either solution to say much more. Someone online just yold me it was their web server to replace more bloated or messy stuff. I was just saying some will default on stuff written by people that normally focus on quality or security. We got quite a few here that like the suckless stuff, too.

                                                              Your reasons for checking out the other one sound good, too. I have no issue with it. Just saying why some default on OpenBSD code.

                                                              1. 2

                                                                I’ll probably remove serve from my script in the future to keep it simple. Here is my use case right now:

                                                                Run httpd(8) as a daemon once:

                                                                # rcctl enable httpd
                                                                # printf 'server "localhost" {\n  listen on * port 80\n}\n' > /etc/httpd.conf
                                                                # doas rcctl start httpd
                                                                

                                                                Then run ssg watch for previewing:

                                                                $ cd src/romanzolotarev.com
                                                                $ DOCS=/var/www/htdocs ssg watch
                                                                
                                                        1. 2

                                                          I don’t really understand the goal of this. OpenBSD is supposed to be used for it’s security (mainly) or simplicity, but what’s the goal of it for machine learning?! I mean, everybody admits that OpenBSD is definitely slower than many linux distributions and ML seem to be an abyss for CPU/RAM resources. Maybe this is just for fun, but it seems like an useless constraints to me…

                                                          1. 19

                                                            From reading the article I think he had three goals:

                                                            • learn about NN
                                                            • learn about OpenBSD
                                                            • leave the comfy environment of an IDE

                                                            It looks like he just picked OpenBSD because he was interested in it, not because it is a good environment for machine learning.

                                                            1. 8

                                                              If you were doing ML for real, you’d probably be using a GPU/TPU. Or a distributed system (as e.g. in neuroevolution). Which makes OpenBSD a suboptimal choice.

                                                              However, if you’re just doing it on the CPU & system RAM, it’s basically all pure compute, so the speed of the operating system does not really play a role (unless you’ve got so many cores that scheduling becomes a problem). The speed of the OS only becomes relevant when you’re heavily involving the kernel (and perhaps the allocator), which you don’t in pure compute.

                                                              It’s just for fun.

                                                              1. 1

                                                                If you were doing ML for real, you’d probably be using a GPU/TPU. Or a distributed system (as e.g. in neuroevolution). Which makes OpenBSD a suboptimal choice.

                                                                I think this is a serious misconception about machine learning. The majority of machine-learning applications probably can run on a single PC (potentially your laptop if it has enough RAM).

                                                                1. 1

                                                                  The majority of machine-learning applications in use today? No doubt, they are constrained by the resources that we have today. The pressure to go bigger and deeper is there and deep networks have shown so much promise. Training overnight, or for days or even weeks is no fun. And yet the fact that we even can train such deep networks at all within such a “reasonable” timeframe is what drives the current AI hype cycle.

                                                                  If you have an useful source from which I can learn why the majority of machine-learning applications are not constrained by performance, I’d be interested.

                                                              2. 3

                                                                He is obsessed with efficiency. At work he doesn’t use them to be efficient and on holiday he is cramming everything together to be efficient (at learning/fun).

                                                                1. 1

                                                                  If it’s for a corporation I presume it’s so he can hack it up without having to share source.

                                                                  1. 1

                                                                    This both highly pessimistic and also wrong. He did it for fun not for work or to open source. Purely personal coding for pleasure.

                                                                    1. 2

                                                                      It’s not pessimistic, it’s what a lot of people hack on BSD for and its honestly part of what the license was designed for. The fact that you clarified that it’s not to open source means he might have a quiet closed source ambition for it. It’s not unreasonable to presume because he picked the platform which legally permits a behavior, that it might contribute to why he picked it.

                                                                      1. 1

                                                                        Except that he wasn’t hacking on BSD. He was using it as a dev platform but he didn’t modify it. He was hacking on neural network implementations from whitepapers so he could learn about them. BSD was filling the role of Operating System and nothing more.

                                                                        1. 1

                                                                          Ah that clarifies a lot. He’s just using it as his os. I normally would RTFA but facebook. I wasn’t trying to paint them in a negative light though yes definitely from a more OSS passionate perspective that would be negative.

                                                                1. 4

                                                                  There’s plenty more experiments here, including SEM images: https://scienceofsharp.wordpress.com/

                                                                  1. 9

                                                                    I didn’t see any superpowers here. Just the most basic of typing. Let’s wait for the second part, I guess?

                                                                    1. 3

                                                                      When compared to vanilla JavaScript, some developers believe types are superpowers.

                                                                    1. 2

                                                                      I don’t understand how the C implementation of true is non-portable? I mean, every C compiler and environment I have seen can set main() as an integer, and return 0 to the shell. Can some one explain how the following C code is non-portable?

                                                                      #include <stdio.h>
                                                                      int main() { 
                                                                          return 0;
                                                                      }
                                                                      
                                                                      1. 9

                                                                        His complaint is that the executable is not portable, not the source file. The literal file /usr/bin/true on a Linux machine can’t be dropped onto a machine that doesn’t use ELF binaries, for example.

                                                                        1. 1

                                                                          That makes way more sense, thank you.

                                                                          1. 3

                                                                            It does make more sense, but what doesn’t (to me) is why Pike of all people complains about binary vs. source compatibility.

                                                                        2. 6

                                                                          Can some one explain how the following C code is non-portable?

                                                                          Main must have exactly two parameters (int and char **) or void. Anything else is implementation defined territory.

                                                                          1. 1

                                                                            Good call!

                                                                          2. 1

                                                                            Saved you some bytes, leaving out the include works fine, no?

                                                                            int main(){return 0;}
                                                                            
                                                                            1. 2

                                                                              Saved you some bytes, leave that to your compilet, he knows his job!

                                                                              main(){};
                                                                              
                                                                          1. 1

                                                                            Question about something tangentially related: does anyone have source code to show what it takes to boot a program (no OS) and draw into the UEFI framebuffer?

                                                                            1. 6

                                                                              Anyone know of cloud providers (either virtualized or real hardware) that either offer OpenBSD, or allow you to install OpenBSD easily and without hacks?

                                                                              I only know of prgmr.com, RootBSD and ARP Networks. I am interested in companies offering real professional support running on server grade hardware (ECC, Xeon, etc) with proper redundant networking, etc, so amateur (but cheap) stuff like Hetzner doesn’t count.

                                                                              Somewhat tangential, but I am also interested in European companies. I only know of CloudSigma, Tilaa, Exoscale and cloudscale.ch. Are they any good?

                                                                              EDIS and ITL seem to be Russian companies or shells operating in European locations, not interested in those.

                                                                              Many thanks!

                                                                              1. 5

                                                                                https://www.vultr.com/servers/openbsd

                                                                                I wouldn’t consider Gilles’ method a hack at this point, now that online.net gives you console access. Like usual, you first have to get the installer on to a disk attached to the machine. Since you can’t walk up to the machine with a stick of USB flash, copying it to the root disk from recovery mode makes all the sense.

                                                                                1. 2

                                                                                  Thanks, I forgot about vultr.

                                                                                  As for installing, I would vastly prefer PXE boot. It’s not just about getting it installed. It’s about having a supported configuration. I am not interested in running configurations not supported by the provider. What if next year they change the way they boot the machines and you can’t install OpenBSD using the new system anymore? A guarantee for PXE boot ensures forward compatibility.

                                                                                  Or what if some provider that is using virtualization updates their hypervisor which has a new bug that only affects OpenBSD? If the provider does not explicitly support OpenBSD, it’s unlikely they will care enough to roll back the change or fix the bug.

                                                                                  You’re not paying for hardware, as Hetzner showed, hardware is cheap, you’re paying for support and for the network. If they don’t support you, then why pay?

                                                                                  1. 2

                                                                                    Yeah I share your concerns. That’s why I’ve hesitated to pay for hosting and am still running all my stuff at home. It would suck to pay only to hear that I’m on my own if something changes and my system doesn’t work well after that change.

                                                                                    Given how often OpenBSD makes it to the headlines on HN and other tech news outlets, it is really disappointing how few seem to actually care enough to run or support it. It’s also disappointing considering that the user base has a healthy disdain for twisting knobs, and the system itself doesn’t suffer much churn. It should be quite easy to find a stable & supported hardware configuration that just works for all OpenBSD users.

                                                                                    1. 1

                                                                                      It should be quite easy to find a stable & supported hardware configuration that just works for all OpenBSD users.

                                                                                      Boom! There it is. The consumer side picks their own hardware expecting whatever they install to work on it. They pick for a lot of reasons other than compatibility, like appearance. OpenBSD supporting less hardware limits it a lot there. I’ve always thought an OpenBSD company should form that uses the Apple model of nice hardware with desktop software preloaded for some market segment that already buys Linux, terminals, or something. Maybe with some must-have software for business that provides some or most of the revenue so not much dependency on hardware sales. Any 3rd party providing dediboxes for server-side software should have it easiest since they can just standardize on some 1U or 2U stuff they know works well with OpenBSD. In theory, at least.

                                                                                2. 4

                                                                                  https://www.netcup.de/

                                                                                  I run the above setup on a VPS. OpenBSD is not officially supported, but you can upload custom images. Support was very good in the last 3-4 years (didn’t need it recently).

                                                                                  1. 2

                                                                                    Looks nice, especially since they are locals :) Do you mind answering some questions?

                                                                                    • Do they support IPv6 for VPS (/64)?
                                                                                    • Have you tried to restore a snapshot from a VPS?
                                                                                    • Mind sharing a dmesg?
                                                                                    1. 3
                                                                                  2. 2

                                                                                    I have two OpenBSD vservers running at Hetzner https://www.hetzner.com . They provide OpenBSD ISO images and a “virtual KVM console” via HTTP. So installing with softraid (RAID or crypto) is easily possible.

                                                                                    Since one week there is no official vServer product more. Nowadays, they call it … wait for it … cloud server. The control panel looks different, however, I have no clue if something[tm] changed.

                                                                                    Here is a dmesg from one server: http://dmesgd.nycbug.org/index.cgi?do=view&id=3441

                                                                                    1. 2

                                                                                      Joyent started providing a KVM OpenBSD image for Triton last May: https://docs.joyent.com/public-cloud/instances/virtual-machines/images/openbsd

                                                                                      (This has been possible for some time if you had your own Triton cluster, but there was no official way until this was published.)

                                                                                      1. 1

                                                                                        What’s the deal for cloud providers for not making OpenBSD available? Is it technically complex to offer, or just that they don’t have the resources for the support? Maybe just a mention that it’s not supported by their customer service would already help users no?

                                                                                        1. 11

                                                                                          As far as I know, it’s a mix of things. Few people ask for OpenBSD, so there’s little incentive to offer it. Plus a lot of enterprise software tends to target RHEL and other “enterprise-y” offerings. Even in the open source landscape, things are pretty dire:

                                                                                          OpenBSD also seems to have pretty bad timing issues on qemu/KVM that have fairly deeply rooted causes. Who knows what other horrors lurk in OpenBSD as a guest.

                                                                                          OpenBSD doesn’t get people really excited, either. Many features are security features and that’s always a tough sell. They’d rather see things like ZFS.

                                                                                          For better or for worse, OpenBSD has a very small following. For everybody else, it just seems to be the testing lab where people do interesting things with OS development, such as OpenSSH, LibreSSL, KASLR, KARL, arc4random, pledge, doas, etc. that people then take into OSes that poeple actually use. Unless some kind of Red Hat of OpenBSD emerges, I don’t see that changing, too. Subjectively, it feels very UNIX-y still. You can’t just google issues and be sure people have already seen them before; you’re on your own if things break.

                                                                                          1. 9

                                                                                            Rust’s platform support has OpenBSD/amd64 in tier 3 (“which are not built or tested automatically, and may not work”).

                                                                                            I can talk a little about this point, as a common problem: we could support OpenBSD better if we had more knowledge and more people willing to integrate it well into our CI workflow, make good patches to our libc and so on.

                                                                                            It’s a damn position to be in: on the one hand, we don’t want to be the people that want to inflict work to OpenBSD. We are in no position to ask. On the other hand, we have only few with enough knowledge to make OpenBSD support good. And if we deliver half-arsed support but say we have support, we get the worst of all worlds. So, we need people to step up, and not just for a couple of patches.

                                                                                            This problem is a regular companion in the FOSS world, sadly :(.

                                                                                            Also, as noted by mulander: I forgot semarie@ again. Thanks for all the work!

                                                                                            1. 7

                                                                                              semarie@ has been working upstream with rust for ages now… It would be more accurate to say ‘we need more people to step up’.

                                                                                              1. 3

                                                                                                Right, sorry for that. I’ll change the wording.

                                                                                        1. 1

                                                                                          Yikes. Meant to put that into the title, obviously, not the URL. Apparently I can’t edit the URL though.

                                                                                        1. 11

                                                                                          I think I mostly agree with the premise here.. I tried freebsd but I hard time being happy with it compared to simply using a systemd-less linux like void or alpine.

                                                                                          OpenBSD on the other hand fascinates me, mostly because of the security focus and overall simplicity, I think part of that idea of focused goals is the same reason I’ve been starting to keep up with DragonFlyBSD development, the drive to do something different than the mainstream can be a strong motivator of interest.

                                                                                          But realistically, I dont see something like FreeNAS dying anytime soon, some of my IT friends swear only by it.

                                                                                          1. 20

                                                                                            I love running FreeBSD. I run Void whenever I have to run Linux, but honestly running FreeBSD is so much fun. The system makes so much sense, there are so few running processes. Configs are kept in the right places, packages that are installed just work, upgrades almost never broke anything, and in general there was a lot less fiddliness. I want to run Void from time to time to get the new and shiny (without having to build it for a custom platform), but in both Debian and Void (the systems I run), packages are of varying quality, and upgrades are always stressful (though Void’s running release nature makes it less so). FreeBSD’s consistency also makes me feel a lot less scared about opening it up and fiddling with the insides (such as trying my hand at creating my own rc unit runner or something), whereas with Linux I often feel like I’m peering at the edge of a Rube Goldberg machine.

                                                                                            Oh and don’t get me started on the FreeBSD Handbook and manpages. Talk about documentation done right.

                                                                                            1. 7

                                                                                              “Rube Goldberg machine” is a great description for much of the Linux world. Especially Debian-style packages with their incredibly complex configuration hooks and menus and stuff.

                                                                                              My favorite feature of pkgng is that packages do not add post-install actions to other packages :)

                                                                                              1. 1

                                                                                                I still can’t get over the fact that installing a deb service on a Debian based distribution, starts the service automatically? Why was that ever considering a good design decision?

                                                                                                I personally run Gentoo and Void. I had FreeBSD running really well on an older X1 carbon about two years back, but the hardware failed on the X1. I do use FreeBSD on my VPS for my openvpn server, but it seems like FreeBSD is the only one supported on major VPSes (Digital Ocean, Vultr). I wish there was better VPS support for at least OpenBSD.

                                                                                              2. 2

                                                                                                Dont get me wrong, I like FreeBSD, I’ve just never felt the same fascination towards it that I do with OpenBSD, DragonflyBSD, Haiku, ReactOS or Harvey. But perhaps thats a good thing?

                                                                                                I guess the main thing Is I’ve never been in a situation where I didn’t need to use linux / windows and couldn’t use OpenBSD.

                                                                                                1. 6

                                                                                                  FreeBSD seems to do less in-house experimental stuff that gets press. Dragonfly has the single-system image clustering long-term vision, OpenBSD is much more aggressive about ripping out and/or rewriting parts of the core system, etc.

                                                                                                  I do feel most comfortable with the medium-term organizational future of FreeBSD though. It seems to have the highest bus factor and strongest institutional backing. Dragonfly’s bus factor is pretty clearly 1: Matthew Dillon does the vast majority of development. OpenBSD’s is slightly higher, but I’m not entirely confident it would survive Theo leaving the project. While I don’t think any single person leaving FreeBSD would be fatal.

                                                                                                  1. 4

                                                                                                    I’m not entirely confident it would survive Theo leaving the project

                                                                                                    There is no reason to worry about that: http://marc.info/?l=openbsd-misc&m=137609553004700&w=2

                                                                                                    1. 2

                                                                                                      FreeBSD seems to do less in-house experimental stuff that gets press

                                                                                                      The problem is with the press here. CloudABI is the most amazing innovation I’ve seen in the Unix world, and everyone is sleeping on it ;(

                                                                                                2. 4

                                                                                                  I tried freebsd but I hard time being happy with it compared to simply using a systemd-less linux like void or alpine.

                                                                                                  The Linux distro that’s closest to the *BSD world is Gentoo - they even named their package management system “Portage” because it’s inspired by *BSD ports.

                                                                                                  1. 2

                                                                                                    As a long time OpenBSD & Gentoo user (they were my introduction to BSD & Linux respectively and I’ve run both on servers & desktops for years), I strongly disagree. If I wanted to experience BSD on Linux, Gentoo would be the last thing I’d look at.

                                                                                                    1. 1

                                                                                                      If I wanted to experience BSD on Linux, Gentoo would be the last thing I’d look at.

                                                                                                      Then you are way off the mark, because the closest thing to *BSD ports in the Linux world is Gentoo’s Portage and OpenRC is the natural evolution of FreeBSD’s init scripts.

                                                                                                      1. 6

                                                                                                        Over the past decade, I’ve used ports once or twice. Currently I don’t have a copy of the ports tree. At this day and age, ports & package management are among the least interesting properties of an operating system (if only because they all do it well enough, and they all still suck). OpenRC might be ok, but the flavor of init scripts doesn’t exactly define the system either.

                                                                                                        My idea of BSD does not entail spending hours fucking with configs and compiling third party packages to make a usable system. Maybe FreeBSD is like that? If so, I’m quite disappointed.

                                                                                                1. 4

                                                                                                  Well, this here is the URL I wanted to submit. Somehow “fetch title” changed it to a completely different domain that hosts an uglier version.

                                                                                                  https://ccrma.stanford.edu/~jos/mdft/mdft.html