1. 8

    After feeling some pain about how complicated all software, IT and Enterprise architecture toolsets are, I got this idea of a dead simple architecture sketching tool, that’s based on just nodes and named lines. The input for this tool is a text file that contains triples in the form of subject-verb-object, like so:

    # comments via shebang
    # declare nouns (for better typo recovery)
    internet, web front, app server, DB, Redis
    # declare verbs (perhaps not necessary and may be dropped)
    flows, proxies, reads/writes
    
    # subject-verb-object are separated by more than 1 whitespace (" " or "\t") 
    # somewhat like Robot Framework does it
    # prepositions (to, from, at, etc.) seemed redundant, so not using them
    internet     flows          web front
    web front    proxies        app server
    app server   reads/writes   DB
    app server   reads/writes   Redis
    

    I’m not married to the syntax yet, but it seems fine after a few iterations of experimentation. A tool could then read this and produce a nice graph via graphwiz. And you don’t really need a tool, you could do these sketches on a piece of paper in no time. But when you want to store and share the design, a text file + tool is a good combo.

    Tried to write a parser for this language in Rust’s pest, but that was a bit of a pain – pest’s error modes are quite odd. Seems like when my parser has a problem, Pest blows up on position 0 every time. Perhaps I’ll just do a dumb line-by-line parser by hand instead. And I’d like to implement in Crystal rather than Rust. Also thought about doing it in Swift, but that doesn’t seem to work so well outside of MacOS/Linux (I’m thinking BSDs here) yet so nope.

    Best part? The tool’s name is Architect Sketch.

    1. 5

      Reminds me of mermaid. It has shortcomings but has worked for me most of the times I’ve had to diagram something over the past few years.

      1. 4

        I’ve been working on something similar myself, with the goal of actually deploying infrastructure on it. I think this is a good avenue to explore, and pairs really well with rule engines and datalog systems.

        1. 2

          This is something I’ve been thinking about a lot as well.

          For my use case, I just want to dump, document, or understand how my multitude of web apps, daemons, and IoT devices all interact with one another.

          I had built a rough prototype with ruby and shell scripts using similar syntax, but I couldn’t ever get Graphviz to generate a “pretty” layout for the whole thing.

        1. 3

          So, thank you all for the accessibility feedback, it has been enlightening.

          That said, does anyone have anything to say about the meat of the article? (Thank you for reading it BTW for those that did.)

          Am I full of crap? Has this been said more eloquently elsewhere? Is this useful to anyone?

          Thanks.

          1. 3

            The meat of the article resonated with me a lot. You’ve reached conclusions which overlap with some of my own I’ve recently discovered. I’m going to explore further the passion side of your recommendations, I’ve certainly seen a few cases where it’s been a liability recently.

            1. 2

              Thank you very much! Reading Avdi’s articles a couple years back really hit a nerve, and I’ve found since that my “passion” had been the source of more than a few problems over the course of my career.

          1. 4

            Really enjoyed this, it helped me form more of an opinion about Clojure spec. I also enjoyed the references to assertions & other languages which focus on this. As I am a full-time Clojure developer, I thought I’d weight in with the little I know about Spec.

            I’m familiar with Clojure so I don’t want to make too many comments,

            From the context, I suspect this is supposed to be “I’m not familiar”

            It seems that Spec is more intended to help with runtime type checking,

            Kinda. You’re definitely supposed to have it off in production. It’s off by default. I’d like to see a change which allowed it to be turned on for dev, but I digress.

            The current API as I understand it is largely about having it on when running tests, and using the specs to do generative testing. You start from a “type” inferred by predicate (e.g. string?) and then run it against the other predicates, and do that until you get a valid match. Then you run that against the function and ensure the “out” contract is matched for all inputs.

            I think Spec has the major benefits you tout for contracts in your article. Clojure gets some of the contextual uses for free by handling “functions”, but does fall down on “loop variants” and “check contracts”.

            1. 3

              I think, personally, I would solve this by calling git log twice, and joining the inputs. Nowhere near as clean, but easier to escape (no special characters).

              I would love to see how to solve this with OSH, as an extension of this post. Seeing a real problem that I can empathise with concretely, and then having “OSH will fix this ;)” feels like a tease!

              1. 3

                If I’m understanding you correctly, I think the joining solution is a little fragile with respect to:

                1. Inputs with multiple lines. What if I wanted the full git commit description and not just the first line?
                2. If there are 4 fields, which there are in the real problem, then you need 4 invocations of git log. Or at least you need an invocation per field that contains spaces.

                Also I’ve used the “join” or “paste” commands and I honestly find them very difficult.

                As for Oil, that’s unfortunately a little far off (hence the call for help in the post!). OSH is the bash clone, so you will solve it the same way as bash.

                Oil is the new language, and one improvement is would be a way to store structured data in memory! In particular, tables!

                I’ve summarized some notes here:

                https://github.com/oilshell/oil/wiki/Oil-and-the-R-Language

                The slogan is that “the output of ls and ps are tables”. And the output of git log is a table. So Oil will be able to parse arbitrary data and store the “correct” values in memory. Then it can serialize them to any output format. So bash has the paradigm:

                $ input | process text in a hacky and probably incorrect way | output
                

                Oil will still allow that. You can play fast and loose if you want. But it will also allow:

                $ input | properly deserialized | structured data | properly serialize | output
                
                1. 2

                  I also thought of @dominicm’s solution, but you’re right, that solution has problems.

                  The simplest solution I can think of, while being obviously safe against adversarial input, would be a script in a scripting language. The key improvement over “the pedantic solution” in the blog post is that you don’t actually need a Git API. You just need a language that can easily call system commands. What’s more, you can fetch the information for just one commit at a time with something like git log HEAD~3 -n 1, which avoids having to stitch together git log’s output for multiple commits.

                  Using those ideas, here is how I would do it in Ruby, calling out to Git with system:

                  #!/usr/bin/env ruby
                  require 'cgi'
                  
                  def escaped_git_log_part(commits_back_from_head, format)
                    log_output = system "git log HEAD~#{commits_back_from_head} " +
                      "-n 1 --pretty='format:#{format}'"
                    CGI.escapeHTML(log_output)
                  end
                  
                  puts '<table>'
                  0.downto(4).each do |commits_back|
                    part_H = escaped_git_log_part(commits_back, '%H')
                    part_h = escaped_git_log_part(commits_back, '%h')
                    part_s = escaped_git_log_part(commits_back, '%s')
                    puts "<tr>
                      <td> <a href='https://example.com/commit/#{part_H}'>#{part_h}</a> </td>
                      <td>#{part_s}</td>
                    </tr>"
                  end
                  puts '</table>'
                  

                  It’s kind of repetitive, but good enough for a safe but quick-to-write shell script, I think.

              1. 3

                I appear to be hitting an ssl exception on this URL. Something about the certificate issuer being unknown.

                1. 6

                  @tedu hasn’t gotten to the book about CA infrastructure yet

                  1. 2

                    Lol. Oh he has. @tedu went further to launch a small-scale experiment on the psychological effects of highly-technical users encountering SSL problems on the homepage of someone they expect understands security. Aside from personal amusement, he probably focused on categorizing them from how many ignore them to quick suggestions to in-depth arguments. He follows up with a sub-study on the quality of those arguments mining them for things that will appeal to the masses. He’ll then extrapolate the patterns he finds to discussions in tech forums in general. He’ll then submit the results to Security and Online Behavior 2018.

                    Every tedu story on Lobsters having a complaint about this is the fun part of the study for him. A break from all the tedium of cataloging and analyzing the responses. On that, how bout a Joker Meme: “If a random site by careless admins generate CA errors, then the IT pro’s think that’s all part of the plan. Let one, security-conscious admin have his own CA and then everybody loses their minds!”

                    1. 2

                      Not far from the truth.

                      1. 2

                        He’ll pay the $$$ and jump through hoops for DNS; but, the CA system— the line is drawn here!

                        1. 2

                          Well, domain names are scarce in a way that RSA keys aren’t, and have unevenly distributed value. My domain name was not randomly generated. :)

                          1. 1
                            tedunangst.com name server ns-434.awsdns-54.com.
                            tedunangst.com name server ns-607.awsdns-11.net.
                            tedunangst.com name server ns-1775.awsdns-29.co.uk.
                            tedunangst.com name server ns-1312.awsdns-36.org.
                            

                            Did you ask for people to add your nameservers to their resolver roots?

                            Domain names and RSA keys are equally scarce. It’s all protection money, for root servers and for root CAs.

                        2. [Comment removed by author]

                          1. 6

                            This comment is totally unsupported by data, the Chrome team in particular has done a ton of research which has improved error adherence: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43265.pdf in particular, but there’s others as well.

                            The past few years have featured the greatest improvement in both the quality and quantity of HTTPS on the web since TLS was introduced, and it’s been supported by careful research on both the crypto side and the UX side.

                            1. 3

                              Huh? The situation was much worse: browsers just displayed OK/Cancel dialog and most users just clicked OK. Today it’s harder for users to click OK, and this single change of UI made many more users secure against MiTM attacks. I don’t have links handy, but those Chrome and Firefox “assholes” did a lot of research regarding this, and made browsing more secure for the majority of non-technical people.

                              1. 2

                                At the same time, I think they’ve made it harder for technical users to make informed decisions.

                                1. 1

                                  True.

                                  1. 1

                                    How is that not a win? ;-)

                        1. 2

                          I am not sure why he didn’t use org-mode if he was aware of it. I personally use Emacs but from what I heard there is also an implementation for vim (probably less complete), so why not use that instead?

                          1. 3

                            The org-mode for Vim is pretty primitive. I doubt it supports the literate programming mode. Attempting to parse the org mode files is a monumental task with the addition of it being an ever moving target.

                            1. 2

                              The specification for source snippets has not changed in recent times as far as I know, although I do not use it much currently. Very basic tangling should not be complicated as long as the substitutions do not need to be resolved, which the author does not use, as far as I can tell.

                              1. 4

                                This discussion led me to http://literate.zbyedidia.webfactional.com/index.php which I think would perhaps have been closer to the correct choice for this project.

                                A general purpose literate programming tool.

                          1. 2

                            I’m unsure about how I feel about packages making their way into vim core. I feel like this is a solved problem already! I don’t feel like these changes completely solve the problems things like vim-plug solve.

                            I do, reluctantly, admit that my understanding of this async implementation is an improvement over neovim’s. Mostly because it is more abstract, but I don’t fully understand it, and it might be needless abstraction?

                            The partials and lambdas are cool. I’ve been feeling a little bit disheartened by vimscript given my recent desire to split up my vimrc into something more like spacemacs layers, and I think that lambdas will help with this.

                            1. 4

                              I’m Dominic Monroe. I’m 19. I’m working at my first job as a developer at juxt.

                              I started writing Clojure last september and fell in love with it. Not much later, I knew a job writing it was exactly the kind of thing I had held out for.

                              I currently work primarily on an electric bike scheme, which has an interesting, albeit frustrating, set of challenges. The code has been very stable, with most bugs originating in third party dependencies such as H2 and React.

                              I quite enjoy editor tweaking to the point where I have started writing plugins for vim. Related to this, I really enjoy yak shaving for some reason, debugging these are extremely fun. I find that pushing clojure editor tools finds limitations easily, as they’re designed to work with emacs, and using vim there is new ground.

                              I have no real hobbies outside programming and I think this is unhealthy. I used to play a lot of sport, but stopped due to injury. I feel fairly exhausted most of the time, as I struggle to recharge my batteries. I have recently discovered, in the midst of the UK’s Summer Heatwave, that I enjoy going for long walks with my phone switched off. This is, a new hobby and may not last. Last weekend left me feeling very recharged, relaxed, and like I hadn’t just wasted away my weekend. It was a really good feeling.

                              1. 7

                                The Author (Malcolm) has been talking to me about this a lot. He makes a really compelling argument for treating as much as data as possible, it seems very obvious, but wasn’t something that I fully understood until he explained the design decisions in yada to me.

                                This blog post is worth reading to change the way you think about software design, and what you can get for free by avoiding function composition.

                                1. 1

                                  Novel: Mistborn - Brandon Sanderson on Audible Paper: I read a paper on an abstraction called a tope, I didn’t really get it though. It’s part of my dive into data validation Technical Books: How to solve problems - George Polya. There’s some interesting tidbits, but I’m half-way and the heuristics seem overly specific to mathematics.

                                  1. 1

                                    I’d started working out a library for topes in Rust, but it hasn’t been a priority. Let me know if that sounds interesting to you!

                                  1. 2

                                    The Liar’s Key by Mark Lawrence. I’m taking a break from computer books this week.

                                    1. 1

                                      Is it as good as the Prince of Thorns?

                                      1. 1

                                        I find Jal (the protagonist of the second trilogy) more likable than Jorg. The writing is just as good. Given the somewhat weird way the first trilogy ended, I’m interested to see whether this one suffers the same issue or not.

                                    1. 5

                                      The URL appears to be incorrect on the header link. It goes to the blog rather than the article, which is at http://blog.jenkster.com/2016/06/functional-mumbo-jumbo-adts.html instead.

                                      1. 1

                                        Odd, it pulled the title correctly. I can’t change the URL, hopefully a moderator can jump in for us!

                                        1. 3

                                          Fixed.

                                          1. 3

                                            Ah I see the problem now. My blog wasn’t generating the correct canonical link in the header.

                                        1. 6

                                          Kris apparently wrote this in part because I was asking him questions.

                                          I enjoyed this article because it transcends a specific programming language, and gave me what felt like a primitive that I could apply to almost any language.

                                          1. 2

                                            I think @ChadSki could write a book with all the questions I’ve asked him over the years…

                                          1. 2
                                            1. Why is there no pre-release versioning in Monotonic Versioning? - The pre-release behaviour of SemVer offers little semantic information about a release. Rather than pre-releases, Monotonic Versioning simply increments the compatibility number when a release breaks compatibility with an existing one.

                                            2. What if I want my API version numbers to be low? - That is silly, aesthetics have little place in versions where the point is to convey semantic information. If you want lower version numbers, get your API right earlier.

                                            If my interpretation of these points are correct, I’m not sure this lends well to public API experimentation. You could easily reach 10+ whilst experimenting with an API design in public.

                                            Beyond this, I’d like to have some space for API experimentation in public. Perhaps I could just decide that +alpha or something, may have breaks between release numbers, and make that clear for my usage of MonoVer.

                                            Maybe this is just aesthetics though, and I’m just thinking in old-fashioned SemVer brain. I’d love to be enlightened though.

                                            1. 5

                                              You could easily reach 10+ whilst experimenting with an API design in public.

                                              Why is that bad?

                                              1. 1

                                                I’m not sure it is. I think it’s my view on aesthetics. SemVer brain, I’ve not really used much else.

                                              2. 1

                                                I had the same feeling, but then taking a step back, I wondered how much of the API development would actually be done in public? Seems like most of my testing is internal or with a few clients, at which point I’m not making any compatibility guarantees. I would just bump the REVISION until I was ready to make a guarantee on API stabiliity, at which point it would become version 1 (or whatever is the next version)

                                                1. 1

                                                  I’m not sure if this encourages bumping the revision number until you’re ready to make a guarantee, (or maybe it does and I’ve missed it?)

                                              1. 1

                                                I’ve been working on a validation library for clojure.

                                                I wanted something that was focused on predicates, but gave you enough data to do something useful.

                                                I also don’t want to strangle my library by only providing low-level constructs, so there will be a few “levels” which build on low-level ideas, progressing into more common uses.


                                                This is quite a big step for me, I’ve never really built a library with such intent of releasing it. I have a clear use in mind (a pet project that will fail), but it’s based on my frustrations trying to get validations working across a number of ecosystems.

                                                1. 1

                                                  I think this is a great alternative to the subscription-model many companies are opting for. Especially for casual readers such as myself.

                                                  I’m sure there are some people who will get the value out of a particular online news site’s subscription, but that isn’t me. I tend to read everywhere, and I’m happy for the people who wrote those articles to receive some money because of that, particularly if it engages me, which is what this add-on will pick up on.

                                                  I also like that there’s no lock-in to flattr, if you include the appropriate code on your page, you can have multiple payment systems, and support the various ways people want to pay. I like it.

                                                  1. 9

                                                    Is there anything nice about this particular implementation that makes it stand out from, say, Guile or CHICKEN?

                                                    1. 10

                                                      What others have said, and also that Chez Scheme is pretty polished in general. IIRC its author was also the author of “The Scheme Programming Language,” which is a pretty good book. If it has nice errror messages, an FFI, and native code compilation, it’s golden.

                                                      1. 15

                                                        Kent Dybvig, the author you speak of, is also the father of syntax-case, wrote a thesis about implementing Scheme “Three Implementation models for Scheme”, as well as being an advisor on the nanopass framework, a compiler optimization strategy that’s become well regarded.

                                                        You could say he’s a “big deal” in the Scheme community, and broader PL community…

                                                      2. 6

                                                        From what I understand, it’s main feature is it’s speed.

                                                        1. 3

                                                          From what I can see, it compiles native binaries. Guile can’t do that (though you can embed the interpreter and scripts inside a binary). Don’t know if chicken can.

                                                          1. 9

                                                            Chicken more or less only compiles native binaries, since it’s a compile-to-C system.

                                                        1. 7

                                                          At work: Setting up Gitlab CI for various projects to have automated tests running. Currently trying to set up Code Composer Studio in a Docker container to build microcontroller projects on it.

                                                          In my free time: Working on qutebrowser - probably a mixture between finally building/releasing a dmg for OS X, merging some pull requests, fixing bugs, writing tests, and organizing t-shirt/sticker printing for the crowdfunding.

                                                          1. 2

                                                            I’m really excited for you to work on qutebrowser! Congratulations on making it so far into your funding.

                                                            I tried to switch to qutebrowser for my daily driver, but I browse a little too much, and the failures were making life hard. I’m going to be straight over once you’re using chrome.

                                                            You may have answered this, but will it be possible to load chrome plugins into qutebrowser? That would give you a vast array of extensions.

                                                            1. 2

                                                              Thank you! 2 months of funded full-time work is quite close :)

                                                              What Qt version were you using? (See :open qute:version) - 5.4/5.5/5.6 were pretty stable here.

                                                              Unfortunately loading Chrome plugins won’t be easily possible, as QtWebEngine doesn’t use that part of Chromium as far as I know. I’ll look into it when I work on a plugin API (which is after QtWebEngine and per-domain settings), but first I’ll add a Python plugin API.

                                                              1. 1

                                                                I use Qt 5.5.1, and qutebrowser 0.5.1, thinkrelevance.com was really bad, the page partially loads, but freezes up Qutebrowser completely.

                                                                I didn’t think so, that’s okay. I look forward to your api! I should be able to implement everything I want with it.

                                                                Thanks again for your hard work, I’ve enjoyed seeing how responsive you are everywhere, you’re clearly really passionate about Qutebrowser.

                                                          1. 1

                                                            I’m really interested in the way MVC has shaped software design. I think the primitives are fairly ubiquitous, I see a lot of code which mixes the model and controller. I don’t really think SQL belongs in web request handlers.

                                                            Lots of value in looking at these different patterns for improving software design.

                                                            1. 1

                                                              So is there an alternative to IFTTT? Because I’m personally a bit frustrated by their lack of pebble support.

                                                              1. 2

                                                                The big player is Zapier, but you’re a little limited on number of recipes. Maciej recommended Botize. I’ve not heard of this one myself. A few quality listed ones here look of interest http://alternativeto.net/software/ifttt/

                                                                1. 2

                                                                  Based on this list, Huginn seems like the best self-hosted, open source option.

                                                                2. 1

                                                                  What does IFTTT have to do with Pebble?

                                                                  1. 1

                                                                    Someone wrote an IFTTT do app for pebble and IFTTT requests it be removed. I suspect they’ve made their own replacement by now, but honestly I don’t even care.

                                                                    1. 1

                                                                      I could easily envision several scenarios where it could be useful. “If I get a tweet from JCS, display it on my Pebble” etc.

                                                                      1. 2

                                                                        Well you can’t talk to the watch directly, so usually something (IFTTT, Zapier, etc.) would just send a notification to an app on the phone (like Pushover), which would then show it on the Pebble.

                                                                        Though now that you mention it, I wonder why Pebble hasn’t opened up an API to send notifications directly to their own phone apps to show on the watch, rather than a 3rd party app like mine that has to forward it to their app.

                                                                    2. 1

                                                                      Maciej points out the alternatives in the article. Zapier for one.