HNHacker News
TopNewBestAskShowJobs

codesnik

1,029 karma · joined March 11, 2009

submissionscomments
codesnik··on NASA releases Hubble image taken in new pointing mode
"norton commander" shell had a user defined menu where you could create short scripts, basically just a chain of DOS commands. As a fellow teenager with no Internet access, I've made a "game" submenu which replaced normal autoexec.bat with a slim one curated for a particular game and rebooted computer right into the game. After you exit the game it'll replace autoexec.bat with the backup of normal one and reboot again back into norton commander.

I have no idea why I needed that level of automation, of course.

codesnik··on A most profound video game: a good cognitive aid for research
not many languages go that far as to allow to redefine what "call" is/does, for example. Though, some do.

"Baba is you" is pretty cool, it is not only about changing rules, it also at some point plays with what language is, and you can even stretch it to explore some platonic ideas.

codesnik··on To the brain, reading computer code is not the same as reading language (2020)
well, people are different. I feel like I have narrator voice for the code, not exactly the same way books do, but still something similar.

Also when I'm trying to read code I feel distracted and annoyed by any background noise where I can recognize words, like speech or music in a familiar language. And I can't talk while coding, it messes up what I'm typing. Also I really prefer english-like languages, like ruby, to more sigil or symbol loaded, like rust, or full of abbreviations and operators, like Haskell. But I'm sure other developers have other brain pathways activated.

codesnik··on The Lunacy of Artemis
it really depends on price and cadence.
codesnik··on Unix and Multics (2019)
or erlang style?
codesnik··on Bringing psql’s \d to your web browser
I'm not sure I understand how to use that.
codesnik··on Was the Stone Age the Wood Age?
most buildings? any example of such a country?
codesnik··on A tiny ultrabright laser that can melt steel
or quick and permanent scar
codesnik··on Embed Crystal code directly in Ruby
That's actually reassuring to hear, thank you. I'll take a look on recent changes in sorbet, I don't even remember where I've seen that "feature complete" remark, maybe I'm just imagined it.

I'd love and use sorbet if it'd be truly an optional typing, I'd happily supply signatures to public interfaces of my classes, but only to them, as a documentation and a somewhat verifiable helper to LSP. Basically, what RBS should be doing. In my experience I rarely if ever make type-like errors in the code I produce, so sorbet just added a lot of chore and forced to dumb down my code significantly, just to be ingestable by sorbet. And worse of all, it added some false sense of security, because absense of sorbet errors didn't mean absense of type mismatches in many cases. But maybe some of those concerns are gone already.

codesnik··on Embed Crystal code directly in Ruby
what annoys me to no end with sorbet is that it subtly pushes to worse looking code, even if to ignore all the verbosity and annotations.

let's say there's a generic data transformation in a method which could be extracted to a private helper method. Sorbet didn't have any issue figuring types of the result while those lines were in the parent method. But when those three lines are extracted, sorbet now requires you to write a generic signature for that method, otherwise type checking is not working anymore. Generic signatures are even more verbose and hard to write than for methods with specific types.

So, a kneejerk reaction would be just not extract those, because it becomes too much work, and readability is not improved anymore, because signature for three lines of code is taking five lines. And that's until someone "clever" will add a rule to rubocop limiting all methods to a specific amount of lines indiscriminately, so I'd spend additional work time imagining that person being punched in a face.

In theory something like that could be solved by marking helper methods as inlined, basically promising that you're not going to use them in subclasses or whatever and allowing the same inference to work inside. But "sorbet is feature complete".

codesnik··on Language models as compilers: Simulating pseudocode execution
maybe that's because prolog from 80ies basically operated in 1bit space and had just 1000s of parameters, crafted by hand. But nowadays...
codesnik··on Building the first highway segment in the U.S. that can charge electric vehicles
"electric buses are the future", and "wires are ugly and expensive to maintain". Also trolleybus depots are taking some valuable commercial space at the end of the lines, it's easier to have a bus depot on city outskirts. For most of those trolleybuses with a small battery (semi-autonomous) could be a much, much cheaper and reasonable answer, but I guess someone made a good buck on depot real estate or electric buses or whatever.
codesnik··on Debian Git Monorepo
from what I've heard, git become much friendlier with monorepos in recent years because of microsoft involvement. Windows repo, pretty sizeable, is now using git, and it supposedly works even without strange things like vfs for git.
codesnik··on Ask HN: Who is hiring? (April 2024)
and engineering lead position leads to an Airtable form which doesn't have "engineering lead" in the "position" dropdown.
codesnik··on Building the first highway segment in the U.S. that can charge electric vehicles
Moscow was a trolleybus capital of the world just recently. I'm still salty that they destroyed it in just a couple of years, replacing with regular buses and a handful of electric ones (which still require a small ICE engine in winter to stay warm, ridiculously enough)
codesnik··on The ü/ü Conundrum
I was really surprised when realized that at least in hpfs cyrillics is normalized too. For example, no russian ever thinks that Й is a И with some diacritics. It's a different letter on it's own right. But mac normalizes it into two codepoints.
codesnik··on Show HN: GritQL, a Rust CLI for rewriting source code
very powerful approach. While I'm still grepping for stuff, and for big refactorings and renames I sometime write perl onelineners, I'll give your tool a try in a brief moment before we all do refactors instructing some LLM.
codesnik··on Practical Railway-Oriented Pipelines in Ruby
yes, it is similar to rack. But what rack has this requirement of being pluggable from multiple decoupled codebases (rails or other framework, your app, some gems you're adding to your app). And that also warranted things like "insert_before" etc.

Even with rack, decoupling of code definition (where you've added your middleware) and code execution could be pretty hard to debug, but at least with enough exposure you know where to look, and you usually have only one rack stack in your app.

If all those steps in your pipeline are defined in the same codebase, rack approach becomes much less useful.

codesnik··on Practical Railway-Oriented Pipelines in Ruby
yes, of course. I usually am all about context. It's just this particular example is over-engineered in most context I've seen (and can imagine) in my 18 years of using ruby. Not much overengineered, I've seen much, much worse, but it is still annoying enough.
codesnik··on Practical Railway-Oriented Pipelines in Ruby
yes, of course. As I said, it's an urge. I wrote quite a few examples of such stuff myself, ruby is amazing for inventing new control structures and trying things. But then I think about my peers and future self who'll have to change and debug my code later, and spend additional time making stuff simpler. This is actually harder to do.

Programming is about managing complexity. Making stack trace twice as long, hiding control flow in data, most cases of metaprogramming do not reduce complexity, they increase it. Unless your app is all about usage of some specific pattern (a lot of procedural scenarios with sideffects, shortcircuiting on error and no return value) then "railway framework" is not worth it in ruby. Use exceptions (really!). Use throw, maybe.

codesnik··on Practical Railway-Oriented Pipelines in Ruby
> The senior engineer who introduced the thing like this ...

I actually consider the urge to introduce overengineered patterns like this a sure sign of a "mid-level developer". Senior knows better.

codesnik··on Git from the Bottom Up (2022)
I think it's the latter. most people don't care about decentralization. Staging is more of a nuisance, there're some projects which try to eradicate it (https://github.com/martinvonz/jj). But I think git won the last decade because it is conceptually simple and elegant. You can reason about it in the case of any trouble. You can reimplement it if needed and be absolutely sure that reimplementation is fully compatible, because it is THAT simple.
codesnik··on Ask HN: Who wants to be hired? (March 2024)
Location: Armenia

Remote: yes

Willing to relocate: possible

Technologies: Ruby on Rails, Node.js, PostgreSQL, MySQL,

Typescript, CI/CD, devops, elixir, erlang, phoenix, clojure

Résumé/CV: https://www.linkedin.com/in/alexeytrofimenko

Email: aronaxis at gmail

Experience: 20 years, 8 years remotely

I'd love to work on some B2C product and/or in early stage startup. You can expect product oriented approach from me.

codesnik··on SpaceX discloses cause of Starship anomalies as it clears an FAA hurdle
wow. Where I can read about those steel nuts? I wasn't able to google anything on the matter.
codesnik··on Perun2 Programming Language
misspelling.. or?
codesnik··on Why is the mouse cursor slightly tilted and not straight?
I suppose it makes more sense for left to right text interfaces?
codesnik··on We built our customer data warehouse all on Postgres
no. it was a private project, and my solution wasn't general enough.

for functions/views/etc: I've used https://github.com/omniti-labs/pg_extractor then removed roles from dump (because the fluctuated between developers) and executed

  perl -000 -i -lne 'print if ! /^--/ && ! /^SET /' `find schema/ -name '*.sql'` || exit 1
to remove a lot of useless comments and flags from the dump (pg_dump output isn't too readable). This oneliner can strip too much, though, comments in functions shouldn't start from the 0 column.

The same script had been run on CI too, to verify that developer didn't forget to run it in the PR.

codesnik··on We built our customer data warehouse all on Postgres
I've made some automatic schema dumping scripts for supabase/postgres code to become searchable and git-diffable and PR-friendly. And I eventually was able to make unit testing to work good enough that I even wrote migrations in a test-first way, it was just quicker to iterate. But overall experience felt like I'm constantly combating problems, solved looong time ago for other languages and ecosystems. It was weirdly fun, but what killed my interest is that row level security policies kill performance of even simple queries so much, and EXPLAIN doesn't help to well with it.
codesnik··on Arctic Adventure: A Lost 1981 TRS-80 Adventure Game
That's some pretty terse code. I'm surprised author was able to enhance the game after 40 years.
codesnik··on I pwned half of America's fast food chains simultaneously
Used it and can't actually recommend it. RLS policies slows down even simplest queries 1000x times sometimes, and postgres' current EXPLAIN ANALYZE isn't helping much. Testing app on it is still a pain. Default migration engine is oneway. Backed in database backups are close to useless. I mean, I managed to solve a lot of those issues for myself, but it still felt like I'm reinventing bicycles instead of doing actual work, and I still had a subpar experience.
← PreviousPage 7 of 17Next →