poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ext4.pk + suggestions


From: Jose E. Marchesi
Subject: Re: ext4.pk + suggestions
Date: Mon, 31 May 2021 14:12:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi There.

> I've had fun writing the ext4.pk. It probably needs a map, but currently
> I played around with it by using the methods. I also wrote a little demo
> script, which lists the '/' directory, picks a random subdirectory, and
> then tries to look (guess) for deleted inodes.

Very nice :)

Would you like to maintain ext4.pk in the poke source tree?

> While writing it, I've found some nice-to-have features:
>
>      - endianess for integral structs

This is interesting.  We have already considered the possibility of
expanding integral types to include endianness, like in:

  type biglong = big int<64>;

That would naturally apply to integral structs, given their integral
nature.

>      - fixed-sized structs (like integral structs but bigger)

Do you mean integral structs bigger than 64-bit?
Or "fixed-sized" on some other way?

The compiler already identifies which struct types have a compile-time
known size.  We call these types "complete".  These are the types that
you can use as offset units for example.

>      - docstrings (which can be accessed with .doc or .help)

Already in the TODO.

>      - lazy arrays (of fixed-sized structs)

Also in the TODO.

>      - I've noticed that despite declaring a field conditionally (i.e
>        an optional field), the field is (I just assume) still loaded in
>        memory - because the loading takes longer

That is because, in principle, you can use the field itself as part of
the condition, like in:

  int optional if optional > 10;

I am noting down an optimization in the TODO: if the condition doesn't
involve the field itself (this is known at compile-time) then the field
is not decoded before evaluating the condition.

>      - 'save' output file offset + size

I don't know what you mean here?

>      - sleep (don't we all need it? xD)

`sleep' is implemented in git master.

>      - stdin, fprintf, and printf accepting string (I tried to create a
>        function 'debug' which calls printf but failed :( ; maybe I did
>        something wrong)

I don't know what you mean with "printf accepting string".

>      - setting (not declaring) variables inside a struct

Hm, like in the following?

  struct
  {
    var foo = 10;
    int f1;
    foo = 20;
    int f2;
  }

Not sure if I like the idea... will have to think about it :)

>      - maybe macros?

Definitely, at some point we need macros.

> Thank you for maintaining this software!
>
> I'm thinking that sometime I might try journald logs. ^^

Thanks to you for the good feedback! :)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]