#💽Programming Chat v2

1 messages · Page 14 of 1

spare quartz
#

this code finally has a use again!!

#

FlipBytesBE for network ordered data ..

#

kinda feels weird to know this code is already 4 months old

spare quartz
#

this looked normal until i saw ia32

#

ohhh

#

this image is from 2017

#

that explains it

#

plotting relations

#

mmm

#

might look into more data saving for extensible_http (do not send unicode support if all files are within ISO/IEC 8859-1)

#

mmm nevermind not worthwhile for processing costs

lyric mesa
#

it seems i found the cause of my storage problem

#

why is docker using so much space 😭

spare quartz
#

what's the biggest files

lyric mesa
spare quartz
#

... huh

#

either initialized with that much data or a lot of dynamic allocation if i had to guess

#

i don't really use docker though

lyric mesa
#

eghhhhh

#

its like barely scratched it too

#

why must this wipe the entire disk 😭

#

i changed the limit to 8 gb and its... using 33.63 gb now???

#

it just jumped up to 68.72 gb???????

spare quartz
#

cccrappp gotta deal with file locking now... no wonder it's erroring

spare quartz
#

ada does have character ops after all!

#

I HATE HTTP

timid quartz
#

So basically just use unchecked conversion

spare quartz
#

it won't cache even with all i' mgiving it

#

💔

#

i've been awake throughout the entire night trying to add caching to this server btw

#

i think it might only cache on https...

timid quartz
#

uhh just

#

have a hash set

spare quartz
#

que

timid quartz
#

actually maybe hash map

spare quartz
#

que ...

#

are you telling me to cache server-side?? are you insane??

timid quartz
#

well where else are you supposed to cache

spare quartz
#

THE BROWSER

timid quartz
#

ok and why is it not caching

spare quartz
#

i don't know :<

#

firefox isn't clear on when their browser caches

timid quartz
#

try chrome

spare quartz
#

you-

#

it cached immediately

#

i hate firefox

timid quartz
#

Read this

spare quartz
#

i have

#

multiple times

#

firefox just doesn't cache it

timid quartz
# spare quartz

I only see max age here, try the example from MDN Cache-Control: no-store, no-cache, max-age=0, must-revalidate, proxy-revalidate

spare quartz
#

you are explicitly disabling caching

timid quartz
#

Oh that’s for a proxy cache mb

#

Try Cache-Control: private max-age=3600

spare quartz
#

no need for private as this does not carry user data

timid quartz
#

do it anyways ca15gatoexplode

spare quartz
#

won't change anything

#

they even show an example with my setup

#

im 99% convinced it just wants to cache only on https

timid quartz
#

check ff settings?

spare quartz
#

doesn't have anything but clearing cache

#

i think it might be in the developer flags

#

but i dont wanna touch that

#

this will be a pain

#

i really need to improve extensible_http, it's very very low level (http wise) at the moment

timid quartz
#

Low level is ok

spare quartz
#

it's very tedious

#

especially since there's no intrinsic header parsing (except for Content-Length)

timid quartz
#

ughhhhhh I don’t wanna write 2 more pages of Japaneseeeeeeeeee

spare quartz
#

do it

timid quartz
#

I’m lazyyyyyy

spare quartz
#

yeah well uh

#

have you thought about that

spare quartz
#

yeah bet you didn't

#

god if only http wasn't catered to super simple languages

timid quartz
#

do I go to networking class…

spare quartz
#

yes......... you need to learn things idot...........

#

okay

#

caching. finally "done"

timid quartz
#

I just need to learn how to force myself to write 2 pages of Japanese

spare quartz
#

in other news

#

i finally took the advice of moving some of th ecode outside the task loop

timid quartz
#

yipee

spare quartz
#

just one more conditional to account for

#

vleh my eyes hurt

#

oh huh

#

added Connection:close and now requests are super fast (<1ms)

#

don't know why i didn't do this before

#

AND NOW FIREFOX CACHES IT

#

🥳

timid quartz
spare quartz
#

NO THEY'RE NOT!!

timid quartz
#

yuh huh'

#

imagine making 50 requests and having to tcp handshake for each one.

spare quartz
#

oh whatever they're like 0.3 bits anyways

timid quartz
#

thats 100 RTT wasted!!!!

#

actually

#

more than that

spare quartz
#

1 baud connection.....

timid quartz
#

200 RTT

#

well

#

hm

#

nah just 100 rtt

spare quartz
#

stop doing math i haven't studied tcp yet :<

timid quartz
#

client: syn
server: ack
client: synack + data

#

yeah only 100 RTT

#

no only 50 RTT

#

RTT is round trip so syn and ack are done in 1 RTT

#

still though if your rtt is like 20ms

#

that's 20 wasted milliseconds

#

20!!

spare quartz
#

and there

timid quartz
#

Connection: keep-alive ftw

#

you should uh respect what the client wants in terms of the connection...

#

so if client says keep-alive you should keep-alive..

spare quartz
#

okay yeah but im a bad task manager

timid quartz
spare quartz
#

if a client wants a keep alive connection they'll have to deal with it... because otherwise i need to actually use GNAT.Socket selectors

timid quartz
#

LET ME OPEN 500 KEEP-ALIVE CONNECTIONS ON YOUR SERVER

spare quartz
#

(and i have no idea how!!!)

timid quartz
spare quartz
#

yes but that'll take up an entire thread

#

you need a selector to... not do that

timid quartz
#

wah wah wah who cares about that

spare quartz
#

ME cause you'll use tcp spammer or whatever and block all of them

timid quartz
spare quartz
#

im so grateful i added an ip argument though

#

-ip 127.0.0.1... testing in peace 🙏

timid quartz
#

trying to find docs for the selector

spare quartz
#

there are zero

timid quartz
#

there never are any docs..

spare quartz
#

like

#

theres a few stack overflow posts on them but

#

nobody has bothered to show an example

timid quartz
#

even in the code type Selector_Type is limited private;

spare quartz
#

that's intentional

timid quartz
#

still that means no reading the source code

spare quartz
#

anything with private; is totally implementation defined

#

you have to use the functions attached to it in the public part as your source

#

the legend:
.ads (public) -> use this for determining what to do with library code
.ads (private) / .adb -> do not use this for determination unless it's unclear what the specification entails

timid quartz
#

gay

spare quartz
#

you wouldn't read a .c file...

timid quartz
#

rust socket2::Socket::set_linger

spare quartz
#

oh no thing is i can set keep alive super easily

timid quartz
#

pub fn set_linger(&self, linger: Option<Duration>) -> Result<()>
Set value for the SO_LINGER option on this socket.

If linger is not None, a close(2) or shutdown(2) will not return until all queued messages for the socket have been successfully sent or the linger timeout has been reached. Otherwise, the call returns immediately and the closing is done in the background. When the socket is closed as part of exit(2), it always lingers in the background.

Notes
On most OSs the duration only has a precision of seconds and will be silently truncated.

On Apple platforms (e.g. macOS, iOS, etc) this uses SO_LINGER_SEC.

spare quartz
#

again the problem is tasking

#

hopefully this doesn't count as spamming

#
 type Option_Name is
     (Generic_Option,
      --  Can be used to set/get any socket option via an OS-specific option
      --  code with an integer value.

      ------------------
      -- Socket_Level --
      ------------------

      Keep_Alive,      -- SO_KEEPALIVE
      --  Enable sending of keep-alive messages on connection-oriented sockets

      Reuse_Address,   -- SO_REUSEADDR
      --  Enable binding to an address and port already in use

      Broadcast,       -- SO_BROADCAST
      --  Enable sending broadcast datagrams on the socket

      Send_Buffer,     -- SO_SNDBUF
      --  Set/get the maximum socket send buffer in bytes

      Receive_Buffer,  -- SO_RCVBUF
      --  Set/get the maximum socket receive buffer in bytes

      Linger,          -- SO_LINGER
      --  When enabled, a Close_Socket or Shutdown_Socket will wait until all
      --  queued messages for the socket have been successfully sent or the
      --  linger timeout has been reached.

      Error,           -- SO_ERROR
      --  Get and clear the pending socket error integer code

      Send_Timeout,    -- SO_SNDTIMEO
      --  Specify sending timeout until reporting an error

      Receive_Timeout, -- SO_RCVTIMEO
      --  Specify receiving timeout until reporting an error

      Busy_Polling,    -- SO_BUSY_POLL
      --  Sets the approximate time in microseconds to busy poll on a blocking
      --  receive when there is no data.

      Bind_To_Device,  -- SO_BINDTODEVICE
      --  Bind to a specific NIC (Network Interface Controller)

      -------------------------------
      -- IP_Protocol_For_TCP_Level --
      -------------------------------

      No_Delay,            -- TCP_NODELAY
      --  Disable the Nagle algorithm. This means that output buffer content
      --  is always sent as soon as possible, even if there is only a small
      --  amount of data.

      Keep_Alive_Count,    -- TCP_KEEPCNT
      --  Maximum number of keepalive probes

      Keep_Alive_Idle,     -- TCP_KEEPIDLE
      --  Idle time before TCP starts sending keepalive probes

      Keep_Alive_Interval, -- TCP_KEEPINTVL
      --  Time between individual keepalive probes

      ------------------------------
      -- IP_Protocol_For_IP_Level --
      ------------------------------

      Add_Membership_V4,   -- IP_ADD_MEMBERSHIP
      --  Join a multicast group

      Drop_Membership_V4,  -- IP_DROP_MEMBERSHIP
      --  Leave a multicast group

      Multicast_If_V4,     -- IP_MULTICAST_IF
      --  Set/Get outgoing interface for sending multicast packets

      Multicast_Loop_V4,   -- IP_MULTICAST_LOOP
      --  This boolean option determines whether sent multicast packets should
      --  be looped back to the local sockets.

      Multicast_TTL,       -- IP_MULTICAST_TTL
      --  Set/Get the time-to-live of sent multicast packets

      Receive_Packet_Info, -- IP_PKTINFO
      --  Receive low-level packet info as ancillary data

      --------------------------------
      -- IP_Protocol_For_IPv6_Level --
      --------------------------------

      Add_Membership_V6,   -- IPV6_ADD_MEMBERSHIP
      --  Join IPv6 multicast group

      Drop_Membership_V6,  -- IPV6_DROP_MEMBERSHIP
      --  Leave IPv6 multicast group

      Multicast_If_V6,     -- IPV6_MULTICAST_IF
      --  Set/Get outgoing interface index for sending multicast packets

      Multicast_Loop_V6,   -- IPV6_MULTICAST_LOOP
      --  This boolean option determines whether sent multicast IPv6 packets
      --  should be looped back to the local sockets.

      IPv6_Only,           -- IPV6_V6ONLY
      --  Restricted to IPv6 communications only

      Multicast_Hops       -- IPV6_MULTICAST_HOPS
      --  Set the multicast hop limit for the IPv6 socket
     );
#

set via

timid quartz
#

jk

spare quartz
timid quartz
#

can you not just uh

#

use a condvar

#

to put the task to sleep

spare quartz
#

a what what

timid quartz
#

a condition variable

#

smh

#

doesn't even know the basics of multithreading

spare quartz
#

that's what select does...

#

what do you think a selector is.....

#

bro doesn't even know the basics of tasking

timid quartz
#
static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;

static int avail = 0;

while (TRUE) {
    s = pthread_mutex_lock(&mtx);

    while (avail == 0) {   /* Wait for something to consume */
       s = pthread_cond_wait(&cond, &mtx);
    }

    while (avail > 0) {   /* Consume all available units */ 
        avail--;
    }

    s = pthread_mutex_unlock(&mtx);
}
spare quartz
#

Ada RM 9.7 pilled 🙏

timid quartz
#

pain

#

ok is there

#

nvm I could just do a lookup table

spare quartz
#

what

timid quartz
#

or actually can I change the repr of an enum

spare quartz
#

yes

#

use a representation clause

timid quartz
#

and I didn't want to make a giant switch-case

spare quartz
#

make a giant switch case

timid quartz
#

noooo

#

there must be a better way...

spare quartz
#

(technically, a switch is just compiler mnemonic for a lookup table (more appropriately a jump table) but who cares)

#

(yes use a lut)

timid quartz
#

there mus tbe a better wayyyyyyyyyyyyy

timid quartz
#

the things

#

to the things

spare quartz
#

i don't knowwwwwwww

#

you might need an ordered table if you can't cough up a hashing function

#

that reminds me

timid quartz
#

ugh stupid

#

why doesnt it just provide a hashing function by default

#

switch-case it is pain

spare quartz
#

it's totally valid to just make a function that returns anything as a normal hash in java

spare quartz
#

!!

#

wait

#

nnnnnnooooo you can't ignore that thought

spare quartz
#

how would you make a hash function for... i dunno, an access-to-record

timid quartz
#

idk

#

hash the pointer

spare quartz
#

for the record it does provide some hashing functions for you

#

like Ada.Strings.Hash

timid quartz
#

I'd have to like

timid quartz
#

add it to a read function or smth

spare quartz
#

nah why is bayachao so cute

timid quartz
#

do like

type Machine_Type is (All_Of_Them);
--  ...
procedure Parse_Machine_Id (H : out Header; Id : Unsigned_16) is
  package La_Mapa is blah;
  M : La_Mapa;
begin
  M.Include (16#0#, Machine_Type.Unknown);
  --  ALL THE REST OF THEM
  --  ...
  H.Machine_Id := M (Id);
end Parse_Machine_Id;
#

@spare quartz

spare quartz
#

wait why are you just not using an enum

#

is he stupid

timid quartz
#

wait................................................

#

i can just....................

spare quartz
#

yes

timid quartz
#

read the enum...........................

spare quartz
#

igiot

timid quartz
#

yeah

#

............

#

IDGUIT

spare quartz
timid quartz
#

wait but

#

I have to go number -> enum

#

not enum -> number

spare quartz
#

'Val

timid quartz
#

'Val...

#

stupid language

#

stupid furries

#

stupid dod

spare quartz
#

ugh darpa should make ada 2035 to beat the crap out of rust

timid quartz
#

no

#

rust should beat the crap out of ada

spare quartz
#

your language is literally half baked

timid quartz
#

NUH UH

spare quartz
#

our language is mega baked.............. in one single oven

timid quartz
#

at least my language isnt uh...verbose
and uh...has a community
and uh.........doesnt have exceptions

#

and uh........borrow checker

spare quartz
#

me when i act silly and become a maintainer in a super used rust project like tokio or whatever

#

and insert panic!

#

o h yaeh

#

i need to look into the GNAT security features again

#

they have this one flag that makes return oriented programming practically impossible

#

super cool (but it can heavily affect perf)

timid quartz
#

or GNAT.OS_Lib.OS_Exit

spare quartz
spare quartz
#

cat get offmy key bot

timid quartz
spare quartz
#

i bet i could beat their library...

timid quartz
#

Nope

spare quartz
#

what

timid quartz
#

You couldn’t

spare quartz
#

i could ......

#

my cat is curhign me so hard

timid quartz
#

based cat

#

stop atp from working

timid quartz
spare quartz
#

okay true

#

i only have http 1.1..

#

also i got no idea how they have this many files

timid quartz
#

A lot are probably conditionally not compiled due to feature flags

#

When you were benchmarking your server, what did you have it doing?

spare quartz
#

im probably at the same level of functionality to them if im gonna be honest (excl http/2)

#

i just delegate a lot more to the end programmer

timid quartz
#

Just serving a static file?

spare quartz
#

which is actually the only dynamic thing in the server now that i think about it

#

directory list has to be computed for each request, but it usually does it in under half a milisecond (haven't benchmarked that part yet)

#
function Get_Directory_Listing (For_Search : in out Search_Type; Request : HTTP_11_Request_Message; Composed_Actual : String) return Directory_Listing_Result is
   begin
      declare

         Result      : Directory_Listing_Result;
         Padded_Kind : String (1 .. Ordinary_File'Image'Length);
         Padded_Size : String (1 .. 12);

         Search_Item         : Directory_Entry_Type;
         Send_Human_Friendly : Boolean := Request.Fields.Contains ("Accept-Language");

      begin
         For_Search.Start_Search (Directory => Composed_Actual, Pattern => "");

         while For_Search.More_Entries
         loop
            For_Search.Get_Next_Entry (Search_Item);

            if Search_Item.Modification_Time > Result.Highest_Modified
            then
               Result.Highest_Modified := Search_Item.Modification_Time;
            end if;

            if (Search_Item.Simple_Name = ".." and then Composed_Actual /= Current_Directory) or else (Search_Item.Simple_Name /= "." and then Search_Item.Simple_Name /= "..")
            then
               if Send_Human_Friendly
               then
                  Ada.Strings.Fixed.Move (Search_Item.Kind'Image, Padded_Kind, Justify => Ada.Strings.Right);

                  if Search_Item.Kind = Ordinary_File
                  then
                     Ada.Strings.Fixed.Move (Search_Item.Size'Image & 'B', Padded_Size, Justify => Ada.Strings.Right);

                  else
                     Ada.Strings.Fixed.Delete (Padded_Size, 1, Padded_Size'Length);
                  end if;
                  Result.Contents.Append (Padded_Size & ' ' & Padded_Kind & ' ' & Search_Item.Simple_Name & ASCII.LF);

               else
                  Result.Contents.Append
                    (Search_Item.Simple_Name & ASCII.NUL & Search_Item.Size'Image
                     & (if Search_Item.Kind = Ordinary_File then 'F' elsif Search_Item.Kind = Special_File then 'S' else 'D') & ASCII.LF);
               end if;
            end if;
         end loop;
         For_Search.End_Search;

         return Result;
      end;
   end Get_Directory_Listing;
#

directory listing code which is then passed into GET_Procedures (minimal writing)

#

Highest_Modified : Time := GNAT.Calendar.No_Time; -- interestingly this could give a cache result from "1901" if no files are in the directory and it's the root ...

spare quartz
#

reading about serde

#

rust really is that much library oriented huh

timid quartz
#

yeah

#

rust is incredibly library-oriented

spare quartz
#

kinda surprising to see for me honestly

#

kotlin has the entirety of the JDK toolkit which is massive
and ada has... a lot of things (gnat on top too)

#

i'm just not used to that

#

hm

#

should probably add a -rom argument to basic_http_server

#

like -d just doesn't allow PUT

timid quartz
#

@spare quartz this uses tokio instead of plain rust threads but benchmark this

spare quartz
#

should i compile the ada one in fast mode or keep it in debug

timid quartz
#

uh whichever you want

#

just compile both in the same mode

#

so if you do ada in debug do rust in debug

#

if you do ada in fast do rust in release

spare quartz
#

wow this compiler really is slow...

spare quartz
#

the program, when running cargo run

timid quartz
#

localhost:3000

#

cargo run is debug by default

spare quartz
#

top is mine, bottom is the one you sent

#

both compiled in unoptimized w/ debug

#

i also got this flooded ...

timid quartz
#

huh interesting

#

I wonder what that is

spare quartz
#

oh crap

#

i forgot, when running my server, without an Accept-Language provided by a browser it'll send binary data of the directory instead of human readable stuff

#

unsure if that contributes much but just letting you know

timid quartz
#

I’ll try to fix the errors

#

But I need to write Japanese first

spare quartz
#

nerd..

#

WAIT

#

I KNOW WHAT YOU SHOULD WRITE!!

lyric mesa
#

i heard japanese

spare quartz
#

specifically <name>\0<size><F/D/S descriptor>\n

#

what a weird name

spare quartz
timid quartz
#

Likely the combination of wrk tossing the connection quickly and being over localhost, the hyper server notices the connection is no longer connected when trying to shutdown. It returns the error from the operating system, letting the user decide whether to care based on the context. In your case, you can likely just ignore that error.
#

hm

spare quartz
#

oh

timid quartz
#

maybe it would be a better comparison to implement http without a library

#

because hyper kinda relies on tokio

#

you can't just use normal threads

spare quartz
#

i'd imagine it also does other processing of the request

timid quartz
#

yeah

spare quartz
#

oh yeah i also modified how the timeout works for my http

#

reading the HTTP message itself is under the time limit, but the body isn't

timid quartz
#

bro wtf...I was writing this japanese thing on my pc and it came out to almost a page, but now that I'm on my laptop it's like a little over 3/4 of a page???

spare quartz
#

dementia

timid quartz
#

what is the difference between the windows and macos font...

spare quartz
#

such a weird type!!

timid quartz
#

me when I flip your bytes

spare quartz
#

okay but how

timid quartz
#

that's how

spare quartz
#

when in doubt

#

uncheck it

spare quartz
#

cooooooooooooll

spare quartz
#

very nice

#
(RECORD_TYPE => HANDSHAKE,
 RECORD_PROTOCOL_VERSION => TLS_10,
 RECORD_LENGTH =>  512,
 MESSAGE_TYPE => CLIENT_HELLO,
 MESSAGE_LENGTH =>  64513,
 CLIENT_PROTOCOL_VERSION => TLS_12,
 CLIENT_RANDOM => "&�ޞ���o� �����mͤ!����W��AP�",
 CLIENT_SESSION_ID => 
 [":�&kt��i��Q�r*��벴���\��
                           �&"],
 CLIENT_CIPHER_SUITES => 
 [
  [TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_AES_128_GCM_SHA256,
   UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN,
   UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN,
   UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN,
   UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]],
 CLIENT_COMPRESSION_METHODS => 
 [
  [NONE]],
 CLIENT_EXTENSIONS => 
 [
  (EXTENSION_TYPE => SERVER_NAME,
   DATA => 
   ["
        localhost"]), 
  (EXTENSION_TYPE => UNKNOWN,
   DATA => 
   [""]), 
  (EXTENSION_TYPE => UNKNOWN,
   DATA => 
   [""]), 
  (EXTENSION_TYPE => UNKNOWN,
   DATA => 
   [""]), 
  (EXTENSION_TYPE => UNKNOWN,
   DATA => 
   ["
     hhttp/1.1"]), 
  (EXTENSION_TYPE => UNKNOWN,
   DATA => 
   [""]), 
  (EXTENSION_TYPE => UNKNOWN,
   DATA => 
   [""]), 
  (EXTENSION_TYPE => UNKNOWN,
   DATA => 
   [""]), 
  (EXTENSION_TYPE => UNKNOWN,
   DATA => 
   ["(

"]), 
  (EXTENSION_TYPE => UNKNOWN,
   DATA => 
   [""]), 
  (EXTENSION_TYPE => UNKNOWN,
   DATA => 
   [""]), 
  (EXTENSION_TYPE => UNKNOWN,
   DATA => 
   ["$ �y���(�}��grXM��+����ٝ���v��Ֆ7"]),

  (EXTENSION_TYPE => UNKNOWN,
   DATA => 
   [""])])
#

the entire CLIENT_HELLO packet as a record

#

i am very tired

timid quartz
timid quartz
#

I'm probably around a page and a third of my japanese

#

for some reason, windows makes the text take slightly more space

#

even though both fonts are 12 point and the spacing and the font itself should be the same

spare quartz
# timid quartz me too..

Tomorrow will be a dark day…

  • need to create X25519 keys
  • need to deal with 256 bit numbers
  • need to securely generate random
  • need to read certificate files
timid quartz
spare quartz
#

Yes

timid quartz
#

ughhhh

#

that's so stupid

spare quartz
#

The compiler should’ve given you an error — did it?

timid quartz
#

order it yourself stupid compiler

#

yeah it did

spare quartz
#

write your code better then!!

#

unorganized …

spare quartz
#

I also gotta fix all of these unknowns

#

Except for Cipher suites since TLS 1.3 only defines 5

timid quartz
#

rrrr

#

how do I order thiss

#

it starts with 16#0#

spare quartz
#

It’s just

#

Ordered 1:1 with the enum def

timid quartz
#

WHAT

spare quartz
#

You don’t need to sort the numbers iirc

timid quartz
#

THAT'S HOW IT WAS ORIGINALLY

spare quartz
#

What did you do…….

spare quartz
timid quartz
#
type Machine_Type is (Unknown, Alpha32, Alpha64, Am33, Amd64,
                         Arm32, Arm64, ArmNT, EfiBytecode,
                         I386, Ia64, LoongArch32, LoongArch64,
                         M32R, Mips16, MipsFpu, MipsFpu16,
                         PowerPc, PowerPcFp, R4000, RiscV32,
                         RiscV64, RiscV128, Sh3, Sh3Dsp, Sh4,
                         Sh5, Thumb, WceMipsV2) with Size => 16;
   for Machine_Type use
     (Unknown => 16#0#,
      Alpha32 => 16#184#,
      Alpha64 => 16#284#,
      Am33 => 16#1D3#,
      Amd64 => 16#8664#,
      Arm32 => 16#1C0#,
      Arm64 => 16#AA64#,
      ArmNT => 16#1C4#,
      EfiBytecode => 16#EBC#,
      I386 => 16#14C#,
      Ia64 => 16#200#,
      LoongArch32 => 16#6232#,
      LoongArch64 => 16#6264#,
      M32R => 16#9041#,
      Mips16 => 16#266#,
      MipsFpu => 16#366#,
      MipsFpu16 => 16#466#,
      PowerPc => 16#1F0#,
      PowerPcFp => 16#1F1#,
      R4000 => 16#166#,
      RiscV32 => 16#5032#,
      RiscV64 => 16#5064#,
      RiscV128 => 16#5128#,
      Sh3 => 16#1A2#,
      Sh3Dsp => 16#1A3#,
      Sh4 => 16#1A6#,
      Sh5 => 16#1A8#,
      Thumb => 16#1C2#,
      WceMipsV2 => 16#169#);
#

wait

#

why are there awo arm64

#

nvm im blind

#

one is amd64

spare quartz
timid quartz
spare quartz
#

Sooorrrtt by the hex then and see what happen

timid quartz
#

coff_header.ads:27:15: error: enumeration value for "Am33" not ordered
coff_header.ads:29:16: error: enumeration value for "Arm32" not ordered
coff_header.ads:31:16: error: enumeration value for "ArmNT" not ordered
coff_header.ads:33:15: error: enumeration value for "I386" not ordered
coff_header.ads:38:17: error: enumeration value for "Mips16" not ordered
coff_header.ads:41:18: error: enumeration value for "PowerPc" not ordered
coff_header.ads:43:16: error: enumeration value for "R4000" not ordered
coff_header.ads:47:14: error: enumeration value for "Sh3" not ordered
coff_header.ads:52:20: error: enumeration value for "WceMipsV2" not ordered

timid quartz
#

still error

spare quartz
#

Also I’d suggest padding the hex

spare quartz
timid quartz
# spare quartz Huhg send the sorted

coff_header.ads:25:22: error: enumeration value for "I386" not ordered
coff_header.ads:26:22: error: enumeration value for "R4000" not ordered
coff_header.ads:27:22: error: enumeration value for "WceMipsV2" not ordered
coff_header.ads:29:22: error: enumeration value for "Sh3" not ordered
coff_header.ads:33:22: error: enumeration value for "Arm32" not ordered
coff_header.ads:35:22: error: enumeration value for "ArmNT" not ordered
coff_header.ads:36:22: error: enumeration value for "Am33" not ordered
coff_header.ads:37:22: error: enumeration value for "PowerPc" not ordered
coff_header.ads:40:22: error: enumeration value for "Mips16" not ordered

spare quartz
#

Send the sorted enum!!!!!

timid quartz
#

ughhh

#

I have to re sort it

#

I changed the redo history

spare quartz
#

Just press CTRL z

#

Oh my odddd

timid quartz
# spare quartz Send the sorted enum!!!!!
   type Machine_Type is (Unknown, Alpha32, Alpha64, Am33, Amd64,
                         Arm32, Arm64, ArmNT, EfiBytecode,
                         I386, Ia64, LoongArch32, LoongArch64,
                         M32R, Mips16, MipsFpu, MipsFpu16,
                         PowerPc, PowerPcFp, R4000, RiscV32,
                         RiscV64, RiscV128, Sh3, Sh3Dsp, Sh4,
                         Sh5, Thumb, WceMipsV2) with Size => 16;

   for Machine_Type use
     (Unknown     => 16#0#,
      I386        => 16#14C#,
      R4000       => 16#166#,
      WceMipsV2   => 16#169#,
      Alpha32     => 16#184#,
      Sh3         => 16#1A2#,
      Sh3Dsp      => 16#1A3#,
      Sh4         => 16#1A6#,
      Sh5         => 16#1A8#,
      Arm32       => 16#1C0#,
      Thumb       => 16#1C2#,
      ArmNT       => 16#1C4#,
      Am33        => 16#1D3#,
      PowerPc     => 16#1F0#,
      PowerPcFp   => 16#1F1#,
      Ia64        => 16#200#,
      Mips16      => 16#266#,
      Alpha64     => 16#284#,
      MipsFpu     => 16#366#,
      MipsFpu16   => 16#466#,
      RiscV32     => 16#5032#,
      RiscV64     => 16#5064#,
      RiscV128    => 16#5128#,
      LoongArch32 => 16#6232#,
      LoongArch64 => 16#6264#,
      Amd64       => 16#8664#,
      M32R        => 16#9041#,
      Arm64       => 16#AA64#,
      EfiBytecode => 16#EBC#);
spare quartz
#

Send error

timid quartz
#

coff_header.ads:25:22: error: enumeration value for "I386" not ordered
coff_header.ads:26:22: error: enumeration value for "R4000" not ordered
coff_header.ads:27:22: error: enumeration value for "WceMipsV2" not ordered
coff_header.ads:29:22: error: enumeration value for "Sh3" not ordered
coff_header.ads:33:22: error: enumeration value for "Arm32" not ordered
coff_header.ads:35:22: error: enumeration value for "ArmNT" not ordered
coff_header.ads:36:22: error: enumeration value for "Am33" not ordered
coff_header.ads:37:22: error: enumeration value for "PowerPc" not ordered
coff_header.ads:40:22: error: enumeration value for "Mips16" not ordered

spare quartz
#

And also add the original enum on top

#

That’s not the enum…

timid quartz
#

wrong

#

fixed

spare quartz
#

That is

#

The enum isn’t sorted

timid quartz
#

hwo

#

do the NAMES have to be sorted?

spare quartz
#

annnndd values

timid quartz
#

this is so GAY

spare quartz
timid quartz
#

WHY

#

DO THEY HAVE TO BE SORTED

spare quartz
timid quartz
#

so I have to sort the names alphabetically

#

and then the values

spare quartz
#

Nooo

#

Not alphabetically

timid quartz
#

?????

#

hlep

spare quartz
#

They just have to appear in the same order in both the clause and the enum

timid quartz
#

THEY DO

spare quartz
#

And the values are to be sorted

timid quartz
#

THEY WERE

spare quartz
#

they were hmmm

spare quartz
timid quartz
#

do I have to arrange the enum such that the names appear in the same order as the values's ordering?

#

so like

#

Unknown has to come first in the enum because the value is 16#0#

spare quartz
#

type A is (A, B, C);
for A use (A => 0, B => 1, C => 2);

#

personally I use 16#FF_FF# for unknown enums but idk if that’s reserved by the format here

#

Ladybird uses a new browser engine called LibWeb that is being created from scratch by the development team. Unlike SerenityOS, it will also use other open source libraries for development.[3] An ad blocking feature is planned.[7]

#

mmmsmmashhhggghhs external libraries

#

I become a zombie the moment I see them

timid quartz
#
type Machine_Type is (Unknown, I386, R4000, WceMipsV2, Alpha32, Sh3,
                         Sh3Dsp, Sh4, Sh5, Arm32, Thumb, ArmNT, Am33, PowerPc,
                         PowerPcFp, Ia64, Mips16, Alpha64, MipsFpu, MipsFpu16,
                         RiscV32, RiscV64, RiscV128, LoongArch32, LoongArch64,
                         Amd64, M32R, Arm64, EfiBytecode) with Size => 16;
   for Machine_Type use
     (Unknown     => 16#0#,
      I386        => 16#14C#,
      R4000       => 16#166#,
      WceMipsV2   => 16#169#,
      Alpha32     => 16#184#,
      Sh3         => 16#1A2#,
      Sh3Dsp      => 16#1A3#,
      Sh4         => 16#1A6#,
      Sh5         => 16#1A8#,
      Arm32       => 16#1C0#,
      Thumb       => 16#1C2#,
      ArmNT       => 16#1C4#,
      Am33        => 16#1D3#,
      PowerPc     => 16#1F0#,
      PowerPcFp   => 16#1F1#,
      Ia64        => 16#200#,
      Mips16      => 16#266#,
      Alpha64     => 16#284#,
      MipsFpu     => 16#366#,
      MipsFpu16   => 16#466#,
      RiscV32     => 16#5032#,
      RiscV64     => 16#5064#,
      RiscV128    => 16#5128#,
      LoongArch32 => 16#6232#,
      LoongArch64 => 16#6264#,
      Amd64       => 16#8664#,
      M32R        => 16#9041#,
      Arm64       => 16#AA64#,
      EfiBytecode => 16#EBC#);
#

ok

#

now

#

just EfiBytecode is unordered

spare quartz
#

It’s correct

timid quartz
#

compiler says otherwise

#

coff_header.ads:50:22: error: enumeration value for "EfiBytecode" not ordered

spare quartz
#

That’s what I’m saying

#

The compiler is correct

timid quartz
#

how fix...

spare quartz
#

Efi needs to be before Riscv32

timid quartz
spare quartz
#

This is why you pad the hexadecimal!!!!!

#

makes it easier to spot

timid quartz
#

ugh this language is stupid and gay and dumb

spare quartz
#

Servo is an experimental browser engine designed to take advantage of the memory safety properties and concurrency features of the Rust programming language. It seeks to create a highly parallel environment, in which rendering, layout, HTML parsing, image decoding, and other engine components are handled by fine-grained, isolated tasks.

spare quartz
timid quartz
#

not specified if it's 0x0EBC or 0xEBC0

spare quartz
#

Well, when there’s less digits in the hex that means it’s smaller

#

0xA000 > 0xFBA

#

0x0A00 < 0xF00

#

(left most is pad)

#

(but you should also add _ for separation between bytes)

full berry
#

very broad question
what are good ways to check permissions in an admin system (discord or roblox)
or generally like a permission system

spare quartz
#

What

#

Wdym permissions

full berry
#

like

#

lets say you have uhhhhhh

#

idfk member mod admin owner or something

spare quartz
#

In like, a Roblox group?

full berry
#

no

#

admin system

spare quartz
#

You don’t

#

That’s something you define

full berry
#

yes i know im

#

asking for ideas

spare quartz
#

Do anything

full berry
#

member has no perms
mod has member perms + kick perms
admin has mod perms + ban
owner has admin + blacklist
(idk i just made this up)

spare quartz
#

Like… permissions boil down to something being true or false, or a number

full berry
#

i was thinking of an inheritance system

spare quartz
#

Have a list of permission names or what have you and make them numbers or boolenas

timid quartz
#

@spare quartz constraint_error ca

#

H.Machine_ID := Machine_ID_Type'Val (Unsigned_16'Input (S));

spare quartz
spare quartz
#

What’s Machine_ID_Type and what’s the error

timid quartz
#

index check failed

timid quartz
full berry
# spare quartz Wdym

liiike the higher rank your is the more perms you get
but perms wouldnt have to be redefined, you would just inherit all of the permissions of lower ranks

timid quartz
#

I just renamed it

full berry
#

if that makes sense

spare quartz
full berry
#

wait doesnt shield just use that

spare quartz
#

Do I look like a shield dev

timid quartz
#

kinda yeah

#

shield perms need to be redone though

full berry
timid quartz
#

¯_(ツ)_/¯

spare quartz
#

Then apply 'Valid

spare quartz
#

It’s fine

timid quartz
#

so..

  1. Unsigned_16'Read
  2. Unchecked_Conversion
  3. ?
spare quartz
#
  1. Use 'Valid on the enum, if it’s false, assign to Unknown, otherwise pass
#

Do not read the enum before assigning. Just use the Valid aspect on it

#

otherwise you get a spooky invalid daya error

#

(Are you sure the stream isn’t being misaligned btw?)

timid quartz
#

yes Im sure the stream isn't misaligned

#

if I read the machine id as plain u16 it outputs the correct thing

spare quartz
#

Mmmm

timid quartz
#

namely 16#8664#

spare quartz
#

Obama wants a mcdouble

timid quartz
#
      Machine_ID_Thing := Convert_Machine_ID (Unsigned_16'Input (S));
      if Machine_ID_Thing'Valid then
         H.Machine_ID := Machine_ID_Thing;
      else
         H.Machine_ID := Unknown;
      end if;
#

ugh this is so stupid and gay

#

but it works

spare quartz
timid quartz
#

well...I'm operating under the assumption that the file isn't corrupt

#

and unknown is a defined value

spare quartz
#

:3

timid quartz
spare quartz
#

Then use enum_Val!

#

you might need to add Pragma Ada_2022 at the top of your file though assuming the project is in 2012 mode (default)

#

Omaneko

spare quartz
#

That works too

timid quartz
#

where is..

#

enum_val...

spare quartz
#

'Enum_Val

timid quartz
#

found it

spare quartz
timid quartz
#

it works

spare quartz
#

Nya

timid quartz
#

is it possible to use Put_Line to output an actual tab character rather than a literal "\t"

#

I know i can like

#

use the latin charset and do HT

#

but that's verbose because you have to "string 1" & HT & "string 2"

spare quartz
timid quartz
#

oh do you have to do f""

spare quartz
#

I’m pretty sure this is a GNAT extension so

#

probably

timid quartz
#

ugh gnat extension

#

whatever

spare quartz
#

GNAT is the only compiler that matters

#

You’re not gonna use like, HP Ada or whatever

timid quartz
#

I'll just type literal tabs myself then

spare quartz
#

Wha

timid quartz
spare quartz
#

You don’t wanna use the extension??

timid quartz
#

how do u even use the gnat extension

spare quartz
#

-gnatX

timid quartz
#

ughhh it's almost 3 almost time to go back and suffer by writing japanese

#

death by 3000 characters

spare quartz
#

or if you try using it in code it’ll tell you what flag to use

timid quartz
#

in this forsaken paper

spare quartz
#

Mr mrroowww

#

I’m so sleeeepyyy . I woke up at 3 pm yesterday

timid quartz
#

go eep

#

rn.

spare quartz
#

Ugghhh fineeeee

timid quartz
#

ending 9/20

#

character 1/20

#

oh yikes that's a failure ending too

timid quartz
#

@spare quartz hmm surely there's a better way to read a struct than a giant procedure

#

ughhh range check failed again

#

possible misalignment

lavish dove
#

misalignment crazy

timid quartz
#

mm no seems to not be misaligned

timid quartz
#

forgot to read a record member

#

lmao

spare quartz
#

Ada’s default RW procedures are usually sufficient for basic scalars, but when it comes to composite stuff like records it’s more geared towards like

#

Communication between Ada apps or the same app

#

You can see this with Input/Output, which sends stuff like discriminants over (which other apps can’t understand, but ada can)

spare quartz
spare quartz
#

I have essentially three of the same function, just differing in unsigned length and the target enum

timid quartz
#

also im SO CLOSE to being done with this accursed paper

spare quartz
#

What is it about anyways

timid quartz
#

有名な少年主人公と日本社会

spare quartz
#

Ohhhh

#

So it’s a scientific fanfic

timid quartz
#

...no?

spare quartz
#

yyyeessss…

timid quartz
#

it's about how shonen anime protagonists relate to japanese soceity

#

specifically elements of japanese society reflected in said protagonists

#

don't tell me I'm wrong, I'm literally writing the damn paper

#

I have written 2.7k characters

#

over the past like 2.5 days

spare quartz
#

I’m not telling you you’re wrong that’s just how I interpret it

timid quartz
#

listen normally I think I'm right but in this case your interpretation is actually objectively wrong

#

this is not a fanfic at all and is a research paper

spare quartz
#

precisely

timid quartz
#

a very shoddy research paper

#

fucking windows ime can't even know to type 炭治郎 (tanjiro) correctly

#

and yes ik it's tanjirou (with a long o at the end) but windows ime doesn't

spare quartz
#

honestly no clue how that thing even works

#

I’ve seen it like once in action

timid quartz
#

romaji -> hiragana (or direct to katakana) -> katakana or kanji

#

"ookii" -> おおきい -> 大きい

#

"anime" -> アニメ

spare quartz
#

Oh so it’s a glorified LUT… with probably a lot more data than I could imagine

timid quartz
#

pretty much yeah

#

with also some temporal locality built in

timid quartz
#

windows IME doesn't even display it as an option

spare quartz
#

We love windows

timid quartz
#

at least it's not fcitx5 or ibus

#

looks at kde and gnome respectively

#

fucking mozc

proud creek
#

pretty cool

spare quartz
spare quartz
#

Damn now I wanna make a discord api… again…

timid quartz
#
procedure Ugh is
  type Me is record
    Is_Alive : Boolean := True;
  end record;
  procedure Yeet (M : in out Me) is
  begin
    M.Is_Alive := False;
  end Yeet;
  Literally_Me : Me;
is
  Yeet (Literally_Me);
end Ugh;
timid quartz
spare quartz
#

I need to finish TLS first soooo

#

Nooo not yet

timid quartz
#

gay

spare quartz
#

and I think I’d rather make a Minecraft server first but idk

#

if I do ever do that LSP I’ll probably fail

#

Hm you know i think it just occurred to me

#

Ada doesn’t free up memory for you because it’d probably be bad in embedded/RT environments

timid quartz
#

makes sense how it gets away without a borrow checker

timid quartz
#

you'd be fine

spare quartz
#

Semantic analysis of code is hard thougghhh

#

I don’t even know where I’d start

timid quartz
#

ugh

#

make abstract syntax tree

#

then analyze

spare quartz
#

that’s just saying “make a compiler” to me….

timid quartz
#

basically

#

honestly I'm taking a compilers course next semester so I might be equipped to do this after that class

spare quartz
#

That is one thing I’ve wanted to do for a while since GCC is kinda annoying to deal with but like

#

Code generation looks scary as hell

timid quartz
#

meh just generate assembly and feed it to gcc

#

or generate llvm ir

spare quartz
timid quartz
#

naaah the processor handles that

spare quartz
#

if anything that’s probably why a lot of my VMs I’ve made corrupt themselves: I never account for CPU state right

spare quartz
#

LLVMs giant though, I’d probably be sitting in the stability of something like Zig

#

I’d imagine the first step to making an LSP is figuring out that protocol they all use right

timid quartz
#

yeah I linked said protocol

spare quartz
#

Yeah I can do that

timid quartz
#

actually honestly

#

instead of making an lsp from scratch

#

taking ada_language_server and fixing parts of it would also be acceptable

#

that way you don't have to worry as much about semantic analysis

spare quartz
#

ALS doesn’t handle semantic analysis itself, that’s part of libadalang

#

there’s also ASIS (standardized semantic analysis) but that hasn’t been updated since like, Ada 05

timid quartz
#

ok well

#

ig you could latch onto libadalang for that then

spare quartz
#

Bark bark

timid quartz
#

wrong animal idiot

spare quartz
#

It is time to wake up

spare quartz
#

wow okay

#

looking at the wikibooks page for GNAT.Sockets

#

edited 12 times in the span of 19 years

timid quartz
#

@spare quartz it’s doone

spare quartz
#

what is

#

your paper?

timid quartz
#

Y. e. S

spare quartz
timid quartz
#

Thanks for the auto-inserted periods iPhone

timid quartz
spare quartz
#

mmmmmmmmmmm how do i wanna do this

timid quartz
#

oh it says SPARQ but the text is black and my discord theme is black so I can’t see it

spare quartz
#

it says sparc

#

its the architecture

timid quartz
#

@wheat zinc I summon thee, Sun SPARC chip mentioned

spare quartz
spare quartz
#

i'm not adding a set of dlls to my project

timid quartz
#

Import openssl then

spare quartz
#

no

#

an ada library already exists for that

#

and i already have the code done for handshaking, its just encryption that needs to be solved

#

god

#

this is what goes into reading a client handshake if you can see this file

timid quartz
#

When I was in college in the early 70s, I devised what I believed was a brilliant encryption scheme. A simple pseudorandom number stream was added to the plaintext stream to create ciphertext. This would seemingly thwart any frequency analysis of the ciphertext, and would be uncrackable even to the most resourceful government intelligence agencies. I felt so smug about my achievement.

Years later, I discovered this same scheme in several introductory cryptography texts and tutorial papers. How nice. Other cryptographers had thought of the same scheme. Unfortunately, the scheme was presented as a simple homework assignment on how to use elementary cryptanalytic techniques to trivially crack it. So much for my brilliant scheme.

From this humbling experience I learned how easy it is to fall into a false sense of security when devising an encryption algorithm. Most people don’t realize how fiendishly difficult it is to devise an encryption algorithm that can withstand a prolonged and determined attack by a resourceful opponent.

  • Phil Zimmermann, PGP creator
spare quartz
#

well yeah that's why im not making my own algo

#

i can't do that anyways -- its a violation of the TLS 1.3 spec

#

oh yeah

#

FFMPEG made a tweet today about ISO gatekeeping documents

#

i needed that post... a month ago

#

they even linked the exact document i was using for that mp4 decoder

timid quartz
#

heh

spare quartz
#

which wouldn't help much if it were free; that thing is horrible to read

timid quartz
#

They knew

spare quartz
timid quartz
#

waah waah look at me I need everything to be foss I can’t stand using proprietary software that actually just works

spare quartz
#

the structure of an MP4 file is incredibly basic to read as Apple basically invented it and they open source their crap

#

but holy crap AVC* as described in the ISO document is literal alien language

#

they just shove paragraph over paragraph that amounts to "these 2 bytes are the type of x"

#

Custom mp4 parsing, 1337 lines of rust, ~100kb of WASM and can be minified much more.

Here I use mozilla. Video decodes on all browsers.

If you want a fun project. Try it. This is a part of engineering that is full of weird licenses and specs.

Quoting wavefnx (@wavefnx)

You consume so much video but many don't know how it works under the h...

▶ Play video
#

uuuuuughhhhh

#

1,337 lines of rust and all you made is a box decoder

timid quartz
spare quartz
#

pal the time i made an mp4 box decoder in roblox was at maximum 400/500 lines

timid quartz
#

Ok but how many features did you skimp on

spare quartz
#

zero

timid quartz
#

bet you didn’t decode the audio

spare quartz
#

neither did this guy

timid quartz
#

hm

#

could just be badly written then

#

He did say it could be minified more

spare quartz
#

i don't have their code so i can't really confirm nor deny

#

also rust's semantics might require more stuff per line than lua

#

should be noted that the PNG decoder is also dependency-less

#

but again: that's cause rust defers some language features ada has baked in to libraries

timid quartz
timid quartz
#

The rationale is a) not bloating the stdlib and b) not restricting things to the release pace of the stdlib (meaning old, bad interfaces get fossilized)

spare quartz
#

understandable

#

static ada programs tend to be quite large for what they do, where as

#

lemme go check your rust app

#

is this cause of the debug data? how do i turn that off

#

strip = "debuginfo"

timid quartz
spare quartz
#

okay its still quite large...

#

i'll just chalk that up to the libraries having a lot of stuff in them

#

like tokio being built with full features

timid quartz
#

Tokio is

#

Yeah

spare quartz
#

i'd imagine a rust hello world program is smaller than an ada one though

timid quartz
#

Try it I’m in bed rn

#

I’ll also try to manually implement HTTP sometime soon so you can test

#

I just have the world’s busiest week

spare quartz
#

okay yeah somethings going on here that i can't see

#

13 MB for hello world doesn't sound right

timid quartz
#

Compile in release mode idk

spare quartz
#

thats what im doing

timid quartz
spare quartz
#

lemme tack on a few flags

#

there

#

-O3 with debug information (alr defaults)

timid quartz
#

Turn off debug info

#

Curious to see how much smaller it gets

spare quartz
# spare quartz

with roughly the same arguments (except for "panic" since that'd require messing with gnat exception handling)

#

very minor

timid quartz
#

Hm do panic = "unwind" for Rust then

spare quartz
#

if i cheat and dynamically link the executable i instead get

timid quartz
#

DAM

#

that is cheating though

timid quartz
spare quartz
#

god this takes forever to compile

timid quartz
#

Nuh uh

spare quartz
#

so about the same

timid quartz
#

neat

#

Now do Zig with .ReleaseSmall

#

jk

spare quartz
#

sure lemme install zig

timid quartz
#

I might write a thing in Zig for you to test though….

#

(Http thing)

spare quartz
#

it won't inform you if you're missing a library either so it's a tradeoff

#

zig build (no parameters)

#

zig build (releasesmall)

#

about 2 kb smaller than ada shared

spare quartz
spare quartz
#

secure random done

spare quartz
#

lot of code

spare quartz
#

To create additional motivation, the NSA incorporated various gamification features. For instance, analysts who were especially good at using XKeyscore could acquire "skilz" points and "unlock achievements."

spare quartz
#

longest function name so far

timid quartz
#

Or use windows

spare quartz
spare quartz
#

That’s more of a laziness thing though, I could’ve imported linux random(3)… but I didn’t!

#

Rn the OpenSSL client recognizes I’ve sent it a Server Hello

#

But… it errors soon after about how I sent the wrong cipher…

#

Oh yeah TODO : need to patch my byte flip library to flip oddly sized Modular types better

#

Rn it’s getting 0xFC0100 and transforming it into 0xFC01…

spare quartz
spare quartz
#

THE CAT

#

Idiot

timid quartz
#

smh

#

unchecked conversions are cringe anyways

spare quartz
#

Nuh uh

#

Well

#

For everything outside of streams yeah

#

But using a String as a byte buffer and reinterpeting is so useful

timid quartz
#

Ada should just read the record correctly, shouldn't need to do what is basically a C typecast

spare quartz
#

Well

#

What if it’s a tagged record

timid quartz
#

oop 🤢

spare quartz
#

Orrrr in my case a weirdly sized modular type

#

Besides you don’t use Unchecked convs when reading off records

timid quartz
#

hm question, do I make a thread pool from scratch or just use a crate

spare quartz
#

Use a crate?

#

Rust threading looks weird

timid quartz
#

eh not really

#

but a crate will prob be quicker

timid quartz
#

@spare quartz are you fine if I tailor this server to specifically serve get requests for the root lmao

#

so like nothing other than GET / HTTP/1.1

spare quartz
#

Sure that’s fine

timid quartz
#

or do you want me to make it more general

#

ok

spare quartz
#

Oh yeah

#

TLS is looking less scarier the more I look at ada big numbers

timid quartz
#

Noo it must be more scary

spare quartz
#

It is quite unfortunate I have to staple “WARNING THIS UNIT IS SUSCEPTIBLE TO TIMINGS SIDE CHANNEL ATTACKS” on the top of it though

#

Specifically the X25565 generator

spare quartz
#

but… I suck at cryptography

timid quartz
#
  1. figure out how long it takes to generate number
  2. wait enough time to make it take constant time
  3. ez
spare quartz
timid quartz
spare quartz
#

Aera

#

I have unfortunate news

timid quartz
#

hm

spare quartz
#

I’m in bed!!!!

#

If you want you can clone the basic http server and run it yourself

timid quartz
#

dies

spare quartz
#

Go onto my profile and click the bread block icon

#

That’s where the stuff is

timid quartz
#

urgh it keeps erroring why

#

like it says it has read errors

spare quartz
#

I need details

timid quartz
spare quartz
#

Oh that

#

Honestly I have no idea what causes those

timid quartz
#

interesting

spare quartz
#

I just ignore them

timid quartz
#

well

#

that was the server

#

so not as fast as ada maybe

#

well...less throughput

timid quartz
#

Idk I’m probably doing something wrong

#

This was able to have a massive throughput

spare quartz
#

Their parameters are different it serms

#

Seems

#

天ガイン
010 809D

timid quartz
spare quartz
#

Trying the iPhone OCR

timid quartz
#

o

#

ngl I can barely read that second kanji

spare quartz
#

Yeah it totally minced the first two kanji

#

Oh well

#

I copied it from the sun facing side too so it had even less to work off of

timid quartz
spare quartz
#

Oh

timid quartz
#

Literally “Touyoko Inn”

spare quartz
#

my .com!!!

timid quartz
#

yeah I used the website url to figure out what it said

#

and it just says the name

#

lmao

#

バカ猫

lavish dove
#

When I was younger I made a compiler that converted some linear thing to python

#

It's just taking text then figuring out what to do with it

#

Very time consuming 😭

spare quartz
#

Doing it well is the hard part!!

#

If I ever do make one I’d start with Ada -> JVM Bytecode

#

since it’s actually detailed on what to do

spare quartz
#

Compiler - translates to machine code
Transpiler - translates to another language

#

At least as far as I understand it

lavish dove
#

Intrinsics of the human language

timid quartz
timid quartz
#

@spare quartz

MZ SIG          OK
COFF SIG        OK

(SIGNATURE =>  17744,
 MACHINE_ID => AMD64,
 SECTION_COUNT =>  3,
 CREATED_AT =>  1729522237,
 SYMBOL_TABLE_PTR =>  0,
 SYMBOL_COUNT =>  0,
 OPTIONAL_HEADER_SIZE =>  240,
 CHARACTERISTICS => 
 (STRIPPED_RELOCATIONS => FALSE,
  IS_EXECUTABLE => TRUE,
  STRIPPED_LINE_NUMS => TRUE,
  STRIPPED_SYMBOLS => TRUE,
  AGGRESSIVE_WS_TRIM => FALSE,
  LARGE_ADDR_AWARE => TRUE,
  RESERVED => FALSE,
  BYTES_REVERSED_LO => FALSE,
  IS_32_BIT => FALSE,
  NO_DEBUG_INFO => TRUE,
  IS_REMOVABLE => FALSE,
  IS_NET => FALSE,
  IS_FS => FALSE,
  IS_DLL => FALSE,
  ONLY_UNIPROCESSOR => FALSE,
  BYTES_REVERSED_HI => FALSE))

(MAJOR_LINKER_VER =>  2,
 MINOR_LINKER_VER =>  43,
 CODE_SIZE =>  1568768,
 INIT_DATA_SIZE =>  45056,
 UNINIT_DATA_SIZE =>  3026944,
 ENTRY_POINT_ADDR =>  4596080,
 BASE_OF_CODE =>  3031040,
 PREFERRED_BASE =>  5368709120,
 SECTION_ALIGNMENT =>  4096,
 FILE_ALIGNMENT =>  512,
 MAJOR_OS_VER =>  4,
 MINOR_OS_VER =>  0,
 MAJOR_IMG_VER =>  0,
 MINOR_IMG_VER =>  0,
 MAJOR_SUBSYS_VER =>  5,
 MINOR_SUBSYS_VER =>  2,
 RESERVED =>  0,
 IMAGE_SIZE =>  4644864,
 HEADER_SIZE =>  512,
 CHECKSUM =>  1637883,
 SUBSYSTEM => WINDOWS_GUI,
 DLL_CHARACTERISTICS => 
 (RESERVED1 => FALSE,
  RESERVED2 => FALSE,
  RESERVED3 => FALSE,
  RESERVED4 => FALSE,
  EMPTY1 => FALSE,
  HIGH_ENTROPY_CAPABLE => TRUE,
  DYNAMIC_BASE => TRUE,
  FORCE_INTEGRITY => FALSE,
  NX_COMPAT => TRUE,
  DONT_ISOLATE => FALSE,
  NO_SEH => FALSE,
  DONT_BIND => FALSE,
  USE_APPCONTAINER => FALSE,
  IS_WDM_DRIVER => FALSE,
  HAS_CONTROL_FLOW_GUARD => FALSE,
  TERMINAL_SERVER_AWARE => FALSE),
 STACK_RESERVE_SIZE =>  2097152,
 STACK_COMMIT_SIZE =>  4096,
 HEAP_RESERVE_SIZE =>  1048576,
 HEAP_COMMIT_SIZE =>  4096,
 LOADER_FLAGS_RESERVED =>  0,
 RVA_NUM_AND_SIZE =>  16)
#

lovely

lavish dove
#

average microsoft docs

lavish dove
timid quartz
lavish dove
#

I mean its microsoft their docs are siht

timid quartz
lavish dove
#

that was separate

#

i think

#

ohhhh

#

yes

spare quartz
#

A langauge has semantics to it though

#

Machine code is simply just “instructions”

timid quartz
# spare quartz Neat

Tbh I may just make an overarching PE record and have both a way to read it in and pretty-print it

spare quartz
#

Well thankfully Ada 2022 added custom ‘Images

timid quartz
spare quartz
timid quartz
#

function My_Image (Self : whatever) return Unbounded_String;?

spare quartz
#

Hold on I need to find my glasses

#

The procedure call is defined by the aspect Put_Image

timid quartz
#

My glasses are on rn so I’m reading

#

Neat

#

You get this in Rust via impl Display for Type_Name

#

You can also #[derive(Debug)] if you’re lazy but you don’t get .to_string() from that (you only get the debug formatter, normally used by format!("{:?}", whatever))

#

You can also use :#? instead of :? for a “pretty print”

spare quartz
#

i need to see if Put_Image is inheritable

#

the date formatter for HTTP is quite reliant on numbers not having a space for the sign (negative years don't make sense)

#

hear me out

#

what if we just use telnet

timid quartz
spare quartz
#

nmap is just a mapping tool thats boring

#

netcat maybe but thats just telnet

timid quartz
#

hm nvm nmap can’t

#

netcat can though

spare quartz
#

DTLS/UDP chat server

#

back to the days of using a BBS

timid quartz
#

it needs encryption so the nsa can’t snoop

spare quartz
#

thats what DTLS is for

timid quartz
spare quartz
#

timid quartz
spare quartz
#

shh

spare quartz
#

im sure none of these are important

timid quartz
spare quartz
#

hi barosto

#

i really more computers

#

all i have is

  • mk2 (current pc, 64gb/3060/5500gt)
  • optiplex from early 2010s
  • gateway laptop from 1999 (nonfunctional)
#

if only mk1 wasn't confiscated..!

timid quartz
spare quartz
#

i hate how openssl isn't clear at all

timid quartz
spare quartz
#

die

#

this cant be where the error message was raied

timid quartz
#

hmmm

#

I can't really override Dos_Header's 'Read

spare quartz
#

wdym

timid quartz
#

so the signature needs to be procedure My_Read (S : Stream_Access; Item : out T); (where T is Dos_Header.Header but eh)

#

but I also need F : File_Type so I can Set_Index

#
   procedure Read_Header (S : Stream_Access; F : File_Type; H : out Header) is
   begin
      Unsigned_16'Read (S, H.Magic);
      Unsigned_16'Read (S, H.Last_Page_Size);
      Unsigned_16'Read (S, H.Page_Count);
      Unsigned_16'Read (S, H.Relocation_Entries);
      Unsigned_16'Read (S, H.Header_Size);
      Unsigned_16'Read (S, H.Min_Paras);
      Unsigned_16'Read (S, H.Max_Paras);
      Unsigned_16'Read (S, H.Init_Stack_Seg);
      Unsigned_16'Read (S, H.Init_Stack_Ptr);
      Unsigned_16'Read (S, H.Checksum);
      Unsigned_16'Read (S, H.Init_Instr_Ptr);
      Unsigned_16'Read (S, H.Init_Code_Seg);
      Unsigned_16'Read (S, H.Relocation_Table_Addr);
      Unsigned_16'Read (S, H.Overlay_Num);

      Set_Index (F, Index (F) + (2 * 4));

      Unsigned_16'Read (S, H.Oem_Id);
      Unsigned_16'Read (S, H.Oem_Info);

      Set_Index (F, Index (F) + (2 * 10));

      Unsigned_32'Read (S, H.PE_Sig_Offset);
   end Read_Header;
#

there are reserved words in those spots

#

and Set_Index is just easier

#

@spare quartz

spare quartz
#

why not reading onto a trash string

#

like
discard : String (1 .. 8)

timid quartz
#

mmm could

spare quartz
#

i thinnnkk

#

if you needed the file_type in a 'Read overriding procedure, you'd have two types like

#
type A is abstract tagged private;
type B is new A with record ... end record;
private
type A is record
  File : ...;
end record;
timid quartz
#

gross

#

tagged records

#

oop

#

yknow what's even more gross though

spare quartz
spare quartz
timid quartz
spare quartz
#

linux user.. its over..

timid quartz
#

it's so icky

#

nothing works right

spare quartz
#

hmm

#

do i do tls or sleep

#

hmm

timid quartz
spare quartz
#

nnnnnnnnnooooooooo