HNHacker News
TopNewBestAskShowJobs

dangets

222 karma · joined July 28, 2012

submissionscomments
dangets··on Zap – Fast backends in Zig
Have to point out that this includes second system optimizations. Just porting C over to Zig won't give you that 3x reduction. For others, I also highly recommend the video linked in that blog post.
dangets··on Homesepot $44K pre-fab house
I remember reading on this site, not that long ago about large US companies regularly block traffic from outside US where they don't ship to or expect purchases. Home Depot was specifically called out.
dangets··on Incident with Actions, API Requests, Codespaces and Pages
Unless not lying / over sharing is bad for your shareholders. Lawyers could argue that publicizing non-material bad news about your service health makes your stock price drop.
dangets··on Datomic is Free
Link comment in a similar HN discussion:

https://news.ycombinator.com/item?id=14715279

dangets··on SQL Maxis: Why We Ditched RabbitMQ and Replaced It with a Postgres Queue
+1 to this. I'm just as wary to recommend using a DB as a queue as the next person, but it is a very common pattern at my company.

DB queues allow easy prioritization, blocking, canceling, and other dynamic queued job controls that basic FIFO queues do not. These are all things that add contention to the queue operations. Keep your queues as dumb as you possibly can and go with FIFO if you can get away with it, but DB queues aren't the worst design choice.

dangets··on The BEAM needs an APL-y language (2018)
Are you only missing types? Gleam is supposed to be designed towards that: https://gleam.run/
dangets··on A misleading open letter about sci-fi AI dangers ignores the real risks
Yes and no. That same inertia of the larger companies allows them to stay in business even after large missteps. Remember Lenovo built-in Superfish [0]? Amazon/Apple/Google are entrenched enough that can take risks, apologize, rollback, and wait for short term memory to pass and release the v2 under a different product name.

Across all startups, yes they can be risky and there will be innovative outliers that take off. But for a single no-name startup a misstep can be a death knell.

[0] https://en.wikipedia.org/wiki/Superfish

dangets··on Parse, don't validate (2019)
A similar saying and popular blog post title is "Make illegal states unrepresentable"

https://fsharpforfunandprofit.com/posts/designing-with-types...

https://ybogomolov.me/making-illegal-states-unrepresentable/

dangets··on Parse, don't validate (2019)
I would think stacking 10 generic conditions wouldn't scale if you are trying to mix and match arbitrarily. If you are trying to mix NonEmpty and AllEven and AllGreaterThan100 for the List example, then you would get the combinatorial explosion of types.

In practice, I find it is usually something like 'UnvalidatedCustomerInfo' being parsed into a 'CustomerInfo' object, where you can validate all of the fields at the same time (phone number, age, non-null name etc.). Once you have parsed it into the internal 'CustomerInfo' type - you don't need to keep re-validating the expected invariants everywhere this type is used. There was a good video on this that I wish I could find again, where the presenter gave the example of using String for a telephoneNumber field instead of a dedicated type. Any code that used the telephoneNumber field would have to re-parse and validate it "to be safe" it was in the expected format.

The topic of having untrusted external types and internal trusted types is also explained in the book `Domain Modeling Made Functional` which I highly recommend.

dangets··on 30 Days of Python
I'll give a plug for 'Cosmic Python'[0], it goes into detail of structuring larger python applications using hexagonal-ish architecture. I wouldn't recommend this approach for smaller services.

[0] https://www.cosmicpython.com/book/preface.html

dangets··on Nullness markers to enable flattening
Maybe this is from my epoch of education, but with early Java null checking everything was promoted as a good practice. Even today, depending on what your teacher said was correct, your coding experiences (e.g. if you came from C++, if you read 'Effective Java'), you might still null check everything.

Personally, I lean towards the "use nulls sparingly and be very explicit where null values are possible", use immutable objects etc. This reduces the unnecessary null-check noise and makes things more robust. In java, I even prefer to add @Nullable to fields to try to switch the default mindset to "assume non-null unless @Nullable annotation exists" - though another developer made a note on a code review that "that is not how Java is designed and @Nullable is just noise".

Having nullability as part of the type makes everything more explicit, so I'm a huge fan. Beyond just the perf and safety benefits, it's a win for domain modeling.

dangets··on Ask HN: What is it about compiling that is so time-consuming?
A major contributor can be memory access patterns. Traversing trees and pointers not adjacent in memory can result in a noticeable performance drag. Andrew Kelley gave an interesting talk about performance wins in the Zig compiler here https://media.handmade-seattle.com/practical-data-oriented-d... , but the same idea is broadly applicable.
dangets··on Carl Hewitt has died [pdf]
I wouldn't say that the actor model is going away. There are several new-ish projects built around it or retrofitting it in more common languages.

- Elixir (and Erlang) https://elixir-lang.org/

- Akka - JVM and .NET frameworks - https://akka.io/ https://getakka.net/

- Actix - Rust framework - https://actix.rs/docs/actix/getting-started

- MS Orleans - https://learn.microsoft.com/en-us/dotnet/orleans/overview

- Pony - https://www.ponylang.io/

dangets··on Maintain a clean architecture in Python with dependency rules
I struggle with this also, I assume the answer is to not have them in the same package. You can also break the application into separate 'domain', 'infra', 'application' modules as documented in [0] with rules on what dependencies are allowed in each module (e.g. domain should not have db or serialization implementation). The problem is that this does create several adapter layers which adds to the mental complexity.

[0] https://learn.microsoft.com/en-us/dotnet/architecture/micros...

dangets··on Ask HN: So you moved off Heroku, where did you go?
See the recent flurry of their sqlite replication blog posts:

- https://fly.io/blog/introducing-litefs/

- https://fly.io/blog/all-in-on-sqlite-litestream/

This allows for extremely cheap s3 database backups as well as fast local serving layer.

And many more deep dives on their blog - https://fly.io/blog/

dangets··on The deception of “buying” digital movies
It sounds like movies need to start including gpu shaders with them to add grains or other effects regardless of the compression.
dangets··on Zig, the Small Language
As the total number of ways to accomplish a task increases it puts more burden on a programmer to recognize the usage and understand the semantic differences between the options. How many ways are there to iterate over a collection in say C++?

Libraries _can_ hide some of this, but then that might also be yet another function or operator that does the same thing. Internalizing when to use one method vs. another adds to the total cognitive load of using the language, and it takes away from the mental capacity available for the problem you are actually trying to solve.

Sometimes these differences are necessary and important, other times they are less so.

dangets··on The Twitter whistleblower story is worse than you think
It is questionable whether he _can_ walk away from the deal. He signed all of the contracts and made legally binding promises to lenders with no clauses around misleading amount of spam bots or security issues. Of course, laws are more bendable when you're that rich and stand to lose billions.

If you're really interested in this stuff, it has been an ongoing centerpiece in Matt Levine's newsletter. Articles are free if you subscribe to the email, but reading prior pieces may require a subscription. e.g. https://news.bloomberglaw.com/securities-law/matt-levines-mo...

dangets··on Ask HN: Boring but important tech no one is working on?
Joe Armstrong gave a good talk on forgotten ideas in Computer Science.

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

dangets··on Carbon Language: An experimental successor to C++
A blog post by Roman Elizarov (Kotlin designer) on the observation of types following the variable name [1]. It mostly states that having consistent length prefixes (fn, val/var) makes the code more readable than arbitrarily long type identifiers (in the eye of the beholder). Not scientific, but interesting.

[1] https://elizarov.medium.com/types-are-moving-to-the-right-22...

dangets··on Things to know about databases
I have not read it personally, but I've seen 'How Query Engines Work' highly recommended several times before. I have a procrasinatory tab open to check it out some day.

https://leanpub.com/how-query-engines-work

dangets··on We're moving to a four-day work week at Beacon
The larger question is whether one would stop doing those personal things during a 4 day work week.
dangets··on Plain text, with lines
I made a few pikchr diagrams and liked the experience, though it would be good if there was a lossless WSYWIG editor that could create and edit them for quick and dirty creation.

There was a Changelog podcast episode with Richard Hipp (sqlite author) where he threw out the great idea that it would be nice if there were renderers in popular markdown engines that could display inline pikchr blocks. https://changelog.com/podcast/454

More examples of what is possible are on the linked pikchr page: https://pikchr.org/home/doc/trunk/doc/examples.md

dangets··on EU Commission is planning automatic CSAM scanning of private communications
It is not just the people in government today that you need to worry about. It is anyone in the potential future also that may abuse these initiatives.
dangets··on Bubble Tea: fun, functional and stateful way to build terminal apps
This and the surrounding ecosystem was recently featured on an episode of The Changelog podcast. https://changelog.com/podcast/481
dangets··on GraalVM 22.1: Developer experience improvements, Apple Silicon builds, and more
Do you have a link to any example repos by chance? The need has slowly been growing for some cli tools I want to write, but I haven't taken the plunge yet. I'm the most curious about peeking at your maven setup.
dangets··on The long strange trip to Java (1996)
I'm sold on Kotlin and have been working professionally in it for a few years (mixed Kotlin/Java projects server-side), so take my opinion for what it's worth.

Integrating with Java's existing build systems (Gradle, Maven) was one of JetBrains initial design goals to avoid the separate ecosystem requirement that initially came with Scala. I admit building Kotlin has some quirks, notably around annotation processors - but overall it is very seamless.

I am happy Java is adding new stuff (records, switch expressions, sealed classes), but I worry it is increasing overall language complexity vs. the fresh start that Kotlin was able to take. Supporting the legacy patterns in the language adds to the complexity any given Java developer is supposed to know.

Overall I think the sane defaults and nudges towards the right patterns Kotlin pushes are a much bigger deal than just reducing boilerplate - though that is nice too.

dangets··on A new programming language for high-performance computers
Zig has a compile time annotation that can do it.

https://zig.news/kristoff/struct-of-arrays-soa-in-zig-easy-i...

dangets··on Raspberry Pi Zero 2 W die shots
A self-directed project I did for a university course was to make a Morse code transmitter and receiver. I was able to use the same LED for both.
dangets··on F# is the best coding language today
Sure, I can see that. I was differentiating between internal company scale politics vs. larger-than-company politics. If Microsoft gave the same first-class promotion and support to F# that it did to C#, that would undoubtedly increase F# adoption.

My experience is a micro-scale observation that it did not take much campaigning to convince developers to try it (given the existing level of support backed by Jetbrains).

← PreviousPage 2 of 3Next →