~apreiml

Austria

https://denkmaschine.at/

~apreiml/hare-tls

Last active a month ago

~apreiml/public-inbox

Last active 3 years ago
View more

Recent activity

[PATCH hare 3/3] bufio::scanner::scan_byte: do not defer scan_shift a day ago

From Armin Preiml to ~sircmpwn/hare-dev

Otherwise we won't have space for unread.
---
 bufio/scanner.ha | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/bufio/scanner.ha b/bufio/scanner.ha
index 92db972c..8976c8b4 100644
--- a/bufio/scanner.ha
@@ -145,9 +145,6 @@ export fn scan_byte(scan: *scanner) (u8 | io::EOF | io::error) = {

	// Consume previous read, if any
	scan_shift(scan);
	// Consume this read right away
[message trimmed]

[PATCH hare 2/3] bufio::scanner: support unread a day ago

From Armin Preiml to ~sircmpwn/hare-dev

---
 bufio/scanner.ha           | 41 ++++++++++++++++++++++++++++++++++++++
 bufio/scanner_test+test.ha | 30 ++++++++++++++++++++++++++++
 bufio/stream.ha            | 13 +++++++++---
 3 files changed, 81 insertions(+), 3 deletions(-)

diff --git a/bufio/scanner.ha b/bufio/scanner.ha
index 8a73f8b6..92db972c 100644
--- a/bufio/scanner.ha
@@ -271,6 +271,47 @@ export fn scan_buffer(scan: *scanner) []u8 = {
	return scan.buffer[..scan.pending];
};

[message trimmed]

[PATCH hare 1/3] bufio::scanner: implement io::reader a day ago

From Armin Preiml to ~sircmpwn/hare-dev

---

The reader will make it easier to implement unread. Also a reader for
scanner doesn't hurt I guess.

 bufio/scanner.ha           | 27 +++++++++++++++++++++++++++
 bufio/scanner_test+test.ha | 12 ++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/bufio/scanner.ha b/bufio/scanner.ha
index 31d4e188..8a73f8b6 100644
--- a/bufio/scanner.ha
@@ -11,7 +11,13 @@ use types;
[message trimmed]

Re: [PATCH hare-json] Update for hare as of 20230813 3 days ago

From Armin Preiml to ~sircmpwn/hare-dev

On Mon Sep 18, 2023 at 9:28 AM CEST,  wrote:
> From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
> diff --git a/encoding/json/lex.ha b/encoding/json/lex.ha
> index a523db1..3d20101 100644
> --- a/encoding/json/lex.ha
> +++ b/encoding/json/lex.ha
> @@ -24,7 +24,7 @@ export type lexer = struct {
>  // Creates a new JSON lexer. The caller may obtain tokens with [[lex]] and
>  // should pass the result to [[close]] when they're done with it.
>  export fn newlexer(src: io::handle) lexer = {
> -	let buf: []u8 = alloc([0...], os::BUFSZ);
> +	let buf: []u8 = alloc([0...], os::BUFSIZ);

This should be the other way around. BUFSZ is the new name.

Re: [PATCH hare-specification 1/2] Add never; remove terminating expressions 27 days ago

From Armin Preiml to ~sircmpwn/hare-dev

On 8/25/23 09:20, Drew DeVault wrote:
> I still think that noreturn is a better keyword here given that the
> "never" metaphor applies mostly to implementation details and "noreturn"
> applies to the user-visible usage of the keyword in most situations.

+1 to noreturn. If one writes fail functions, never doesn't seem to fit 
the name.

fn fail() never; // cognitive dissonance between the name and return
fn err() never;

vs.

fn fail() noreturn; // much clearer for a function that never returns.

[PATCH hare 3/3] use SZ as suffix for sizes in other modules a month ago

From Armin Preiml to ~sircmpwn/hare-dev

Signed-off-by: Armin Preiml <apreiml@strohwolke.at>
---
 bufio/scanner.ha          |  8 ++++----
 bufio/stream.ha           |  4 ++--
 cmd/hare/plan.ha          |  2 +-
 cmd/harec/main.ha         |  2 +-
 encoding/base32/base32.ha |  4 ++--
 encoding/base64/base64.ha |  4 ++--
 encoding/hex/hex.ha       |  6 +++---
 encoding/pem/pem.ha       |  2 +-
 format/tar/reader.ha      | 12 ++++++------
 format/tar/types.ha       |  4 ++--
 hare/lex/lex.ha           |  2 +-
 hare/module/manifest.ha   |  2 +-
[message trimmed]

[PATCH hare 2/3] hash: use SZ as suffix for sizes a month ago

From Armin Preiml to ~sircmpwn/hare-dev

Signed-off-by: Armin Preiml <apreiml@strohwolke.at>
---
 hash/adler32/adler32.ha | 2 +-
 hash/crc16/crc16.ha     | 6 +++---
 hash/crc32/crc32.ha     | 6 +++---
 hash/crc64/crc64.ha     | 6 +++---
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/hash/adler32/adler32.ha b/hash/adler32/adler32.ha
index 25833665..be2bb18c 100644
--- a/hash/adler32/adler32.ha
+++ b/hash/adler32/adler32.ha
@@ -8,7 +8,7 @@ use io;
use strings;
[message trimmed]

[PATCH hare 1/3] crypto: use SZ as suffix for sizes a month ago

From Armin Preiml to ~sircmpwn/hare-dev

To convert your projects you could use:

find . -name "*.ha" -exec sed -i 's/SIZE/SZ/g' {} \;

Signed-off-by: Armin Preiml <apreiml@strohwolke.at>
---

As discussed on irc, I'd like to propose to use SZ as suffix for buffer,
block and key sizes.

 crypto/aes/+test/gcm.ha         |  4 ++--
 crypto/aes/+x86_64/ni.ha        | 16 ++++++-------
 crypto/aes/aes+x86_64.ha        |  2 +-
 crypto/aes/aes.ha               |  2 +-
[message trimmed]

Re: [PATCH hare-tls] Adapt to stdlib memio/strio/bufio rewrite a month ago

From Armin Preiml to ~apreiml/hare-tls

Very Nice! Thanks!

The tests are failing because I've started to add certificate validation and
the certificates are missing or expired. I didn't bother to update the test
certificates yet. Also hostname checking does not work yet and some critical
extensions are still ignored.

Re: [hare/patches] build success a month ago

From Armin Preiml to ~sircmpwn/hare-dev

Applied