HNHacker News
TopNewBestAskShowJobs

lilactown

849 karma · joined September 2, 2015

submissionscomments
lilactown··on Effective Concurrency with Algebraic Effects in Multicore OCaml
Project Loom is both about the JVM and the language Java. Most of the work for Loom AFAICT is at the JVM level, and the benefits are that all Java code will Just Work(TM) with the new primitives underneath them at the end.

Scala’s varied async/concurrency libraries are implemented in user land, and still use threads underneath. Mechanically, you must opt in to these and have to work to interop with code that might use other primitives. Scala can handle a lot of this complexity at compile time w/ types, but it’s not perfect, and certain runtime behaviors will always be out of scope.

Loom improves this by allowing any language that runs on the JVM (Java, Scala, Clojure) to opaquely use virtual threads to run their existing synchronous, scheduler-unaware code on the new Loom concurrency primitives implemented in the JVM. That’s powerful!

lilactown··on Thoughts on Clojure UI framework
I think they are very similar, but different enough that it makes sense to use different words. Using just the word "REPL" doesn't give much insight into the iceberg of capabilities that lisps like Clojure, Common Lisp, etc. provide. I wrote a long post about some of the differences: https://news.ycombinator.com/item?id=28475647

Would love a better word or phrase to differentiate from e.g. the way people experience a python or haskell REPL.

lilactown··on Thoughts on Clojure UI framework
Modern hot reloading and how lispy REPLs work are similar in many ways, i.e. they allow you to make changes to a running application without stopping it, however there are differences in their experience and how they accomplish it.

The primary difference in experience is the unit of change that you can make with these systems, which is typically based on the unit of compilation of the language you're using.

For example if you're using a language whose unit of compilation is a file, IME you must reload every change in the file at once. This has upstream effects to how hot reloading is accomplished, because if you're reloading an entire file where you've only _actually_ changed one function, then your hot reloading system has two options:

1. It reloads everything in the file, meaning you're potentially losing state that could have been preserved across the change. This typically leads developers to spread definitions across many files in order to be able to make more fine grained changes to their running system.

2. It uses some heuristic to detect whether state should be preserved or not, typically via some static analysis. This can be opaque to developers working on applications, and adds a lot of complexity to the hot reloading system, but is probably the best one can do if your unit of compilation is a file.

Lisps, on the other hand, typically make the unit of compilation a "form", i.e. a well-formed syntax tree like (foo (bar baz)). This, combined with some editor tooling, means that I can make extremely fine grained changes to the system by selectively evaluating forms within a file, preserving its state except for the form that was evaluated.

The way this works in practice is: I have my editor open and connected to my running application using an extension. I place my cursor on a form I have changed and use a hot key to compile and send that form to the running application. I can view the return value of that form in my editor, and if there were any side effects (e.g. re-defining a variable or function), my application will now exhibit that new behavior.

Side note: the benefits of being able to evaluate forms and see their output in my editor is hard to state. It turns your editor from a one-way communication tool (I make changes, hit save, and those changes get made to the application) to a bidirectional tool, where I can both change and inspect the running system. I wish more languages had robust tooling for this.

The other difference that you tend to see between languages (even between languages with just hot reloading) is late vs. early binding. Lisps are typically very late bound, so you don't need to recompile and/or restart your entire application on every change.

Other languages who bind earlier have to deal with stale bindings. Even JS hot reloading has to deal with this problem in complex ways because most bundlers use closures as modules and bind their inter-module dependencies on instantiation, which means that even though you in theory don't need to recompile or reload anything except the one JS function you just changed, in practice you have to reload the file and any files that depend on it, which puts us back in the position of needing to use some sort of static analysis to detect what has actually changed in order to precisely invalidate application state.

I hope this mountain of text helps highlight the subtle differences between hot reloading and a lisp REPL. It's not just the tooling but the specific semantics of the language that make a difference when trying to make changes to a running system.

Source: my experience working with and developing tools for hot reloading and REPL development in JS, ClojureScript and Clojure

lilactown··on The Coronavirus Is Here Forever
Immune suppressed individuals and the people who interact with them I would assume are, as a population, used to taking care of themselves in the face of the common flu and other things which present danger to them.

The ease at which COVID, especially delta, spreads basically guarantees immune suppressed individuals will come into contact with it w/o everyone taking precautions.

You don't have to put your life on hold forever. Wear a mask, be vaccinated, and encourage others in your life to do the same. Live your life within the bounds that helps others survive this. We're in this together.

lilactown··on Facebook bans researchers who were investigating Facebook ads
The debate on who has control over data typically creates two parties: the individual user who it is related to, and the corporation providing the platform or product.

We ought to add another party: the public. Perhaps data should be able to be used for the public good, and we should be able to participate in deciding what data is collected and how data is used.

In this case, having data about what ads are seen, by whom, and why they see those ads, seems like it could lead to us better understanding how FB and other companies algorithms are segmenting the population and how certain ideas proliferate within those segments. This seems beneficial to the public, since as we've seen over the last 5 years or so, these platforms and the way they choose what information we see can have drastic effects on the economy, politics, etc. If I had a choice, I would choose to continue collecting data about the behavior of advertisers and the platforms that serve them for that kind of analysis. But we don't have a choice, because facebook "owns" that data.

A number of people in this thread have referenced Cambridge Analytica. When Facebook does choose to share data with other parties, we have no say over what data is shared with them or what they may do with it. We don't even get a choice in how Facebook internally uses our data. Instead of democratizing the decision of what data is collected and how it is used, the FTC applied the rules of private property and fined FB for lack of privacy.

The public got nothing out of that situation. Facebook now is more defensive of their ownership over our data, which also precludes us using it for the public good.

lilactown··on Apple has a decade-long lead in wearables
One of the few things I used my smart-ish watch for is tracking my sleep.

Without a large screen and turning off all notifications, I get about 3-4 weeks of battery with my current watch. Personally I rarely take it off.

I’d like at least a week of battery if I were to adopt any other smart watch. For me personally, I enjoy thinking less about the battery of a device that I mostly use for passive personal data collection and telling the time.

lilactown··on Woke at Work: Why tech firms are trying to run away from politics and failing
Democrats are an essentially center-right party with a socially progressive veneer.
lilactown··on Framework Laptop pre-orders are open, starting at $999
I'd be OK paying a premium for more modularity. I'm curious what the support for things that I can't upgrade will be like if I want to run Linux.
lilactown··on Traversing nested data-structures in various languages
The Clojure reduce solution is pretty low quality. Here's my 15 line proposal: https://github.com/josevalim/nested-data-structure-traversal...
lilactown··on What happens after a bank closes all of your credit cards?
I don't understand the dichotomy of asset vs. debt-based economy. AFAICT an asset-based economy is one whose growth is based on appreciation of equity assets[0], rather than creating value via goods or services.

In such an economy, debt would be as relevant if not more so, due to the fact that as asset prices rise the only way for many to buy in is to borrow.

[0] https://en.wikipedia.org/wiki/Asset-based_economy#:~:text=Th....

lilactown··on A new moralism is gripping the literary world
AFAICT Le Guin was criticized by feminists of her day for her decisions to be a home maker and - until later in her career - telling mostly stories of young men doing heroic things. She was "tolerated," lauded even, by the greater SciFi and Fantasy community _because_ she told stories that matched the tastes of young men back in the 60s and 70s.

It was only later that she reconciled with feminism and began writing from the feminine perspective, and received a lot of criticism from her life long fans for it!

There are valid criticisms of Left Hand of Darkness from an LGBTQ perspective, but it's also viewed as revolutionary for its time. Today, she's viewed as a complex person who contributed greatly to feminist literature - despite not being perfect - based on her merits, not because of some mistaken identity.

lilactown··on Swift Evolution: Actors
The problem IMHO is that there aren't a lot of problems that are particularly suited to STM.

I can't think of many instances where I would use STM over CAS (e.g. an atom in Clojure); and the times I have needed something akin to STM (e.g. building an incremental dataflow engine with transactions) I wanted more control over the runtime behavior than Clojure's STM provided.

Plenty of business systems need transactional guarantees and either durability or distribution (or both), which makes an external store like Postgres or Redis a ton more attractive than STM within a single process.

lilactown··on Java 16
Other languages have started to eat into Java's market share, but coincidentally a lot of them run on the same host VM as Java. For instance, Kotlin, Scala and Clojure are more and more frequently seen in backend, web and mobile development.

These languages are definitely much more "portable" depending on what your definition of portability is; the JRE runs on A LOT of systems and abstracts much of the underlying system away for you, meaning that IME you have to write a lot less platform-specific code if you're targeting e.g. Windows, macOS and Linux.

As for your edit, the licensing is a bit complex for Java but TL;DR if you install OpenJDK releases you do not need to worry yourself about licensing.

lilactown··on Understanding Coinbase
I assume it's because plaid requires your bank login information in order to make transactions on your behalf.
lilactown··on The Last Message Sent on AIM
(not the OP) two big UX gripes I have with iMessage:

1) For some reason, photos take forever to be received (and sometimes are not received at all) when I send them to certain people. Best I can tell is they're using older devices and/or are in poor reception.

This + I can't send a photo with a message attached means that I'll send the photo, then a message with context, but the person never receives the photo so it's confusing.

2) There is no clear way to dismiss messages from the list of conversations without deleting them. It makes it hard to find conversations later when I have to scroll through a bunch of stuff I don't care about, but may want to search later.

lilactown··on Modules, Monoliths, and Microservices
And this is a real killer w.r.t. startups adopting microservices: if you're shipping your org chart, but your org chart needs to change frequently to adapt to different contexts as you pivot, arrange, create and eject use cases, microservices cause frequent friction because the relationship between the way you want to organize, and the way the boundaries are established in code, are so different.

I even see the reverse happening, org chart changes made based on service boundaries, due to this friction.

lilactown··on SwiftGraphQL – A GraphQL client that lets you forget about GraphQL
If you do a survey of front end data fetching frameworks, they basically land in two categories:

- API-agnostic: react-query, rtk-query, swr

- Declarative queries (e.g. GraphQL): apollo-client, relay, urql

A major difference to notice is that the API-agnostic libraries do not handle normalizing the data before caching it. Instead, they cache the data based on some key related to the request. So you can potentially fetch and cache two different versions of the (semantically) same information, leading to UI incoherence. The various API-agnostic libraries have ways of solving this by explicitly creating relationships between different requests so that you can manually say, "when I fetch with this key, also trigger a re-fetch of any components subscribed to these other cache keys." This is coarse, but for many cases "good enough" in contexts where you don't have full control over the API you are fetching data from.

In order to leverage a normalized cache, the layer between the cache and network needs to intimately understand what data is returned by which request so that it can support things like stale-while-revalidating, re-rendering on refetch of the same data from another part of the page, etc. Describing all of the data that could possibly be returned by an endpoint is tedious and error prone, as APIs can be dynamic in what they return and backend changes could easily lead to breaking any assumptions the frontend might make about an opaque endpoint.

Now if you have more control over how a backend behaves and buy-in on solving this problem full stack, you can start to build some of these assumptions into both layers. For instance, you could require all endpoints to be fully documented via swagger, and the front end could use the swagger JSON doc to map endpoints to data potentially returned by a response. You would also need a pattern to key each request with what entity (type + ID) it is responding data with before it completes; HATEOAS provides a standard of relating URIs to entities and would solve this problem.

So you can see that this normalized caching problem can be solved without GraphQL, as long as the backend and frontend can agree on a set of standards and requirements such as REST + HATEOAS + Swagger. Personally, if someone is passionate about solving this problem, I would recommend GraphQL, but it is up to each team to decide on what solutions meet their requirements.

lilactown··on Tauri: An Electron alternative written in Rust
AFAIK Revery doesn't use webviews, it is based on Skia
lilactown··on What if incomes grew like GDP?
The difference is that we can easily redistribute wealth. It is much more difficult to redistribute "health."

IMO our goal shouldn't be for everyone to be objectively equal in all ways, but rather to be provided enough resources and opportunities to live a good life.

Like on the opposite end of your example, if I was born with a congenital condition, or became injured, I should still be able to live a good life with my needs met and opportunities to do good work. The fact that we don't have that today, due to lack of a social safety net and accessibility, is a problem.

lilactown··on I rewrote a Clojure tool in Rust
Sounds like I was mistaken. What I was seeing in my tests was due to chunking, not realizing the whole seq.
lilactown··on I rewrote a Clojure tool in Rust
I probably didn't make it any more clear in my reply. Transducers don't win based on allocations IME but because it removes the number of iterations required.

Take the case: (->> (for ,,,) (map ,,,) (filter ,,,))

`for`, `map` and `filter` will all create lazy sequences, holding a reference to the previous one. The problem here is when the `filter` seq gets realized, it will first realize the `map` seq, which will realize the `for` seq. Each sequence will wait for the next one to realize before iterating over it. So in this case it will iterate twice; once for the `map`, and then again for the `filter`.

As you know, transducers combine these steps together so that you only iterate over the initial collection once.

My other comment was making the point that the author has conflated "laziness" with "immutable data" AFAICT. The lazy seqs in the first example they give will be slower w/o transducers, but the other problem is that the overhead from all the allocations required for creating a bunch of immutable hash maps that are then destroyed immediately after is also non-negligible, and seems to be a source of the authors performance problems.

lilactown··on I rewrote a Clojure tool in Rust
When I was reading the article, I thought the author of the post was probably pointing more in the direction of Clojure's immutable data being slower, rather than laziness specifically.

IME (admittedly in a different context, doing UI development) Clojure's seqs and other immutable data can be a huge performance drag due to additional allocations needed. If you're in a hot loop where you're creating and realizing a sequence immediately, it's probably much faster to bang on a transient vector. Same with creating a bunch of immutable hash maps that you then throw away; better to create a simpler data structure (e.g. a POJO or Map) which doesn't handle complicated structural sharing patterns if it's just going to be thrown away.

Transducer's would help in the author's first case to take the map/filter piped through the `->>`, which is going to do two separate passes and realize two seqs, and combine it into one.

lilactown··on Preview in macOS Big Sur is destroying PDFs
I struggled to find good software for this. Is there a specific app you recommend?
lilactown··on ARM MacBook vs. Intel MacBook: A SIMD Benchmark
what does "inf GB/s" mean in this circumstance? I can't figure out exactly how these compare yet; the minify number makes it look like native M1 underperforms Rosetta2.
lilactown··on Thought Leaders and Chicken Sexers
It feels like you're the one trying classify what the essay's saying in a weird way. Someone can critique a person without condemning them. One can say that PG's opinions shouldn't be taken seriously without saying that he's a 'wrongthinker.'

The internet gives a mouthpiece to many, many people; not everyone's opinion should be considered with equal weight. The essay's author uses the example, "EARTH HAS 4 CORNER SIMULTANEOUS 4-DAY TIME CUBE." It is content that someone put a lot of time and effort into. How should I use the ideas and world view found in the timecube website to forge my own?

Probably not much. That's what I equivalate with "taking seriously," and a "serious public intellectual" is someone whose opinions I would probably consider when forming my own.

I don't think the author is tearing PG down to try and oust him from his material wealth; just saying, maybe what he writes in his essays shouldn't be taken as seriously as some of us thought.

lilactown··on Thought Leaders and Chicken Sexers
> The actual thrust of the argument seems so broad (i.e. reliance on intuition), this could be used to label almost anybody outside pol-sci academic circles a "profoundly unserious public intellectual" for commenting on politics

That seems like a fair assessment IMHO. Most of us are not "serious public intellectuals," especially w.r.t. politics. This isn't a moral failing; politics is hard.

I don't think the thrust of the author's point necessitates him to rigorously define what a "serious public intellectual" is, although perhaps he'd be a better "serious public intellectual" by doing so. Rather, it's building on the already numerous critiques of PG's political essays, and saying, "He's been like this all along. It's not that he got worse; he's always been like this."

PG's brand relies on us taking him seriously, and this essay's main thesis is that PG - despite his monetary success - has not earned that right, whether through his essays about programming language design or politics.

> I'm not convinced that role of intuition is exactly similar in something as subjective as political commentary as in designing a programming language.

I don't know if one is more or less subjective, but I also don't think that clarifies to me how much success in one or the other has to do with intuition. The essay uses chicken sexing as an example, which is pretty damn objective; yet success is only obtained through trained intuition.

lilactown··on Thought Leaders and Chicken Sexers
I don't see any point in the article where the author says that PG is a _bad person_. Just that perhaps we shouldn't take him seriously as an intellectual, which is perfectly okay. You can be a good person and but "unserious" w.r.t. being an intellectual - I mostly am!

The only way this is can be seen as a personal attack is if PG (and his followers) identify with being a "serious intellectual." At that point it makes sense that it would seem like an attack to point out that no, he is not a "serious intellectual." Someone's character is only tarred if they insist that they are while being demonstrably not.

lilactown··on Exotic Programming Ideas
Is the definition of datalog tied to the syntax?
lilactown··on Concurrency: Implement withUnsafe[Throwing]Continuation
I would prefer more languages provided delimited continuations, rather than “full” continuations like call/cc.

See this paper by Oleg Okmij: http://okmij.org/ftp/continuations/against-callcc.html

lilactown··on How to Think for Yourself
I am 99% sure ska is saying that "lots of people would have suggested to buy a house in 2009."

I was not in a position to buy then, but IIRC the market had plummeted the previous year and was at an all-time low; if you were in a position to buy, it was a great time to do it.

← PreviousPage 2 of 9Next →