Better HN
topnewbestaskshowjobs
Log inSign up

codesections

2,587 karma · joined Jul 5, 2018 (8y ago) · 324 submissions

Free software developer working primarily in Raku and Rust. Former attorney at Davis Polk & Wardwell LLP; current member of the Raku Steering Council and The Perl & Raku Foundation board. My professional interests include web development, open source, and making things as simple as possible.

  website:     www.codesections.com
  public key:  codesections.com/pubkey.txt
  email:       daniel@codesections.com
  mastodon:    fosstodon.org/@codesections
  github:      github.com/codesections
  discord:     discord.com/users/555470786677440524
I am also the 'codesections' user on: gitlab, github, stack overflow, libera.chat, reddit, tildes, lobste.rs, and probably other sites
Submissions

comment 7y ago · link · parent

As cool as this is, APL has improved a lot in the 34 years since that video was made. Most notably, these days, APL has `direct functions`, which enable a degree of concision and tacit-programming support unmatched in any other programming language (yes, including Haskell).

As a minor taste of the power of direct fns, here's a naive implementation of the Fibonacci sequence with one: `fib←{1≥⍵:⍵⋄(∇⍵-1)+∇⍵-2}`

comment 7y ago · link · parent

Like others, I'm also left wondering what methods the US is really using. Obviously, it's too soon to disclose all the details. But compare this (where the few strategies disclosed involve methods like "guess the answer to a security question") to something where we do know the details.

For example, the Stuxnet worm used multiple OS zero days and involved hacking or otherwise exfiltrating signing keys from multiple other third parties (https://www.quora.com/What-is-the-most-sophisticated-piece-o...). I bet a lot of that sort of thing is going on these days too, and we just don't know about it.

comment 7y ago · link · parent

> I hate to be That Guy, but I found the massive overuse of exclamation points to be very distracting.… [Exclamation points] should not be a default punctuation choice.

I think that's overstating it quite a bit. There's one exclamation point in the first four paragraphs. The frequency picks up a bit after that, but I'd hardly call them the default punctuation choice.

274.

Why Rust and Not Go: A Rebuttal(blog.juliobiason.net ↗)

31 points · by codesections · 7y ago · 17 comments

275.

Free as in Sausage Making: Why Debian Alows Use of Non-Free Software(hartmans.livejournal.com ↗)

2 points · by codesections · 7y ago · discuss

276.

Performance Matters: Profiling and Optimizing Concurrent Code(m.youtube.com ↗)

4 points · by codesections · 7y ago · discuss

comment 7y ago · link · parent

> How often do you see .NET repos on Github?

Well, ok, if we're going by GitHub repos, C has 117k repos with at least one star and Rust has 11k. That doesn't seem to be that different than then number of programmers as a whole.

(FWIW, there are 104k starred C# repos and 2k F# repos, which doesn't seem all that out-of-line with the popularity of those languages as a whole.)

comment 7y ago · link · parent

Cool project. Last time I looked, the image selection was a bit lacking—in fact, I blogged about choosing between Lorem Picsum and several alternatives a couple months ago: https://www.codesections.com/blog/guide-to-placeholder-image...

I eventually settled on Pixabay, but if Lorem Picsum has added more images recently, I might need to give it another look.

comment 7y ago · link · parent

> rust rewrite means you are more likely to invite contributions from a larger community

I'd be really interested to know why you think that's the case. Somewhere around 3% of programmers know Rust, while over 20% know C. https://insights.stackoverflow.com/survey/2019#technology

Naively, I would have thought that a C project would invite contributions from a much larger community. Sure (as I've personally experienced!) the Rust community is friendly and helpful, but we're still small, so I'm curious why you think a rewrite would get more contributions.

280.

Cleaning your GitHub profile with a simple Bash script(codesections.com ↗)

3 points · by codesections · 7y ago · discuss

281.

Using Vim to take time-stamped notes(codesections.com ↗)

3 points · by codesections · 7y ago · discuss

comment 7y ago · link · parent

I'd be interested to see what you have in mind/hear why you think that would be a big improvement on the way I had it set up. (I'll admit to not putting a ton of thought into the JS version, though)

comment 7y ago · link · parent

Yeah, I 100% agree that they're not good examples of the sort of problem you'll need to solve in a given language.

That said, I still like them—at least enough to write this one, anyway!—because they're small, self-contained, and dive deep enough into the language internals that you can (start to) see the differences in the "world view" of the language. (Compare them to something like Advent of Code challenges—those are also small, self-contained, and unrealistic to real programming, which makes them pretty similar. But many of the early ones don't get deep enough into the language to really get a feel for how the language pushes you to think/approach problems)

comment 7y ago · link · parent

We needed to use a raw pointer there because of Rust's ownership system. Here's the short version: Rust wants everything to have exactly one owner and enforces that by disallowing multiple mutable references to the same data (or, for that matter, multiple references to the data if even one of the references is mutable).

But that doesn't play too well with linked lists. You need to have a reference to the tail node from the previous node and have a reference from the list itself. And you need to be able to mutate the tail node, so you can't just do that with immutable references.

Now, rust does have some safe ways to solve that type of problem (Arc and RefCells are two). But it turns out that the best way to solve it here is to make the jump to `unsafe` code since we can guarantee the invariants that keep it from being unsafe in practice.

285.

Comparing Rust and JavaScript Ergonomics with a Simple Linked List(codesections.com ↗)

59 points · by codesections · 7y ago · 57 comments

286.

Twitter Is Dumb Software(a.wholelottanothing.org ↗)

2 points · by codesections · 8y ago · discuss

287.

How to Send Keybase Chats Using Vim(codesections.com ↗)

2 points · by codesections · 8y ago · discuss

comment 8y ago · link · parent

This might not be quite what you described, but masto.host is a hosting provider that specializes in providing managed hosting for Mastodon instances (and they charge way less than $100/month!)

comment 8y ago · link · parent

> "mastodon is a technology, not a product" - it doesn't have a business model, a way to scale and grow like a business.

I'd agree with 2/3rds of that. Mastodon is a technology, not a product, and it doesn't have a business model.

But that does not mean that it can't scale and grow—it means that it doesn't have any way to turn scaling and growing into money. email is a technology; javascript is a technology, the microchip is a technology. All of those technologies have seen tremendous growth, and none of them have made money (though products using them certainly have).

I suspect that, if Mastodon grows, it will be precisely because it is a technology, not a product. Making money isn't the only way to grow.

comment 8y ago · link · parent

> I think "Right problem, wrong solution". The reason people mock bad ideas on Twitter is probably because Twitter has a character limit.

Well, I didn't mention it in the post, but Mastodon also ups the character limit to 500 characters (really, even more, because links always count as 24 chars, regardless of actual length). So if you're right that that's part of the problem, then it's also partly addressed.

But I think the bigger issue is that retweets encourage you to try to refute/mock/engage with bad ideas in a tweet. With Mastodon/boots, users tend to just ignore bad ideas (or, if they're really bad, respond at length in a blog/medium post)

You're right that it could become too much of an echo chamber, but it will at least avoid becoming a rage-generator.

comment 8y ago · link · parent

Yeah, I agree that this is the biggest usability hurdle, and its actively being worked on.

That said, there are plenty of good general-purpose instances and it's not that different from picking an email host. Sure, you can spend hours figuring out which email host to use, but most people go with a name they've heard before (e.g., Gmail) and don't need to think much about it at all. I could see Mastodon getting to a similar point once it gets more established.

comment 8y ago · link · parent

> Look, you want me to get excited about Mastodon? Show me something exciting I can do with it that I can't do with twitter

I don't think the advantage for Mastodon is being able to do anything that Twitter can't. Instead, it's being able to do everything that Twitter can without a lot of the negatives that come with Twitter.

My view is that, fundamentally, Twitter is a good platform, but it suffers from a number of toxic elements (dog piles, turning everything into angry politics, new "features" designed to increase engagement/number of ads you see, etc.). I'm guessing that "Twitter, but without everything you hate about Twitter" is enough to overcome the network effects, especially as Twitter keeps finding new ways to annoy its users for money.

But maybe I'm wrong about that. I guess we'll see.

293.

Mastodon Is Better Than Twitter: Elevator Pitch(codesections.com ↗)

467 points · by codesections · 8y ago · 375 comments

comment 8y ago · link · parent

> This post describes the idea of a “never pattern” (written !) that matches against the ! type or any other “empty enum” type. It also describes an auto-never transformation that inserts such patterns into matches. As a result – in the desugared case, at least – we no longer use the absence of a match arm to designate matches against uninhabited types.

> Explicit ! patterns make it easier to define what data a match will access. They also give us a way to use lints to help bridge the needs of safe and unsafe code: we can encourage unsafe code to write explicit ! patterns where they might help document subtle points of the semantics, without imposing that burden on safe code.

295.

Fastmail Outage Postmortem(fastmail.blog ↗)

2 points · by codesections · 8y ago · discuss

comment 8y ago · link · parent

This was apparently unintentional—the founder wasn't aware of the slang term when they decided on the terminology.

That said, I view it as a happy accident, since it keeps the tone a bit silly/irreverent and reminds users that their thoughts aren't that valuable.

comment 8y ago · link · parent

Thanks! That was because I put the wrong link; fixed now.

(And it's my instance only in the "my country" sense—I'm a user there, but I don't run it or anything.)

comment 8y ago · link · parent

You clearly see value in HackerNews—my use case for Mastodon isn't that different from my use case for HN.

My instance (https:/fosstodon.org) is mostly focused on free and open source software (hence the name). Conversations there tend to be a lot like conversations on HN, but with the benifit of a local community where you get to know the regulars.

(I'm not saying that there's no purely personal talk—but think "office water cooler" not "high school lockers")

comment 8y ago · link · parent

I wrote a companion piece that explains what makes Mastodon better than Twitter. It starts like this:

> Mastodon is a newcomer social media platform that is a lot like Twitter—short messages, followers, hashtags, all that. But Mastodon is much better than Twitter, and not just because being totally ad-free and keeping chronological timelines make it far more enjoyable to use (though that certainly helps!).

All that is nice, but the real advantage Mastodon has over Twitter is that Mastodon is not an outrage machine that's corroding our ability to view our politic opponents as real humans, deserving of sympathy and understanding.

To explain how much better Mastodon is, I'm going to give you three examples of how Mastodon is better, and then I'll step back and talk about why Mastodon is better.

https://www.codesections.com/blog/mastodon-elevator-pitch/

comment 8y ago · link · parent

Spam is an issue, though not (yet) a huge one.

Mastodon has a couple of key advantages, though.

* First, if the spammer is coming from a "good" instance, the admin of that instance can ban them—and the number of instances means that there are more mods to go around. * Second, if the spammer is coming from a pure spam instance, other instances can ban/unfederate with the whole instance.

That said, it's an area that the community is focused on. Here's an issue discussing spam and additional tools that could help: https://github.com/tootsuite/mastodon/issues/8122

1
7891011