1. 1

    Why are the timestamps wrapped in Option<>?

    1. 6

      it’s common to disable atime etc… I can’t count how many bugs I’ve had to deal with over time due to misunderstandings of mtime, ctime, atime etc… Making the ones other than creation time optional is a nice technique for reducing bugs due to representing a type that might not actually be present by some placeholder value that only those who have already been burned enough times might remember to properly handle next time.

      Translating many types of common gotchas into compile-time constraints through types like this is one of the biggest timesaving features of Rust as I use it.

      1. 2

        But as soon as anyone stats it you’re going to have to make up values for them anyway. I’m not aware of any “real” filesystems (*nix ones, anyway) that have any analogous notion (however encoded) of a timestamp that might be missing, and I’m having trouble thinking of a case in which a filesystem-internal operation would be doing anything with the semantic value of a timestamp other than reporting it to a running process (via an API that doesn’t support Option<>), so I still don’t really see the point.

        And just to be clear: I’m not an anti-rust partisan or anything (in fact I’ve been introducing bits of it at my current job) – this particular pattern just seems like additional complexity for no discernible benefit.

        1. 2

          Making the ones other than creation time optional

          Creation time is mostly useless. Hell, Linux didn’t even have an API to read the file creation time until recently.

          Modify time on the other hand is how things like make work.

          1. 7

            It doesn’t matter if it’s useful to you or not. If a file has been created, then it has a creation time. It will not have a modified time until it is modified. The purpose of the Option is to signify when something does not exist, without resorting to error-prone magic values.

            1. 5

              Huh? Creation time is super useful for end users. I often sort Finder windows by creation time, especially of documents I’ve created.

          2. 1

            Disclaimer: not the author.

            created_at is not an option but accessed_at, modified_at, and changed_at are which makes sense in the way that a file may not have been accessed, modified or its properties changed since its creation time. It could also be there for ease of implementation of features like noatime mount option. However, currently code is initializing all of them to the same value when instantiating an Inode so not sure whether that argument holds water.

            1. 1

              Yes, that is exactly the reason. And right now I’m initialising the values to mimic the behaviour from my local machine (APFS).

          1. 5

            I’ve a somewhat similar setup but have been looking for something like redshift/f.lux without all of the dependencies. It should automatically transition between temperatures, gradually, based on time of the day (not a sharp transition at a set start and end time) and should do this throughout the year without requiring to be told that sunrise/sunset times have changed. So I wrote this: https://github.com/amir/sctd

            And I simply put the following in my .xinitrc:

            sctd --latitude 53.3498 --longitude -6.2603 &
            
            1. 1

              I am going to try this out. Thanks!

              1. 1

                The is the simple sct command from Ted Unangst. I use that as a cronjob every 30 minutes to change the color, using a ratio based on the current time offset compared to 2:00 pm (value randomly chisen by me). The closer I get to 2 pm, the closer the color is to 6500 (no red). The minimum value is set to 3500, which can be seen at 2:00 am. I can get you the script if needed.

              1. 4

                I’d love to post a LogicT implementation using Haskell but normal sudoku using LogicT is the final assignment for the “Functional & Logic Programming” class I’m teaching. Will have to wait a month or so, sadly!

                1. 2

                  I presume this is the course? https://course-profiles.uq.edu.au/student_section_loader/section_1/106673 I’m definitely pushing my luck but is any of the material open to the general public?

                  1. 2

                    Lectures and pracs are public:

                    https://gitlab.com/comp3400

                    Assessment isn’t public. We’ll see if we can make it public after the course is finished. Maybe, maybe not.

                1. 2

                  I’ve been working on a simple redshift/f.lux replacement for Linux based on Ted Unangst’s sct. You can give it your location’s latitude and longitude and leave it running and it’ll transition between suitable temps: https://github.com/amir/sctd/

                  1. 15

                    FWIW GitHub is not being blocked in those regions, GitHub is blocking users from those countries.

                    1. 3

                      Author here. Good point. Corrected.

                    1. 3

                      Being an Iranian and all decided to migrate everything from https://github.com/amir to self-hosted https://git.gluegadget.com/. I gave sourcehut serious thoughts and happy to pay for and support it but don’t want to put @sircmpwn in a difficult situation where he has to terminate a customer’s account to comply with regulations. I’ll keep my github account for the social-networking aspects of it though, but will be making all repos mirrors.

                      1. 2

                        Erica Klarreich is a very good author. I’m unfamiliar with most of the maths subjects she covers but she does an impressive job explaining the concepts to the uninitiated in an easy-to-read narration. Not only I get to read a good story, but I also learn something.

                        1. 3
                          • Miniflux (RSS)
                          • Jira (Kanban style project management (side projects, house renovation, etc.))
                          • Gitea (Git)
                          • Drone (CI)
                          • NetData (System monitoring)
                          • OpenVPN
                          1. 6

                            Jira, as in Atlassian’s?

                            1. 5

                              Yeah, you can buy a license for $10 and self-host it. it’s a bit of a memory hog running on the JVM though. Unfortunately the alternatives I tried didn’t quite fit my use-case for house renovation project management.

                          1. 3

                            Although it’s simple enough to be added as an alias, I’d recommend using the function. The function re-evaluates date each time its run, while the alias only evaluates it when your bashrc or zshrc is evaluated.

                            You can define your alias using single quotes and it’d have the same effect.

                            alias lb='vim ~/logbook/$(date "+%Y-%m-%d").md'
                            
                            1. 27

                              I was accepted to the Recurse Center and am arranging the logistics of moving to NYC from mid-September to mid-December. If anyone in NYC would like to meet up, message me. I plan to study category theory, dependent types, and, if I can find a study buddy, tools like Coq and TLA+.

                              Codewise, I’m tinkering ahead on my current Haskell practice program, a solitaire solver. I’m also making demo Rails apps for my two factor authentication Rails gem.

                              1. 4

                                Check out @hwayne’s tutorial on learntla.com since it’s on a practical subset. Also, Alloy Analyzer has long been used to do something similar for structural analysis of programs with ease of use vs Coq etc.

                                http://learntla.com/

                                http://alloy.mit.edu/alloy/

                                Hopefully, you master it all. TLA+ and Alloy just knock out lots of low-hanging fruit with relatively few people quiting due to difficulty like what happens with big-time provers.

                                1. 3

                                  Great news, looking forward to the blog posts! Is there something similar to Recurse Center in Europe?

                                  1. 2

                                    There was “Hacker Retreat” in Berlin that was explicitly inspired by Recurse Center, but it disappeared in October or November 2015. I’m not aware of others, but I haven’t looked.

                                  2. 3

                                    Glad to have more RC people here. Enjoy!

                                    1. 2

                                      This is wonderful news! Looking forward to hearing all about it :).

                                      1. 2

                                        Congrats again, we’re looking forward to having you :)

                                      1. 1

                                        Takes a while to get used to but this has helped me several times: https://github.com/adrieng/xrandr-nightmode I’m not running it every night though.

                                        1. 8
                                          • Learning Japanese
                                          • Running (goal is to be able to run 100k races one day)
                                          • Bouldering
                                          • Reading (When In French at the moment)
                                          • Code a bit, here and there
                                          1. 2

                                            At first I thought it’s a typo, 100k instead of 10k then I Googled and it seems to be a thing, and an impressive one on that.

                                            1. 2

                                              It is definitely a thing and I’m still as impressed as you! I’m sure it’s terrible for your body, but damn… It’s an amazing feat.

                                              1. 2

                                                I’d think it’s probably not all that terrible if you can do it with great form and/or minimal footwear. It definitely wears you out for a matter of weeks, but I’d guess it doesn’t have to be too damaging in the long run.

                                          1. 9

                                            Tehran, Iran.

                                            1. 3

                                              Elsewhere in this thread I was talking about how having Iranian internet probably blocked you off from many parts of the rest of the internet. I have also heard that a lot of Iranians know how to use proxies and VPNs. What is your experience?

                                              1. 6

                                                Yes, we’re well versed in bypassing them, mostly just an inconvenience. The real problem is limited bandwidth, which has been partly due to—recently lifted—sanctions.

                                                1. 3

                                                  I worked on a project a few years ago, creating a system to organize artifacts and articles from the Qajar period. It was fascinating working with the clients (a Professor and her grad students) as they would go back and forth from Boston to Tehran, and how much more complicated it was working on the site w/ them while they were there. In Boston – skype calls, screenshares, they whole nine yards, in Tehran, I’d be lucky to get an email.

                                                  Not to mention the complicated an disheartening process of making sure all the icons on the site didn’t come across as too politically subversive.

                                                  All this to say, even my secondhand experience with the level of crap you have to deal with tells me “inconvenience” is an understatement. Here’s hoping the lift those restrictions someday soon.

                                                  1. 2

                                                    You’re right, but as I said the real problem is the capped bandwidth and the added latency—to an already slow connection—of solutions used to bypass the restrictions. Bypassing restrictions is the easy part, but actually using the produce, not so much: a very slow with high latency Internet connection. You should get used to waiting several minutes for GMail or Twitter’s web interfaces to become responsive.

                                                  2. 2

                                                    Is this every Iranian? It’s an open secret how to get around internet restrictions? Or just a few technically savvy people? Do grandpa and grandma know how to bypass internet blocks?

                                                    1. 2

                                                      You’re right and my judgment is, probably, clouded with selection bias; but I think most of the young generation know how to bypass it because the censorship has been part of the Internet since the day they’ve started using it. And they usually take care of their grandpa and grandmas.

                                              1. 1

                                                Honest question, I’m new to Haskell. I remember reading several comparisons of parser combinator libraries in Haskell and the general census has been use attoparsec when performance matters, and trifecta when error messages matter. I presume data (de)serialization is one of those areas that performance does matter?

                                                1. 2

                                                  It’s a bit weird to me that it uses parsec. I would expect/want attoparsec here.

                                                  1. 1

                                                    I think it uses aeson for parsing json. It looks like it uses parsec for parsing the IDL.

                                                    1. 1

                                                      Oh! I see. It doesn’t have aeson listed as its own dep, but users would need one.

                                                1. 4

                                                  From Twitter:

                                                  E-reader friendly now too!

                                                  What does this mean, exactly? Is there an extra non-margin PDF, or is there actually an epub version available now?

                                                  1. 4

                                                    I too hope to see an epub at a certain point. The ereader PDF has some code that overflows in the late chapters. It is much better for tablet reading however.

                                                    I’ve read this morning the Monad chapter and the functor/applicative/monad in the wild. They are really top class (as the rest of the book)! I look forward to buy also the paper version when it’s ready!

                                                    1. 3

                                                      I too hope to see an epub at a certain point.

                                                      We’ve tested an epub render, it mangled the content horribly. I’d rather just fix the PDF via the LaTeX.

                                                      Glad you’re liking it so far :)

                                                      1. 2

                                                        Boo, epub would really be a lot nicer for reading on a tablet beside the laptop. Curious what got mangled.

                                                        1. 3

                                                          The e-reader version of the PDF I made vastly exceeded my expectations. I poked around it a fair bit on my kindle and it was very nice, IMO. Other readers that tested it on various devices gave it a thumbs up as well.

                                                          epub on my kindle was horrendous and the gaping maw of labor required to fix it by hand isn’t going to happen. I’d have to charge a lot more for the book to cover that and people already complain about the $59.

                                                    2. 2

                                                      The former.

                                                      1. 2

                                                        Ooh goody, I’ve been mostly reading it on my kobo so this is good. The book really has been great so far, things like the structure, you can find exercices sprinkled throughout the chapters instead of all globbed at the end, I usually have trouble getting into a books exercices because of this. They’re even little goodies at the end of chapters in the form of links to recommended extra reading.

                                                      1. 2

                                                        I use http://www.fpx.de/fp/Software/Gorilla/, and its cross-platform.