HNHacker News
TopNewBestAskShowJobs

chucke

261 karma · joined April 3, 2016

submissionscomments
chucke··on JIT-optimized Ruby can outperform a C extension
Do you mean this one: https://node-postgres.com/features/native ? I don't know much about the node ecosystem to judge how many use this instead of libpq bindings, but judging by the number of features mentioned in that page as incompatible, it doesn't look like a free lunch.
chucke··on JIT-optimized Ruby can outperform a C extension
Probably, but you'd have to reimplement a lot of things you get for free out of libpq (prepared statements, pooler support, other things I'm forgetting about). But fwiw, there's already this: https://github.com/mneumann/postgres-pr
chucke··on JIT-optimized Ruby can outperform a C extension
That's true, but I think that it is due to a few factors: JNI is considered a big penalty in the java, and treated as a "last resort" (libvips is an example); go community has been advocating against C bindings since the runtime was itself rewritten, and treated as an antipattern; protobuf and grpc teams are compromised of mostly googlers, which have more incentives to optimize java and go (it's known that a big chunk of their services are java and c++, and most new stuff is go).

And the rest might as well just use the bindings, as it's probably easier to maintain for them, and low in ggwir priorities lidt. There's actually a pure ruby protobuf library (I believe square employees use and maintain it), but it probably won't ever be merged into google/protobuf for those reasons.

chucke··on JIT-optimized Ruby can outperform a C extension
This article outlines well the paradox that JITs require to be truly more efficient: if more of the target language is available to optimize, it'll get waaay more optimized, compared to dropping down to the layer below and try to hand-stitch it.

Of course, there is massive overhead in doing so. Just look at go, which had to rewrite practically everything already available in go, and must always require a native implementation (protobuf for example shares the underlying interface across ruby, python, php... but then has a full separate implementation in go, and java I think). And they have the budget for it at least, Google won't let go die under the overhead it created for itself.

So definitely, write more ruby, enough of those "fast-C gem - rewritten as C extension", but still keep using low level libraries like libpq.

chucke··on Gojekyll: A fast, partially compatible Go clone of Jekyll
So, no support for plugins. What's the upside then, considering that building static jekyll pages is a solved problem, even if it takes 500ms instead of 90ms?
chucke··on Python: Just Write SQL
Thea answer to your prayers already exists: http://sequel.jeremyevans.net/.

By far the best database toolkit (ORM, query builder, migration engine) I have seen for any programming language.

chucke··on Dynamic Languages Strike Back (2008)
Let's meet again in 20 years, when developers discover dynamic languages again.
chucke··on Is ORM still an anti-pattern?
Ruby sequel (http://sequel.jeremyevans.net/) is the only library where you can combine classic ORM Model bases usage, with a more raw query builder "just get me all the data into plain objects". You'll never need anything again in your career life.
chucke··on Why use OpenID Connect instead of plain OAuth2?
I don't understand what's the point of this. So there is an answer that doesn't answer the question in SO, and we glorify because it... is confirmation that yes, it's bad?

OpenID is a specific layer on top of OAuth2. It standardised claims for authentication, scopes it down to the 2 credentials flows it can care about, and that's core in a nutshell. It's complicated, but so is HTTP, which most people don't use directly anyway (and the same should be applied for OpenID, just use a blessed implementation, the OpenID foundation maintains a list of certified libraries you can rely on).

chucke··on Why Do ML on the Erlang VM?
I was mentioning mostly debugging XP. And even if my comment applies to other facets of elixir, it does not describe it as a whole. That being said, I don't find it easier to debug than ruby, IME.
chucke··on Why Do ML on the Erlang VM?
Elixir's most popular debugger tool is called pry.
chucke··on Why Do ML on the Erlang VM?
Side effects free is a good thing? Sure. Easier to debug? Cmon, elixir MO is based on, if not copied from, ruby. If anything, elixir is as easy to debug as ruby, if you can claim such a thing (I don't have substantial XP)
chucke··on Sketch of a Post-ORM
If you want a db tool which can be an ORM for your app, and drop down to a lower level dsl, while targeting specific features of the databases it supports, + having a "composable superset for building queries", there's [ruby sequel](http://sequel.jeremyevans.net/), which is the best tool of the kind you'll get for any proglang. Everything the author wants, minus the typrchecking perhaps, which is IMO shooting at the stars.
chucke··on Rails Cheat Sheet
Thx for the FUD salt. Rails never left, and neither did sinatra. In fact, other frameworks came to play, like roda. Ruby is ok.

Sure, jekyll is no longer the new hotness, but I don't see a market shift towards a single tool. There's just the usual fragmentation. Hugo, next, none of them is consensual.

Ruby was one of the primary targets of wasi. It compiles to WASM since 3.2 officially, but work started more than a year ago. Ruby in the browser is possible.

Sure, not everyone is targeting Ruby. But I don't see new products targeting new stuff either. Seems that there are less oficial SDKs nowadays, usually targeting the top 3 tier 1. And that's fine, and means little about Ruby in the end.

chucke··on Story: Redis and its creator antirez
It's actually funny to see mentioned again, just like recently in a linus torvalds interview about git, how the "ruby people" contributed yet again to the massive popularity surge of an otherwise unrelated piece of software. It was definitely a special time, the ascension of that community.

And obviously, antirez and redis rock!

chucke··on How Postgres Triggers Can Simplify Your Back End Development
Workflow engines are neither simple, nor they are widely available for all programming languages.
chucke··on Reliable event dispatching using a transactional outbox
On the topic, I created this ruby gem called tobox, essentially a transactional outbox framework: https://gitlab.com/os85/tobox

It actually circumvents most of the limitations mentioned in the article. Been successfully using it at work as an sns relay, for another app which is not even ruby.

chucke··on Thoughts on the Python packaging ecosystem
Ruby was actually the precursor to the solutions seen nowadays. It was thre first mainstream case of a packaging tool using lockfiles, and one of the persons behind it was also involved in the development of yarn (which brought lockfiles to node) and rust cargo.
chucke··on Breaking the Snake: How Python went from 2 to 3
What example is C# exactly? Never struck me as anything reaching wide adoption outside of the enterprise MS market, and you can certainly change anything if your customers already sunk the licensing cost. I certainly never and will never touch it, with or without incompatible language changes.
chucke··on Breaking the Snake: How Python went from 2 to 3
Tell that to perl, or php.
chucke··on Ruby 3.2’s YJIT is Production-Ready
https://ruby.social/@eregon/109280839376585363

Tl;Dr it runs rails for a while already, it even runs mastodon.

chucke··on Ruby 3.2’s YJIT is Production-Ready
The core team is split across oracle and shopify. They are still actively interested in it, even for research purposes.
chucke··on Ask HN: Who’s using Ruby for web development, without Ruby on Rails?
> You don't have to use all of the features Rails provides.

You kind of do. First, you have to opt-out, not opt-in. And the opt-out path is less battle-tested, so there's a lot of skeletons to be found there. Use it at your own risk.

If you want the best modern example of a ruby framework which starts small (like sinatra) but allows you to opt into a wider feature-set (like rails), you should give roda a look: https://www.youtube.com/watch?v=9fukis_VHl4

chucke··on Rails authentication from scratch
Roda is not a full blown framework. The footprint of rodauth overall is quite low, when compared. Couple that with the fact that you get 2 factors, sms, otp, webauthn, json mode, argon2, along with json mode + an array of security and usability features, from a single dependency.
chucke··on Rails authentication from scratch
Devise has not aged well. It's quite complex for the functionality it offers. Does not support json api mode. Only supports email/password. It's account creation flow is too simplistic for what most apps require OOTB.
chucke··on Rails authentication from scratch
Roda is as lightweight as it gets, when it comes to ruby web routers. If you're worried about heavy dependencies, you should probably look into rails first.
chucke··on Rails authentication from scratch
If you want to use an authentication solution which will not make you want to roll your own and highly configurable, use rodauth: http://rodauth.jeremyevans.net/
chucke··on Ruby 3.2.0 is from another dimension
I think you're spot on. Ruby actually gained wider appeal only when it gained visibility in the US (via rails). Being present in the markets which drive adoption matters more than being consistent, which python isn't ("one way of doing things" is mostly a meme nowadays, everyone touching python knows it's fake).
chucke··on The State of HTTP in 2022
Definitely not performance, QUERY is an improvement/hackfix. Browsers have a cap on size of the request headline path (used to be very small for IE7), and server software also tend to cap the size of it, as a security mitigation (smth like max header size, similar to what happens with cookies). For this reason, technologies such as elasticsearch or graphql, which allow for quite large query defs, use POST and fit the query in the body instead, which is not bound to the same limitations.

Semantically, such queries are cacheable, but the request being POST, intermediate edge proxies or CDNs won't cache the request. This means clients pay the penalty every single time. Moreover, browsers can't have url-based history with such solutions, as POST requests can't "go back".

So QUERY fixes this. Semantically. Now you have to build support in middle boxes for it, and browsers must support it as well.

chucke··on Pelé has died
That statement does not make justice to the time Pelé played in.

Pelé came of age at a time where the best brazilian players played in Brazil. Some of those legends he played alongside in the selecção, from Garrincha, Amarildo, Vavá, Djalma Santos, all the way to Rivelino, Tostão, Jairzinho, were playing for rival teams in Brazil. Tier-1 league in the 60s. He rose above them all internally.

Pelé scored his 1000th goal at 28. As prolific as Messi and Ronaldo were, they're not a match. Compare goal-by-games differential.

Football has progressed a lot in terms of science and strategy. But it also regressed. For instance, compare the competitiveness of the champions league circa 2000, and during the heyday of Messi-Ronaldo. Back then, there were absolute CL classics in the group stages. Later on, thanks to Platini's election as UEFA president, there was a flood of low market eastern european teams in the group stages, which contributed to goals-per-edition being broken several times by Ronaldo and Messi. Consider as well that both broke goalscoring records in Spain where, not counting Atletico Madrid, every other team just played in a "separate lower division". Those would probably never happen had they played in the Premier league. Bottom line, they're all-time greats, but throwing the competitiveness argument to the table is disingenuous at best.

Put Pelé in real perspective. Back then, careers didn't last long, nor had a lot of impact. Besides playing in Brazil, his Santos team played all around the world in highly competitive "friendlies" 58-62, as everybody wanted a piece of Pelé. Think about the impact of such games when it comes to selling the game worldwide. He was 17-21 years old. He's the single 3-time WC winner there is. And he won them all against all-time greats. He beat Gre-no-li in 58. Beckenbauer. Mueller. Eusébio. Bobby Charlton. Lev Yashin. Rivera. He was the face of the WC 70, the first color-televised WC, and the one credited with spreading football worldwide. And then Pelé played well into his late 30s in the USA, credited for introducing the sport to the american audience. When he was gone, football was the only true world sport, and a profit machine in the making. Today it's a multi-million dollar industry. Current players sell their brands using football. Pelé is football.

← PreviousPage 3 of 6Next →