1. 2

    A while ago I embarked on an activitypub server implementation in haskell, and definitely ended up in the weeds trawling back and forth between the various specs. Thanks for this! In particular the minimal expressjs implementation, exactly the type of thing I was looking for.

    1. 3

      Just finished listening - very enjoyable. Would be very interested in a follow up with some of the topics you mentioned towards the end (especially garbage collection) - any concrete plans? Seems like a high quality podcast, subscribed!

      1. 2

        Hey, thanks! I am planning to do a follow up on building a compiler with author of https://compilerbook.com/.

      1. 30

        I don’t know what they put in the drinking water at the office where the GOV.UK people work, but it’s something the rest of the industry needs to bathe in daily. I’m a big fan of their approach, and I’m consistently pleased with the UX any time I have to do or research something on a UK government website.

        1. 3

          As an Englishman it’s something I’m most proud of about this great nation. The UI/UX is so incredibly stupidly simple it’s brilliant.

          1. 2

            Couldn’t agree more. I have a few friends working there, and by all accounts it sounds like a pretty nice work culture/environment for devs, also.

            1. 2

              I’m not used to the GOV.UK websites but I have the same feeling from the Luxembourgish ones. Every citizen that needs to use their online services is given a account with a 2FA token and their UX is really awesome too!

              I’m really impressed by how some governments manage to build services of such qualities despite the inertia they have in other areas!

            1. 2

              I had forgotten Uniqlock until this popped up. Thanks for the memories!

              1. 5

                I use hakyll and serve the files up using caddy. I would normally reach for nginx, but caddy’s easy of use (in particular built in https from letsencrypt) won me over.

                1. 11

                  Going to finish up Fortress then write a post explaining it with a demo (video - because I know doing it will be too much work, lol).

                  1. 2

                    I’ve been looking for something like Fortress for a while, awesome.

                    Also, love the artwork for the site! Did you create it yourself?

                    1. 2

                      I didn’t; the art’s from Icons8’s Ouch! collection.

                      I hope you’ll find it useful when it’s ready.

                    2. 2

                      This is super interesting, I’ll be looking at this more in depth after work today. btw, in the set up section there are two “2”s in the numbered list.

                      1. 1

                        Nice catch!

                        And yeah, hopefully; I’ll be done if I can cram this between work.

                    1. 3

                      I am moving from Oakland California back to the UK, leaving this Wednesday. A mostly ok process made fraught by the fact I’m bringing my small furry pal back with me, so it’s vet’s forms and visits to the USDA.

                      1. 4

                        I’m programming (on the side) again after a 3-4 month hiatus!

                        Rewriting my Discord bot in Haskell. It’ll be the basis of a few future blog posts where I show Haskell’s pit of success via functional core/imperative shell. Plan is to explain each layer separately: the pure code containing most of the logic, the constrained effect layer where we interact with the world, and the IO layer where we make it happen.

                        The basics of the functional core are done and the shell compiles now, which is a big accomplishment for my rusty Haskell skills. I can connect to Discord successfully and respond to commands. This week I want to clean up the IO layer and write a command parser with parsec.

                        1. 2

                          very much looking forward to seeing these blog posts!

                        1. 1

                          Apologies if off topic, but the increase in interest in Mastodon got me interested in activitypub implementations. Does anyone know where the source is for this test suite? https://test.activitypub.rocks/ I’d love to use it as a baseline to try my hand at implementing some of it, but that website is a bit of a black box.

                          1. 2

                            It links to https://gitlab.com/dustyweb/pubstrate in the footer. Digging around I see several sub-sub-directories called aptestsuite

                            1. 1

                              thanks yeah, don’t know how I missed it before :/

                            2. 2

                              Link to sources is right there in the bottom of that website…

                              1. 1

                                Huh! I can’t believe i missed that. Thanks!

                            1. 2

                              This is the clearest, simplest explanation of what hpack is and why I might want to use it, that I have come across.

                              1. 3

                                This definitely resonates with me.

                                At $work we’ve been using ansible for 4 years. It’s a great tool, and I still recommend it for some use-cases. But you definitely end up needing a more flexible flow and control over it. Now, ansible offers you plenty of escape hatches, you can use conditionals in the list of yaml statements, and you can add parameters to your playbooks. But over time this becomes increasingly hard to parse, and exposes an unclear interface to the users (developers.)

                                Recently I’ve been converting our infrastructure to a kubernetes environment, and it’s the same story. When you’re working through a simple kubernetes example, the minimal deployment-spec-as-yaml is wonderfully clear. But in order to support different flows (or even just different environments as part of the same flow,) you need more power. That’s why, this time round, I have written a small library+cli that is specific to our conventions and requirements. All it does is wrap existing tools (docker, kubectl etc.) but the point is it exposes commands to do certain things with them. And it’s written in an actual programming language (in our case, python) so that conditionals, parameters etc. are easy to write and read.

                                1. 3

                                  There’s this great debate in tech about the benefits of simple configs that are easily to statically analyze vs flexible turing complete languages. Often we see “simple” config language will rather quickly grow conditionals and loops via recursion.

                                  In most cases I’d much rather just start with a real programming language with real testing frameworks and analysis tools. In my personal projects I prefer using lisp, lua, or (if needed) javascript.

                                  You can start with:

                                  (
                                  :http 80
                                  :https 443
                                  :keyfile foo.key
                                  :certfile foo.crt
                                  )
                                  

                                  and let that grow naturally.

                                  Also, same argument for me applies to ansible and salt. I can test my chef recipes using rspec. I’ve recently moved to salt because it has other nice properties, but I find jinja templated yaml files to be yuck and I’m in the process of moving towards more python so things can be re-usable and unit testable (salt supports a python “renderer” and python modules).

                                  1. 4

                                    The alternative dating back to LISP is a powerful language with great support for DSL’s. Then, you can use increasingly complex DSL’s and/or language primitives. I see this repeating with better safety in Haskell-land.

                                    EDIT: Ive also seen logic approaches like Prolog where they just describe it. The runtime does the rest. One did it for Cmake.

                                    1. 2

                                      I don’t personally favor the DSL approach. How much do they really buy you over using the syntax and tools that whatever programming language you’re working with give you.

                                      1. 3

                                        Do you use sed, HTML, or SQL? Those are DSL’s. The main value users mention is that they’re declarative, often concise, often clear in meaning, and improve productivity. The disadvantage comes when you need something they’re not good at or just raw performance. During debates on the topic, the DSL proponents often pointed out that the alternative, flexible language + libraries, essentially devolves into the same problem on the library side with you stuck memorizing their terms, working within their patterns/frameworks, having to call external things, and so on. Between then, DSL’s are cleaner for a lot of purposes. Aside from above examples, state machines, GUI generation, data formats, bindings, language grammers, test engines, and so on all come to mind. Way easier to do that stuff in a DSL that autogerates code for your language of choice.

                                        Pieter Hintjens has a nice write-up on the topic given iMatix delivered robust, high-performance apps in C using a set of DSL’s. Recall, though, I advise a powerful language like Scheme that can DSL within itself for consistency. A developer named sklogic does the same for his compiler-writing tool with ability to use LISP, Standard ML, Prolog, XML, etc all in one app seemlessly depending on best tool for the job.

                                        https://web.archive.org/web/20160427063252/http://download.imatix.com/mop/introduction.html

                                        https://github.com/combinatorylogic/mbase

                                        Another example is Galois using Haskell DSL’s for stuff like writing correct C code. Their Ivory language is good example where it’s advantageous to DSL in Haskell w/ C extraction than build their own tool or exclusively rely on either language in isolation.

                                        http://ivorylang.org/ivory-introduction.html

                                        1. 3

                                          Your response is spot on, but because I wasn’t clear enough in my original post, let me shed some light on what I was trying to express.

                                          I’ve been working in the new fangled sysadmin/ops/devops/whatever you want to call it space for about 5ish years now. I’ve used Chef pretty much that entire time. I’m pretty familiar with it.

                                          In my experience, I have found that Chef works really great when your configuration management needs are comparatively simple, but when they become complex, Chef’s DSL starts to become more of an encumbrance than it’s worth - you end up lost in a sea of detail that’s germane only to the DSL.

                                          As a very concrete example - Chef’s execution model is not intuitive to say the least - is this executing at compile time or at convergence? Why does notify not work the way one would expect? Why are there 40 different syntaxes for attributes?

                                          So, rather than adding value in a very constrained problem space (e.g. query a database, edit streams of text), in my experience configuration management DSLs can become a morass of detail to master, ultimately requiring that you dive deep and learn the underlying code anyway.

                                          So what’s the point? Wouldn’t a nice straight forward Python or Ruby library with a well thought out, properly abstracted API do a better job of helping the programmer solve the problem at hand? With that approach, you only have to master a single set of semantics - those of the programming language being used.

                                          1. 2

                                            An internal DSL (like Ivory) does reuse a lot of the core semantics of the language – and can be a nice and intuitive way to work with an underlying API. For example, Rake’s DSL is a succinct way to work with the internal Task abstraction.

                                            It is external DSLs – which require laborious redefinition of every PL feature – that are the real problem in my mind.

                                            A “cute” Ruby DSL for configuration management could still be importable – it doesn’t have to be like Chef where require is replaced with require_recipe. Let’s say the DSL is called bbq. You could write a config like this:

                                            require "bbq"
                                            require "company/infra"
                                            
                                            
                                            bbq "App Server" do
                                              use Company::Infra::NTPConfig
                                              use Company::Infra::SSHConfig
                                              use Company::Infra::Users
                                            
                                              task "Update Ruby" do
                                                if ENV["RUBY3"]
                                                  curl_pipe_sh "https://company-infra.s3.amazonaws.com/ruby" 
                                                else
                                                  bash "aptitude install -y ruby"
                                                end
                                              end
                                            end
                                            
                                            
                                            1. 1

                                              I have no problem with a DSL like the one you just postulated. It is lightly layered over plain old Ruby code and as a result does not impose a huge additional cognitive load on the developer.

                                            2. 1

                                              Ok, I see where you’re coming from. What you’re actually experiencing are two problems with only one being common with DSL’s: pain of moments where your needs mismatch what the DSL provides (common); the DSL’s actually being a complicated piece of software without clear model of how it works (uncommon). The most prominent DSL’s of the past were BASIC-like 4GL’s, Excel, HTML, and SQL. Your experience with these should show they were fairly easy to understand at a glance. The conceptual mapping is straight-forward plus the language itself is high-level enough to save time. That’s how a good DSL should be. It seems to me Chef just isn’t well-designed or what it’s being used for has high complexity that’s seeping into the language too much. Maybe it needs increased flexibility.

                                              “So what’s the point? Wouldn’t a nice straight forward Python or Ruby library with a well thought out, properly abstracted API do a better job of helping the programmer solve the problem at hand?”

                                              It can. You can use either. The best DSL’s will be embedded in your language’s semantics or be similar. Moreover, they should provide a way to call custom functions for weird situations. An easy example of that are state machine compilers that let you combine a high-level description of states/transistions and a list of custom functions. It does the rest.

                                              In most cases, libraries are fine. It’s really when there’s a lot of glue, boilerplate, scaffolding, portability issues, error handling, etc that it helps to modify the language itself to do those cleaner. DSL’s are easier than doing a whole language or ecosystem, though. So, it’s really what tool suits your needs for a given situation. I’d also recommend, as with any dependency, that you have an exit strategy where you’ve chosen a DSL or tool that’s easy to move off of if it becomes a problem. A simple one in terms of syntax and execution model might even be automatically translated into something else during a move.

                                  1. 2

                                    As mentioned last week, I took part in Ludum Dare this weekend. You can see/play my daft entry here: Bathroom Break Manager

                                    Had an absolute blast, and did not completely kill myself. Got a full 8hrs of sleep on of the nights. Definitely the most complete game I’ve submitted out of my three attempts. Spent a reasonable amount of time laughing childishly at variable and function names relating to toilet activity.

                                    This week I will be attempting to get enough work done that I can happily relax for the holiday period. This mostly means tidying up a kubernetes setup and helping team members get set up and running with it.

                                    1. 3

                                      If you have some spare time or particular pain points, please feel free to PM me with any feedback around getting devs set up with kubernetes. I work on local kubernetes developer velocity.

                                      [0] https://lobste.rs/s/d4ben6/what_are_you_working_on_this_week/comments/qpcive#c_qpcive

                                      1. 3

                                        Nice! Thank you, I will definitely ping you if I have questions / come across a problem etc. I’ve been using minikube extensively to get setup and build out our developer workflow, and it’s been a treat to work with, so thanks for all your work

                                    1. 10

                                      I like using inoremap jk <Esc> instead of inoremap jj <Esc>. It’s quicker to hit two keys in quick succession and it has the benefit of being mostly being a no-op in normal mode since you just go down a line and then up a line; which is nice if you have a nervous habit of returning to normal mode even though you might already be in it.

                                      1. 2

                                        I am a big fan of using jk, and like you have never run into any issues where I need to type “jk” in insert mode. I recently switched to spacemacs, where they introduce a default of “fd” which I have found similarly ergonomic.

                                        1. 1

                                          So doing that would cause typing ‘jk’ in insert mode to return you to normal mode? What would happen if you actually wanted to type ‘jk’?

                                          1. 4

                                            In three years that I’ve used jk, it’s never been an issue.

                                            That would change when someone invents texting integration into vim.

                                            1. 4

                                              You need a small delay so that the chord doesn’t register, it’s about one second. So you type j, wait a second, then k.

                                              1. 3

                                                Please keep in mind this timeout is configurable via timeout and ttimeout.

                                              2. 1

                                                Hasn’t ever happened to me either. If it did, you would just have to hit j, then wait a second for the multi-key timeout to expire and the j to actually appear, then hit k.

                                              3. 1

                                                Me too! IMO, jj just doesn’t feel right… It will probably become more of a habit when I start using a new mbp.

                                                1. 1

                                                  some people remap jk and kj to esc so all you need to do is press both j and k at the same time to get esc. I am too used to jj to do that but you might want to try that.

                                                1. 3

                                                  I’ve dropped off these weekly threads purely because I rarely get the time to do much interesting work atm. But this weekend I will be taking part in Ludum Dare (a global game 48hr game jam) so I’ve got that to look forward to! Anyone else here taking part?

                                                  I’ve dabbled with various game engines/frameworks in the past, but have decided this time to stick to phaser because it’s nice and easy to distribute browser-based games, and I can use my usual stack of tools for developing (on linux) - rather than having to deal with Unity on windows or mac.

                                                  1. 4

                                                    Well, I just made the move from London to San Francisco. I’ve transferred internally within the same company, so no new-job-jitters, but starting on the mountain of boring personal admin I need to get sorted. First up, SSN and bank account.

                                                    Who knows if I’ll have any time to do anything interesting this week :)

                                                    1. 3

                                                      Welcome to the US and to the Bay! Good luck sorting through the mundane government stuff :)

                                                      1. 1

                                                        Thanks!

                                                    1. 9

                                                      Both of these users have fairly simple use-cases. Check email, skype and photo sharing.

                                                      I’m certainly no expert but isn’t this issue solved to a certain extent by tablets/phones? I’m thinking of the meme about how toddlers can pick up and navigate an ipad with little or no introduction. Certainly they offer less power in return for simpler interactions (jab this icon, poke about etc.)

                                                      1. 5

                                                        Or Chromebooks?

                                                        It’s great we’re revistiing 1995 lessons on the desktop metaphor, but there are better alternatives for these types of users.

                                                      1. 2

                                                        Really like this idea!

                                                        Will have to watch myself - I can imagine accidentally staying in a “sudo>” shell :/

                                                        1. 1

                                                          Does eat history though (commands run in sub shell are not captured)

                                                          1. 1

                                                            Im no bash expert but I think it could append to the bash history file or at least call a command to. That might be an easy addition.

                                                            1. 2

                                                              the author says it’s on the todo list

                                                          2. 1

                                                            you mean like ‘su’?

                                                            1. 3

                                                              Yeah you’re absolutely right :) - although I tend to avoid su for the exact same reason

                                                              1. 1

                                                                or sudo -s

                                                            1. 2

                                                              Similar to @ericdykstra I’ve struggled with technical podcasts, as I feel as though I am not absorbing the content. However, podcasts I tend to listen to a lot are:

                                                              • Idle Thumbs - entertaining stuff about video games
                                                              • In fact anything on the Idle Thumbs Network is probably worth a listen, they’ve got in depth interviews with game designers, strategy game chat and a Netrunner podcast
                                                              • The Adventure Zone - three brothers and their dad play DnD. Worth starting at the beginning. Can be completely hilarious.

                                                              Having said the above about technical podcasts, I did enjoy the HaskellCast. Wish there were more episodes though :(

                                                              1. 4

                                                                I own this and I’m not sure I can recommend it. Nothing wrong with it per se. It is most definitely a “cookbook” as it is essentially lots of fairly small code snippets. Unfortunately a lot of them seem to be about how to use a particular library rather than general techniques.

                                                                I guess I’m saying it’s not terrible but don’t expect it to get continued usage over the years.

                                                                1. 1

                                                                  Nim is one language I always forget about but every time I look at it, I’m impressed with it’s feature list.

                                                                  Out of interest, anyone had any experience using it in anger?