HNHacker News
TopNewBestAskShowJobs

huahaiy

351 karma · joined November 7, 2011

I am a technologist, with an academic background in psychology and computer science.
submissionscomments
huahaiy··on Why I Chose Common Lisp
Graalvm native image for Clojure is a solved problem. Just add this library to the project and add a flag to native image command line.

https://github.com/clj-easy/graal-build-time

This initializes Clojure classes at build time and it mostly works for pure Clojure code.

Doing complicated things (e.g. depending on native library, etc.) requires some tweaking. For example, a few packages may need to be declared as initialized at build time or run time, depending what they are doing. And any unresolved classes need to be added to reflection-config.json.

All these are easily discoverable if one talks to people in the Clojurian slack channels. Clojure is a small community, so it helps to be part of it, because there are not a lot of open materials on the Web.

huahaiy··on Competing for the JOB with a Triplestore
Author here, happy to talk about it. Thank refset for posting.
huahaiy··on Ask HN: If you are starting in 2024, what is the most productive solo dev stack?
Clojure/clojurescript
huahaiy··on Jepsen: Datomic Pro 1.0.7075
Correct. I don't know about DataScript's intention, but it is intentional for Datalevin, as we have tests for sequential intra-transaction semantics.
huahaiy··on Are You Sure You Want to Use MMAP in Your Database Management System? (2022)
Embedded DB
huahaiy··on Clojure Turns 15 panel discussion video
Not really.

Our experience is that Clojure is a very good language for newcomers to programming as a profession.

In fact, we almost exclusively hire new computer science graduates. None of them had heard of Clojure before joining, and the vast majority of them became useful in 2 weeks, and become productive in a few months. What you described as barriers are the things that got sorted out in the first day when they join.

We do not hire veterans unless they already know Clojure. These people need to unlearn stuff, some of them are resistant to changes, so we don't bother with them.

huahaiy··on The near future of AI is action-driven
Maybe you should try some "small names" in AI chatbots.
huahaiy··on California Says Brace for Blackouts as Heat Wave Drives Record Power Use
We have backouts two days in a roll now at south bay. Both lasted over 6 hours, right at the honest hours of the day. My bedroom temperature reached 90 degree last night. This is maddening.
huahaiy··on The Jank Language: LLVM Hosted Clojure
That's indeed a valid concern. Keeps my finger crossed.
huahaiy··on The Jank Language: LLVM Hosted Clojure
Rust and Clojure address completely different domains of problems.

Rust is competing with C++ for writing low level systems, whereas Clojure is designed for writing business applications.

Low level systems tend to have stable and well understood requirements, whereas the same cannot be said for business applications. Efficiency is not a primary concern of business applications, but flexibility is. The efficiency of Clojure is often "good enough" for business application, and there is no peer in flexibility. This explains the many fintech companies using Clojure, as well as many other B2B companies.

huahaiy··on Clojure needs a Rails
Most of these things do have Clojure libraries. For example:

- unit tests with ephemeral dbs: we use com.opentable.components/otj-pg-embedded for postgres.

- db migrations: there are Migratus and many others, we also just use flyway in app startup shell script

Some are not relevant if you write proper Clojure.

- ORM library: I am not sure you need these in Clojure. Clojure is data-oriented, not object-oriented, so you don't need to map data to objects. Clojure is good at transforming data. Just keep data as data.

I don't recall us spent too much effort in building Clojure libraries of our own for something missing.

For my over a decade of Clojure career, I only built two Clojure libraries of my own. Both were not missing, just that I didn't like the existing ones. One is a Clojure data diff library (Editscript), and another is a database (Datalevin).

In general, if one cannot find a Clojure library (very rare), we tend to use Java interop. As mentioned repeatedly, Clojure is a hosted language and we embrace the platform.

huahaiy··on Clojure needs a Rails
That's fine.

But I was merely pointing out a false premise. The article was saying too much focus was spent on "big web frameworks" in Clojure, but the reality is that most people in the community do not care about these at all.

huahaiy··on Clojure needs a Rails
Clojure itself is not much more than a decade years old. Even that, there are quite many libraries that have stayed all these year, e.g. the standard things I mentioned, such as Ring, Reagent, etc.

As I have already mentioned, "actively maintained" is not a requirement for many Clojure libraries. Many are just done, as in "nothing needs to be changed".

As long as they are still working, why do you want to update them? As I mentioned, many production code bases in Clojure contain libraries that have not been updated for ages, but they still work. Why fixing things that are not broken?

huahaiy··on Clojure needs a Rails
Of course. I have plenty of cases when working django, flask, and tensorflow code stop working after bumping the dependency versions.

In fact, it is rare that I do not need to change code after I upgrade python dependencies. Most likely I have to change my code.

huahaiy··on Clojure needs a Rails
So what you mean by "stable" is in the names only, but not in substance.

What I mean by stable, is that my code remains working after I upgrade the dependencies, which is definitely NOT the case for python frameworks, but it is mostly the case for Clojure libraries.

In Clojure, Web related things have remained relevant for a long time as well. For example, I do not anticipate that the standard things such as Ring, Reagent, Re-frame, etc. are going to change any time soon.

If you have not used Clojure, you just have not experienced what a stable ecosystem looks like. You have too used to changing your own code just because of a dependency bump. This is very rare in the Clojure world, but a norm outside.

huahaiy··on Clojure needs a Rails
I don't think the HN mentions of Clojure is representative of what the Clojure community thinks. If you are talking about the frontpage of HN, it is even less representative.

The Clojurians slack, Clojure Reddits and Clojurverse are more representative, and you can hardly see anything about Web frameworks in those places.

huahaiy··on Clojure needs a Rails
Clojure is intended as a hosted language and embracing the host is the philosophy, so interop with the host is never a bandage.

Again, I am curious where you get all these impressions that are contrary to most people in the community take for granted, such as:

* Clojurians prefer libraries over framework, but you said we spent too much effort in developing "big web framework".

* Clojure is intended to be a hosted language, so seamless interop with the host is the norm, but you thought interop is a bandage until Clojure matures.

It's very interesting.

huahaiy··on Clojure needs a Rails
Care to mention a few examples of missing libraries that you spent 50% of time writing on the job?

I can hardly recall a case where I could not find a Clojure libraries for. The only exception would be wrappers for proprietary APIs, such as Stripe.

huahaiy··on Clojure needs a Rails
"countless of Clojure dependencies having died"?

What exact does it mean by "died"? It does not work any more? Very unlikely.

In the Clojure world, it is the norm that a 5 years old library works as well as a one-week old one.

If you mean "died" by "not updated any more", sure that's the norm in Clojure as well. Some libraries are done, and some authors moved on. But most likely, these libraries can still be used just fine.

My production code base contains plenty of libraries that are not updated for ages, but I consider that a benefit, not a fault.

huahaiy··on Clojure needs a Rails
Retries, JSON coercions and so on do have Clojure libraries for them, so I am not sure why you want to solve these problems yourself, let alone a dozen times. Really not sure what your exact point is.
huahaiy··on Clojure needs a Rails
"very stable" and python in the same sentence? I am not sure about that.
huahaiy··on Clojure needs a Rails
Your observation is simply not true. To the contrary, the consensus of the community seems to be that there's no need for a rails-like framework for Clojure. Most of Clojurians are satisfied with what we have in the Web front, and are not worrying about the lack of "big Web framework" at all. I don't know where you got your impression from.
huahaiy··on Clojure needs a Rails
"open-source efforts are repeatedly being spent on trying to build the next web framework/library/toolkit (Rails) for Clojure and not much else", really?

That's contrary to what most of us know. There are some efforts in the Web front, but not much. At least, the community is not paying much attention to these efforts.

Let's look at the list of community funded projects, e.g. those in Clojure Together: the only Web related projects funded were clj-http in 2018, ring, re-frame and reagent in 2020. None of these are Web frameworks, and the rest of the funded projects are not Web related at all.

huahaiy··on Clojure needs a Rails
What are the "missing or rotting libraries"? Maybe a few examples might be helpful. In my over 10 years of using Clojure in production, I am not sure I have "re-implemented" a lot of logic that are not already covered by some Clojure libraries. Such examples are rare.

Sure, I have used Java interop for working with Stripe, but that's because it is futile to maintain a 3rd party Clojure library if Stripe decided not to do it themselves. These proprietary APIs are constantly changing. It is perfectly OK to do Java interop in these cases. Any niche language will have the same problem, and Clojure interop with Java is quite pleasant to use, compared with using Java itself.

As far as I can tell, using ring and related things are fairly standard on the server side, and re-frame and related things are fairly standard on the client side, so I am honestly not sure what is missing for Web development in Clojure, as Web development is the most common use case of Clojure.

I am honestly confused.

huahaiy··on SQLite Internals: Pages and B-trees
Sounds like Datalevin https://github.com/juji-io/datalevin

Embeddable, check. Datomic data model and Datalog query, check. Storage written in C, check.

huahaiy··on Max Datom: Interactive Datomic Tutorial
Not exactly.

My goal of developing Datalevin is to replace our use of both Datomic and Postgres, so we have a single DB. The aim is to provide a versatile database that meets data needs of most use cases.

I mention Sqlite in README because I have not finished the query engine rewrite of Datalevin, so the query performance is not up to my standard of being competitive with relational databases for large data sets. However, even at the current state, Datalevin is already faster than the alternative Datalog stores in the Clojure world for the most part.

Finally, since you seems to want to go into this space, I will mention that: without some new tricks in query algorithms, triple stores would be always slower than standard relational DBs. This is not a solved problem. Just be aware what you are getting yourself into.

huahaiy··on Max Datom: Interactive Datomic Tutorial
Every database that implements MVCC does this, that means most ACID databases. So "reading a consistent view" is not unique for Datomic.
huahaiy··on T-Wand: beating Lucene in less than 600 lines of code
The "hostility" I referred to was the one towards the users. Basically, he's demanding users to show evidence that whatever they want is better than BM25.

That's just wrong. Period. This is the reason I mention his job, because his job requires him to listen to the users, instead of taking something he learned in school and use that to talk condescendingly to his users. That's not gonna fly.

Given this context, I think whatever I said it is entirely appropriate.

huahaiy··on T-Wand: beating Lucene in less than 600 lines of code
One observation I have to make: this community of information retrieval seems to be very thin-faced and cannot seem to accept outside contributions. I hope I am wrong.

This is not an isolated case. They rejected some industry changing contributions when they first came out.

For example, I remember that Google PageRank paper was outright rejected by SiGIR. Lucky for us, that paper was rejected, shattering the dream of an easy academia career for the two Google founders. Otherwise, we would probably still be searching with hotbots (remember that?).

The WAND paper was published in CIKM, a lowly conference in some people's eyes, I guess that's not the first venue they tried to publish that work in, because I worked at IBM Research before, I knew for a fact that CIKM was not in the first tier of the venues to publish, definitely not for the IR PIC.

Very interesting. I wonder what have caused this. My wild guess is that this may has something to do with early mistreatment the pioneering IR people received from the wider CS community, because their field was probably considered "soft" and not hard enough. For instance, even today, IR papers are not full of theorems and proofs, unlike some other CS fields, such as database. Their revengeful attitude got passed down to their students, as we can see here. And their reasons for dismissing other people's work are all the same: this is not new, we have done this before. But you have not, because the proof is in the systems you build and the papers you publish.

It does not have to be this way. HCI is even softer, but HCI is the most open field in CS, anyone can publish, you can prove theorems, or you can present user studies, anything goes. Funding? Not a problem. Because it is so open, HCI can work with anyone and on any projects. I remember that my advisor had so much funding, he basically paid me to whatever I wanted when I was in school. I am deeply in gratitude for that openness.

huahaiy··on T-Wand: beating Lucene in less than 600 lines of code
Again, you miss the novelty of the algorithm due to your smugness. I have updated the article to point out explicitly where the novelty is at. You completely ignored that. In fact, I believe you didn't even read that far before your jumping out to write this dismissal.

I wrote a blog post for lay people to read. I am under no obligation to do an extensive literature review, I only need to mention the essentials.

You just cannot seem to swallow the fact that someone who does not have a Ph.D in IR or computational linguistics can come in to contribute quickly then move on to something else. It hurts your feelings deeply, does it? Heed my advice, just get over it, don't take your degree or your specialization too seriously. It does not matter.

← PreviousPage 2 of 7Next →