HNHacker News
TopNewBestAskShowJobs

eliben

3,222 karma · joined July 5, 2010

http://eli.thegreenplace.net
submissionscomments
eliben··on static-server: an HTTP server in Go for static content
Thanks for the comment, Matt! I love Caddy. For some reason I thought it needs a configuration file.

The simplest cmdline I found to run it as a local server on a non-priveledged port with listings is:

    $ caddy file-server --listen localhost:8099 --browse
Is there a simpler way I'm missing?
eliben··on static-server: an HTTP server in Go for static content
Thanks for your comment. I surely hope no one will even consider using this server for anything public-facing :) It's solely for testing on localhost.

The shutdown endpoint is used for robust testing; I suppose I can hide it a bit more, like using an environment variable or something.

eliben··on Learn WebAssembly by writing small programs
Cool project!

I maintain a somewhat related repo here: https://github.com/eliben/wasm-wat-samples/

eliben··on Codereview: Should the Go project stop importing GitHub PRs?
I love GitHub but I sure wish its code review functionality was much, much better. Doing complex code reviews is really painful.
eliben··on WebAssembly Text Code Samples
> (although I wished it was a bit more extended!).

What additional samples would you like to see in there?

> Hopefully we will be able to help with it as part of our work

That's great to hear. What are you planning here?

eliben··on The tug-of-war over server-side WebAssembly
Very timely post. I was recently looking at the ways one can implement a plugin system using WASM (outside the browser). Communicating between the host application and the plugin is sure tricky... I've seen places that use WASI to map stdin/stdout to files and use that. It feels... wrong.
eliben··on Denmark, Norway, Sweden, and Finland to Operate as a Joint Air Force
Isn't Greenland already included in "Denmark"?

And Iceland doesn't even have a military, AFAIR. The country's total population is <400k

eliben··on Nvidia Announces H100 NVL – Max Memory Server Card for Large Language Models
NVIDIA is selling shovels in a gold rush. Good for them. Their P/E of 150 is frightening, though.
eliben··on Pgrok – Poor Man’s Ngrok
I recently wrote about how ngrok-like functionality is easily implemented in Go via SSH port forwarding: https://eli.thegreenplace.net/2022/ssh-port-forwarding-with-...
eliben··on Code coverage for Go integration tests
Yes, technically you could wrap every `main` in a test and build everything just right, but it's nice to be able to do this without any hacks if you already have an integration test suite and you want to know what coverage it gets you.
eliben··on Service Weaver: A Framework for Writing Distributed Applications
You do have to worry about the network when you call between components. The documentation talks about this explicitly in "Semantics":

"Method calls are executed with at-most-once semantics. This means that Service Weaver does not automatically retry method calls that fail. However, you can detect and retry failed method calls explicitly using weaver.ErrRetriable. If a method call fails because of a transient system error (e.g., a component replica crashed, the network is partitioned), it returns an error with an embedded weaver.ErrRetriable."

With the following example:

    // Retry the cache.Get method call up to five times.
    var val string
    var err error
    for i := 0; i < 5; i++ {
        val, err = cache.Get(ctx, "key")
        if errors.Is(err, weaver.ErrRetriable) {
            // Retriable system error! Retry.
            continue
        }
        break
    }
[The docs at https://serviceweaver.dev/docs.html are fairly comprehensive, kudos to the team!]
eliben··on Ask HN: Why Is Everything Declining?
You too will get old, and when you do you'll fantasize that when you were young prices were reasonable, politicians were noble, and children respected their elders.

[https://www.songlyrics.com/baz-luhrmann/everybody-s-free-to-...]

eliben··on Lisping at JPL Revisited
I believe the OP's ergolib provides an example. From https://github.com/rongarret/ergolib/blob/master/core/bindin..., the examples show code like:

   ;;; (bb
   ;;;  x 1
   ;;;  :db (y z) (foo)
   ;;;  :mv (a b c) (bar)
   ;;;  (do-something)
   ;;;  :with open-file f "foo"
   ;;;  (do-something-else))
And the code this replaces. This seems to me hard to understand without first digging into ergolib and grokking what bb means. It's just one simple example.

I forget now where it was, but there's a famous Lisp quote which goes something like (paraphrased from poor memory): in Lisp you don't just solve problem X, you first grow a new programming language designed for solving X-like problems and then simply solve X with that.

This has its charms, for sure. But it makes the code harder to understand for folks not familiar with your "language designed for solving X-like problems"

eliben··on Lisping at JPL Revisited
Thanks for writing this followup, Ron.

This paragraph really resonated with me:

> All this is a reflection of the so-called Lisp curse, the fundamental problem with Lisp -- its great strength is simultaneously its great weakness. It is super-simple to customize Lisp to suit your personal tastes, and so everyone does, and so you end up with a fragmented ecosystem of little sub-languages, not all of which (to put it mildly) are particularly well designed.

I have a career-long love and admiration for Lisp, but I've never used it for "real" things because of this precise reason. I wanted my code to be understandable and modifiable by others who are already familiar with the programming language I'm using. With Lisp, it's almost guaranteed that any sufficiently large program will be written in its own dialect no one but the author knows.

eliben··on Ask HN: What are your favorite sub stacks?
Substack has much higher-quality content than Medium, but it seems to be moving in generally the same direction. There are already popups that disrupt reading on any article (sign up to the newsletter!) -- is eventual Medium-ization unavoidable?
eliben··on Lisp-stick on a Python
I genuinely like Rust, but it's pretty amazing that you managed to write a comment on this article and make it about Rust. Peak HN :-)

Re Lisp's superiority - Lisp was certainly a superior language when it was devised many decades ago, but over time much of its comparative advantage has been absorbed by other languages. Starting in the 90s when productive, GC'd scripting languages like Python started being prominent this trend accelerated.

For a nice discussion of this see https://norvig.com/Lisp-retro.html

eliben··on (Mastodon) Surviving and thriving through the 2022-11-05 meltdown
Thanks for the explanation. If a huge number of "laypeople" flocks to Mastodon, it's very likely that the users will be clustered around one or small number of "major" servers. So basically the admins of that server will become the de-facto moderators of discourse, it sounds like. Is that a reasonable course of events?

Or will the idea be more like "lefties should go to $SERVER1, righties to $SERVER2" and then the two servers don't federate with each other because they find each other's content distasteful?

eliben··on (Mastodon) Surviving and thriving through the 2022-11-05 meltdown
Twitter's biggest/hardest problem seems to be content moderation. With all the people moving to Mastodon now, it's not clear how Mastodon is going to handle this?

Is the hope that just folks of a given political viewpoint will move to Mastodon and moderation will not be necessary?

eliben··on Math with Bad Drawings
These books are awesome - the perfect bait to get kids interested in math topics.

We have all three on the shelf; kids first are drawn to the cute stick-figure comics, and read around a bit while they're there - the result is learning interesting bits and pieces about math.

Highly recommended! In particular the third book about mathematical games is a delight.

eliben··on An Australian startup is “growing” water for California
I wonder why the cost is so high, is it mainly electricity?

Parts of California produce more solar power than can be used at that time during parts of the day - could that extra electricity be used for desalination?

eliben··on It's time to halt starting any new projects in C/C++
I ran into the exact same problem and wrote up some potential solutions at https://eli.thegreenplace.net/2021/rust-data-structures-with...
eliben··on California Says Brace for Blackouts as Heat Wave Drives Record Power Use
Thanks. Interesting, indeed. Maybe they're using different terminology; otherwise it's not clear how both Caiso and these local utilities can be truthful at the same time.
eliben··on California Says Brace for Blackouts as Heat Wave Drives Record Power Use
Unless the official CalISO twitter account is lying, this could be a local issue for specific substations etc. With the weather there could be transformers overheating and failing, for example. In a large state, power goes out _somewhere_ quite often.

The bag of tricks CalISO has to lower demand at peak is fascinating - for example, there are large consumers with significant generation resources (like emergency generators) that sign in to turn the generators on and get off the grid for a couple of hours. This produces drops in demand without blackouts per-se. Distributed power generation is generally more resilient.

eliben··on Vulnerability Management for Go
2 of these refer to TIOBE and another is a 404

The IEEE Spectrum one seems independent

eliben··on Vulnerability Management for Go
Please, please don't use tiobe for programming language comparisons. https://blog.nindalf.com/posts/stop-citing-tiobe/, etc.
eliben··on Korea shatters its own record for world’s lowest fertility rate
As an opposite data point: in Israel, military service of 3 years is mandatory for males, 2 years for females. Israel has BY FAR the highest fertility in the OECD. So military service probably isn't a strong correlation here.
eliben··on How to Estimate Distance Using Just Your Thumb
I would think that a single quick glance in the general direction of the sun won't do much harm
eliben··on Shor, I’ll do it (2007)
I like how there's a comment by Peter Shor commending Scott on the article :-) Knowing Scott's blog, this is likely legit
eliben··on How I went about learning Rust
This is explained in much detail in the very first link, in the very first sentence of the post :-)
eliben··on How I went about learning Rust
In addition to munificient's response, I'd point out that this will likely have a significant performance cost. Since performance is one of the main reasons of using a low-level language like Rust, it should give you pause.

I'm not saying there's anything bad with Arc + Mutex - they're certainly useful tools and great in some scenarios; it's just that I wouldn't reach out to them just to "avoid fighting the borrow checker". If your code can be written without those tools, it's best to do so.

← PreviousPage 3 of 34Next →