1. 2

    I just learned about Orca from this snippet of the video and it is so cool — thanks for sharing!

    1. 7

      A while ago I hacked the ability to read files and write files into jq 🙈 Here’s some of the resulting code that writes to a bunch of files:

      poems
        | reverse
        | add_numbers
        | map(compile_single)
        | [ write("index.html"; .[-1].content), map(write("poem_\(.number).html"; .content)) ]
        | flatten
      
      1. 7

        Suggest only the plt tag, since tags are filtered via intersection and not union. :)

        1. 12

          Tags should be partially ordered in a lattice, with “sub-tags” being substitutable for any “super-tags” higher up in the lattice.

          1. 4

            If we’re brainstorming, I’d suggest not ordering them initially and instead allowing people to use a blang to query them.

            1. 2

              I see what you did there.

          1. 8

            See also Irmin

            1. 2

              There’s also noms which has been around longer.

              1. 2

                Dolt uses noms internally, but it doesn’t seem like noms is a ready end-user product. Dolt is a UI layer and workflow for end-users on top of noms.

            1. 2

              Does anyone know what IR this backend takes as input? Bucklescript has had difficulty staying up-to-date with the latest ocaml version I think in part because it consumes the initially parsed AST.

              1. 2

                Answering my own question… It looks like it takes a Typed Tree as input, so quite high level still, just after type checking.

              1. 10
                • Mindfulness Meditation
                • Melatonin
                • Touch typing (not a small change, also “impact” here is questionable, but I feel good about it)
                1. 4

                  Melatonin

                  Just curious how you are incorporating this in your life. I use it occasionally (small doses, typically for no more than a couple of nights in a row) to “reset” my sleep cycle (I generally drift to later and later hours). I’m always curious how other people are using it.

                  1. 1

                    Personally I don’t know through what mechanism it would “reset” (???) your sleep cycle as it appears to solely improve quality of sleep… I take 300mcg every night for lack of a reason not to.

                    1. 3

                      I’m pretty sure the mechanism it resets is your Circadian rhythm. That is, the daily fluctuation of natural melatonin in your body. Fun fact, everyone’s circadian rhythm takes a drop in the early afternoon for an hour or so, probably due to humans previously having a biphasic sleep schedule.

                      1. 2

                        It makes me tired a little while after I take it, and helps me fall asleep earlier.

                  1. 4

                    You can’t separate software into “Harmful” and “Not”. Things are nuanced, the world is complicated and trying to make arbitrary categories is the truly harmful thing going on.

                    1. 2

                      But this worked out so well in politics! 🙃

                    1. 9

                      Really cool, thanks for sharing! Some unsolicited css feedback: there’s no margin on the left or right so it’s a bit hard to read on my phone..

                      1. 2

                        I had to take out my phone to figure out what the issue is so to spare others the effort:

                        No margin means on screens with a bevel some of the letters fall of the edge. How did we manage to make our screens so stupid? Are websites now supposed to detect the screen size including what the shape is to make sure the content displays properly?

                        1. 3

                          No margin means on screens with a bevel some of the letters fall of the edge. How did we manage to make our screens so stupid? Are websites now supposed to detect the screen size including what the shape is to make sure the content displays properly?

                          Text is always more readable with margins. Best example to me: Books also have margins, and you’d probably complain if there wasn’t.

                          1. 1

                            Haha; thanks. I had it set to margin auto, which for some reason made me think it would just do the right thing–silly assumption to make, I know. Pushed out a fix.

                          1. 5

                            It makes sense that Rust has better libraries and IDE support, it has more funding and a larger community.

                            in OCaml you have opam, esy, dune, and OCaml itself all doing part of the job. They sorta kinda mostly work well together, until they don’t. And as you wire them together, you really need to understand what each tool does, where it starts and stops, and how they integrate.

                            I think this is only true if you’re trying to use Reason, now ReScript?. If you stay firmly within OCaml-land you only need to know two tools: Opam and Dune. Opam is a package manager and Dune is a build system. It’s nice that Cargo can combine these — and Cargo is excellent — but so is Dune. Dune has been introduced widely in the last two years and IMHO has totally transformed the OCaml build story. It’s true that Reason has introduced a lot of segmentation, but if you stay away from npm things are generally good.

                            Re macros: I totally agree that PPX’s fall short sometimes and a hygenic macro system for OCaml would be awesome. That said, the blog post supposedly showing trouble in the PPX ecosystem is from four years ago and I believe the proposed solution has been adopted. Overall the PPX infrastructure has improved a ton in the last four years.

                            I’ll also say OCaml has a great module system with “functors” (function-like things that take modules as arguments and produce new modules) that subsumes much of the use-case for macros.

                            Re aesthetics:

                            OCaml is so ugly that the community came up with a whole other syntax for it

                            Well, the JavaScript community came up with a JavaScript syntax for it. Of course beauty is in the eye of the beholder, but I happen to prefer the OCaml syntax.

                            1. 8

                              That’s one point I disagree with. Merlin (in OCaml) is just amazing, and much better than rust-analyzer. It’s fast, it’s very, very robust to bad syntax, and I only have good things to say about it. RA is not too bad but it’s not as mature yet.

                              The ppx story keeps unfolding with, imho, still no viable solution in sight (soon there’ll be a ppxlib 2.0 or something, that doesn’t improve ppx stability, and we still don’t have a stable AST to write these parsers again.) I would love macros and deriving in OCaml, but I don’t see any way of getting them in a stable, future-proof way.

                              1. 3

                                I would love macros and deriving in OCaml, but I don’t see any way of getting them in a stable, future-proof way.

                                Both Haskell and Rust wisely have deriving so OCamls stubborn insistence to defer it to a combination of ppx_deriving/type_conv and support from the build system is just death by a thousand cuts.

                                1. 2

                                  I couldn’t agree more. Sadly it’s difficult to contribute this kind of functionality and get it accepted.

                              2. 4

                                This is exactly what I was thinking about reading his criticisms of OCaml. Sure, the language has some warts (I think mostly due to adding features over the years) but I find the core syntax very nice. Reason to me is incredibly ugly. Along similar lines, OCaml + Merlin + Emacs is one of the best toolchains for writing code that I’ve ever used.

                                The authors comments about bad error messages are valid, they could definitely use some work. But I think a lot of the complaints about dealing with the typechecker is something you get comfortable over time, or if you sit down and read up on the type inference/checking algorithm.

                                1. 1

                                  I think this is only true if you’re trying to use Reason, now ReScript?

                                  No, you can also use Esy as a replacement for opam on pure OCaml projects, without having to use Reason. ReScript (formerly BuckleScript) is a separate toolchain that leverages npm and a different build tool (ninja).

                                  To the wider point, though: I was going to take issue with the way Paul mentioned confusion with so many build tools, but I’m forced to admit that’s partly on the OCaml community. If the community-recommended tools don’t solve real developer needs like cross-project dependency sandboxing and build caching, then eventually alternative tools (like Esy and Nix) will enter the picture and compete for market share.

                                1. 3

                                  I love this post! If it’s really true that people aren’t going to be punished for making mistakes, why should they be afraid to own up to it? No, mistakes are how we learn and it’s important to design a culture that understands that.

                                  1. 10

                                    If it’s really true that people aren’t going to be punished for making mistakes, why should they be afraid to own up to it?

                                    • because it’s hard to be sure in advance that they won’t be
                                    • because official punishments aren’t the only disincentives

                                    People who are fully secure and self-confident can more easily admit blame. It’s a position of privilege. Not everyone can do this as easily, even without fear of official punishment.

                                    1. 2

                                      Yeah I think it’s true this requires a large amount of trust between relatively secure and self confident employees. My thought is that this kind of system encourages trust and confidence. Lots of blame to go around without shame is better for an insecure employee than a system that has anonymous blame and implicit shame.

                                      1. 4

                                        Trust and confidence is a lot to ask. You also have to take emotions into account. People may feel guilty and/or respond defensively if you blame them, even if you promise there are no consequences.

                                        1. 3

                                          Yes, and people mature at different rates and are in different places in their life and career at any given time.

                                          The me of today will totally own up to even the most disastrous mistake in a meeting, because what’s the point in not doing so? But the me of 10 years ago, if I’m honest with myself, would have been afraid. Afraid of the loss of face before my peers and afraid of the career repercussions that might ensue.

                                    2. 2

                                      Citing a lack of courage on the part of individual contributors is, in my opinion, missing the point.

                                      I can take ownership of a mistake in a post mortem, but that’s an almost inconsequential part of arriving at the answer “What can we do to keep this from happening in the future that isn’t good intentions?”

                                      1. 2

                                        Hmm I don’t at all the problem is a lack of courage: I think the problem is with systems and cultures that require courage, i.e. cause fear. And yeah totally agree with you about the overall point!

                                    1. 2

                                      This is awesome! Is it using any exciting PL theory?

                                      1. 29

                                        After dropping out twice, and just barely meeting the requirements… I’m graduating college!!

                                        1. 3

                                          Congratulations!

                                          1. 1

                                            Thanks!

                                          2. 1

                                            Congratulations!

                                            1. 1

                                              Thanks!

                                          1. 6

                                            I use Caddy to serve static files. I couldn’t be happier with it: totally takes care of https which was a pain even with nginx and let’s encrypt.

                                            Digital ocean droplet + namecheap = best money I’ve ever spent.

                                            Edit: Oh yeah and rsync for actually moving the files. (Way faster than scp since it does diffing)

                                            1. 2

                                              Is anybody else a little annoyed by all these people referring to Python and Ruby as scripting languages ಠ_ಠ

                                              1. 11

                                                no, ‘scripting language’ has a well-understood meaning and perl, python and ruby certainly qualify

                                                1. 1

                                                  “Scripting language” isn’t a very good distinction. People typically mean that the main implementation of it is an interpreter instead of a compiler, but defining a language by its implementation detail is a bit of questionable choice. Just because the implementation changes but the syntax and semantics doesn’t shouldn’t fundamentally change what a language is.

                                                  “Scripting language” used to mean a programming language that was part of a larger system, a smaller thing for automating the execution of tasks, something that ran only within a specialised environment like an IRC program or a web browser, such as e.g. javascript or mIRCscript. That usage is almost dead now.

                                                  And sometimes people are just ambiguous about which one of these two they mean.

                                                  1. 2

                                                    After having considered this a bit, I’d defined “scripting language” as

                                                    • interpreted - i.e. no compilation stage before executing the source
                                                    • has good “hooks” into the computer’s file system and stuff like the Internet

                                                    So that would cover Perl, Python and Ruby, even if Perl explicitely grew out of the smaller, more specialized text processing tools like sed and awk, while Python approached the domain after having been designed as an educational tool.

                                                    1. 2

                                                      i’d define it as a grab-bag of features including:

                                                      • dynamically typed
                                                      • effectively interpreted (i.e. if it’s compiled under the hood that should be transparent to the user)
                                                      • good support for strings, lists and hashmaps, almost always including syntactic support and data literals
                                                      • having, as you note, good out-of-the-box support for filesystem operations and talking to the world
                                                      • the possibility to wrap and use C libraries
                                                      • eval
                                                      1. 1

                                                        Except for dynamic typing, all of this sounds like D, although you can sort of get something like dynamic typing in D via compile-time type inference.

                                                        Hell, if you use ghci, it also kind of sounds like Haskell. Or due to REPLs, it sounds like most or all lisps.

                                                        I still don’t think “scripting language” is a clear or useful distinction.

                                                      2. 1

                                                        I think I’d be able to qualify D as a scripting language, since it has curl in its stdlib (and obviously, filesystem), and you can use rdmd as a shebang, therefore getting rid of an obvious compilation step.

                                                        1. 1

                                                          That’s interesting to know!

                                                          1. 3

                                                            But note that rdmd is still a compiler. It just happens to be a “dumb” compiler that never frees memory during the compilation step, hence does no memory management and is therefore speedy enough to match most interpreters’ warmup time.

                                                            On the other side, most interpreters nowadays also do at least a little compilation. Python’s pyc files are one of the more obvious examples.

                                                            I’ve also heard people who have only used Python refer to C++ code as “C++ scripts”. The “scripting language” distinction really is nebulous.

                                                  2. 1

                                                    But you think it’s ok to refer to Perl as one? Why?

                                                    The term is from the XCode beta release notes.

                                                    1. 0

                                                      I omitted Perl because I’m not as familiar with its internals. Both Python and Ruby compile to bytecode, and Ruby recently added a JIT. So neither language is interpreted.

                                                      1. 4

                                                        Taken from wikidepia:

                                                        The term “scripting language” is also used loosely to refer to dynamic high-level general-purpose languages, such as Perl, PowerShell, Python, and Tcl.

                                                        The term “scripting language” is a characterization of a language itself: being dynamic, high-level, and well-suited to small programs.

                                                        The term “interpreted” is a characterization of a particular implementation: is their an interpreter involved in running it? So a language can be both a scripting language and interpreted.

                                                        That said, both Python and Ruby are in my mind interpreted. They compile to a high level bytecode, which is subsequently interpreted. There are also interpreters for C, C++, and other non-scripting languages. Does that make them interpreted? Kind of, yeah, but I’d argue you wouldn’t apply the term “interpreted” to a language itself unless its one of the most common ways of running it.

                                                        1. 1

                                                          Script language vs compiled language. The unit of distribution for all three is still raw source code, or script.

                                                          1. 0

                                                            go get downloads source code and compiles locally. But Go is a compiled language.

                                                          2. 1

                                                            Thanks for the clarification!

                                                            I’ve not really thought about whether a language compiles to bytecode as a characteristic of being a “scripting language”.

                                                            Also, does Perl 5 have a bytecode stage? It depends.

                                                      1. 2

                                                        I think Pony a bit more cumbersome to use than many other languages, at least for a simple “Hello, World!” example in SDL2, but it feels surprisingly solid. https://github.com/xyproto/sdl2-examples/blob/master/pony/main.pony

                                                        1. 4

                                                          I will say, this is pony program that uses SDL by directly linking against external c functions! Most SDL hello world examples you’ll see in other languages use a library wrapping the external calls. I think it speaks volumes that in fact the Pony source is both readable and short, especially considering that Pony is a managed language, with support for actors. (In comparison, the C FFI in both Go and Erlang tends to be much harder)

                                                          1. 1

                                                            It uses SDL2 directly only because no SDL2 library were available for Pony at the time (I’m not sure if there is one available now).

                                                          2. 3

                                                            I just did some exercises in Pony and Rust and I definitely found Pony the more elegant and easy language; but with much worse library support

                                                            1. 4

                                                              We definitely have a considerably smaller community than Rust at this point. In part, I think that is:

                                                              1- Rust has corporate backing and people paid to work on it 2- It’s post 1.0 and most people won’t consider using pre-1.0 stuff

                                                              More people contributing to the Pony ecosystem (including libraries) is something we could really use and would happily support as best we can. We’ve had a lot of excited people start to pitch in. Most haven’t contributed to open source projects before and I think for many, the shine rather quickly rubs off. I don’t blame them, maintaining open source software is… well, it’s an “interesting hobby”.

                                                              1. 1

                                                                Absolutely agree. Even contributing to a few projects, I can see that I wouldn’t want to be a maintainer without being paid or “it” being my big idea.

                                                                I don’t do much system level programming, so I don’t need either, really, so I’m very unlikely to step up.

                                                                A bridge to rust might help though?

                                                                1. 5

                                                                  A bridge to rust might help though?

                                                                  Pony can directly call into C (and therefore into Rust) and generate C headers, which Rust can consume to generate interfaces. The biggest problem for “just” using both from both sides is language semantics outside of the function call interface that the C ABI provides. Also, Rusts ABI is currently private.

                                                                  I don’t do much system level programming, so I don’t need either, really, so I’m very unlikely to step up.

                                                                  Both Rust and Pony provide safety guarantees and features way past “safe systems programming” and Rust is definitely used as a “wicked fast Python” in some circles. It’s an interesting space to work in, currently :).

                                                            2. 2

                                                              I really like the syntax, and the underlying ideas. I recently speed read through the tutorial, and the most daunting aspect of it (for me) was the reference capabilities part. I hope I can find a side project to play with it some more.

                                                              Plus the language is named pony, which makes it instantly great. ;)

                                                            1. 0

                                                              Through interactivity, a well-designed explorable immediately invites the reader to play with the initial arrangement of elements, and thereby to discover potential problems on their own.

                                                              I am deeply, fundamentally, almost radically disinterested in interactive explorable widgets ala the example given. Visual examples have visual limitations: when you rely on your visual instincts to solve e.g., 8-dimensional math, you’re Doing It Wrong. Working through the essences (i.e., the actual symbolic & textual aspects of math), gives the requisite information. Occasionally a quick graph is useful to assist in intuition building in the 2-dimensional case….

                                                              1. 9

                                                                Np if that’s how you tend to learn, but I do learn math visually (and I have a math degree) and I don’t think I’m “Doing it Wrong” when I use use lower dimensional projections of higher dimensional spaces to better understand what’s happening.

                                                                1. 5

                                                                  I think you may have missed the point. It’s not about “visual instincts”, it’s about actively engaging the brain, rather than have it passively take in information.

                                                                  This is pretty much the only way to really learn new skills, which is hardly a new insight, and is why you should take notes during lectures etc. I can read all about carpentry or playing the guitar, but none of that makes me a carpenter or guitarist.

                                                                  Unfortunately, many classrooms and online tutorials are in the “here is information, absorb it!” style. There is certainly a need for reference manuals and the like, but if you want to teach people novel insights then this is usually not the best way.

                                                                  1. 2

                                                                    The author never stated visual anywhere in that paragraph. I think you may have deeply misunderstood the author. For example it’s nearly trivial to imagine an interactive math exercise that is non-visual.

                                                                  1. 3

                                                                    You can implement exceptions, and even while loops, using algebraic effects! The koka paper does a good job explaining these.

                                                                    1. 2

                                                                      Love the “Press F2 to edit the current entry in the editor of your choice”. Tools working together :)

                                                                      1. 12

                                                                        The light-grey on light-grey is too hard for me to read, I had to stop :/

                                                                        1. 3

                                                                          I removed the opacity for u element in my web inspector. Note that a value of 0.5 (instead of 0.25) is fairly reasonable.

                                                                          I also have problems with this text disappearing sometimes: https://i.imgur.com/RPOQYdX.png – I added that red line myself to indicate missing text. Also note the &em; It seems to happen when I select/hover/click text? It’s pretty intermittent. Using Firefox.

                                                                          Arguably, such frequent use of asides is not a great writing style by the way.

                                                                          FYI @zge

                                                                          edit: I think you’re missing a “not” before “because” in this sentence here?

                                                                          But people have not tried to go “beyond” Unix, because they are evil or ignorant, but because the

                                                                          1. 1

                                                                            I’m sort of conflicted about raising the value to 0.5 (currently it’s at 0.3333, and 0.6666 when hovered over) since the <u> tags are unarticulated side notes, comments or background voices – I kind of abuse it too much, I admit that.

                                                                            All I can say about the disappearing text is that it works on my machine, even though I also just use Firefox… Maybe I should try opening it in chromium or some different engine.

                                                                            Also thanks for the hypo notice. Most of it was written just before midnight, so I didn’t get around to properly go over it again. I will be reformulating some of the sections, particularly those with many <u> tags, when I have the time, so hopefully I will also be able to make it a bit easier to read too.

                                                                            1. 3

                                                                              since the tags are unarticulated side notes, comments or background voices – I kind of abuse it too much, I admit that.

                                                                              In my personal opinion, side notes should rarely be used. It breaks the flow of the text, and much of the time it’s a “hack” for writing down a proper paragraph that flows well. In other cases, it’s just an aside which isn’t too relevant to the topic at hand, in which case it should probably just be omitted; more words does not equal a better article. I have similar feelings about text in parenthesis by the way, which some people over-use (including myself ☺), especially when it’s used as a hack to clarify a badly written sentence, instead of clarifying the sentence.

                                                                              At any rate, in your case because the asides are so often interspersed in regular paragraphs with a different colour, I find it breaks the regular “flow” of the paragraph, and everything comes across as “disjointed”.

                                                                              Just my 2¢. Writing is of course very subjective, so reasonable people could disagree.

                                                                              All I can say about the disappearing text is that it works on my machine, even though I also just use Firefox… Maybe I should try opening it in chromium or some different engine.

                                                                              I mucked about some more, and can reproduce it fairly reliable by selecting text with double/triple click, but only if there is a line break between [ and ] (in which case all text before the line break disappears). I tried looking at the JS, but it’s all minified.

                                                                          2. 2

                                                                            if you’re reading on Firefox then you can activate reader mode which makes the reading experience quite pleasant. It looks like this. You can activate it by clicking the little document icon that is present on the address bar after you load a page which has a recognizable content/article part

                                                                            1. 2

                                                                              Oh, I’m sorry about that. I tried increasing the opacity, since I didn’t realize that that was a problem.

                                                                            1. 3

                                                                              One of the benefits of an open struct is that you can assign to values many layers deep, which I don’t think this proposes to do. But still looks great!

                                                                              1. 2

                                                                                to be honest I’m mainly using those as read-only structures so I didn’t try the assigns too much but it works fine

                                                                                user = SimpleHash[name: "a"]
                                                                                user[:name] = { prefix: "a", suffix: "b" }
                                                                                user.name.prefix # => "a"
                                                                                

                                                                                I could have direct setters like name= but I prefer it without the setters for now