1.  

    I’m working on an astrophysics simulation! My friend is a postdoc doing theoretical astrophysics, and he recruited me to help him with a simulation. We experimented with a version that used multiprocessing to do some of the computation in parallel, but abandoned that idea for the “production” version. I’m still tinkering on that as an exercise in learning how to profile, optimize algorithms, etc.

    The tricky part about this simulation is that some of it needs to run sequentially and some of it can be done in parallel. I currently have a main process and a bunch of worker processes that use Events to communicate when the parallel part should start and when the sequential part (which happens in the main process) should resume. It’s not very efficient because the execution time of each time step is limited by the slowest worker process (each worker is modeling a different physical process), so there’s a lot of CPU time spent doing absolutely nothing.

    1. 14

      My two cents: keep it minimal, focus on content and not on fancy themes.

      For my personal website I keep it as simple as I can and I’m quite satisfied. https://github.com/dacav/App-PFT/blob/master/share/templates/terminal.html rendering as https://dacav.roundhousecode.com/

      1. 1

        I also tried to keep it minimal: https://soc.github.io/

        1. 1

          I really like that you have things organized into a grid, it makes it so that I don’t have to do a separate search once I’m already on the site.

          1. 1

            Thanks! It took a substantial amount of time to get the dimensions to 2. :-)

        2. 1

          I agree with this. It’s roughly what I’ve done with my site as well: https://c.har.li/e/

          1. 1

            I really like the look of your site!

          1. 2

            Interesting that the original implementation was written in Common Lisp, and that reference counting added so much overhead to the C++ version. I wonder if a Rust implementation would suffer the same way, or if the borrow checker could shift some of that overhead to compile time.

            1. 3

              I literally LOLed when I read the name

              1. 2

                But more seriously: This looks like a well-designed shell replacement. I wonder if it’ll catch on

                1. 1

                  I don’t get it, could you explain?

                  1. 2

                    There’s a famous painting by Magritte involving a pipe.

                1. 2

                  Looks like a slam dunk for a lot of users currently on Git. It’s also written by the competition. Any pro-Git people want to counter any of it?

                  1. 18

                    I’m not really pro-git but I some of the strawman arguments can be easily countered.

                    Fossil is more efficient? Then how comes that git scales better? And git does not scale that well either if you look at what Microsoft had to do to it for 300GB. Describing Gitlab has “a third-party extension to Git wrapping it in many features, making it roughly Fossil-equivalent, though much more resource hungry and hence more costly” is so wrong it’s funny. At least, compare with Gitea.

                    The article discusses the design philosophies but never considers Torvalds design criteria like speed.

                    Fossil uses the most popular database in the world? You could also say git uses an even more popular one called “file system”.

                    Git is POSIX only? Git certainly has more windows users than fossil has users in total.

                    Fossil has many check-outs per repository? Git also.

                    Fossil remembers what you actually did? Git can do that just as well. Git provides a choice where fossil is opinionated.

                    In general, this is a one-sided pro-fossil page. Not surprising given the domain. It tells you a lot about the design philosophy behind fossil and is valuable because of that. It is not an honest comparison though.

                    1. 11

                      Honestly? I don’t actually care which SCM system I use, as long as it talks to GitHub, because that’s where all my code and all my employer’s code lives.

                      Furthermore, I use maybe three or four Git commands 99.9% of the time and I have them memorized (and aliased!), so why would I ever switch?

                      People complain about Git’s UI and I wonder what it is they’re doing that I don’t do that makes it such a big deal for them. I’m not saying they’re wrong, but I kind of suspect that most devs are more like me, they treat SCM as a black box utility, like the CPU or the memory, and that’s why we’re moving toward a monoculture, because it just doesn’t matter to most people.

                      1. 11

                        Not a pro-Git, but when I considered switching to Fossil there was no (easy) equivalent of git rebase -i.

                        That was probably my biggest complaint.

                        1. 4

                          The article explains that this is a deliberate design choice.

                          1. 22

                            That choice is a total dealbreaker for me. I never use SCM to record development history as it happened, with all the stumbles, experiments, dead-ends, and “oops, forgot a semicolon in the previous commit”. I use it to produce sets of changes that are easy to review and revert if necessary.

                            1. 11

                              I agree, except that I absolutely do use local SCM to record all of that nonsense history, so I have the freedom to try different approaches and make mistakes without losing work. Obviously I don’t push all that crap; I clean it up with rebase -i before letting anyone else see it. It baffles me how this could be considered bad practice at all, much less “history written by the victors”.

                              (Edit: I wonder if people are just talking past each other here — perhaps the anti-rebasers think you would rebase after pushing, which would be very rude — and the benefits of rebasing locally while working just don’t occur to them.)

                              1. 5

                                I’ve used fossil in the past and my workflow was to have two trees: one with a “history as it really happened” and one that I rsync the completed work to and commit for a “clean” history. The latter gets shared and later rsynced over the other messy repo since I didn’t care about how I got to the end state.

                                1. 3

                                  I did something like that in the olden SVN days. cp -R . ../asdfaasdf was my git stash.

                              2. 8

                                I liked every part of the post except the rebase commentary. Everywhere else it does a great job of comparing fossil to git in terms of design motivation vis-à-vis team size. But for rebasing the criticism waxes philosophical without acknowledging different perspectives.

                                One commentator characterized Git as recording history according to the victors, whereas Fossil records history as it actually happened.

                                To me, a rebasing workflow is analogous to compare-and-swap operations, making development lock-free. I make a change, I try to check in the change, if that fails I back off and retry. The history of my retries is no more permanent than the history of transaction rollbacks in a SQL database.

                                I can see why that history might be useful for small teams, who observe the progress of each other’s branches. But right now at work I have 15 branches on deck, blocked on other teams or on hold while I work on something higher priority. My team doesn’t care about any of those branches until I send them for code review, and they don’t care about any versions of my change except the last one.

                                Depending on the time of day, dozens to hundreds of mainline merges are submitted per second. No one cares about the fully accurate history of every developer’s workflow, the deluge of finalized commits is plenty.

                                Now with all that said, I am 100% convinced by this post to use fossil for personal projects. I have notes I’d love to publish as blog posts, but no motivation to operate a web app, build a static site, or use some hosted solution. And I often do wish I could go back and see my thought process for personal code that I pick up again after months, sometimes years.

                            2. 9

                              This recent lobste.rs comment by the “game of trees” author illustrates some downsides, mostly related to scaling.

                            1. 4

                              Not everything needs to be done with machine learning. Many tools already do this well without it. What is the benefit of using machine learning instead of the more conventional approaches for this problem?

                              1. 3

                                I’m not convinced that this approach will lead to more efficient implementation of already-planned designs (not least because even fairly naive completion on large codebases is liable to grind the whole system to a halt, & any RNN is much heavier than even a very naive identifier prefix lookup). However, like Robin Sloan’s similar experiment with prose & the markov-model-backed systems for the same purpose used by Botnik, it’ll probably be interesting for introducing noise into the process of coding & thus slightly scrambling bias, producing weirder results when coding in an exploratory way. (This is worthwhile: almost all bugs are the result of tunnel vision on the part of devs, rather than actual conceptual difficulty.)

                                1. 1

                                  I don’t have context for what your first sentence is saying. Which approach are you referring to as “this” approach? Which “already-planned designs”?

                                  Although generating an initial sometimes takes a moment, the only time I’ve seen completion bring any workstation to a “grinding halt”, it was a pretty inefficient implementation. Even then, it wasn’t that bad.

                                  I don’t think that’s the kind of tunnel vision that causes bugs either, though…

                                  1. 1

                                    I don’t have context for what your first sentence is saying. Which approach are you referring to as “this” approach? Which “already-planned designs”?

                                    By ‘this approach’ I mean putting neural net generated nonsense code into autosuggest. If you have an existing large codebase and you want to make straightforward known modifications to it, adding noise is not useful – but if you’re writing something weird from scratch & you don’t have any particular direction in mind, adding noise can help break you out of mental ruts.

                                    Although generating an initial sometimes takes a moment, the only time I’ve seen completion bring any workstation to a “grinding halt”, it was a pretty inefficient implementation. Even then, it wasn’t that bad.

                                    Completion in IDEs tends to cause my workstations to freeze for minutes per completion, not even redrawing window contents. Now, I tend to get cheap machines & work them hard, but this is a problem I’ve seen persistently for more than a decade on a whole host of machines with varying degrees of pep.

                                    1. 1

                                      IntelliJ?

                                      1. 1

                                        IntelliJ, Eclipse, and NetBeans (among others). It’s a persistent problem across IDEs.

                                        Vim CTAGS plugins don’t do this, but they’re also of limited utility.

                                        1. 1

                                          I don’t usually have many problems w/ YouCompleteMe / Python+Jedi on Vim either. Tern is pretty slow :(

                                2. 2

                                  I’ve been using TabNine for a little while and I find it better than conventional approaches because it tends to suggest longer snippets that are correct.

                                  1. 1

                                    Whilst many tools do this well already, many others do not, particularly for dynamic languages (I’m unaware of a reader-macro-aware autocomplete in the lisp ecosystem, for instance).

                                    1. 2

                                      Can’t one use ctags or similar for most languages? Emacs tags is supposed to handle lisps:

                                      https://www.emacswiki.org/emacs/TagsFile

                                      Caveat, I was researching this this morning and couldn’t find any good docs on how to do this with Perl.

                                      1. 3

                                        CTags isn’t type-aware or context-aware at all AFAIK; it’ll suggest everything that matches the current text. That’s the bare minimum.

                                        1. 2

                                          ctags isn’t great since it requires rebuilding large indexes in medium or large projects, though. I think that usability could be improved with machine learning if that’s the only option, but still not convinced that there isn’t a more reasonable approach.

                                    1. 2
                                      • Moving
                                      • Disc golf (my latest addiction)
                                      • DnD
                                      1. 6

                                        I think it’s too soon to be picking a language to replace C. Sure it could do with replacing, but the field is advancing incredibly quickly at the moment: With time, my money would be on Zig as the generally preferred successor, over Rust.

                                        1. 6

                                          I’d prefer something now instead of waiting another five years. I’m perfectly happy with something good. instead of something perfect. There are infrastructure adoption effects to think about.

                                          (I would have preferred a C replacement in the early 00s, but the technology just wasn’t there yet.)

                                          1. 5

                                            The problem is that the would-be alternatives are constantly changing making adoption potentially more costly, where as C is largely unchanged since C99.

                                            1. 4

                                              The technology was there back then, but nobody bothered to make a production quality tool out of it. Which just reinforces your point about choosing something now to take this out of academia.

                                              I’m not that hot about rust myself (c++ level complexity in places, and the sigil soup doesn’t help), but the cambrian explosion in tools recently only means that people will get used to using different tools in the same project.

                                              1. 4

                                                Ada was in production at the time.

                                                1. 1

                                                  But not with a great open source story, unfortunately.

                                                  1. 1

                                                    That’s true. Many were paying for IDE’s and compilers, though. So, it was there at least for them.

                                                2. 1

                                                  I’m sorry if this is an ignorant question, but what is sigil soup?

                                                  1. 2

                                                    It’s not an ignorant question :-)

                                                    Sigils: “magic” symbols.

                                                    Sigil soup: lots of sigils, for example (randomly picked from somewhere on the web):

                                                    struct Sub<'a> {
                                                        name: &'a str
                                                    }
                                                    

                                                    There’s lots of stuff going on in that short snippet that is signified by such “magic symbols” (&? ‘? &’?). Contrast that to Ada whose most curious syntactical feature is probably the Type’Attribute syntax while everything else is spelled out in rather verbose and easy to follow language. (although the Ada 2012 expression functions aren’t really helping readability either, in my opinion)

                                                    1. 1

                                                      What’s “magic” here? Verbose? Yes. Magic? No. It would be entirely possible to allow this as

                                                      struct Sub {
                                                          name: &str
                                                      }
                                                      

                                                      (and indeed, in some function signatures, the 'a can be elided)

                                                      But that would lead to the introduction of an implicit generic parameter (anonymous lifetime), making diagnostics quite a bit harder. The current situation is clear: Sub has a lifetime that is bound to the lifetime of the reference in “name”.

                                                      Indeed, the change was discussed, but we decided to keep it clear when a structure is one where the borrowing rules apply. In the current version, all you need to look at is the structure generic parameters, otherwise, you’d have to look at every parameter.

                                                      Considering that structs with private fields are notated as:

                                                      struct Sub<'a> {
                                                        // fields hidden
                                                      }
                                                      

                                                      In the docs, this also allows for better visibility there.

                                              2. 8

                                                With time, my money would be on Zig as the generally preferred successor, over Rust.

                                                But Zig does nothing about memory safety, so I don’t see it as a step up the same way I do Rust.

                                                1. 4

                                                  D has already claimed the throne.

                                                  1. 6

                                                    I’m waiting for Pony to get a Better Horse mode.

                                                    1. 3

                                                      Is that a giraffe, or an OCaml?

                                                      1. 2

                                                        A Giraffe, OCaml is better Perl.

                                                    2. 1

                                                      Does anyone want to use it, though?

                                                      1. 11

                                                        To butcher the Bjarne quote, there are only two kinds of languages: the ones nobody wants to use, and the ones nobody wants to use.

                                                        1. 1

                                                          Nice!

                                                    3. 1

                                                      Interesting re your statement. How come? Why Zig? Why not ATSlang?

                                                      1. 3

                                                        Zig was just the first language that came to mind as a C successor. Simplicity is somewhat key. ATS would be a completely different direction and equally as valid.

                                                    1. 7

                                                      I’m generally in favor of plain text formats, so I think this is a step in the right direction, but I think there are some ways that the marketing can be improved. I’ll break them down by section.

                                                      Simple

                                                      Writing pro & contra lists in Argdown is as simple as composing a Twitter message. You don’t have to learn anything new, except a few simple rules that will feel very natural.

                                                      Having read the syntax guide, I don’t find this to be true. It’s nowhere near as simple as composing a tweet. You can apparently embed YAML/JSON into these documents, though having only read the syntax guide I’m not sure what the practical benefit of that is.

                                                      Nest pro-contra-lists
                                                      [Argdown is the best]: Argdown is the best 
                                                      tool for analyzing complex argumentation 
                                                      and creating argument maps.
                                                        - <Editors easier>: Argument map editors 
                                                          are way easier to use. #pro-editor
                                                          + <WYSIWYG>: In argument map editors what 
                                                            you see during editing is what you get 
                                                            at the end: an argument map. #pro-editor
                                                        + <Pure Data>: With Argdown no user interface 
                                                          gets in your way. You can focus on writing 
                                                          without getting distracted.
                                                      

                                                      At first glance it’s not obvious to me whether a + or - should refer to the root statement ([Argdown is the best]), or to the parent. This appears to be something you just have to know. Granted, it’s more intuitive when you’re looking at the map, but the beauty of Markdown is that you can read it without it being rendered as HTML first.

                                                      Premise-conclusion-structures

                                                      Based on the tagline, “A simple syntax for complex argumentation”, I didn’t realize that this was built for logical arguments requiring premises, conclusions, etc, so when I read this example it made no sense to me. It wasn’t until I read the syntax guide that this actually clicked for me. I think a barebones syntax guide would be a good idea, something like:

                                                      <argument name>
                                                      
                                                      (1) A premise
                                                      (2) Another premise
                                                      ...
                                                      (n-1) The last premise, separated from the conclusion by dashes
                                                      ----
                                                      (n) The conclusion
                                                      
                                                      Syntax

                                                      The syntax guide is very in-depth. As mentioned above, I would actually prefer two different syntax guides, one that’s just a reference for the syntax (i.e. just syntax examples), and one that contains most of the content of the current syntax guide. I also think there are some unfortunate syntax decisions. In the example given in the “premise-conclusion-structures” section, you could easily mistake the -> in -> <Editors easier> for an arrow pointing to <Editors easier>, but it’s actually a negative relation whose counterpart is +>.

                                                      Anyway, that’s all I have time for at the moment. I hope this doesn’t come across as too critical. I actually think this tool is a step in the right direction for things like RFC discussions since debates can be checked in to source control, points can be added as pull requests, etc.

                                                      1. 25

                                                        This is a really weird list, with a couple things that feel like borderline errors to me.

                                                        When discussing Dato, the author writes:

                                                        So, when someone asks you what date is it today you have to open a calendar app. Seriously?

                                                        Uh, no? You just click on the clock, same as you would with Dato. (And that’s assuming you didn’t turn on showing the date by default, which is an option right in the Date and Time preferences, and has been since I think Mac OS 9.) Dato also gives you a full calendar in the dropdown, but that’s not what you asked. And since Dato is brand-new, you might instead/also want to look at Fantastical 2, which has been out for some time and has the same feature.

                                                        Should I really mention Flux? Because everyone should already have one installed.

                                                        Agreed—but as it happens, it’s built-in to macOS since at least 10.13, and in my head somewhere in 10.12. Maybe there’s a reason for installing Flux, but you didn’t specify it.

                                                        Spectacle is solid (I prefer Magnet, but that’s closed-source and not free), and the preview plugins are fine, but I’m not convinced they need their own blog posts at this point, nor that they “fit everyone.” Overall, this just felt like a weird listicle to me.

                                                        1. 3

                                                          Uh, no? You just click on the clock, same as you would with Dato.

                                                          Big fan of iStat Menus as a similar improvement over Dato.

                                                          https://i.imgur.com/1bwzIfo.png

                                                          1. 1

                                                            You just click on the clock,

                                                            Apple+space, type “terminal”, hit enter, type “ cal”, hit enter? :)

                                                            You give the sensible way of doing that but the stupid one is in my muscle memory too ;)

                                                            1. 10

                                                              It’s “Cmd” not “Apple” you heathen :)

                                                            2. 1

                                                              In this vein, I also found it mildly annoying that the first couple of items in the list weren’t linked to, and I had to search for them, even though the later ones were.

                                                            1. 1

                                                              I’ve been using TabNine for some time now (just package install it in Sublime text), it’s amazing what it autocompletes sometimes.

                                                              1. 1

                                                                Agreed. I’ve been using it since it was announced and it’s very nice.

                                                              1. 16

                                                                Absolutely nothing. I’ve taken most of the week off and it’s been glorious.

                                                                1. 4

                                                                  I’m gonna hook up my newly acquired Behringer X-Touch Mini MIDI controller to PulseAudio for per-application volume control (and maybe other things). I don’t really have a clue about MIDI yet, so that’s gonna be fun.

                                                                  1. 1

                                                                    Those are pretty versatile devices. Some people use them with Lightroom/Photoshop.

                                                                  1. 2

                                                                    I’m just getting into Ruby and I’ve been impatiently going through a bunch of beginner stuff so that I can learn the stuff I find more interesting, like this. Thanks! I’m going to look at some other articles on your blog. Do you have any recommendations for other “Ruby internals” kinda of posts?

                                                                    1. 6

                                                                      I usually try to post Ruby internals stuff on my blog, so I guess check there. Other than that, I recommend Ruby Under a Microscope: http://patshaughnessy.net/ruby-under-a-microscope

                                                                    1. 2

                                                                      PBT is for sure good at finding edge cases. I used it for some physics simulations and the number of times I shook my fist at the sky and angrily yelled “FLOATING POINT” is nonzero. Part of that was my own fault for not restricting the range of generated values though.

                                                                      1. 3

                                                                        That’s what I think is so interesting: It makes you think in properties and what input data exactly does your function accept because it’s good at generating data that’s like “wait I’d never want my function to get this!” which I think is already good value in itself :)

                                                                        1. 1

                                                                          Exactly! I think property based testing is a good teaching tool.

                                                                      1. 8

                                                                        I think you’ve overstated the freedom that unsafe provides in your first footnote. It really just lets you dereference certain pointers, but all of the type checking still works. I think it’s important to dispel this myth since there’s a misconception that “you can do anything in unsafe Rust, so there’s no benefit over C/C++”.

                                                                        From the book:

                                                                        Those superpowers include the ability to:

                                                                        • Dereference a raw pointer
                                                                        • Call an unsafe function or method
                                                                        • Access or modify a mutable static variable
                                                                        • Implement an unsafe trait

                                                                        It’s important to understand that unsafe doesn’t turn off the borrow checker or disable any other of Rust’s safety checks: if you use a reference in unsafe code, it will still be checked.

                                                                        1. 4

                                                                          Yeah, it’s important to understand that unsafe really just means you can deref raw pointers. With that power (combined with pointer casts) you can circumvent any safety check, but those checks are not disabled.

                                                                          Unsafe Rust is still a safer and more explicit language than C/C++, but just as powerful. The cost is increased verbosity.

                                                                        1. 1

                                                                          This isn’t really my field so I can’t comment on the content, but man, that README is thorough.

                                                                          1. 3

                                                                            I have a friend visiting from Chicago on Saturday. On Sunday I’ll probably start working on my proposal for a talk at Rust Belt Rust. This is my first talk proposal, so any advice would be greatly appreciated!

                                                                            1. 3

                                                                              I’m a conf organizer. I’ve organized confs in the past in Pittsburgh with some of the RBR crew. They’re awesome and RBR is great. I’ll hopefully see you there.

                                                                              I know I like abstracts that are creative – clever prose – while being adequately technical or persuasive that this is how I should spend my time. Identify the problem clearly, diagnose it separately, and explain how you are going to advocate for the remedy in your presentation while threading in your authority on the matter. Another thing I’ve found that can work is to read the abstracts of past years’ presentations to get a feel for the style of writing that was accepted.

                                                                            1. 1

                                                                              This convinced me to give RST another look. I think I see things slightly differently from the author though. In my mind markdown handily beats RST if you want to read the documentation inline because of its simplicity, but RST appears to be better suited to producing documentation pages due to its semantic elements and extensibility. That’s not to say that you can’t produce good HTML documentation from markdown (just look at the automatically generated API docs for any Rust crate on docs.rs, here’s one selected at random).

                                                                              I think another thing that turned me off to RST initially was trying to get Read the Docs and Sphinx set up for the first time at the same time that I was learning RST, so it was hard to tell whether the friction was coming from RST or the rest of the documentation stack.