Why Nostr? What is Njump?
2024-07-21 13:12:47
in reply to

mleku on Nostr: yeah, that's really sticky programmers tend to be fairly opinionated about languages ...

yeah, that's really sticky

programmers tend to be fairly opinionated about languages

some must have objects, and some don't want them

some must have functional, and others don't want them

some want composition, some want inheritance

but the protocol is not a language and only has a syntax in as far as the API is defined

you can define the API in a protocol like for example protobuf or jsonrpc2 but nostr unfortunately uses a custom API as well, with two main types and a bunch of context relative messages that tend to indicate the state of a subscription

relay testing is relatively straightforward because there is only one interface, the websockets

client testing is different, it has to provide a standard form for each kind of request that it handles, in the wire format, allowing the simulation of human inputs parsed by the client code... probably best done as part of the client-side of the library implementation... in fact it's got me thinking, maybe i should be clearly separating these two parts in my work, currently just been focused on the implementation of data encodings, that should not be in the same package as client or relay code, both should be separated

i'm gonna start thinking about this a lot, at least, preparing myself to be able to work with such a system, maybe at some point actually implement the test harness and define the language agnostic (CLI) interface

it's not possible to eliminate human language from the spec without picking a computer language and that is just not a viable approach, as outlined above

but converging on a single test implementation gives you the freedom to implement with other languages so long as everyone agrees on API encoding, while keeping the "spec" in one codebase

there is probably a reasonable way to create a side-by-side generator so you can compare different implementations to each other, it's just a small extension to the test rig's structure, allow more than one and test the outputs for differences and flag them in the logs
Author Public Key
npub1fjqqy4a93z5zsjwsfxqhc2764kvykfdyttvldkkkdera8dr78vhsmmleku