
hi all, finally wrote something about my wip language Fairylog, for programming FPGAs http://pinksquirrellabs.com/blog/2019/04/17/fairylog/

@jim.lee has joined the channel

@pezi_pink very cool!

Philosophy and terminology question: if modules can enter contacts with each other, does that mean modules have rights? If there was a “software module bill of rights” what would you expect it to contain?

@notjack have you seen this? https://www.youtube.com/watch?v=LIEX3tUliHw

(maybe related content)

@samdphillips Yes! It’s what originally got me thinking about whether or not the term “bill of rights” makes sense for more kinds of code than just macro implementations

I think that at a base level provides give the right to access a name. And with contracts (and blame) modules have the right that those names will deal with certain values.

(or rather “access a value with a specific name”)

- Free speech: a module has the right to provide bindings with data, print stuff, open gui windows, etc. when run.
- Soldiers need consent before staying in someone’s house: a module has the right to guard its functions with contracts that say
(not/c soldier?)
. - Unreasonable search and seizure: Encapsulation and being able to hide information from inspectors? For this to work no one should be able to get a root-inspector unless they have a warrant with probable cause, so this right isn’t being protected completely.
- Due-process, no double-jeopordy, no forced self-incrimination, etc: When a contract blames a module, it must have the correct reasons, it can’t just assign blame without a proper trial. A contract can’t blame a module twice for the same contract-value instance. A module can’t be forced to blame itself for a contract it didn’t invoke. This right is violated all the time. The
contract
form just takes positive and negative blame as arguments and trusts the programer, the module being blamed doesn’t have any say in that. - Trial, impartial jury, right to legal counsel and witnesses in your favor: When a contract blames a module it has a right to a trial with legal counsel to defend it? When a contract blames a module there is no trial, the programmer just assumes it’s guilty. This right is also violated all the time. 7,8. um this analogy is starting to break down.
- Don’t misinterpret enumurations.
- Powers not delegated to the federal government or prohibited by it, are given to the states or the people: I don’t know how this would apply to modules or contracts.

Clarifications: in this context, “software module” does not necessarily mean “Racket module”. Functions can be modules, as well as Java classes, command line programs, web services, virtual machine images, and linkable object code files. Also, a software bill of rights doesn’t have to map one-to-one (or at all) to the US bill of rights (and it probably shouldn’t).

But reflection systems that prevent proper encapsulation are still a violation of the module’s rights.

I think so, yes. I think “right to privacy” is a reasonable demand

Meaning the right for a module to hide information from another module if it is not relevant to the contract between them

@greg thanks for the logging config pointer, i’ll check that out.

@notjack Hobbes might argue that, beneath the veneer of social contracts lurks a state of nature imposed by the generational garbage collector, in which the lifetime of objects ought to be solitary, poor, nasty, brutish, and short.

Alas I don’t know enough about to Thomas Hobbes to properly appreciate that joke. I just know he was a philosopher and one of the two namesakes of my favorite comic strip.

Oh right, you’re a lawyer! Perfect!

It’s a barely coherent joke, anyway. ¯_(ツ)_/¯

To me (a US-centric non-lawyer) those do sound like separate notions, and it sounds like a useful distinction

In the context of software, I’d associate the first with contacts between two parties of similar authority, like module-to-module or server-to-server. The second sounds kind of like agreements between different levels of authority like module-to-programming-language or server-to-hypervisor

That’s fine, sometimes all you need is a vague direction :p

@tgrelsson has joined the channel

Not saying I’m actually going to, but if I wrote a scribble doc about this would you want to read it?

I can’t seem to find a way to attach contracts to parameters. Imagine I’d like a parameter, current-characters, to be such that (current-characters) is either #f or a list of char? values. I’d like (parameterize ([current-characters “haha!”]) …) to raise a contract violation. I don’t think parameterize works like that, but I’d imagine that there’s something that would. I can write my own thing, but perhaps I’m overseeing something simple here.

@jesse Is there a reason parameter/c
isn’t enough for what you want? https://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._parameter%2Fc%29%29

oh. d’oh. yes, that’s what I have in mind. thanks!