1. 4

    Just to offer an alternative, I use “Dark Reader” [1] for Chrome which tries to automatically apply a dark theme to websites. It’s not great for most websites (so I keep it as a opt-in per site), but does a really good job with simple sites like lobsters.

    [1] https://chrome.google.com/webstore/detail/dark-reader/eimadpbcbfnmbkopoojfekhnkhdbieeh?hl=en-US

    1. 2

      Just be aware that these kind of extensions get full access to all you see and do on your browser, because they need it in order to function.

      Is dark mode a reasonable tradeoff? That’s for you to decide.

      1. 3

        For this specific extension, Dark Reader is recommended by Mozilla on AMO. This means it has passed an additional level of security / privacy review beyond what a typical extension receives.

        Of course your point is still valid. But if you are a Firefox user who trusts Mozilla more than the Dark Reader dev(s), this may sway your decision.

        1. 2

          A workable (IMO) middleground is to just grab (and ideally audit) the source and then load the unpacked extension on individual devices. This dodges the “I made an extension with justifiably broad permissions and am selling it to a party that will do Bad Things with those permissions for a shitload of money” threat.

          1. 2

            Yup, but not many people do that.

            I know how to do it but I didn’t. Used to use 2-3 extensions with this kind of access. Now I no longer use them, and simply accept that the web is not as comfortable as I’d like it to be.

        2. 1

          Dark reader also lets you apply custom styling. So you can take the CSS in this post and copy it in the Dev Tools panel in Dark reader to use it.

        1. 3

          This need the satire tag to avoid inspiring people to actually start solving fizzbuzz like this. :)

          1. 7

            I saw this shared in a different forum, and I have been interested in learning Zig, so I’ve been going through and porting it (slowly). I’ve found it to be a good learning exercise because of the small iterations, it’s easy to see the mapping between the two languages’ semantics, and it’s a chance to explore the Zig stdlib. Put it up on GH if anyone is interested: (and definitely not purporting it to be idiomatic Zig, feedback welcome)

            https://github.com/paulsmith/texteditor-zig

            1. 1

              Looks very interesting. How was your experience porting this from C to Zig? Would you prefer Zig over C?

              1. 1

                Zig has a strong family resemblance with C that makes porting relatively straightforward. The things that make Zig fun are the more predictable semantics of the language itself and some of its modern features like slices, and stuff in the stdlib like ArrayList, which is super useful and you normally build yourself in C over and over (stretchy buf, etc.)

            1. 5

              I write Haskell for my research work, and I was planning on doing this year’s advent of code in it. However, since I was planning on trying to go fast (my goal was to make top 100 at least once this year), I quickly gave Haskell up when I solved a few of the 2019 problems for practice. It just felt like a lot of these problems lend themselves very well to imperative solutions, and these solutions are very hard to represent in Haskell. Good on you for sticking all the way to the end!

              You mention zippers in your post. I don’t know if you know this, but I heard that you can derive the type of a zipper by “taking the derivative” of a data structure type. For instance, suppose we represent a unit type as 1, a sum type using +, and a product type using *. To represent Either a b we can write a+b. We can write a list as l(a) = 1 + a*l(a), or (1+a)l(a) = 1 or l(a) = 1/(1+a). Taking a derivative of this – in the calculus sense! – yields (1/(1+a))^2, or l(a)^2. A zipper of a list is, indeed, two lists! Apparently, this is true in general.

              Finally, Haskell’s parser combinator approach was so intuitive to me that I implemented a version of it in my language of choice, Crystal, for one of the Advent problems.

              Thanks for sharing!

              1. 2

                Thanks for the kind words! I’m aware of the derivative approach for zippers.

                1. 2

                  (Regarding the zipper derivative.) That’s incredibly awesome. Truly, math is cool. I took a category theory class a while ago but never imagined you could do stuff like this.

                1. 1

                  My site is at https://abhinavsarkar.net. I’d love some reviews.

                  1. 1

                    I quite like the simplicity and the prominently-displayed feed icons for notes & posts.

                    I did find the distinction between note/post a little confusing at first glance. Maybe it would be worth describing what each is at the top of the /posts and /notes pages?

                    1. 2

                      Great suggestion, thanks! I added short descriptions to clarify things.

                  1. 2

                    I used Cursive for years when I used to work with Clojure. It is a great IDE and more so for people who are coming from the Java world and used to IntelliJ IDEs. You can use the REPL like you would in Emacs but you can also use the debugger like you would for Java in IntelliJ. Some of my colleagues sweared by Emacs for Clojure development but I never got used its shortcuts.

                    1. 1

                      Awesome post, we have a JSON parser as an exercise in fp-course. It’s amazing how quickly you can implement an almost spec compliant JSON parser in Haskell, something that is quite difficult using other tools.

                      1. 1

                        Thanks Brian. I loved your workshop at Functional Conf.

                      1. 1

                        Great article!

                        meta: There’s nothing that’s really plt in here. Imho, the p in plt is important. JSON isn’t a programming language, therefore not plt despite the discussion of plt related things like grammars and parsing. Just my 2 cents :)

                        1. 1

                          Thanks! Is there any other tag where discussion about grammars and parsing may fit in?

                        1. 1

                          nice write up. i’m always on the lookout for some way to bridge the gap between beginner/intermediate Haskell (things in Haskell that I understand) and advanced Haskell (things in Haskell that I don’t understand). I’ve been on the fence with this book for a while, but it seems like it might be a worthwhile purchase

                          1. 2

                            Thanks. The book is definitely useful to understand more sophisticated type-level stuff in Haskell but IMO that’s just one of many things about advanced Haskell.

                          1. 4

                            I’ve use the standalone jar bundled in a .deb file + upstart/systemd method for deploying Clojure applications. Works really well.

                            1. 13

                              I use Hakyll. It’s written in Haskell and is completely programmable. It’s actually more of a framework for writing static site generators. That said, there are example codebases that you can get started with. It supports all your desires.

                              1. 3

                                I use Hakyll, too, but it’s complete overkill for me. And I’m not deep enough in Haskell any more to do much development on it, so I’ve been considering moving to something else.

                                I still endorse Hakyll, fwiw, but its strength lies in either: 1- leveraging your existing Haskell knowledge, and/or 2- generating sites that are far more complex than most personal sites/blogs.

                                1. 4

                                  I still endorse Hakyll, fwiw, but its strength lies in either: 1- leveraging your existing Haskell knowledge, and/or 2- generating sites that are far more complex than most personal sites/blogs

                                  It’s also fun to spend more time programming your blog than writing blog posts.

                                  1. 1

                                    i use hakyll and i’ve used it to also teach myself odd bits of haskell.

                                    i like how extensible it is, and i’ve occasionally used it to add various bits and pieces

                                    the main downside w.r.t. github is that you have to commit all the generated artefacts; which is definitely a shame.

                                    i’ve not done too much funky stuff with it; but on my companies website i’ve used it to build some (very simple) features, such as lists and specialised rss views, next/previous blog post buttons, etc.

                                    it’s not the most elegant code; but gets the job done.

                                    1. 1

                                      Late to the party, but you might be interested in rib.

                                      Why? Because by using rib, you will automatically learn Shake which it is built on top of. Compared to Hakyll, rib is relatively simple to use.

                                      Disclaimer: I’m the author. :-)

                                    2. 3

                                      hakyll here as well

                                      1. 2

                                        Great to see you’re blogging (again), Pavlo!

                                      2. 2
                                        1. 1

                                          Hakyll too. It’s simple if you only want to convert text into HTML, however, if you want something more advanced be prepared that you might spend more time figuring out how to implement this instead of writing.

                                          I’m also using supplementary python scripts and relying on external means (e.g. jupiter/emacs) to generate HTML too, I shared my setup here

                                        1. 2

                                          I quite liked this. Thinking about using it to build my own site (currently trying to use lektor, but I think it might be too complicated).

                                          Just one question: Is there any way to preview the webpage it will generate?

                                          Edit: Clarifying, can I add/edit files locally, preview the website that will be generated, and then push to github? I understand that it’s not in the scope of your project to do that, but, is there a way? Have you tried it?

                                          1. 2

                                            Since Precis is built over Github Pages which in turn is built over Jekyll, it is possible to preview it locally. Refer to this article about how to set it up.

                                          1. 2

                                            I really like the look and feel of your app. I’ve been trying to do a minimal client-side js note/blog app for my personal uses for some time, with the hopes of coming to a solution that looks and feels similar to yours. Guess I’ll have one less personal project to do. :)

                                            1. 2

                                              Thanks, I’m glad you liked it :-)

                                            1. 5

                                              Perhaps it’s not built over Github Pages, so much as it’s built over Github itself. Search uses Github. Edit uses Github (if you want an online editor). Display parses Github Flavored Markdown, and is intended for Github Pages.

                                              It’s a smart idea, and probably quite effective. Two problems for me: no note privacy, since Github Pages doesn’t have a great security story. It’s features are pretty tied to Github, though obviously can be recreated off of it.

                                              Great project though!

                                              1. 1

                                                Thanks for the kind words :-) I wrote Precis in few hours (in an unpolished form) to take notes for myself. Hence, it offloads as much work as possible to Github. It has no dependencies other than git and basic *nix commands and you can get started with it in few minutes. You can always choose a different and more elaborate tool later for rendering your notes as they are just plain Markdown files in a git repo.

                                                There are a few workarounds possible for note privacy. You can use Jekyll Auth with Precis and host it on Heroku or a VPS. But you’ll need to setup some CI mechanism to generate the HTML pages as you’ll be getting rid of Github which does it otherwise.

                                                Alternatively, you can use a custom domain name for your Precis setup and put it behind an authenticated Cloudflare domain.

                                              1. 2

                                                To save other’s from reading the source and being very confused:

                                                This is 3 shell scripts which together generate a homepage, tag and date index markdown files from the ‘note’ markdown files in the directory, and add them to git. It’s intended for use as a pre-commit hook. It relies on Github Pages running repositories through Jekyll to render HTML with layouts, and Github Pages’ hosting.

                                                It’s cool, I dig the tool use, but I was expecting something more complicated, so got very very confused when checking out the repo ’:D

                                                1. 3

                                                  It’s minimal in design and minimal in implementation too :-) I wrote it to get started with writing notes as quickly as possible and not care about anything else.

                                                  1. 2

                                                    Yeah absolutely. I hope it didn’t come off as dismissive; I didn’t actually realize GitHub Pages would autorender a folder of markdown files, which led to a lot of head scratching :D

                                                1. 2

                                                  Great detailed post! I use Hakyll for my blog and it’s nice to see some good tutorials popping up for it. I had to hack my blog together by reading Hakyll docs and source code of Hakyll blogs :-)

                                                  Talking about feeds, Hakyll recently added support for custom feed templates.

                                                  1. 2

                                                    Woah! I had no idea. I’ll need to add this info to the post! If it’s okay, I’d like to thank you in the post; is there a name & link I should use?

                                                    1. 2

                                                      I updated my lobsters profile with a link to my website. You can follow through :-)

                                                      1. 1

                                                        Updated! Thanks again

                                                  1. 1

                                                    Staticman is pretty neat. It’s not very clear without reading the documents that it also supports nested comment threads and email subsciption for reply notifications. I integrated it in my Hakyll based blog. Here’s one example comment thread.

                                                    1. 2

                                                      nilenso | Engineer | Bangalore, India | http://nilenso.com

                                                      nilenso is an employee-owned software cooperative. We’re looking for people we’d really like to work with.

                                                      We work on problems that are technically deep, large scale, in domains with high impact, and we have an affinity to work with functional languages: Clojure, Elixir, Haskell et.al.

                                                      You can read more about working at nilenso here: https://nilenso.com/careers.html. Write to us (moshimoshi@nilenso.com) if you’re interested.

                                                      1. 1

                                                        This is amazing. Thank you so much for these posts!

                                                        1. 2

                                                          Thanks! Sudoku solver has been my go-to problem even since I started learning Haskell. I used it to learn and explore various facets of Haskell.

                                                        1. 3

                                                          https://abhinavsarkar.net/

                                                          I recently started blogging and most of the posts I write are tutorial-like. I mostly write about Haskell and other functional programming relating things.