HNHacker News
TopNewBestAskShowJobs

seagreen

1,213 karma · joined October 12, 2011

ianjeffries.net

mail@ianjeffries.net

submissionscomments
seagreen··on Is Semantic Versioning an Anti-Pattern?
Executables should pin.

Libraries should depend on ranges (though they can also pin internally for development).

seagreen··on Top Developer Tools of 2016
Since this list doesn't actually make any sense, I'll list two actually great developer tools:

+ The Stack package manager for haskell: https://docs.haskellstack.org/en/stable/README/

+ NixOS: https://nixos.org/

Note that NixOS' drive towards critical mass isn't complete yet. It has great Haskell support (especially since Stack has nix integration), but may not have as good support for your language. No point in switching OSes before the time is right.

seagreen··on Problems with CSVs
Self-describing data is generally a bad idea. If you can't get programs to agree on the original document format, what makes you think you'll be able to get them to agree on this meta format?

EDIT: The right solution is the simple one. Follow RFC4180 exactly. Reject everything that doesn't match it.

seagreen··on 2016 will be one second longer
Leap seconds have no business being tracked in the core logic of our programs.

Just like timezones and calendar changes, leap seconds are a display issue. While obviously very important in some circumstances there's no need to keep track of them through absolutely all of our code.

If the way you measure time takes leap seconds into account, you have no way of saying "exactly X Système international seconds from now". This is a big deal.

seagreen··on GNU Guix and GuixSD 0.12.0 released
Nixpkgs on a mac actually has a really bad reputation as being undersupported.

I use NixOS as my main OS though and it works fine.

seagreen··on PureScript
PureScript emphasizes a solid theoretical foundation. Its closest competitor, Elm, emphasizes ease of learning and use.

Both are very tastefully designed (so I've heard, I haven't used Elm myself). If you're coming from something like Haskell and really value correct abstractions go with PureScript. If you need something working right now and don't plan on pushing the boundaries of the language then Elm should be fine.

seagreen··on Let’s Stop Bashing C
Personally, I like my addition associative, but you do you.

EDIT: Also I like my numbers reflexive.

seagreen··on Let’s Stop Bashing C
Totally agree! By the way, the Haskell community is working to make scripting easier in Haskell, so if you want to go from one of the most buggy languages straight to one of the least, now you can: https://docs.haskellstack.org/en/stable/GUIDE/#script-interp...

(Downsides: Haskell is weird (but good), you have to have Stack installed, and the first time you run the script it will take a while to download dependencies)

More resources: https://github.com/Gabriel439/post-rfc/blob/master/sotu.md#s...

seagreen··on Swift and the Legacy of Functional Programming
Well said. I can write exceedingly low defect code without folds. I can't do so with implicit IO everywhere, ad hoc polymorphism, and dynamic typing.
seagreen··on Watch out: ɢoogle.com isn’t the same as Google.com
The fact that we need application-specific security measures against this just emphasizes the problem. There are a lot of applications.
seagreen··on Parsing JSON is a Minefield
Almost two weeks late, but I thought about this more and I totally agree with you.

I should have said "JSON number's aren't machine numbers" (e.g. float, double, integer). But serialized, human-readable numbers are still numbers, so I was wrong.

seagreen··on Functional Programs Are Imperative Pumpkins

  no program can be purely functional
Pure functional programming means building up a machine. This machine will eventually be executed by the runtime system (at which point IO will happen) but from the programmer's perspective a program can still be purely functional.

By this I mean that a function that takes an Int and outputs an Int will have type `Int -> Int`, and a function that takes an Int, does logging, and outputs an Int will have type `Int -> IO Int`. Both are purely functional -- they're pure transformations from an Int to some other thing. For the first function that other thing is another Int, for the second that other thing is an action that can be performed by the machine which will return an Int.

So from the perspective that matters to us a developers programs can be purely functional.

(This becomes even more useful with something like PureScript's granular effect tracking https://github.com/purescript/purescript/wiki/Differences-fr...)

seagreen··on Ask HN: What are the best personal project websites you've seen?
AAAAAAHHHHHHHHHHHHHHH.

That's the point.

If a genius can't make a tricky personal website without breaking things, what chance do normal people have?

Just make a normal website.

Brett Victor is awesome. If you copy his website, you're learning exactly the wrong lessons from him.

seagreen··on Parsing JSON is a Minefield
I respect the pragmatism of your reply. At the same time "distinguish decimals and integers" is about as far from a subtle distinction as you can get.
seagreen··on Parsing JSON is a Minefield
Thanks for your analysis (and the Ruby and JS reports). The more I think about it the more I think parsers should not parse to numbers by default, but instead to (using a Haskell-based pseudo type):

  data Sign = Positive | Negative

  data Digit = Zero | One ... Eight | Nine

  data JSONNumber = JSONNumber
    { _sign           :: Maybe Sign
    , _integerPart    :: [Digit]
    , _fractionalPart :: Maybe [Digit]
    }
Actually this should include exponents as well -- basically parsers should just report exactly what the spec allows, without coercing to float or whatever.

Of course, users of the parsers could ask to have a number converted to a float, but that wouldn't be the default.

We're a long way from that though. At the moment I don't even feel like I can write a protocol that expected implementations to distinguish `1` and `1.0`. This should not be the case.

seagreen··on Parsing JSON is a Minefield
Exactly. JSON Number ARE NOT ACTUAL NUMBERS. They're really restricted strings (or, as you quote, a syntax for representing numbers).

IMO this wasn't originally a bad thing at all. There are so many different types of numbers, with so many different behaviours (does `1` == `1.0`? Not in statistics class) that trying to work it all out in JSON would have been a fools errand. The problem is that so many JSON parsers are overly aggressive about turning JSON Numbers into something specific (usually floats) that when writing a JSON API we have to assume it will be consumed in this lowest-common-denomitor way.

By the way, I don't think that all JSON numbers are technically both integers and floats. `42` and `42.0` are clearly different according to the spec, IMO. I'd be curious to get your thoughts on this.

seagreen··on Parsing JSON is a Minefield
No he doesn't. "JSON, the good parts" is just JSON. The problems the post is describing have to do with RFC 7159 allowed extensions.
seagreen··on ZCash Will Be a Truly Anonymous Blockchain-Based Currency

  If we want it to be secure anyway...
Oh God, I'm _really_ hoping you're being sarcastic.

You've read about the dozens on dozens of compromised exchanges?

You heard about the DAO hack?

You realize that the majority of bitcoin is mined by like a dozen people in China?

Maybe someday we'll get our act together, but right now blockchains are a recipe for FUD and centralization.

(I say this as someone who thinks bitcoin is cool. For instance, the traditional financial system makes it unnecessarily hard to send money overseas, a need bitcoin can fill well. But secure? No.)

seagreen··on A Taste of Haskell
Totally fair point. haskell.org has a very . . . casual approach to presenting the language. It's been such an issue some people made an alternate homepage at haskell-lang.org.
seagreen··on “Curl Bash piping” wall of shame
Railing against `curl https://foo/ | sh`? I guess security theater's not just for the TSA.

(Do be aware of pastejacking though, but this is not nearly an important enough issue for a wall of shame)

EDIT: We can all learn something from the readability of that page though. One zoom and it's better than 90% of the websites I've seen. Text -- it works.

seagreen··on Ask HN: Team for Hire?
Sorry to hear that OpenTable's moving out of Chattanooga.

I was in Chattanooga from 2013-15 and have nothing but good things to say about their team. Most notably they ran a functional programming meetup that covered pretty advanced topics but was still inclusive to beginners. I'll remember the encouragement I got there for a long time.

If anybody who cares about the Chattanooga tech scene reads this: do your best to keep the OpenTable team intact. A lot of the programming community's enthusiasm is either directly coming from or being encouraged by them.

DISCLAIMER?: I was in Chattanooga a couple weeks ago and they gave me a bunch of useful, free advice on my current project. This isn't really a disclaimer though because IMO it just reflects even better on them.

seagreen··on NixOS 16.09 released
Dvorak! And nice to see you've got fonts working, that's not something I've messed with. Thanks!
seagreen··on GitHub Audio
Even worse, this matches the actual way URLs should have gone in the first place: com.site.subdomain/folder/subfolder/subsubfolder/.
seagreen··on NixOS 16.09 released
Can you share your NixOS config?
seagreen··on Appropriate Uses for SQLite
Thanks. Too late to edit it now though. And nandhp's detective work was right, the adjective was originally "awful".
seagreen··on Appropriate Uses for SQLite

  It's up there with bash
Clearly you've just arrived from some wonderful alternate universe where bash means something different than it does on Earth. Welcome traveler!

  bash is the world's default shell for a reason
Here on Earth that reason is network effects ("If I write it in bash, it will run anywhere!"). Bash is an bad language. If you've mastered bash you can have the honorable feeling of mastering a difficult, ugly, but practical skill (see also: knife-fighting, driving a motor vehicle, running for office). But there's no need to be mean to SQLite by comparing the two.
seagreen··on While open source is free as in beer, it’s also free as in baby (2014)
I agree with all this:) I also enjoyed the article, "free as in baby" is a great phrase.

At the same time I think it's important to note that the entropy analogy is just an analogy. Software is not actually subject to the laws of entropy (at least no more than a book or a poem is). Sure, often we want to change programs for various reasons -- that's not entropy.

Most fields have to deal with actual entropy -- the fact that we don't should be super exciting. See chubot's adject comment for just some of the things this makes possible.

seagreen··on While open source is free as in beer, it’s also free as in baby (2014)
> software decays over time, a.k.a. entropy

This is similar advice to "always have your castle ready to withstand a siege". Both are excellent pieces of advice -- for 2010s software/the medieval ages respectively. But the advice is not timeless, once we get/got our crap together it stops making sense.

Software decays because we don't track all its inputs. Once we do it will no longer decay, when run in environment X it will give output Y, every time. There's already movement on this front with http://nixos.org and imitators -- I expect massive improvements on that front in our lifetimes.

Of course, you still need an x86-64 computer or whatever. I doubt they'll stop making them any time soon though=)

seagreen··on REST Anti-patterns

  Imagine you want to implement a vacation-booking service 
  as part of an enterprise system. The first step is to 
  remove any reference to computers or modern technology. 
  This will allow you to concentrate on the business 
  objectives of the service, without getting sidetracked by 
  technological considerations. In other words, it enables 
  you to separate the “what” from the “how.”
That's pretty great advice.
seagreen··on JavaScript Conquered the Web, Now It’s Taking Over the Desktop
In case Eich reads your comment: given that it had to be done in ten days and "look like Java", JavaScript is a fine langauge.

(But yeah, compared to languages that were designed over years obviously it's incredibly bad.)

To quote Eich (from here[1]):

" Ten days to implement the lexer, parser, bytecode emitter (which I folded into the parser; required some code buffering to reorder things like the for(;;) loop head parts and body), interpreter, built-in classes, and decompiler. I had help only for jsdate.c, from Ken Smith of Netscape (who, per our over-optimistic agreement, cloned java.util.Date -- Y2K bugs and all! Gosling...).

Sorry, not enough time for me to analyze tail position (using an attribute grammar approach: http://wiki.ecmascript.org/doku.php?id=strawman:proper_tail_...). Ten days without much sleep to build JS from scratch, "make it look like Java" (I made it look like C), and smuggle in its saving graces: first class functions (closures came later but were part of the plan), Self-ish prototypes (one per instance, not many as in Self).

I'll do better in the next life. "

[1] Edit: jwz.org intercepts HN links. See mjgoeke's comment.

← PreviousPage 6 of 16Next →