238 karma · joined Aug 15, 2011 (15y ago) · 26 submissions
1.
Show HN: Go AI SDK – A Unified Go API for LLMs(github.com ↗)
4 points · by dloreto · 1y ago · discuss
comment 3y ago · link · parent
My personal take is that at some point you are better of just using a full programming langugage like TypeScript. We created TySON https://github.com/jetpack-io/tyson to experiment with that idea.
4.
TySON: TypeScript Object Notation. Use TS as an embeddable config language.(github.com ↗)
6 points · by dloreto · 3y ago · 3 comments
comment 3y ago · link · parent
1. We've now implemented pretty thorough testing: https://github.com/jetpack-io/typeid-go/blob/main/typeid_tes...
2. I clarified the prefix in the spec
Thanks for the feedback!
comment 3y ago · link · parent
Thanks for the feedback!
comment 3y ago · link · parent
Ultimately I ended up leaning towards a base32 encoding, because I didn't want to pre-suppose case sensitivity. For example, you might want to use the id as a filename, and you might be in an environment where you're stuck with a case insensitive filesystem.
Note that TypeID is using the Crockford alphabet and always in lowercase – *not* the full rules of Crockford's encoding. There's no hyphens allowed in TypeIDs, nor multiple encodings of the same ID with different variations of the ambiguous characters.
comment 3y ago · link · parent
We have tests for the base32 encoding which is the most complicated part of the implementation (https://github.com/jetpack-io/typeid-go/blob/main/base32/bas...) but your point stands. We'll add a more rigorous test suite (particularly as the number of implementations across different languages grows, and we want to make sure all the implementations are compatible with each other)
Re: prefix, is the concern that I haven't defined the allowed character set as part of the spec?
comment 3y ago · link · parent
We might add a warning in the future if you decode/encode something that is not v7, but if it suits your use-case to encode UUIDv4 in this way, go for it. Just keep in mind that you'll lose the locality property.
comment 3y ago · link · parent
For example, the PostgresSQL implementation of TypeID, would let you use a "domain type" to define a typeid subtype. Thus ensuring that the database itself always checks the validity of the type prefix. An example is here: https://github.com/jetpack-io/typeid-sql/blob/main/example/e...
In go, we're considering it making it easy to define a new Go type, that enforces a particular type prefix. If you can do that, then the Go type system would enforce you are passing the correct type of id.
13.
Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs(github.com ↗)
418 points · by dloreto · 3y ago · 221 comments
comment 3y ago · link · parent
At jetpack.io we've been doing exactly that via TypeIDs: https://github.com/jetpack-io/typeid and there's a PostgresSQL implementation available. TypeIDs are UUIDv7 with additional type information, so you also get type-safety in your IDs.
comment 3y ago · link · parent
comment 3y ago · link · parent
Currently it works on a "per-project" basis, but we're planning to add support to use it as your primary package manager for global installs as well.
comment 4y ago · link · parent
That said, I do want to experiment with building the container directly through nix and seeing if there’s advantages to doing that. I just haven’t had the time yet.
comment 4y ago · link · parent
Sorry for the hiccups – it is our first pre release version but feedback like yours helps us harden it. It should definitely be considered beta software right now, but we’ll have it hardened before announcing a GA/1.0 version
comment 4y ago · link · parent
When writing javascript there's often a desire to have "isomorphic" or "universal" applications. Write the code once and run it in _either_ the client or the _server_.
Devbox is taking a similar approach to the development environment: declare it once, run it locally as a shell, and when you're ready, turn it into a container without having to re-declare it. It's only the latter functionality that has a Docker dependency.
comment 4y ago · link · parent
If you are comfortable with nix itself, then it allows you to do a lot more than devbox does, but at the cost of extra complexity.
Depends on what level of abstraction you're looking for.