1. 10

    I’ve only used it for a sum total of 30 minutes, but https://k6.io/ was pretty easy to get going.

    1. 4

      Never even heard of k6 before, it looks wicked. Nice one.

      1. 3

        I’m also a fan of k6, since it’s not more complex than most one-line CLI tools to get going, but you have full-on JS scripting if you need to script complex behavior.

        1. 3

          I’ve also had success using k6. Solid tool.

        1. 16

          Rust strings don’t seem hard. They are hard.

          But that’s because strings in general are either hard or (slow,unsafe)…

          1. 8

            Yeah, indeed. In my case it wasn’t the different string types, but the many different conversions between them. The not-quite-64 combinations of {source is String, &str, OsString, OsStr, CString, CStr, PathBuf, Path, Vec, &[u8]} * {which of those 8 types is the target type} * {is this conversion always succesful, or lossy, or fallible, or should I go via another type} is a lot to take in if you haven’t internalized the common patterns yet.

            Luckily, one can work in Rust just fine without learning the conversions up front; looking them up as needed works fine. The “I have an X, I and want a Y” conversion cheat sheets below have been a big help for me, both coding and learning goes faster now.

            Still a joy to work in!

            1. 3

              As someone coming from interpreted languages, and higher-level compiled languages (e.g. Nim, Crystal), this article really helped Rust’s strings click for me, as well as understanding the why behind it all.

              1. 2

                While strings certainly can be complex in a language-agnostic sense, there’s also the Rust-specific wrinkles of A) the borrow checker and B) the choice made for what type you get when you write a string literal in source code, both of which combine to create ergonomic issues and “oh, that’s just a pattern you have to memorize” things in Rust that aren’t attributable solely to the difficulty of strings in general.

                Also compounding this slightly is the proliferation of special-purpose string-like types Rust offers on top of the basic introductory-level actual string types.

              1. 3

                Azul’s been a project I’ve had my eyes on for a while, but haven’t been able to successfully run over the past few years.

                On the other hand, one that might’ve been either purposefully skipped (since it’s basically a browser window with native bindings to Rust code), or just missed is web-view. I’ve had great experiences with it, and it’s been incredibly easy to use on multiple platforms.

                Edit: Reading back on this, I think I’m underselling web-view. It utilizes the native web view functionality within OSes (or via GTK-Webkit on Linux), in contrast to Electron which bundles Chromium. I was able to produce a 1MB binary quite easily, though it does come with some of the same memory usage considerations that you might run into with similar tools like Electron.

                1. 1

                  $personal:

                  • My personal project as of last night is working on a mini desktop player for Epidemic Sound written in Rust. I stream on Twitch every so often, and have been using Epidemic for stream-safe music. Still need to figure out why GH Actions does not like compiling webview-sys, while it works fine on my local machine (outdated MSVC compiler?), but at the very least, I’ve made something tangible in Rust!
                  • Trying to find the motivation to either finish up my Nim rewrite of a song-of-the-day bot, or start fresh on it in Rust. I did the rewrite to get a handle on Nim’s ergonomics, and how it feels to get a project done with it, but I’m not as satisfied with it as I thought I would be.
                  • Doing some coding challenges with friends on BinarySearch.com

                  $work:
                  Trying to balance jumping on tickets while looking for ways to pay down tech debt. Nothing really set in stone as we wrap up a sprint.

                  1. 1

                    Interestingly enough, I got my first job because someone saw me doing coding live on Twitch. I was trying to get more comfortable with Angular.js. I found that if I talked challenges through with myself, it helped. If I talked challenges through with other people, it helped even more.

                    Anyway, it turns out that letting someone see your thought process as you’re working is a lot like doing a coding challenge in a formal interview. Someone popped in to watch and asked me if I was local to them. A couple weeks later, I had an on-site, and had an offer before I left.

                    1. 3

                      https://benjamincongdon.me/blog (all posts)

                      I like to write about Go/Rust, productivity, and my various web development projects. I also tend to write pretty frequently about programming language ergonomics. (Though recently my blog has mostly been a pandemic/lockdown working log to keep myself sane 😅)

                      Popular posts:

                      Favorite posts:

                      I also have a blogroll of other blogs I think are interesting and a list of books that I’ve read

                      1. 3

                        I feel like blogrolls are a great point to discover a plethora of similar blogs, and more people should definitely consider including one of their own.

                        1. 2

                          I really like your blogroll.

                        1. 1

                          https://brandonanzaldi.com

                          Right now it’s pretty barren, after starting from scratch. I tend to write mostly about JavaScript, TypeScript, security, and anything I find interesting.

                          As for some other blogs I find interesting:

                          1. 5

                            Crystal seems interesting and really loved by its community !

                            I write a lot of web services with Python/Django at work, and I am curious about how would it works in the Crystal land ? Does someone has some experience to share :) ?

                            1. 2

                              I’ve toyed around with some of Crystal’s web frameworks. There’s Kemal, which is Sinatra/Flask-ish, and Lucky which is more Rails/Django-like. I’ve also heard good things about Amber. All of these frameworks feel at least somewhat familiar. When I last used it (about a year ago, I think), Kemal felt a bit rough around the edges, but a quick perusal seems to show it’s grown a lot in that time.

                            1. 1

                              Quick question, what is $http_server_library?

                              To be fair python is slow as hell and no one expects it to be fast. Between 2011 and 2017 there was this weird push to make fast python servers using uvloop like falcon, sanic, and other projects that don’t make sense from a performance perspective since doing anything besides a hello world with them means destroying performance.

                              Using a server with python or any slow language is implicitly stating that you prefer some quality - say developer friendliness - over performance. That’s ok and all but you can’t assume that your system is better than anything else except for that quality.

                              I use an asynchronous C++ single threaded server that I can run multiple procs of and which listen to the same port. They talk to FoundationDB asynchronously because it’s hooked into the event loop making batched calls. They call other services using libcurl asynchronously because it’s also hooked into the event loop. I get ~380,000 requests per second on a vm on my laptop with 4 cores, benchmarked with wrk on the same vm.

                              Is it developer friendly? Not as friendly as django or ror but with spdlog and proper logging It’s easy enough to track everything while building upon what I have. I could run probably run all of Discord’s text based systems off of this setup with as many or fewer servers than they have.

                              1. 1

                                Final note: I didn’t mention what language or what library I used for this. To make my point, a friend did a similar test and got similar numbers with a different language/library. Then, just to make things even more ridiculous, he shoved it onto his Windows box and ran it from there. Even then, it did a stupid amount of traffic without breaking a sweat.

                                I think the point of this was that, for the most part, you’re unlikely to need complex tooling to get decent performance out of any tool. You might not need Puma on top of a Ruby server, you might not need gunicorn/gevent on a Python server. Ruby/Python just by itself would likely be “good enough” without needing to tune it, or use external libraries.

                                1. 1

                                  I’d be interested in hearing more about this setup. I’ve started dabbling in FDB so seeing some more advanced usage would be great. What can you share wrt code and experiences?

                                1. 46

                                  The Linux community values their privacy and others’. That’s something Discord needs to be taught.

                                  There is no privacy on Discord to begin with. Packaging would be the least of my worries, if I was using it.

                                  1. 11

                                    Yes, it would be preferable to use only open-source software that you’ve built yourself, and to only communicate on platforms where you control the data. Many people, however, do choose to use Discord and similar chat apps regardless.

                                    I think for people who have made that choice, it is meaningful to talk about ways to limit how much other information those apps can scrape up about your system. The communications you use the app for, obviously, are under the control of the app provider. The privacy intrusions aren’t limited to that, though. It is common for advertising SDKs to scan any data they are permitted to access, in order to fingerprint a device or a user. It really does make sense to want to limit things as much as possible, and it sucks when app vendors nag users to do things that are less secure or less private.

                                    1. 6

                                      Perhaps I’m not getting the authors problem – the rant goes on and on, and only in the last sentence it seems to allude that the issue is that the web site offers native packages instead of Flatpak/Snap?

                                      I mean … yeah? My policy is to not use Flatpak/Snap/… so the website offering *.deb/*.rpm seems fine to me.

                                      Not sure how this is related to security/privacy that Flatpak/Snap are supposed to provide. I’m not seeing that either.

                                      1. 6

                                        There is no privacy on Discord to begin with.

                                        This is why Discord users have so much to gain from Flatpak and Snap.

                                        Some enforced privacy is better than no privacy at all.

                                        1. 15

                                          The alternative I had in mind was no Discord at all, rather than no privacy at all. :)

                                          1. 4

                                            What privacy does Flatpak/Snap guarantee, actually?

                                            1. 3

                                              I think people are hinting at sandboxing in Flatpak (don’t know about Snap) as a means of restricting access to the system:

                                              https://docs.flatpak.org/en/latest/sandbox-permissions.html

                                              Permissions for the Discord Flatpak can be found here:

                                              https://github.com/flathub/com.discordapp.Discord/blob/818f10af0b0238d8ffd4c6df027e296c39944fe5/com.discordapp.Discord.json#L13

                                              device=all seems pretty far-reaching.

                                              1. 1

                                                Apparently that’s required to access devices like microphones and webcams.

                                                While not ideal, –device=all can be used to access devices like controllers or webcams.

                                                https://docs.flatpak.org/en/latest/sandbox-permissions.html#device-access

                                                1. 2

                                                  Apparently that’s required to access devices like microphones and webcams.

                                                  Indeed. One would hope that more fine-grained access policies were possible. But I think Pipewire support in xdg-portal is going to make this possible?

                                                  https://github.com/flatpak/xdg-desktop-portal/blob/master/src/camera.c

                                              2. 1

                                                Read this https://www.ctrl.blog/entry/firefox-linux-flatpak-snap.html

                                                Containerized applications can prevent the discord client from doing various things with its read access to violate your privacy, among other things.

                                          1. 2

                                            I was really excited when I started the article (being this a thought that never occurs to me, it’s interesting to see what options there are out there) but when I started seeing what kind of changes to a standard dictation were necessary to perform even some simple typing (why do I need to use ‘parent’ or similar and not switch to a “command-input-mode” and simply dictate ‘dot-dot-slash’ like one does in their head? Why do I need to say “snake” before a section instead of just ‘underscore’?) it seemed more of a faff than I’m ready for.

                                            Also lots of the settings and commands do seem to require a surprising amount of typing (configs and commands) for tools meant for people who cannot type.

                                            1. 1

                                              This is probably an article I should write myself at some point, but a lot of the custom words are for speed and accuracy.

                                              E.g. Many letters of the Latin alphabet, at least in English, have extremely similar sub-syllable sounds. B, C, D, E, G, P, T, V, and Z all have extremely similar sounds. (All one-syllable words ending in “ee”), and speech detection would likely lose accuracy when using those directly. One voice-coding program, Talon Voice, has a pre-defined (but customizable) alphabet. Each alphabet has a reasonably distinct sound as far as speech recognition goes, and is (or at least can be pronounced with) one syllable.

                                              As far as speed goes, W is an interesting letter, since it’s the only letter that in English, has three syllables. Imagine trying to type out “www.wikipedia.org” simply with letters. “Double you double you double you dot double you” takes a lot longer to say than, hypothetically “wag wag wag dot wag”, just for the first five characters. Same with “underscore” vs “snake”. Three syllables, vs one. For some words, there’s no easy spoken representation, and it depends on context. Homophones like “their”, “they’re”, and “there” are tricky to simply speak aloud.

                                              As for configuration and commands, all voice coding libraries that I’ve looked into in the past couple days since I found this article have an out-of-the-box setup that can at least get you started using the commands to customize things to your liking.

                                              Voice coding is something that typically trades a steeper learning curve for greater long-term efficiency.

                                            1. 13

                                              The only officially supported installation method for Discord on Linux is the .deb and .tar.gz files they provide. Any other installation method, including both the Flatpak and Snap, is unofficial and not supported by Discord.

                                              1. 3

                                                There’s a difference between only officially supporting one installation method, and designing your software to undermine the other installation methods even when they have been chosen. Especially when said other installation methods add security measures for users’ privacy.

                                                1. 9

                                                  designing your software to undermine the other installation methods even when they have been chosen

                                                  “Designing to undermine”, in my opinion, is absolutely not what’s happening here. They try and make updates less painful through their admittedly kind-of-clunky official distribution channels.

                                                  To avoid doing that when it’s installed through another method, they’d have to maintain an built-in check for these non-official distribution channels.

                                              1. 3

                                                A good accompaniment to this is a recent presentation at Linux.conf.au this year by Shervin Emami.

                                                Desktop Linux, without a keyboard, mouse or desk

                                                1. 3

                                                  Interesting talk, but the presenter used “um” as a period…

                                                  1. 2

                                                    Very solid talk, and definitely a great accompaniment to this article. Thanks for sharing!

                                                  1. 2

                                                    Anyone know when this was published? Late in 2019, or early?

                                                    I looked around for a pub date but didn’t see one.

                                                    EDIT – I found it from a blog post. November 2019.

                                                    1. 3

                                                      This reminds me of Apple product designations: “JavaScript, early 2019”.

                                                      1. 1

                                                        Yep! They tend to run the survey around… October-ish I think? And then publish it a bit later in the year, so it’s always kind of a year-end roundup.