HNHacker News
TopNewBestAskShowJobs

widdershins

927 karma · joined January 31, 2013

submissionscomments
widdershins··on Gleam OTP – Fault Tolerant Multicore Programs with Actors
There's a talk from Lustre's developer about doing LiveView-type things with Gleam/Lustre. The promise is that you can easily pick and choose which parts of your app run on the client, and which run on the server.

https://www.youtube.com/watch?v=TbCm-zR7qZ0

widdershins··on How to Debug Chez Scheme Programs (2002)
> The inspector is menu driven, and you can always see the available options by typing "?." For the most part, the options are self-explanatory.

I've enjoyed using Chez Scheme a lot, but I never could get my head around its built-in debugger. I never remember where to go to just view a stack trace, and if I do find it, I end up confused when I try to navigate around it.

I suspect all the information I could possibly want is in there, but I don't find the interface at all intuitive.

widdershins··on Gleam is my new obsession
The OTP package is not built-in because that would prevent Gleam being compiled to other targets, namely Javascript. This is a big draw for the language, and it's worth pulling out BEAM-specific stuff into packages for this reason.

I think Louis and the Gleam community are very serious about supporting OTP, but there are still open research questions around typing parts of OTP.

The parts of OTP that Gleam supports are still very useful, compatible with Erlang/Elixir, and very much used. And they have the benefit of being statically typed [1].

There's no embarrasement about Gleam's primary runtime being the BEAM, it's right there on the front page, above the fold! [2]

[1] https://github.com/bcpeinhardt/learn_otp_with_gleam [2] https://gleam.run/

widdershins··on OpenAI raises $8.3B at $300B valuation
Yeah, but at that point is the company that developed the superintellegence really relevant any more? Doesn't the superintellegence take over and capture all the value for itself? If the concept of 'value' even has the same meaning any more. In truth at that point the foundations of our economic system have been profoundly reconfigured. Your VC investments may be completely irrelevant.
widdershins··on Getting AI to write good SQL
Testing something is the best way to prove that it behaves correctly in all the cases you can think of. Relying on your own (fallible) understanding is dangerous.

Of course, there may be cases you didn't think of where it behaves incorrectly. But if that's true, you're just as likely to forget those cases when studying the expression to see "what it actually says". If you have tests, fixing a broken case (once you discover it) is easy to do without breaking the existing cases you care about.

So for me, getting an AI to write a regex, and writing some tests for it (possibly with AI help) is a reasonable way to work.

widdershins··on Odin: A programming language made for me
> It's fun to nerd out about memory allocators, but that's not contributing to overall improvements of software engineering as a craft which is still too much ad hoc hacking and hoping for the best.

I'm sorry, but it is. Understanding memory layout and (sometimes) using custom allocators can improve performance in ways that no compiler cannot do automatically. And when used correctly they contribute to code correctness too. This is the reason they are used in projects like Chromium.

Regarding your car analogy, you have to remember that developers here are not driving the car: they're building the car. Understanding the differences between and ICE engine and an electric motor are very salient to designing a good car.

widdershins··on Inheritance was invented as a performance hack (2021)
> But even then, I notice React (& friends) have all moved away from this approach. Modern web development usually makes components be functions.

But what do those functions return? Oh look, it's DOM nodes, which are described by and implemented with inheritance.

I would agree that view hierarchies in UI libraries are one of the primary use-cases for inheritance. But it's a pretty big one.

widdershins··on DeepMind releases Lyria 2 music generation model
> theoretically it can react to crowds better than any human could

That's one area I'd expect AI to do poorly. Performance is a two-way dialog between performers and the crowd, with facial expressions and body movements from both the stage and the audience in communication. I'd expect any AI that's not attached to a humanoid robot to be less exciting to a crowd.

However, I am very excited about AI in some of the other contexts you mentioned, like as a music-writing or editing partner.

widdershins··on Coordinating the Superbowl's visual fidelity with Elixir
Runtime errors? As far as I know Gleam will never present runtime errors unless you manually add `todo`, `panic` or `let assert` statements. [1]

I feel you on the macros, I have wanted them too, but I respect the language creator's commitment to minimalism, and I don't feel that e.g. JSON decoders are too much effort. It seems the language is headed down the route of code generators rather than macros, which seems like a reasonable tradeoff to me. [2]

[1] https://tour.gleam.run/table-of-contents/ [2] https://gleam.run/news/improved-performance-and-publishing/#...

widdershins··on Coordinating the Superbowl's visual fidelity with Elixir
Have you given Gleam a try?
widdershins··on Coordinating the Superbowl's visual fidelity with Elixir
Gleam has a subset of OTP functionality already [1]. It also compiles extremely quickly. I haven't made any huge projects yet, but I've used some fairly chunky libraries and everything compiles super quick.

[1] https://github.com/gleam-lang/otp

widdershins··on Shift-to-Middle Array: A Faster Alternative to Std:Deque?
Yes, I agree, insertion not moving things is a very useful feature of deques. It allows you to keep items with deleted copy and move constructors in a container that has good cache locality.
widdershins··on Claude can now search the web
The word makes perfect sense, somebody just used it wrong. Don't let's go down the post-modernist "nothing means anything" route just because some people are too partisan to use words properly.

What the person should have said is "a Nazi made that car".

widdershins··on Functional Tests as a Tree of Continuations (2010)
The C++ testing framework Catch2 enables this kind of testing. The first time I saw it I couldn't figure out how some of the tests would even pass.

It turns out that using some evil macro magic, each test re-runs from the start for each inner section [1]. It also makes deduplicating setup code completely painless and natural.

You just have to get over the completely non-standard control flow. It's a good standard bearer for why metaprogramming is great, even if you're forced to do it in C/C++'s awful macro system.

[1] https://github.com/catchorg/Catch2/blob/devel/docs/tutorial....

widdershins··on Gleam, Coming from Erlang
Can you explain why you don't like `use` but you would like an `await` keyword?

As far as I can see, `use` is a superset of the `await` transformation that just happens to work in a lot more situations. It circumvents callback hell when you're working on the Javascript target [1] but also de-indents lots of other code like handling results [2].

[1] https://github.com/gleam-lang/javascript [2] https://erikarow.land/notes/using-use-gleam

widdershins··on Grok3 Launch [video]
LLMs don't seem to be very impartial so far. Quite the opposite in fact, they're entirely beholden to the prejudices of their trainers.
widdershins··on Jujutsu VCS: Introduction and patterns
> For bug hunting, every commit should build successfully and be a faithful representation of what was on the developer's machine at the time they made the commit. Merge-based workflows are good for this.

I'm not quite sure how that follows - I commit things all the time that cause either the main build or tests to fail. And a faithful representation of what was on my machine at a certain time in the past doesn't help me find bugs.

What helps is when each commit represents a single atomic change that I can easily understand, it has a clear commit message and it builds and the tests pass. To acheive this I often need to rewrite history, but doing so doesn't diminish my ability to find where I introduced bugs later on.

So I feel that rebase workflows are better for both readability _and_ bisection.

widdershins··on From C++ to Clojure: Jank language promises best of both
I'm not an expert in Clojure or Rust, but an interested outsider in both, so please don't take my question as a challenge but a genuine curiosity:

Doesn't the focus on immutable data make most of the ownership stuff redundant? My understanding was that ownership lets you be sure that you're the only mutable owner of a resource, or otherwise that you share the resource immutably. If data is (almost) always immutable, which seems to be a founding principle of Clojure, then what does ownership/borrowing buy you?

widdershins··on I got a heat pump and my energy bill went up
That's on a very cold day. Depending where you are they may be more common or not. But in the UK, they're pretty uncommon. COP of ~4 is much more common.
widdershins··on DeepSeek-R1
Yeesh, that shows a pretty comprehensive dearth of humour in the model. It did a decent examination of characteristics that might form the components of a joke, but completely failed to actually construct one.

I couldn't see a single idea or wordplay that actually made sense or elicited anything like a chuckle. The model _nearly_ got there with 'krill' and 'kill', but failed to actually make the pun that it had already identified.

widdershins··on Yek: Serialize your code repo (or part of it) to feed into any LLM
I'm a gptel addict, so I'll be looking at your approach. Thanks for posting it.
widdershins··on Programming in Lua (first edition) (2003)
I agree on all points, especially the idea of using Lua as a first language. It has so few features that you're really forced to focus on fundamental concepts like functions and (simple) data structures. And its flexibility to be used in an imperative or functional manner is great too. It's almost like a stripped back Javascript, and anyone who learns it will find jumping to JS easy.

I guess one might argue that 1-based indexing could cause beginners to get confused when they move to another language. But maybe it's good for them to get used to the idea that things like this can be different across languages.

widdershins··on Agents Are Not Enough
> it does so with no consideration of worldly facts

Why don't you consider its training set (usually the entire internet, basically) worldly facts? It's true that the training set can contain contradictory facts, but usually an LLM can recognize these contradictions and provide analysis of the different viewpoints. I don't see how this is much different from what humans can do with documents.

The difference is that humans can do their own experiments and observations in the real world to verify or dismiss things they read. Providing an LLM with tools can, in a limited way, allow an LLM to do the same.

Ultimately its knowledge is limited by its training set and the 'external' observations it can make, but this is true of all agents, no?

widdershins··on Gleam v1.7
I've built several personal projects that I'm not really ready to share widely:

An AI tourguide which presents the nearest geotagged Wikipedia pages to the user's location and then produces an entertaining summary of your chosen topic on request. It's just a simple mashup of Wikipedia, MaxBox and OpenAI APIs.

A "leaving the house" dashboard for my wife. It's displayed on a tablet near her mirror, and shows weather and live public transport information to reduce the "I missed the bus and I didn't realize it's raining" disasters that get her day off to a bad start.

I've had a lot of fun making these with Gleam. It has the "if it compiles, it usually works" factor that people love about Rust, with none of the complicated borrow-checking rules. It's very simple - once you're up and running, there's not a lot more to learn about the language and you can just focus on modelling your problem.

widdershins··on Who killed the rave?
In the UK a hybrid is increasingly popular. Start the rave at 2pm, end it at midnight, but it's in a dark room so it might as well be 4am. Usually in some semi-temporary space (e.g. Printworks, now defunct and moved to Drumshed).

I agree this loses some of the spirit of the original rave scene, but as an older person now it fits better for me. If the original late-night scene is dying it's because the younger generation doesn't care very much for this kind of night out.

widdershins··on Size Optimization Tricks (2022)
The article explains the author's justification right at the very top, so you can decide if the given reasons apply to you or not.
widdershins··on Apple squandered the Holy Grail
Interesting note: they don't market it as AI. They market it as Apple Intelligence. I think this is deliberate. So it seems they've already taken your advice (albeit with the 'wink' of using the same initials).
widdershins··on Apple squandered the Holy Grail
I think it's much easier for Apple to sort out their AI and add this to iPhone than it is for OpenAI to figure out an entire mobile ecosystem where Apple has a ~15 year headstart and use their AI in it.

I agree Siri isn't good, but adding good AI into the existing ecosystem is clearly where the market is headed, and I don't think it will be long before Apple gets there.

widdershins··on UK bans daytime TV ads for cereals, muffins and burgers
I'm not sure what you're getting at. They banned certain advertisments at a particular time of day. They didn't ban parents from giving their children whatever thet want to give them.
widdershins··on Gleam Is Pragmatic
Pragmatism is more than just giving people the quickest way to complete their task. There are other axes to consider, such as the simplicity of the compiler and the uniformity of the language experience. These contribute to the maintainability of the language itself and your own code also.

When the rule is "if you need a module, you must import it", and that applies equally to standard library modules, hex packages or your own internal modules, there are fewer mental overheads. The procedure is always the same. Incidentally, this also means that the Gleam language server can automatically add or remove import statements, which it now does [0].

Personally, I also find it pleasing that I can look at the top of a file and say "oh, this module appears to be doing some stuff with floating point math and strings". It often gives me an overview of what the module might be doing before I begin reading the detail.

[0] https://gleam.run/news/convenient-code-actions/#missing-impo...

← PreviousPage 2 of 9Next →