1. 1

    I believe that many beginners struggle with recursion not because the task at hand is not practical enough, but because the concept of recursion is difficult to visualize and therefore to model in one’s head. Especially when implemented with functions. Functions calling other functions already introduce nontrivial amount of unintuitiveness and complexity. Functions calling themselves is just weird and difficult.

    My attempt to explain recursion is based on a visual language of analogies to function definitions, function calls and values: https://youtu.be/vLhHyGTkjCs

    1. 12

      Miniflux has let me fall in like with RSS again. I’m running it via docker-compose on an Ubuntu VM with Portainer managing most of my network services. I’ve got it behind Traefik so I can access it at my equivalent of http://miniflux.home.lan.

      I’ve put fewer than a dozen feeds in it in the last ~2 months and I’m reserving it only for things I don’t ever want to miss a single post from but also if I lose my feed list, I would be able to recreate it relatively quickly.

      1. 4

        I second Miniflux, it’s refreshingly simple and fast.

        1. 3

          I payed for the hosted version of miniflux. It’s literally just $15/year, which is a steal, and there’s a 15 day free trial so you can really make up your mind. I never knew I needed RSS, until miniflux.

          1. 1

            Miniflux seems awesome, but I see that it currently only uses Fever API which is quite limited and FreshRSS/Google Reader API is still on the “requested” side :(

            1. 1

              I also am a happy Miniflux user.

              My setup is a free Heroku instance. I am running it for a few months now and don’t see any issues. The only drawback is that I have to manually refresh the feeds. Deployment takes no time, upgrade is automatic whenever my GitHub repository is updated.

            1. 16

              There are a lot of static site generators. There’s a lot of bike-shedding around them because everyone has different needs. Wanting it to be “easy” or “simple” is at odds with having flexibility to handle things other than your favorite workflow. Ultimately, you’re just looking to find a framework that saves you time and energy.

              I personally went in the complete opposite direction. I used to use a static site generator for a number of years but I don’t post all that often. Every time I’ve wanted to post something, I’d have to relearn the tool, and pray nothing broke since the last time I used it.

              As a result, once it broke, I didn’t post anything for four years.

              When I started writing fiction as a hobby, I tossed my old, dead website and made a new one. I’d made a few websites on Wordpress.com for friends by that point.

              So I ended up hosting Wordpress by myself and heavily modified one of the official themes. It doesn’t give me quite as much control but the plugins allowed me to build a website with far more functionality and in less time than doing the code myself.

              Writing and posting new articles is so much easier using rich text. I generally type up my post in Apple Notes first. Copying and posting to Wordpress saves most of the formatting. Inserting images is drag and drop.

              As far as security, my website has one api key to send mail. Everything else is isolated to the server it runs on. I put as much of the admin pages behind basic auth as I could. The login page is inaccessible without knowing those credentials. It’s not perfect but I have a defense in depth to mitigate damage. If it gets hacked, nothing of value is lost. I have complete, incremental backups of everything (configs, webroot, database) that’s pulled down via cron job every night.

              I say all this because… everyone ultimately looks for a tool that works for them. My goal is to write posts, not fiddle endlessly. Other people love the fiddling.

              If you’re looking to build and maintain a website, think about what’s important to you. What’s your skill set, interests, preferred workflow, and goals?

              For me, Wordpress fits. For a lot of programmers, they have very legitimate reasons to be horrified I used it. :)

              1. 9

                I made a comic recently which may be relevant to what you said: https://rakhim.org/honestly-undefined/19/

                1. 2

                  LOL this gave me a good laugh

                2. 9

                  Every time I’ve wanted to post something, I’d have to relearn the tool, and pray nothing broke since the last time I used it.

                  As a result, once it broke, I didn’t post anything for four years.

                  I’m in the same situation with Hugo. It seems like every time I go to rebuild the site, something has broken. Given Hugo’s vast complexity, it is actually rather difficult and a huge time sink to figure out how to actually fix it.

                  But my plan, assuming I ever summon the motivation, is to just write my own static site generator. I’ll publish the code for it, but it won’t be something I intend to share or maintain for others. It will be narrowly scoped for my specific use cases alone. I think with a narrow scope, it has the potential to be very simple and easy to maintain going forward.

                  1. 3

                    That sounds very familiar. After not updating my hugo binary for years in fear of breaking something, then doing it, thereby discovering I seem to use 0.7% of the features I rewrote only the parts I needed to reproduce my site. Turns out, 333 lines of code was enough - I never went live with my rewrite, but I haven’t posted a ton since.

                    1. 3

                      Oh interesting! I didn’t think of keeping most of the structure the same as what Hugo expects and then just writing a different tool to handle the things I need. I’ll probably just re-think it from first principles though, since I think I can get things to be a bit simpler. But I’ll probably need more than a few hundred lines. One of the things I do with my blog is ensure that all my code snippets compile without duplication. That’s been a pain to do with Hugo, so I’ll likely devise a better answer to that problem through coupling.

                      1. 2

                        Ah, yeah. I think I don’t even have any of the fancy oEmbed things I used to have in former iterations and I don’t do code snippets - except formatting them with <code> or <pre> :)

                      2. 2

                        My personal blog’s SSG is now a 63-lines bash 5 script, no argument, no config, and a pretty direct usage.

                        Handles everything I want (RSS, categories, markdown, medias, templating with “smart tags” (ie custom tags)

                        1. 1

                          I’d be curious to see what this looks like if you wouldn’t mind sharing.

                    2. 4

                      Articulate. Well, I 100% agree with you that no tool can satisfy every users. That’s exactly the reason why we have so many choices. However I’m of the opinion that so many choices is quite a nice thing as different people can find their version of perfect tool.

                      Regarding WordPress, I like to write in markdown. I was able to port my old blog to a new one quite easily because they were all a bunch of markdown posts. Although yes WP is so popular that you’ll get exporters/importers for almost every mainstream choice, I still prefer to have these markdown posts committed to a .git repository.

                      And the reason I ported to a simpler tool is because I wanted to fiddle less and focus more on writing. I consider this as a one time investment, but let’s see how it goes. :)

                      1. 3

                        Absolutely!

                        I love the idea of markdown and use it frequently for documentation, but my brain can’t grasp the mismatch between presentation and formatting in real-time, which means I can’t do creative work in it. :)

                        1. 1

                          There are markdown editors, including one I use for Android, which bridge that gap for you. Just on case you wanted to know

                          1. 2

                            Of course. Then I have to figure out how to manage markdown files and so on. :)

                            As I’ve said elsewhere, it’s really easy to solve one issue. Solving the majority of them is difficult.

                      2. 4

                        I coincidentally started using Zola myself just last week, and having a backlog and knowing I could have this exact relearn-the-tool-in-X-years problem, I created a little script that puts a skeleton file in the right place, opens it in a text editor, and then runs zola build. It took a couple of minutes to write, and it doubles as a tutorial for my future self. I suppose this reinforces your point: what are my goals and skills? Wordpress certainly isn’t either for me, but I wouldn’t recommend my own workflow to someone who just wants a blog.

                        1. 6

                          Hmm. This should be a post on my blog. scribbles notes

                          Also, being able to post and edit articles on my phone or iPad using the official Wordpress app is one of the big selling points for me. By using Wordpress, I get offline editing on any device for free.

                          1. 2

                            Interesting! I love writing posts in markdown so there’s a difference, but you might find this approach interesting:

                            I switched to Zola a while back, and set up CI to automatically publish new site versions with a static Zola binary. When I want to add something, I only edit markdown files. I just push these new changes in a git repository, and it automagically appears online. It takes very low effort to edit and update the website (given you’re used to using git and markdown). You don’t install Zola locally and can do this from anywhere in the world.

                            It seems impossible to break Zola with just adding markdown files. The only real thing that can break here, is the server I’m hosting these static files on. The whole setup is actually super simple, if things ever go haywire it’s simple to debug or I just revert.

                            Not trying to make you switch. Just thought you might find it interesting, as I assume this has minimum breakage, which you were having problems with.

                            1. 3

                              Someone always mentions markdown and tries to solve one of the problems I mentioned. :)

                              There’s a long, long list of features I use and all of them reduce the immediate friction of writing or making changes. (The worst offender is using plain text with a markup language.) This is absolutely critical to my creative process. Everything else is secondary.

                            2. 2

                              I already write my drafts in Notion as it is just restrictive enough to keep me focused, but flexible enough to embed any kind of media. That is why I’d probably lean towards something like https://super.so/ tor OSS alternative to make it a one-click thing.

                              1. 1

                                Not entirely sure what you’re getting at. Wordpress is open source under the GPLv2 license.

                            1. 2

                              Trying my best to pass the Finnish language exam.

                              1. 2

                                Hugo is fast and pretty powerful, but I keep disliking it for two main reasons:

                                1. The documentation rarely helps me solve problems, even though my problems are trivial by nature. Try to find a canonical way to show posts grouped by year in Hugo. It took me probably 30 minutes.
                                2. Several minor updates in the past broke backwards compatibility. One example is described in this post (not mine).
                                1. 1

                                  In general with static-site generators, content authors need to be developers, or at least be familiar with using a text editor, Markdown, and Git. However, web host Netlify has an open-source tool called Netlify CMS that allows non-developers to contribute using a WYSIWYG editor — the tool commits to a Git repository behind the scenes.

                                  Does anyone have any experience using Netlify CMS or any of the other tools that add a nice UI to a static site generator? I love the premise, but the ability to empower someone who is only comfortable with Microsoft word to change a website is pretty powerful, and that’s what these SSGs seem to be missing.

                                  1. 2

                                    I’ve tried it once a couple of months ago, but found the experience unpleasant. The whole system is too finicky, the local development did not work without some serious googling (sorry, don’t remember the specifics, but the point is that following the official tutorial did not yield a successful setup).

                                  1. 2

                                    My only real complaint with Hugo is the difficulty in making your own themes. I did not find their documentation for theme-makers to be very helpful at all.

                                    I understand the concepts of partials and that they piece the page together into different “puzzles” by using variants of a partial, but I don’t understand how to change which page gets which assembled “puzzle”.

                                    1. 5

                                      The first comment on the lwn post has a reference to a themeless setup for Hugo. The themeless theme sets up a barebones Hugo site. It might be helpful in learning theming because there is very little in the templates and css files to it is easier to work with them than more established themes.

                                      1. 2

                                        Check out Pelican. It’s using Jinja2 for better templating and it’s a really nice templating engine also used by Django.

                                        1. 3

                                          Django doesn’t actually use Jinja2 (at least not by default, you can configure it to do so) but it’s own templating engine. They are however very similar since Jinja2 is actually modelled after the Django templating engine.

                                        2. 2

                                          My current site is built using Gatsby, which, while cool, is a nightmare to keep updated. I’d heard of Hugo, and figured porting my site would be fairly easy since it’s a single-digit number of blog posts and a super basic stylesheet.

                                          After fighting with Hugo and their docs for at least three hours, I gave up and just wrote my own site generator. I’m sure Hugo is great for complex scenarios, as most static site generators probably are, but I wanted a home page, list of posts, a post page, and nice syntax highlighting. I couldn’t manage to get that with Hugo as easily as I thought it could be.

                                          On the plus side, my site generator is the only one I’m aware of that uses the same syntax highlighting engine as VS Code, so all my code snippets are now super colorful!

                                          1. 1

                                            I’m using Hugo for several projects and have a similar experience. I still cannot confidently say I know how to solve the simplest tasks like list posts with some conditions or create an archive page. This is mostly my fault, but Hugo’s documentation does not help.

                                            1. 1

                                              Would you mind sharing a link to your generator if it is open source?

                                              1. 2

                                                I still need to get inlining of small assets working, but maybe I can use this as motivation to finish it soon! I’ll reply again once I’ve published it.

                                            2. 2

                                              I actually found creating my own theme pretty straightforward, especially after trying to do it in Pelican. In a simple case you need only two templates (“list” and “single”), as opposed to a dozen in Pelican. Because of this it’s also easier to create a non-blog in Hugo, as many templates required by Pelican stop making any sense when you don’t create a typical blog.

                                              1. 2

                                                I think I just need to start fresh as I think I went about it wrong after looking at what @eb commented. I did some very dirty solutions to get things working early on and I think that is contributing to the current issues.

                                                1. 1

                                                  That’s not true at all, in Pelican you only need index and page templates, everything else can be empty. Explicit is better than implicit so if empty files bother you then you can hide them on your system file browser or something.

                                              1. 1

                                                Does it include lobste.rs users’ blogs in the search stack?

                                                1. 1

                                                  Sorry, what are lobste.rs users’ blogs?

                                                  1. 1

                                                    Blogs written by people on lobste.rs :-) See for example here.

                                                    1. 1

                                                      I’ll try to, gradually :) Thanks!

                                                1. 1

                                                  This is really cool, besides being useful and a good idea, I’ve been using to see what comes up when I search non-dev related things (such as band names or celebrities) and getting hilarious results

                                                  1. 1

                                                    I’m also slightly terrified of entering stuff like “how to kill children processes” into Google.

                                                  1. 1

                                                    No JS is bad feature. Instead of adding more value (autocomplete, autosuggestion, etc) you treated with small benefits of “no js”. A graceful degradation will be better. More features for normal users, less for adepts on “No Script”.

                                                    1. 3

                                                      That’s probably how I’ll proceed from now on. Autocomplete, keyboard shortcuts, etc via js, but never breaking the core functionality.

                                                    1. 1

                                                      –foo excludes word

                                                      I think you mean

                                                      -foo excludes word

                                                      (Something auto-converting hyphen to en dash)

                                                      1. 1

                                                        Yeah, something in my toolchain auto-converts this and it drives me crazy… Fixed, deployed, thanks!

                                                      1. 2

                                                        This is pretty cool! It works better than I would have expected. I just made a pull request for Common Lisp.

                                                        1. 2

                                                          Merged! Thank you.

                                                        1. 6

                                                          Definitely some potential. But the search results will need some prioritization before it truly hit the mark. Searching for “mongoc_client_pool_new” I could not see the documentation page on the first page of result. And searching for “std::vector” came up with a bunch of Stack Overflow links.

                                                          1. 4

                                                            Agreed, some prioritization is needed, maybe even by users themselves (voting?).

                                                            Also, have you tried narrowing the search to “docs” only?

                                                            1. 4

                                                              I had not but I just did. It is better, but still needs some refinement from what I would expect.

                                                              Still, keep up the good work!

                                                              1. 1

                                                                I didn’t see that narrowing the search was possible at first. In Firefox, your form select { appearance: none } CSS style hides the disclosure triangle, so the “All” part of the search bar doesn’t look at all like a menu. It looks more like a button, which makes it feel janky that a pop-up menu opens after I click it.

                                                                If you’re going to hide the browser-default disclosure triangle, I suggest adding your own (which can match your site’s theme) so the menu still looks like a menu. Alternatively, if you really want to make the menu look like a button, I suggest giving it a darker background color and making its background color change on hover.

                                                                1. 1

                                                                  Got it, I’ll work on it, thank you!

                                                                2. 1

                                                                  Also, have you tried narrowing the search to “docs” only?

                                                                  I do not understand this reasoning. If this is a search engine for programmers, then looking for “std::vector” must give you fist the most official documentation of that class, no matter what.

                                                              1. 1

                                                                Might be interesting to add devdocs.io docs collection as a source. It has a really large number of docs collected.

                                                                  1. 2

                                                                    It doesn’t work though. It only finds the documentation groups, but cannot find symbols in the documentation, e.g. I’d expect https://quickref.dev/search?q=site%3Adevdocs.io+godot+object.connect&type=all to point to https://devdocs.io/godot~3.1/classes/class_object#class-object-method-connect

                                                                    1. 2

                                                                      I could add a bang for devdocs, though. Maybe, !dd ?

                                                                      1. 1

                                                                        Hmm, google yields similar results with site:devdocs.io godot object.connect. Maybe devdocs loads that content dynamically and somehow doesn’t let crawlers to scrap the data… Quickref uses Bing’s index.

                                                                  1. 2

                                                                    Is the “explicit” vs “implicit” distinction a common one for search engines? I’m not familiar with it. I’m guessing that explicit means “literal” match, implicit means some kind of fuzzy/“guess what I mean” matching?

                                                                    1. 5

                                                                      Most search engines assume you’re looking for something common, and thus:

                                                                      • “Fix” queries with typo & misspelling correction based on string edit distance and term frequency
                                                                      • “Expand” queries by projecting your terms into some kind of topic space (embedding) and giving you results that score highly on nearby terms

                                                                      These are great for natural language queries for popular resources, and really terrible for precise, niche queries.

                                                                      1. 1

                                                                        Hmm, I haven’t heard those terms being used either in this context. I definitely would find it a little more clear if it used the terminology you mentioned instead.

                                                                        1. 4

                                                                          Thanks, I’ve updated the terminology on the frontpage, and it should go live in a few minutes.

                                                                      1. 32

                                                                        There’s a huge vacuum in the search space right now since Google is so broken. This has so much potential!

                                                                        Could you tell us a little about how the search engine is implemented?

                                                                        1. 20

                                                                          Sure!

                                                                          I use Bing search services (via MS Azure). Quickref itself is a simple RoR app which loads metadata from https://github.com/freetonik/quickref.dev and talks to Azure, while maintaining privacy and not transferring any client info to MS.

                                                                          Bing is pretty good, since I didn’t have to crawl and index the sites myself (the first iteration was built with scrapy + elasticsearch), and the results are generally ok, but there are limits to the number of sites in the index and the number of priority adjustments. So, if this project proofs to be of value, I’d probably need to go back to custom crawl/search setup, hopefully with the help of others. I’ll definitely open source the app.

                                                                          1. 4

                                                                            Very interesting, I had no idea that Bing provides that kind of service. I think it’s good to use their service for now; for the users of a search engine the value should be in the search results, not in how the results are computed. The results are good as far as I can see, I’m finding lots of things I never knew about!

                                                                            If you have some thoughts about it, could you provide some guidance on what sites belong in the index and what is out of scope?

                                                                            1. 4

                                                                              If you have some thoughts about it, could you provide some guidance on what sites belong in the index and what is out of scope?

                                                                              Yeah, I’ll put that info to the github page. In short, I think it’s a good idea to stick to these:

                                                                              • official websites and docs
                                                                              • community-driven docs
                                                                              • private blogs
                                                                              • blogs of engineering departments of companies

                                                                              The borders are vague though, it’s a bit tricky to define. Like, I feel like dev.to is okay, but something like programiz.com is not…

                                                                          2. 14

                                                                            There’s a huge vacuum in the search space right now since Google is so broken.

                                                                            Absolutely yes. I believe that nowadays Google presents the most popular results and not the most accurate anymore. This is especially hard for programmers because we sometimes search for very narrow and specific things where accuracy actually matters. You can still find your ways around this (I call this search skills) but it seems to get harder recently.

                                                                            Maybe it’s time to have more specialized search providers / search engines in the future for different fields or purposes.

                                                                            1. 11

                                                                              One idea I had floating around my head is to seed a search engine with this human-curated content. These “awesome” lists have been appearing to fill a hole in Google, IMO.

                                                                              https://github.com/sindresorhus/awesome – 133 K stars

                                                                              https://github.com/vinta/awesome-python – 82K stars

                                                                              https://github.com/ziadoz/awesome-php - 24K stars

                                                                              https://github.com/aalhour/awesome-compilers – 5K

                                                                              Wikipedia is also another obvious source of human-curated content (and one that Google heavily relies on to answer many queries)


                                                                              It’s like a distributed Yahoo on top of Github! (if anyone even remembers what Yahoo did originally …!) Human curation rather than algorithmic.

                                                                              Basically the theory is that github collaboration prevents spam and is a filter for quality. Spam and dupes are the #1 problem you’ll run into when creating a search engine. And I think the web is full of pages that just BARELY meet the Google threshold of “not spam”. But those pages don’t make it onto these lists…

                                                                              So it should be an easier ranking problem in theory. Too bad I don’t have years to work on this :-/

                                                                              1. 3

                                                                                I mean, that’s how DMOZ and Yahoo worked in the Before Times™.

                                                                                1. 2

                                                                                  If we think of a search engine as a shared view into a projected subset of the web and not a gate keeper, then the search service itself should be a form of collaboration so that groups of people can train/code/filter a specific hyperplane in a high dimensional space.

                                                                                  There are plenty of niche industries that would be better served by industry specific search services.

                                                                                  Combine reddit, full text search, rss/federated queries. Basically a community workbench for creating custom search and presentation services.

                                                                            1. 2

                                                                              This is so cool! I just tried this for the issue I’m working on now, and it surfaced a relevant github issue I haven’t seen yet!

                                                                              I think this really fills a need. I’ve been finding myself using !g on DuckDuckGo a lot, since google’s results are a lot more relevant for dev related searches than DDG’s. This looks like a far more privacy-friendly option, with better results too!

                                                                              The only feedback I have is to pad the search results to appear in the center of the screen on wide monitors like most other search engines do.

                                                                              1. 1

                                                                                Thanks! I’ll work on improving the layout soon. Btw, maybe we should also add the !g bang :-)

                                                                              1. 2

                                                                                Is it open source?

                                                                                1. 7

                                                                                  I too find it interesting, but am somewhat disappointed that only the metadata is public, while the site itself seems closed source. Do you plan to change that?

                                                                                  1. 6

                                                                                    Probably, but there’s not much there anyway. The search engine is Azure’s Bing services, and the app itself is just a simple RoR app.

                                                                                    1. 4

                                                                                      Ah, I see. For some reason I was hoping you had been working on your own search-engine implementation, but I guess that’s not someone one should expect from a side project.

                                                                                      1. 1

                                                                                        It is a good starting point, and changing the user expectation is already a huge gain, giving more to margin to similar projects to maneuver with later-on.