1. 2
    • Banging my head against elm-graphql + PostGraphile
    • Reading A Common-Sense Guide to Data Structures and Algorithms and Domain Modeling Made Functional
    • Also slowly reading Data Model Patterns: Conventions of Thought, 90s book by David Hay
    • Hopefully making some headway on a side project in the weekend
    • Date night with my [common-law] wife tomorrow, rare evening without kids!
    1. 3

      If you want to go straight to the draft paper itself: https://arxiv.org/pdf/1911.02564.pdf


      A major determinant of the quality of software systems is the quality of their requirements, which should be both understandable and precise. Natural language, the most commonly used for writing requirements, helpsunderstandability, but lacks precision.

      To achieve precision, researchers have for many years advocated the use of “formal” approaches to writing requirements. These efforts have produced many requirements methods and notations, which vary considerablyin their style, scope and applicability. The present survey discusses some of the principal approaches.

      The analysis uses a number of complementary criteria, such as traceability support, level of abstraction and tool support. It classifies the surveyed techniques into five categories: general-purpose, natural-language-based,graph and automata, other mathematical notations, and programming-language-based). The review includesexamples from all of these categories, altogether 22 different methods, including for example SysML, Relax,Petri Nets, VDM, Eiffel, Event-B, Alloy.

      The review discusses a number of important open questions, including the role of tools and education andhow to make industrial applications benefit more from the contributions of formal approaches.

      1. 1

        If you create a bunch of types in typescript and then try to have the typechecker catch all possible error states so that it wouldn’t compile a runtime error (but maybe a functional bug would still happen), isn’t this Elm? You model out your problem and you lean heavily on the types of that model. Then you write functional/business-y tests?

        I’m not declaring this, I’m more like asking. :) I’ve done way more typescript than Elm but not years and years of either.

        1. 3

          This is indeed the idea behind type systems like Elm’s, and Elm takes the idea a bit further than comparable languages by being very restrictive about sources of non-determinism. So if you try to utilize types to their fullest, then I’d say you’re doing things in the spirit of Elm but you won’t be able to get the same guarantees from a language that wasn’t designed from the ground up to be able to make strong guarantees the way Elm was. And in any case, having a strong type checker doesn’t obviate the need for unit tests (or unit-level tests, whether they are classical example-based tests or not), although you’ll probably not need to write as many, since their are fewer degrees of freedom in the interactions between the units/modules in your system.

          1. 3

            isn’t this Elm?

            Hi! I’m the blog post author and yes this concept is heavily encouraged in Elm! I have a few other blog posts that go into more detail if you’re interested to learn more. With* Functions, Phantom Types, The Never Type, and Opaque Types are all related to being deliberate about modeling data and defining function / module interfaces.

            Also, Richard Feldman gave a good talk a few years ago you may find interesting - Making Impossible States Impossible

            I hope that helps!

          1. 3

            Funny… I have that book! I’ve skimmed through it a few times, and my impression of the language is that it’s very similar to Erlang, but with more Prolog.

            I figured the language was dead, but I’ll see if I can get this running.

            1. 3

              It should be straightforward to build, running multiple communicating nodes can be a bit of a hassle, though. I recommend giving the “strand” rc(1) script in strand-utils-1.tar.gz a try, as it makes this much easier. Any questions and suggestions are more than welcome!

              1. 1

                Back in the 90s when I first saw Erlang, I always thought it had some “surface similarity” with Prolog.

                1. 2

                  The early versions of Erlang were indeed implemented on top of Prolog, and Joe Armstrong talked about his fascination with Prolog in more recent years as well. As I remember it, he said they gradually removed all backtracking/indeterminism until they realized they weren’t really doing Prolog programming anymore. Some of the syntax that looks very idiosyncratic in Erlang is carried over from Prolog.

                  Robert Virding (another co-creator of Erland) has created a “Prolog for Erlang”[0].

                  Term unification in Erlang and Elixir come straight from Prolog, a lot more restricted without backtracking but still very nice! And Joe described Elixir’s beloved pipe operator like this:

                  This is the recessive monadic gene of Prolog. The gene was dominant in Prolog, recessive in Erlang (son-of-prolog) but re-emerged in Elixir (son-of-son-of-prolog).

                  (He’s referring to DCGs in Prolog.)

                  [0] https://github.com/rvirding/erlog [1] https://joearms.github.io/published/2013-05-31-a-week-with-elixir.html

              1. 2

                Hey Nicholas, I found a job through 30 Hour Jobs via this post. Thanks!

                1. 3

                  Today: released a web shop I’ve been working on for quite some time as a side project (for a friend/client): www.tapetorama.se. (In Swedish only, for now.) It’s based on Solidus with a bunch of customizations. One thing I discovered along the way: it seems there are no great OSS e-commerce frameworks. Solidus is pretty good (Rails based) and very malleable if you know your way around Rails and various Ruby trickery. Saleor is interesting as well. There are several proprietary platforms that seem good (both the self-service variety and the ones that come bundled with consultants building your site) but given how important and lucrative this market is, I’m surprised there aren’t any more mature OSS projects. (Of course, there are a few popular ones, mostly in PHP land.)

                  1. 1

                    I don’t know Solidus (yet :) ) but I have experience providing SaaS companions to ECommerce solutions paid & OSS alike.

                    Magento is, honestly, decent if you require advanced, large scale, capabilities which basically leads to Magento Enterprise & having a couple team members certified. Many of my customers have been burnt by the breaking changes of Magento 2.X but things are getting easier with every iteration.

                    However Magento now belongs to the same category as SAP Hybris, Intershop, Salesforce Commerce & al: big, costly solutions than handle complex workflows

                  1. 2

                    Intriguing: Function-level Array Programming vs Function-level Stack Programming.

                    APL, J, et al are examples of the former. Forth and Joy were pioneers of the latter, but Factor is the state of the art (see factorcode.org).

                    1. 5

                      From your article

                      1. Loop through the vocabulary list and count the number of words in it (by the number of word boundaries).
                      2. Allocate an integer array big enough for all of the words.
                      3. Loop through the vocabulary list again and add each of these words to the words array.

                      Since the vocabulary list is pretty safely not going to change at this point, we can omit the first step:

                      There’s a history of scribes counting words when transcribing the Bible to make sure they didn’t miss or add a word in the process. I obviously don’t know, but it’s possible Terry was following in that tradition.

                      1. 5

                        Nah that’s how you do things in C simply. A linked list is tedious and error implement also has some memory overhead.

                        Interesting point about counting words though, poor man’s hash function

                        1. 4

                          I know it’s not profound but this correspondence is just beautiful.

                          1. 1

                            … and inspiring

                          2. 2

                            poor man’s hash function

                            — or “rich man’s”, given the time expenditure involved.

                            1. 1


                        1. 4

                          Just want to take the opportunity to say how much value I’ve gotten out of Rubocop over the years. Especially in a team setting it simplifies so many discussions and gets a project to a baseline of reasonable formatting and practices. I usually even leave some rules that I don’t like unchanged just to avoid bikeshedding. I always set Metrics/LineLength to 100 though :)

                          And I will always cherish reject, collect and inject as reminders of Ruby’s colorful pre-history. If you do Ruby and wonder where they come from and have five minutes to kill, read all about it here: https://nofluffjuststuff.com/blog/rick__denatale/2011/01/how_arlo_got_injected_into_ruby

                          1. 1

                            Thanks for the kind words!

                          1. 1

                            I like the initiative and would pay for something like this, but to my mind a privacy-focused project like this must operate in an OSS model. Not because I’m particularly interested in self-hosting or even looking at the code, but because open source is the only sustainable way of keeping software secure. (At least unless you’re an extremely well-funded government org, but even then it’s doubtful…)

                            1. 2

                              All of their services and apps are forks of Free Software servers and apps. I couldn’t find links to software repositories on the librem.one page, but I’m sure I’ve previously seen the source of their Mastodon fork.

                              1. 2

                                Source is available here.

                            1. 18

                              I once gave a talk about what makes a successful abstraction layer and evaluating ORMs as an abstraction layer (similar to the pros and cons in this blogpost).

                              I think what makes ORMs more popular than they probably should be is that the benefits are front-loaded while the drawbacks appear when you’ve already invested considerable amount of effort into working with one.

                              Long story short, I consider ORMs a flawed abstraction layer because they make things more opaque (performance, data representation that you actually care about), coupled to a framework/library (it inevitably happens that once a project starts using an ORM you have a hard time understanding meaning in data without always using those classes describing your data, in effect binding you to that ORM), and when inevitably you end up needing to understand and work with SQL anyway in some cases, you end up with Claw crane syndrome: ever tried using one of these to get your prize instead of just using your hands? Yeah, ORMs feel a lot like that sometimes.

                              When you have a small application/service/project with a single programming language (and one of the better ORMs), where you don’t mind that the data/performance/object model is strongly fused together, then it’s an okay choice. For anything else, it might be more painful.

                              SQL itself in comparison is probably a much better abstraction layer, even with it’s own imperfections.

                              1. 9

                                I think what makes ORMs more popular than they probably should be is that the benefits are front-loaded while the drawbacks appear when you’ve already invested considerable amount of effort into working with one.

                                This has been my experience with every ORM I’ve come across. The time/effort savings is an illusion, and (in my experience) by the time that illusion fades you’ll never get the time to factor the ORM out of your project. I got so frustrated working on a Scala project that uses Slick recently, I did a little write-up.

                                1. 3

                                  I find this quite interesting. A year or two ago, I decided to investigate all database wrappers in different languages that seemed better than a regular ORM, and Slick was one that seemed (for a while) to me to get things right. (Although Quill looked even better.) But in the end I came to the conclusion that all but the thinnest wrappers are a waste of time in general, and I’ve increasingly taken a database-centric approach, using SQL and the database’s capabilities to the fullest extent without wrapping them up in layers of poorer abstractions.