Better HN
topnewbestaskshowjobs
Log inSign up

_vya7

2,337 karma · joined Jun 25, 2011 (15y ago) · 1,518 submissions

Submissions

comment 1y ago · link · parent

Tay all over again.

comment 1y ago · link · parent

Ha, anyone remember Microsoft's Tay?

comment 1y ago · link · parent

That kind of makes sense for a lowest common denominator.

Then what is it good for? Just simple apps?

comment 1y ago · link · parent

I remember using pip and venv back in like 2009. Last time I checked, maybe 5 or 10 years ago, the recommendation of the community was generally to just use Docker instead of all these tools. Did that not catch on?

comment 9y ago · link · parent

Really cool! May have to borrow this some day.

comment 9y ago · link · parent

Or when you want to do logging. That's the part I was working at.

comment 9y ago · link · parent

Your solution doesn't short-circuit when any of the calls fail. It relies on (error) throwing some kind of exception to interrupt control flow and prevent the following lines from executing.

comment 9y ago · link · parent

For the nested if-let mess, I'd probably do something like this:

    (let-every [x (foo)     err "foo failed"
                y (bar x)   err (format "bar %s failed" x)
                z (goo x y) err (format "goo %s %s failed" x y)]
      (qux x y z)
      (handle-error err))
Where `let-every` is a macro that works like let, but stops short on the first nil/false variable, runs only the next symbol binding expression, and then runs the else-clause.

There'd be nothing special about the "err" symbol on each line. It's just the next symbol binding, but on the same line as a convenience, and this means it can reference any previously valid symbol bindings.

Here's a quick & dirty implementation of that macro. I don't have a Clojure interpreter installed, so I don't know if it works.

    (defmacro let-every [bindings if-body else-body]
      (let [pairs      (partition 2 bindings)
            quad-pairs (partition 2 pairs)]
        (loop [quad-pairs quad-pairs]
          (if quad-pairs
            (let [[quad-pair]         quad-pairs
                  [try-pair err-pair] quad-pair
                  [try-sym try-expr]  try-pair
                  [err-sym err-expr]  err-pair]
              `(if-let [~try-sym ~try-expr]
                 (recur (next quad-pairs))
                 `(let [~err-sym ~err-expr]
                    ~else-body)))
            if-body))))
Given the above example, it should expand to this:

    (if-let [x (foo)]
      (if-let [y (bar x)]
        (if-let [z (goo x y)]
          (qux x y z)
          (let [err (format "goo %s %s failed" x y)]
            (handle-error err)))
        (let [err (format "bar %s failed" x)]
          (handle-error err)))
      (let [err "foo failed"]
        (handle-error err)))

comment 9y ago · link · parent

Yeah it's a very real form of lock-in, nothing else really compares to Emacs + Paredit + Cider for productivity. And Emacs isn't great. But when I did Clojure full time for 5 years, I just sucked it up and learned Emacs and got really good at using it. Customizing my init file little bits at a time probably added up to a month's worth of lost productivity. But out of 50 months, 1 month lost to environment setup isn't bad. That's like 2% of the whole time. Or about 48 minutes per week. And the learning curve for me (as a long-time vim user) wasn't as hard as I thought it'd be, especially since knowing bash shortcuts really helped prepare me for the Emacs way. In fact I even took some Emacs knowledge back to the shell, such as how Ctrl-underscore is "undo the last edit to the current command".

comment 9y ago · link · parent

After spending 50 months with Clojure, I can safely say it's my favorite server-side programming language (with Datomic as my favorite database), and the tooling (CIDER + Paredit + Emacs) is really downright amazing in terms of productivity.

comment 9y ago · link · parent

Then what about ChromeOS? Do you think they're trying to build a "full-fledged" OS for the modern era, with safety and security in mind, but not as lightweight as ChromeOS?

comment 9y ago · link · parent

The memory mapping model is really interesting, since it moves a lot of that out of the kernel and into user-space, but it seems like it has more disadvantages than advantages. What am I missing?

comment 9y ago · link · parent

This is pretty terrifying. So many "arbitrary code execution with root privileges" exploits! They may be fixed, but how many more are still only known to malicious third parties?

And without even needing to install anything! "Processing maliciously crafted web content may lead to arbitrary code execution."

comment 9y ago · link · parent

One of my favorite skills & challenges is do things as efficiency as possible, and using Electron for an app like this just strikes me as super-duper wasteful, especially for an app that'll be running all the time. That said, it's probably not going to make that huge of a dent in daily battery life.

comment 9y ago · link · parent

Meh. I'd rather just continue scaling back my time spent here. It's becoming a more and more worthless site every day.

comment 9y ago · link · parent

Yep done that. That's when they basically said nope too bad so sad.

comment 9y ago · link · parent

It's not just joke. It's the fact that it way too closely resembled the writing style of big-city newspaper articles, trying to "subtly" play on double-meaning words. It's just so awful.

comment 9y ago · link · parent

They never ever adjust the position or color of any comment. They used to, until the day the mods labeled my account a "troll" account a few years ago. Now my posting is rate-limited, and my votes do nothing. Even after changing my behavior on HN, they refused to reverse their decision.

Let that be a warning to everyone here, never to post comments or links the HN mods do not approve of. Their vengeance is moderate and permanent.

comment 9y ago · link · parent

Man it's times like this that I wish the mods didn't turn my votes into shadow-votes (a la shadow-ban) and that my votes actually worked.

comment 9y ago · link · parent

Yep. 99% of programmers use an actual computer to type their code into, rather than typing on an iPad or other touch screen. And 95% of programming still requires manipulating text.

comment 9y ago · link · parent

> 100 years from now, it's highly unlikely that the screen-and-keyboard model of data ingestion will be regarded as anything but a historically important link in data evolution, cast away in favor of more tactile, neurochemical, and cybernetic interfaces.

Very imaginative and sci-fi, but not likely. Just because we've advanced this fast in the past 50 years doesn't mean we'll be able to keep this rate up. There are physical limits to the things we can do, even if we keep gaining knowledge at the same speed. We'd have to break a lot of very big scientific barriers before any such technology would be both practical and affordable.

comment 9y ago · link · parent

But then what would the Haskell of tomorrow look like?

comment 9y ago · link · parent

Language is inherently complex, there's no way to solve this in any "cleaner" way than what we already came up with. Unfortunately the best way forward is to build up what we already have and cover all the warts with wrapper functions/libraries.

comment 9y ago · link · parent

Are MD5 hashes that predictable that you can just make a few adjustments to a binary until it's the one you want?

comment 9y ago · link · parent

Dunno why you're downvoted, you have a totally valid point. Trying to shoe-horn a hacker-friendly OS into a layman-friendly desktop/laptop experience is going to be painful. Extremely fun and satisfying, sure. (Well, sometimes.) But there will be pain.

comment 9y ago · link · parent

The article says:

    // This was useful in C to avoid accidentally
    // typing variable = null. These days it will
    // confuse most people, with little benefit.
The use of "was" and "these days" in the link shows that the author of this piece is in a tiny little bubble of development, and is far from being able to give general advice for programming. C is not past-tense. C, C++, Objective-C, these are all still widely used today by modern professionals. I'm very tired of articles and authors which claim to be representative of all programming or programmers, when they're isolated to a tiny little bubble. Especially when they only know JavaScript.

comment 9y ago · link · parent

It'll be interesting to see how that plays out.

Btw why are the Linux and Mac versions both 21mb but the Windows version is only 1mb? Magic? I'm gonna assume magic.

Also: it doesn't seem to use Electron! Cool! But wait, it uses Python + Qt instead?

comment 9y ago · link · parent

Then maybe it should be: "Don't rely on Google products unless they're utterly dominant and necessities." Maps, email, search, are all needed in modern life. RSS readers lost out to Twitter & Facebook years ago.

comment 9y ago · link · parent

In my experience, Clojure + CIDER are pretty much exactly what you're describing. Especially once you get into the advanced evaluation features. I no longer think in terms of s-expressions or text, but I think in terms of the actual semantic objects I'm dealing with on screen. It's neat.

comment 9y ago · link · parent

Also Maps.
12345
51