Better HN
topnewbestaskshowjobs
Log inSign up

john-shaffer

595 karma · joined Oct 22, 2019 (7y ago) · 206 submissions

https://github.com/john-shaffer

hn.scorn217@passmail.net

Submissions

comment 11mo ago · link · parent

AWS announced Lambda durable functions today in a blog post titled "Build multi-step applications and AI workflows with AWS Lambda durable functions" [0]

[0] https://aws.amazon.com/blogs/aws/build-multi-step-applicatio...

2.

Lambda Durable Functions(docs.aws.amazon.com ↗)

11 points · by john-shaffer · 11mo ago · 9 comments

comment 1y ago · link · parent

Related story with much more detail and comments: https://news.ycombinator.com/item?id=44105878

comment 2y ago · link · parent

Have you considered https://github.com/dolthub/dolt for your use case?

comment 2y ago · link · parent

But Nix is the best way to build images for dockerc.

comment 2y ago · link · parent

Mostly playing around with stacking "powerful" words:

  King Kong + Power Ranger = King Kong Ranger (first)
  Megazord + Power Ranger = Power Megazord
  Megazord + Power Megazord or Artzord + Megazord = Ultrazord
  Dragonzord + Art = Artzord (first)
  Groot + Mega Artzord = Grootzord
  Megazord + Grootzord = Gigazord (first)
  Godzord + Giga Artzord = Giga Godzord (first)
  Giga Godzord + Giga Titanic Gigazord = Giga Titanic Godzord (first)
  Giga Titanic Godzord + Mega Power Godzillazord = Super Giga Mega Titanic Power Godzillazord (first)
I also got firsts on both Earthquake Laser and Laser Earthquake, but I'm not sure what the recipes were.

Trying to get Zebra was an interesting sequence.

  Tamer + Africa = Tamerlane (first)
  Tamerlane + Terror = Timur (first)
  Timur + Asia = Genghis Khan
  Genghis Khan + Bellerophon = Alexander the Great
  Alexander the Great + Unicorn = Bucephalus (first)
  Alexander the Great + Bucephalus = Horse
  Horse + Africa = Zebra

comment 2y ago · link · parent

https://jobs.braveclojure.com/

comment 2y ago · link · parent

Clojure itself actually loads pretty quickly, but almost every project has enough libraries to make loading the project take a few seconds.

comment 2y ago · link · parent

  export LC_ALL=C
  nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/2322899a1fa85f6547004b2829af81e7b444f506.tar.gz -p openssh
  ssh -V
  OpenSSH_6.1p1, OpenSSL 1.0.0i 19 Apr 2012
Note that the first stable release of nixpkgs was in 2013.

comment 2y ago · link · parent

> So how do I install the old version next to the new version in ubuntu 34.04?

You would install Nix and run something similar to "nix run nixpkgs-23.11#openssh <address>"

comment 2y ago · link · parent

This looks promising, but it doesn't work on personal accounts. I'm not ready to install it on my organization account just yet.

Can I expect complex caching actions like https://github.com/DeterminateSystems/magic-nix-cache to work as quickly as they do on GitHub?

comment 3y ago · link · parent

Clarification on file duplication: DVC tries to use reflinks if the filesystem supports it, and falls back on copying the files. It can be configured to use hardlinks instead for filesystems like ext4 [0]. This improves performance significantly.

[0] https://dvc.org/doc/user-guide/project-structure/configurati...

comment 3y ago · link · parent

DVC is slow because it stores and writes data twice, and the default of dozens of concurrent downloads causes resource starvation. They finally improved uploads in 3.0, but downloads and storage are still much worse than a simple "aws s3 cp". You can improve pull performance somewhat by passing a reasonable value for --jobs. Storage can be improved by nuking .dvc/cache. There's no way to skip writing all data twice though.

Look for something with good algorithms. Xethub worked very well for me, and oxen looks like a good alternative. git-xet has a very nice feature that allows you to mount a repo over the network [0]

[0] https://about.xethub.com/blog/mount-part-1

comment 3y ago · link · parent

Performance with Docker is slightly worse, but it shouldn't be an issue for a long-running process. The main problem I've run into is that, by default, Docker logs will eventually fill the disk and crash the server. You have to change the logging system and then delete and recreate all of your containers, because there is no way to change the logging system for existing containers.

comment 3y ago · link · parent

Thanks. I had no idea D2 was on switch, and it's on sale for $13! [1]

[1] https://www.nintendo.com/store/products/diablo-ii-resurrecte...

comment 3y ago · link · parent

malli, specter, and calva are all less than ten years old. Clojure has seen a lot of progress in tooling and libraries.

comment 4y ago · link · parent

IIRC, posts with more comments than votes are automatically penalized. It is #11 on the front page now, though.

comment 4y ago · link · parent

Polylith does a good job of solving this: https://polylith.gitbook.io/polylith/

19.

My case against mocking frameworks(dpc.pw ↗)

2 points · by john-shaffer · 4y ago · discuss

comment 4y ago · link · parent

Have you had problems with Nix on macOS? Nix works great for me, but I can't use it much to deal with installs or synchronize dependencies because the devs on macOS can't get Nix running.

comment 4y ago · link · parent

I have no affiliation, but I tried the free trial of their tool and I found that the Code Health metrics made a lot of sense. The files that it pointed out are definitely overly complex and more difficult to change than they need to be. But it gave perfect scores to some files with complex jobs that are better-designed. I recommend just giving it a spin on a codebase that you are very familiar with.

22.

Code quality: measuring the business impact of unhealthy code(codescene.com ↗)

11 points · by john-shaffer · 4y ago · 13 comments

comment 4y ago · link · parent

In production, I may only want one connection pool to a DB, and in that case global state is pretty much equivalent to passing state as an argument. Development in a Clojure REPL is a different story. I have one connection pool for the dev server, and a separate pool to run tests against. The test db is re-created from a template between each test run, without affecting the dev db at all. I can trivially have multiple test pools if I want to run tests concurrently.

I also have a separate service that the server makes calls to, which doesn't run on this server in production (it has its own production server), but does run in dev and test. Each dev/test system runs a separate instance of this service, which has its own separate connection pool(s), and setting this up was trivial.

Needless to say, failures are reproducible and meaningful. There is no mocking -- we test against real local services with real local DBs. (There are still some remote service calls which I'm slowly replacing, and some flakey, unavoidable remote dependencies in a few browser tests).

I didn't do anything special to make this possible other than naming the config files "service-name-config" instead of just "config". It is just the natural result of passing state in explicit arguments. The same is not true of global state.

comment 4y ago · link · parent

Thanks for the explanation. What are some of the other techniques?

comment 4y ago · link · parent

I just added a test case that importing org.apache.logging.log4j.core.lookup.JndiLookup throws a ClassNotFoundException. Any log4j2 class would work too.

comment 4y ago · link · parent

Clojure is strongly typed and dynamically typed, not "untyped". Much of its core behavior is built on interfaces like ISeq.

It's not uncommon to use a spec library like clojure.spec or malli, whose benefits overlap those of static typing. I'm not sure if there is a measured improvement from their use, but they have either advantages like facilitating generative testing that do help one to write more correct software.

comment 4y ago · link · parent

I have one of their borg accounts, which is a fraction of the normal price. https://www.rsync.net/products/borg.html

comment 5y ago · link · parent

This is a good example of why dynamic vars are dangerous. They are just as perilous as global state, but are more surprising and more difficult to understand. Prefer passing explicit arguments in all cases. You don't have to even think about the behavior, and you'll never spend 8 hours tracking down a missing binding in a commit from 2018.

comment 5y ago · link · parent

It's pretty easy to run embedded postgres on the JVM: https://github.com/opentable/otj-pg-embedded

The defaults create a temporary DB which is useful for dev & tests, but a pair of calls to .setCleanDataDirectory(false) and .setDataDirectory("...") will change that.

If you don't like the default postgres version, you may select one from https://search.maven.org/search?q=io.zonky.test.postgres or include your own postgres binary.

1234567