News for hackers. Stuff that matters.

kurtbuilds

Re:SQL NULLs Are Weird on Thursday January 09, 2025 @12:59PM (#42648155)
If you want equality testing with nulls, you want to use `is (not) distinct from` instead of `=` and `<>` / `!=`.

`1 is not distinct from NULL` => false

`NULL is not distinct from NULL` => true

`0 is not distinct from 1` => false

What’s the process to deliver and test a quantized version of this model?

This model is 264GB, so can only be deployed in server settings.

Quantized mixtral at 24G is just small enough where it can be running on premium consumer hardware (ie 64GB RAM)

Can you elaborate on why the `mixing` approach doesn't work? Specifically, if you want send bounds, doing this:

    trait HttpService: Send {
        fn fetch(&self, url: Url)
        -> impl Future<Output = HtmlBody> + Send;
    }

    impl HttpService for MyService {
        async fn fetch(&self, url: Url) -> HtmlBody {
            // This works, as long as `do_fetch(): Send`!
            self.client.do_fetch(url).await.into_body()
        }
    }
Re:Ask HN: I’m falling out of love with coding on Monday February 06, 2023 @09:40AM (#34677867)
You are anxious about things constantly breaking, and you work in Javascript. No surprise.

Try learning Rust.

Your anxiety of things constantly breaking will disappear.

I've been coding for about 20 years. My joy of coding would be gone if not for Rust. Instead, writing code is my primary hobby today, in addition to it being (part of) my job professionally.

Re:Ask HN: Is it still safe to use Stripe? on Tuesday January 31, 2023 @11:01PM (#34606186)
What did you migrate your clients to?
Re:Ormlite: An ORM in Rust for developers that love SQL on Wednesday January 25, 2023 @02:21PM (#34522896)
That's great to hear!

Unfortunately, MySQL is less feature complete compared to Postgres and Sqlite. The migration auto-generation definitely won't work. Other features might be broken too. If you encounter any issues, please let me know!

Re:Ormlite: An ORM in Rust for developers that love SQL on Wednesday January 25, 2023 @01:59PM (#34522621)
I've been working on `ormlite` for around a year, and it's now reaching the point where it's a massive boost in productivity for my Rust application server development. It's built on the amazing foundation of `sqlx`.

If you do Rust application server development, you might be interested for several reasons:

- It now auto-generates migrations from Rust structs. To my knowledge, it is the only Rust ORM with this capability.

- The join API, while in alpha, has far moving pieces than any other Rust ORM. It only relies on the table `struct`s themselves, and does not rely on relation traits (SeaORM) or modules (Diesel).

- There's little to no query builder syntax to learn. The query builder basically joins together &str fragments of raw SQL. It strikes the right level of abstraction between composability, and having near-zero learning curve for anyone who already knows SQL.

Re:Ask HN: What's the best “higher level Rust” these days? on Monday September 26, 2022 @02:41PM (#32986653)
I'd recommend going full steam ahead with Rust.

Companies like Azure and Meta now recommend Rust as either one of several viable choices, or THE recommended option, for the use cases you describe, including CLI and web servers.

Personally at this point, just about anything that's not a frontend (android, ios, web), I think Rust is the best language for the job. It's the language I prefer, and feel most productive in, for the use cases you're describing (web server, CLI, small scripts and utils).

There's a learning curve, but at this point, I almost entirely forget about the lack of GC. It feels like writing code in any other language - except of course with all the benefits you call out (no null, ADT, typed error values, trait-based OO system, the best tooling of any language I've used, expansive 3rd party libraries).

To clarify, the JSON parse error was data coming down from the server. The code generator accepts either a JSON or a YAML OpenAPI document.

I was looking at the server logs - are you the payments company with abbreviation CP? It looks like there are a few errors in your OpenAPI doc that prevented the generator for working in your case - I'm sorry the error message wasn't more clear.

If you're interested, email me, kurt at libninja dot com, and I can describe the spec issues and we can chat about working together.

Are there APIs you have in mind?

One tool we have under development is a tool (might end up being a chrome extension) that will analyze web requests to turn them into a spec.

There are a few tools that are similar in purpose, though I've only seen ones based on proxying, rather than chrome's network request recording.

- https://github.com/alufers/mitmproxy2swagger

- https://github.com/adafruit/openapi-mitm

Thank you - fixed!

Show HN: Stripe-quality API client libraries with a single button click

https://www.libninja.com

TL;DR- Libninja will generate world-class client libraries for you, without you needing to fiddle with openapi-generator, maintain build pipelines, and so forth.If you just want Rust, reach out, and I'll create your client library at no cost, because I want to help Rust's ecosystem grow.--Hi HN,I got into Rust in a big way about 9 months ago.While the language is quickly maturing, one large gap...

( Read More... | 10 comments | 27 points | on HN )