3
0
Fork
You've already forked spec
0

Add Smalltalk sample encoder #3

Closed
emery wants to merge 4 commits from smalltall-samples into main
pull from: smalltall-samples
merge into: eris:main
eris:main
eris:pages
eris:tup
eris:ietf-rfc-xml
Owner
Copy link

I've added some imperative code to show the minimal imperative streaming encoder.

Its Smalltalk, which is unusual, but Smalltalk has the least syntax of any language that I'm comfortable with.

I've added some imperative code to show the minimal imperative streaming encoder. Its Smalltalk, which is unusual, but Smalltalk has the least syntax of any language that I'm comfortable with.
emery force-pushed smalltall-samples from 2c8a12e930 to 56dffad682 2022年07月01日 22:53:06 +02:00 Compare
emery force-pushed smalltall-samples from 56dffad682 to cfac9d789f 2022年07月01日 23:06:38 +02:00 Compare
implementation".
The distinction between functional and imperative seems a bit
unnecessary to me. Naming the implementation by language seems
clearer. Let's let other people decide what imperative and functional
means.

I like that we include a Smalltalk implementation instead of C.

I've renamed the section to "Smalltalk-80 implementation". I find it very hard to distinguish what "imperative" or "functional" means. Let's just name the implementations by the programming language.

I like that we include a Smalltalk implementation instead of C. I've renamed the section to "Smalltalk-80 implementation". I find it very hard to distinguish what "imperative" or "functional" means. Let's just name the implementations by the programming language.
@ -1754,0 +1782,4 @@
<section anchor="exampleErisStore"
title="ErisStore">
<figure>
<preamble>A common implementation pattern is to use a semi-abstract object to represent a store of blocks. It should at miminum provide a <tt>get</tt> and <tt>put</tt> method and may also provide methods for handling cleartext blocks.</preamble>

Hm. I'm not sure if this is an abstraction we should introduce in the specification (even if in the appendix).

How about adding an Object BlockStorage that only has a get and put and does not do any encryption (move crypto to ErisEncoder)? This would make the BlockStorage object correspond much closer to things described in section 3.1 Storage and Transport Layer.

Hm. I'm not sure if this is an abstraction we should introduce in the specification (even if in the appendix). How about adding an Object `BlockStorage` that only has a `get` and `put` and does not do any encryption (move crypto to `ErisEncoder`)? This would make the `BlockStorage` object correspond much closer to things described in section 3.1 Storage and Transport Layer.

I think it would be nice to also include a random-access streaming decoder. In my experience, this is much trickier than the streaming encoder. Do you think you could add a Smalltalk-80 random-access decoder?

I think it would be nice to also include a random-access streaming decoder. In my experience, this is much trickier than the streaming encoder. Do you think you could add a Smalltalk-80 random-access decoder?
Author
Owner
Copy link

I pushed a commit to make the code more readable and mostly refer to Smalltalk rather than Smalltalk-80 (I think its all -80 these days).

The ErisStore abstraction could be omitted but I think it is unavoidable in practice and if you are going to implement ERIS you should think about it as soon as possible. The crypto could be moved into ErisEncoder but I think its wise to specify it only once at the common abstraction.

A random-access decoder is missing but I don't know of one yet, either I find one in the existing implementations or I write one from scratch in Squeak.

I pushed a commit to make the code more readable and mostly refer to Smalltalk rather than Smalltalk-80 (I think its all -80 these days). The `ErisStore` abstraction could be omitted but I think it is unavoidable in practice and if you are going to implement ERIS you should think about it as soon as possible. The crypto could be moved into `ErisEncoder` but I think its wise to specify it only once at the common abstraction. A random-access decoder is missing but I don't know of one yet, either I find one in the existing implementations or I write one from scratch in Squeak.

The ErisStore abstraction could be omitted but I think it is unavoidable in practice and if you are going to implement ERIS you should think about it as soon as possible.

I agree that some kind of abstraction is necessary.

The crypto could be moved into ErisEncoder but I think its wise to specify it only once at the common abstraction.

Hm, this I don't quite understand.

If you have want to store blocks in SQLite and also IPFS you might have two objects: a SQLiteBlockStore and an IPFSBlockStore. Wouldn't it make sense that these objects do not have to implement ERIS specific crypto?

Maybe you mean that both SQLiteBlockStore and IPFSBlockStore can both inherit from ERISStore and get the crypto like that?

Wouldn't it be a more clearer distinction to keep all ERIS related crypto in ERISEncoder and let the BlockStore objects just implement "stupid" block storage?

Sorry for missuing terminology. I am not so familiar with object-oriented/SmallTalk terminology.

A random-access decoder is missing but I don't know of one yet, either I find one in the existing implementations or I write one from scratch in Squeak.

I think it would be good to have a random access decoder. This seems to be the most tricky part about implementing ERIS.

On another note: Would you be open to including a Python implementation instead? I'm afraid I don't feel comfortable reading Smalltalk. Python is something we both read and write. Or maybe StandardML? That has the advantage that the language is synctactically simple and semantically well-specified.

> The `ErisStore` abstraction could be omitted but I think it is unavoidable in practice and if you are going to implement ERIS you should think about it as soon as possible. I agree that some kind of abstraction is necessary. > The crypto could be moved into `ErisEncoder` but I think its wise to specify it only once at the common abstraction. Hm, this I don't quite understand. If you have want to store blocks in SQLite and also IPFS you might have two objects: a `SQLiteBlockStore` and an `IPFSBlockStore`. Wouldn't it make sense that these objects do not have to implement ERIS specific crypto? Maybe you mean that both `SQLiteBlockStore` and `IPFSBlockStore` can both inherit from `ERISStore` and get the crypto like that? Wouldn't it be a more clearer distinction to keep all ERIS related crypto in `ERISEncoder` and let the `BlockStore` objects just implement "stupid" block storage? Sorry for missuing terminology. I am not so familiar with object-oriented/SmallTalk terminology. > A random-access decoder is missing but I don't know of one yet, either I find one in the existing implementations or I write one from scratch in Squeak. I think it would be good to have a random access decoder. This seems to be the most tricky part about implementing ERIS. On another note: Would you be open to including a Python implementation instead? I'm afraid I don't feel comfortable reading Smalltalk. Python is something we both read and write. Or maybe StandardML? That has the advantage that the language is synctactically simple and semantically well-specified.
Author
Owner
Copy link

Maybe you mean that both SQLiteBlockStore and IPFSBlockStore can both inherit from ERISStore and get the crypto like that?

Right, this is what I meant.

Wouldn't it be a more clearer distinction to keep all ERIS related crypto in ERISEncoder and let the BlockStore objects just implement "stupid" block storage?

I think there are occasions where you need something other than then stock ErisEncoder and so it is better to move the crypto to a more base object/interface. It's a language specific thing.

A random-access decoder is missing but I don't know of one yet, either I find one in the existing implementations or I write one from scratch in Squeak.

I think it would be good to have a random access decoder. This seems to be the most tricky part about implementing ERIS.

Agreed.

On another note: Would you be open to including a Python implementation instead? I'm afraid I don't feel comfortable reading Smalltalk. Python is something we both read and write. Or maybe StandardML? That has the advantage that the language is synctactically simple and semantically well-specified.

Python I don't know well and it and Go feel like languages that are ostensibly simple but to write competent code you are expected to act on common superstitions on how the runtime is implemented.

I agree Smalltalk is an odd choice but something about the language made me choose to implement the efficient encoder right-the-first-time where as in Nim I did something slapdash.

How about Ada? ;)

> Maybe you mean that both `SQLiteBlockStore` and `IPFSBlockStore` can both inherit from `ERISStore` and get the crypto like that? Right, this is what I meant. > Wouldn't it be a more clearer distinction to keep all ERIS related crypto in `ERISEncoder` and let the `BlockStore` objects just implement "stupid" block storage? I think there are occasions where you need something other than then stock `ErisEncoder` and so it is better to move the crypto to a more base object/interface. It's a language specific thing. > > A random-access decoder is missing but I don't know of one yet, either I find one in the existing implementations or I write one from scratch in Squeak. > > I think it would be good to have a random access decoder. This seems to be the most tricky part about implementing ERIS. Agreed. > On another note: Would you be open to including a Python implementation instead? I'm afraid I don't feel comfortable reading Smalltalk. Python is something we both read and write. Or maybe StandardML? That has the advantage that the language is synctactically simple and semantically well-specified. Python I don't know well and it and Go feel like languages that are ostensibly simple but to write competent code you are expected to act on common superstitions on how the runtime is implemented. I agree Smalltalk is an odd choice but something about the language made me choose to implement the efficient encoder right-the-first-time where as in Nim I did something slapdash. How about Ada? ;)

How about Ada? ;)

I like that! :)

Let's try and hack together an Ada implementation.

> How about Ada? ;) I like that! :) Let's try and hack together an Ada implementation.
emery closed this pull request 2022年08月26日 17:44:40 +02:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
eris/spec!3
Reference in a new issue
eris/spec
No description provided.
Delete branch "smalltall-samples"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?