HNHacker News
TopNewBestAskShowJobs

hnlmorg

12,514 karma · joined May 13, 2015

Developer / Sysadmin / Geek

Author of murex (https://github.com/lmorg/murex, alt DevOps $SHELL). Contributor to open source. Also works on a few proprietary projects too.

submissionscomments
hnlmorg··on Apple’s grey list: Words and phrases your iPhone won’t help you spell
One of my friends is famously bad at texting. She’s even posted antisemitic stuff by accident. This is on Android.

I know these are all typos because she’s a really close friend and easily the last person who would be offensive to other people.

So yes, you’d be surprised at what people can typo on a phone.

hnlmorg··on Apple’s grey list: Words and phrases your iPhone won’t help you spell
There is a way to win here: make it an opt out

- [ ] Disable autocomplete swear filter.

But finely grained options are not Apple’s way.

hnlmorg··on Tasfer: a text editor drawn on a 2D canvas
It might seem unsound but it’s the concept we’ve built our terminals around.

And there are already definitions and APIs to decide the terminal cell width of different Unicode characters.

I’m not saying it’s easy, because you end up with 3 different string widths:

1. memory length in bytes

2. Number of Unicode characters (which is annoyingly also different to the number of Unicode code points since some codes can be combined)

3. terminal cell width

But as annoying as it is, there are a few relatively mature libraries you can use to solve this problem.

hnlmorg··on They don't make 'em like that any more: Borland Turbo Pascal 7
I think we are still a long way from that becoming an option due to the cost of hardware to run even the lower end models. But I do like this prediction of yours
hnlmorg··on Tasfer: a text editor drawn on a 2D canvas
> This is wildly wrong

You’re right. I’ve been experimenting with Monaco lots lately and could have sworn it used a canvas. But it doesn’t.

> 2D canvas is consistently slower than letting the browser handle the rendering, so long as you avoid making the DOM too complex, and possibly monitor the viewport and only keep some of the content in the DOM at a time (though for most applications it’s somewhere between harmful and not useful, and it definitely adds a lot of complexity).

Interesting. I’ve found the reverse to be true. But it sounds like this is human error on my part. (probably doesn’t help that I’ve had more experience building high performance GPU applications in Dx, SDL, and similar than I have building high performance web apps.

Thanks for the correction.

> Why on earth would you build with web technology, if you’re then going to use canvas? I can’t immediately think of any that match your description (though I have no doubt that in-browser ones using canvas exist).

You answered your own question.

And I do know of at least one written using the canvas. Because I wrote it. I’m now interested in how others work though.

hnlmorg··on They don't make 'em like that any more: Borland Turbo Pascal 7
I disagree. However even if that were true, that’s more of a reason to learn more instead of less.
hnlmorg··on They don't make 'em like that any more: Borland Turbo Pascal 7
We aren’t just talking about technology, we are talking about knowledge.

Like I said, I have zero issue being “AI first”. 90% of my day-to-day is using AI. But the part I objected to in the OP was “we don’t need to know things because we have AI” (to paraphrase. So I was asking the question: what if AI goes away?

I agree humans are resilient. But that’a not a good excuse for complacency.

hnlmorg··on They don't make 'em like that any more: Borland Turbo Pascal 7
No. It’s that we shouldn’t depend on AI always being available.

Absolutely we should use all the tools at our disposal which enhances productivity. But that doesn’t mean we shouldn’t also learn how’re to do things for ourselves too.

To use a contrived example, there’s no shame in using a dishwasher. But if you cannot wash dishes by hand when the dishwasher breaks down, then you know you have problems.

hnlmorg··on They don't make 'em like that any more: Borland Turbo Pascal 7
Yes, I hinted at that. And each time that civilisation fell. With the next occupiers of the land left to find it.

Do we really want to put ourselves in the same situation?

hnlmorg··on They don't make 'em like that any more: Borland Turbo Pascal 7
I would say your reply feels like you didn’t read beyond the first sentence of my comment.

If you did, then I apologise. But my point is about accessing that knowledge when AI isn’t available. Not about how AI discovered its corpus to begin with.

hnlmorg··on Text.js: Build full-stack React apps that render inside console.log
I’d wager it’s just a bit of fun. Which is amongst the best reasons to do anything.
hnlmorg··on They don't make 'em like that any more: Borland Turbo Pascal 7
There’s no substitute for human knowledge. What if the climate crisis gets to the point where we cannot justify boiling the ocean to perform tasks we’ve come to depend on?

What’s our disaster recovery strategy in the event of war and loss of internet?

Or worse yet, a near extinction event and we are forced to rebuild civilisation from memory?

Some of these might seem like extreme edge case scenarios but then history is full of disasters that people didn’t prepare for because they assumed they were too big to fail.

hnlmorg··on Tasfer: a text editor drawn on a 2D canvas
This looks slick but I think you need a better way to market it.

The 2D canvas part is the norm for anyone who wants performance. Working with the DOM becomes painfully slow and resource intensive the moment you add syntax highlighting, spell checking, and other visual chrome, to large documents.

This is why Monaco (the editor widget behind VSCode) is a canvas. Why terminal emulators built with web technologies use canvas. And so on.

So I wouldn’t say the canvas part of the heading is a differentiator.

Edit: apologies, seems I was wildly wrong here. Please disregard the above.

hnlmorg··on Tasfer: a text editor drawn on a 2D canvas
That’s the “human in the loop” part. Use the LLM to generate a copy and the human to refine it.

If you think successful campaigns these days are always entirely done by humans, then I’m afraid you’re mistaken.

hnlmorg··on What do the next 4000 emoji look like?
So what about ASCII control codes? They are non-printable characters that are part of Unicode, grandfathered in, yet aren’t part of any writing systems.

And home computers have had pictograms as part of their character set since the late 70s/early 80s. For example code page 437 (MS-DOS) had smilies, card suites, and other emoji. Likewise for the PETSCII (Commodore Pet) too.

And not just emoji’s, but full on drawing characters. In fact that was the only way to draw graphics on some early systems, such as Teletext, in the early 70s.

And then you have the question of what pictograms are part of writing systems. For example the media control symbols (play, pause, fast forward, etc). Or how about the fact that some emojis had been part of written text long before Unicode, in the form of “smilies”, eg :-)

I hope this illustrates that the problem was never an easy one to define boundaries for inclusion.

hnlmorg··on A new Go API for JSON
> It's a function, not a method. So it can't be part of an interface.

The mashaller here is a function, yes. But having a consistent signature means you can interchange those marshallers. It’s a trick I use heavily in murex to enable typed pipelines.

And I do this via a pipe interface. So it’s not uncommon to reuse function signatures for interface types (fewer runtime abstractions) while retaining some level of dynamism.

> Say you are marshaling a struct that contains a struct from a third party library, and it works fine. Then you update to a new version of that library, and that added a new field for a type that doesn't work, say a map[A]string where A is a struct.

The first mistake there is to blindly forward an internal API struct that you don’t control, and depend on that business logic.

Which comes back to my point about if you want type safety then you’d create a struct to be marshelled rather than passing data you don’t control.

I do take your point that the compiler in smarter languages would catch this. But you’d equally be told not to do this sort of thing on those languages too. So it feels like a moot point.

hnlmorg··on A new Go API for JSON
I read that differently. If you have a non-nil pointer then you get the address of the pointer irrespective of what that pointer points too.
hnlmorg··on A new Go API for JSON
That’s an interesting take. I appreciate the alternative view point and I can’t say I disagree with the way you’re looking at it.

Thanks for sharing.

hnlmorg··on A new Go API for JSON
> A Go pointer is encoded as a JSON null if nil, otherwise it is the recursively JSON-encoded representation of the underlying value.

The doc you linked to literally proves me right.

hnlmorg··on A new Go API for JSON
> The function is in the `encoding/json/v2` package. It might have a similar design, and maybe they will use the same function signature for other encoders, but it the functions are very much json specific.

But the point you keep missing is that the function signature needs to be encoder agnostic for it to work as an interface. That’s a hard requirement.

And since interfaces are a convenience to allow common abstractions to be reused at runtime, you cannot depend on things like generics (ie compile time abstractions) to generalise the data types for disparate serialisation formats.

I know this limitation well because I’ve built a shell with a typed pipeline and support for different serialisation formats. So make heavy use interfaces to achieve this. And I’ve spent a lot of time investigating alternative approaches. Each time, I’ve found interfaces to be a massive advantage despite any tradeoffs I end up making do to generalising a “class” (to borrow a term from OOP).

I’d honestly love to have a more sophisticated type system in Go. But that’s not a limitation in this specific instance.

> But if you use a struct that has a field that can't be marshalled, you don't get a compile error, you get a runtime SemanticError. That's the problem.

My point here was: if you know you’re creating a struct to pass to the mashaller at compile time, then you’re already going to use JSONAble fields. So it’s not an issue.

And if you don’t know what you’re passing to the mashaller a compile time, then you’re dependent on runtime checks regardless of the expressiveness of Gos type system.

I don’t disagree that Gos type system is inflexible. But in respect to this specific use case, your argument is a storm in a teacup. The type system isn’t a limiting factor here.

hnlmorg··on MCP Explained
I’d already answered that. Audit control in enterprise environments.
hnlmorg··on MCP Explained
Have you considered that maybe it’s useful bloat that you don’t understand much?

XML has features that other documents don’t support and thus can be useful in some domains.

Likewise, I find MCP extremely useful for accessing enterprise systems using OAuth. It’s secure, easy to define access controls, and easy to audit.

hnlmorg··on A new Go API for JSON
Python introduces new abstractions for the same problem. Whereas this is an updated API version.

It’s versioned because the function signature differs but the abstraction itself doesn’t.

That’s not to say that Go doesn’t have multiple different abstractions for common problems too. Just that your specific argument here is incorrect.

hnlmorg··on A new Go API for JSON
You don’t get runtime errors for marshalling pointers to JSON. I actually do this all the time. What you get is the address of the pointer marshalled.

I think the same is true for channels too but I’m not near a computer to check.

I’ve abused the v1 API heavily* and haven’t found anything it couldn’t marshal. Though I’m yet to apply the same “fuzzing” (for lack of a better term) to v2.

* the v1 JSON marshaller underpins some core functionality in my alternative $SHELL. So I’ve thrown a lot of exotic type structures (by Gos standards at least) at it.

hnlmorg··on A new Go API for JSON
Except it’s not JSON specific. The article literally talks about how their function design was chosen for similarity with the v1 API. And I’d wager that the go team are planning on reusing that function signature for other encoders too. Or at least expecting it to be reused by the wider ecosystem.

If you want type safety then pass a struct to the marshal. Which is actually the idiomatic way to do it anyway. The type safety would be in that.

I’m not going to disagree with you that Gos type system is a rather blunt tool nor that Gos expressiveness is extremely rigid compared to many other popular languages. All of that is completely true. But I don’t agree that the v2 JSON API is a good example of that problem.

hnlmorg··on A new Go API for JSON
I’ve written package management tools and I agree that dependency management is hard. Though I wouldn’t say it’s that hard compared to the other problems you encounter with language development.

But difficulty aside, my point was Go waited until there were multiple established 3rd party package management tools for Go already in widespread use before even releasing their own experimental implementation.

Their inaction caused far more disruption to the ecosystem because people got fed up of waiting, implemented their own, integrated it into their workflow and then had to reintegrate a whole new system all over again a year or two later.

Your point about Googles needs is the one often cited for Gos inaction. But I think that actually makes the situation worse. Because if the Go team cannot empathise with use cases outside of one bespoke enterprise, then it really shouldn’t be released as a general purpose language available for all to use.

And I say this as someone who generally likes the language.

hnlmorg··on Insects don't swarm at LED lights
I think it’s to do with the LED flicker. You can sometimes see it in your peripheral vision (ie your light/dark receptors) but your RGB cones aren’t as good at spotting it.

Insects eyes are biologically very different.

With LED lighting, if you have lots of spot lights in the ceiling and and open door, you’ll likely find that the light leaving the house is a bath of reflection from different sources inside the house and that likely cancels out the worst of the flicker.

hnlmorg··on A new Go API for JSON
The GP is talking about compile time errors. You’re discussing exceptions, which is still a runtime check
hnlmorg··on A new Go API for JSON
I think in the case of JSON, it was “good enough”. People who found this to be a problem would use one of the many 3rd party options.

I kind of like that the standard library doesn’t move fast. It makes it easier to fit the ecosystem into my head (unlike, for example, the JavaScript ecosystem where I find code doesn’t survive 2 years before failing to compile).

But I do agree that slow and steady produces its own problems. Your example of generics is a good one. But think the example of Go modules is another, perhaps even better, example of how sometimes the Go team really should have accelerated their efforts on.

hnlmorg··on A new Go API for JSON
I’d already addressed that when I said the marshal API is an interface that’s meant to be reusable across generalise use cases. it can be used for a variety of data formats and not just JSON.

Go has this concept baked into the language. For example read and write interfaces so you can write data to an endpoint without having to worry about whether it’s a file system object, TCP/UDP socket, gzip achieve, and a plethora of other options too.

It’s a nice convenience feature and makes up considerably for the restrictions that the Go type system places.

And if you need higher performance code, or compile time safety, or have any other constraints that limit your ability to use these generalised interfaces, then you can use different APIs from the Go standard library to achieve the same thing.

You don’t need to call json.Marshal() if you don’t want to. It’s an option, but it’s just one API into the JSON toolbox.

← PreviousPage 3 of 34Next →