#💽Programming Chat v2
1 messages · Page 14 of 1
FlipBytesBE for network ordered data ..
kinda feels weird to know this code is already 4 months old
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
what's the biggest files
... 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
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???????
cccrappp gotta deal with file locking now... no wonder it's erroring
How many images do you have pulled
So basically just use unchecked conversion
@[email protected] Funny story, someone posted on a forum once that they were not sure how to get more ports for ssh. They had 22, 23, 24, but had issues with 25 being taken. How were they going to support their 4 friends sshing into their host. They were setting up a daemon for EACH expected ssh connection on a unique port.
Sad thing...
savve me
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...
que
actually maybe hash map
well where else are you supposed to cache
THE BROWSER
ok and why is it not caching
try chrome
Read this
I only see max age here, try the example from MDN Cache-Control: no-store, no-cache, max-age=0, must-revalidate, proxy-revalidate
you are explicitly disabling caching
no need for private as this does not carry user data
do it anyways 
won't change anything
they even show an example with my setup
im 99% convinced it just wants to cache only on https
check ff settings?
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
Low level is ok
it's very tedious
especially since there's no intrinsic header parsing (except for Content-Length)
ughhhhhh I don’t wanna write 2 more pages of Japaneseeeeeeeeee
do it
I’m lazyyyyyy
do I go to networking class…
yes......... you need to learn things idot...........
okay
caching. finally "done"
Nuh uh
I just need to learn how to force myself to write 2 pages of Japanese
in other news
i finally took the advice of moving some of th ecode outside the task loop
yipee
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
🥳
because long-lived tcp connections are better 
NO THEY'RE NOT!!
oh whatever they're like 0.3 bits anyways
1 baud connection.....
stop doing math i haven't studied tcp yet :<
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!!
and there
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..
okay yeah but im a bad task manager

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
LET ME OPEN 500 KEEP-ALIVE CONNECTIONS ON YOUR SERVER
(and i have no idea how!!!)
just make normal tcp socket but don't close it
wah wah wah who cares about that
ME cause you'll use tcp spammer or whatever and block all of them

trying to find docs for the selector
there are zero
there never are any docs..
like
theres a few stack overflow posts on them but
nobody has bothered to show an example
even in the code type Selector_Type is limited private;
that's intentional
still that means no reading the source code
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
gay
you wouldn't read a .c file...
rust socket2::Socket::set_linger
oh no thing is i can set keep alive super easily
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.
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
uploading entire jdks again 🙏
a what what
that's what select does...
what do you think a selector is.....
bro doesn't even know the basics of tasking
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);
}
Ada RM 9.7 pilled 🙏
urrrgghh
what
or actually can I change the repr of an enum
im reading the machine id bits from the exe fiel
and I didn't want to make a giant switch-case
make a giant switch case
(technically, a switch is just compiler mnemonic for a lookup table (more appropriately a jump table) but who cares)
(yes use a lut)
there mus tbe a better wayyyyyyyyyyyyy
i don't knowwwwwwww
you might need an ordered table if you can't cough up a hashing function
that reminds me
ugh stupid
why doesnt it just provide a hashing function by default
switch-case it is 
it's totally valid to just make a function that returns anything as a normal hash in java
USE AN ORDERED TABLE
!!
wait
nnnnnnooooo you can't ignore that thought
becuase you can make an table (map?) of any type
how would you make a hash function for... i dunno, an access-to-record
for the record it does provide some hashing functions for you
like Ada.Strings.Hash
there's no way to instantiate it with a literal
I'd have to like
wdym
add it to a read function or smth
nah why is bayachao so cute
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
wait................................................
i can just....................
yes
read the enum...........................
igiot
HERE
'Val
ugh darpa should make ada 2035 to beat the crap out of rust
your language is literally half baked
NUH UH
our language is mega baked.............. in one single oven
at least my language isnt uh...verbose
and uh...has a community
and uh.........doesnt have exceptions
and uh........borrow checker
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)
me when I act silly and become a maintainer in a super used ada project like idk nobody uses ada
and insert Abort_Task!!!!
or GNAT.OS_Lib.OS_Exit
bro found the one ... i dont evne know what that is
me when i export an ada function to c exit (its just a noop
cat get offmy key bot
look at all those chickens
Nope
what
You couldn’t
Nuh uh
okay true
i only have http 1.1..
also i got no idea how they have this many files
A lot are probably conditionally not compiled due to feature flags
When you were benchmarking your server, what did you have it doing?
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
Just serving a static file?
directory listing
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 ...
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
@spare quartz this uses tokio instead of plain rust threads but benchmark this
should i compile the ada one in fast mode or keep it in debug
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
how do i use this
the program, when running cargo run
top is mine, bottom is the one you sent
both compiled in unoptimized w/ debug
i also got this flooded ...
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
i heard japanese
@timid quartz https://fixupx.com/i/status/1857876458896765230
Peter x 混沌ブギ
作ってみた🙌👐👏🫶
#FGtwt #混沌ブギ #familyguy
specifically <name>\0<size><F/D/S descriptor>\n
what a weird name
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
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
i'd imagine it also does other processing of the request
yeah
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
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???
dementia
what is the difference between the windows and macos font...
such a weird type!!
me when I flip your bytes
okay but how
cooooooooooooll
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

me too..
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
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
wait the for thing for the enum has to be ordered???
Yes
The compiler should’ve given you an error — did it?
Oh yeah
I also gotta fix all of these unknowns
Except for Cipher suites since TLS 1.3 only defines 5
WHAT
You don’t need to sort the numbers iirc
What did you do…….
Wait no… you do… or don’t… I have dementia
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
and this causes an error?
yes
Sooorrrtt by the hex then and see what happen
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
Also I’d suggest padding the hex
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
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#);
Send error
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
annnndd values
this is so GAY


They just have to appear in the same order in both the clause and the enum
THEY DO
And the values are to be sorted
THEY WERE
they were hmmm
What you’ve shown up here is a violation of the first…
in this, the names appear in the same order
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#
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
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
It’s correct
compiler says otherwise
coff_header.ads:50:22: error: enumeration value for "EfiBytecode" not ordered
how fix...
Efi needs to be before Riscv32

ugh this language is stupid and gay and dumb
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.
Rust user when they have to be consistent for once 👻
yeah but IMAGE_FILE_MACHINE_EBC | 0xebc | EFI byte code
not specified if it's 0x0EBC or 0xEBC0
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)
very broad question
what are good ways to check permissions in an admin system (discord or roblox)
or generally like a permission system
In like, a Roblox group?
Do anything
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)
Like… permissions boil down to something being true or false, or a number
i was thinking of an inheritance system
Have a list of permission names or what have you and make them numbers or boolenas
@spare quartz constraint_error 
H.Machine_ID := Machine_ID_Type'Val (Unsigned_16'Input (S));
Wdym
Okay, give more information
What’s Machine_ID_Type and what’s the error
index check failed
machine_id_type is the enum
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
I just renamed it
if that makes sense
A table of permission names with numbers then
wait doesnt shield just use that
Do I look like a shield dev
yeah um...
why does @Roblox have level 10...
¯_(ツ)_/¯
Anyways uh you’re reading an invalid value obviously, you need to use an unchecked method
Then apply 'Valid

It’s fine
so..
- Unsigned_16'Read
- Unchecked_Conversion
- ?
- 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?)
yes Im sure the stream isn't misaligned
if I read the machine id as plain u16 it outputs the correct thing
Mmmm
namely 16#8664#
Obama wants a mcdouble
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
Oh yknow what you’re supposed to use Enum_Val, a 2022 thing… but that won’t handle Unknowns for you
well...I'm operating under the assumption that the file isn't corrupt
and unknown is a defined value
You should inline if
:3
Oh
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
Compiling with -gnat2022
That works too
'Enum_Val
found it
it works
Nya
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"
String interpolation (GNAT Reference Manual)
oh do you have to do f""
GNAT is the only compiler that matters
You’re not gonna use like, HP Ada or whatever
I'll just type literal tabs myself then
Wha
You don’t wanna use the extension??
how do u even use the gnat extension
-gnatX
ughhh it's almost 3 almost time to go back and suffer by writing japanese
death by 3000 characters
or if you try using it in code it’ll tell you what flag to use
game ending screen
ending 9/20
character 1/20
oh yikes that's a failure ending too
@spare quartz hmm surely there's a better way to read a struct than a giant procedure
ughhh range check failed again
possible misalignment
misalignment crazy
mm no seems to not be misaligned
Not that I know of
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)
Also you just reminded me I really need to make enum reading generic
I have essentially three of the same function, just differing in unsigned length and the target enum
also im SO CLOSE to being done with this accursed paper
What is it about anyways
有名な少年主人公と日本社会
...no?
yyyeessss…
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
I’m not telling you you’re wrong that’s just how I interpret it
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
precisely
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
romaji -> hiragana (or direct to katakana) -> katakana or kanji
"ookii" -> おおきい -> 大きい
"anime" -> アニメ
Oh so it’s a glorified LUT… with probably a lot more data than I could imagine
it wasn't macOS's first guess either, BUT it learned pretty damn quickly that I wanted to type that
windows IME doesn't even display it as an option
We love windows
at least it's not fcitx5 or ibus
looks at kde and gnome respectively
fucking mozc
pretty cool
wow acc kinda neat
Damn now I wanna make a discord api… again…
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;
ada time?
gay
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
makes sense how it gets away without a borrow checker
that’s just saying “make a compiler” to me….
basically
honestly I'm taking a compilers course next semester so I might be equipped to do this after that class
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
me when the assembly I generate makes the cpu die (I forgot to account for the 1 billion different external vars that determine the state of a processor)
naaah the processor handles that
if anything that’s probably why a lot of my VMs I’ve made corrupt themselves: I never account for CPU state right
Maybe
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
yeah I linked said protocol
Yeah I can do that
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
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
Bark bark
wrong animal idiot
It is time to wake up
wow okay
looking at the wikibooks page for GNAT.Sockets
edited 12 times in the span of 19 years
@spare quartz it’s doone
Y. e. S
Thanks for the auto-inserted periods iPhone
blank
mmmmmmmmmmm how do i wanna do this
oh it says SPARQ but the text is black and my discord theme is black so I can’t see it
@wheat zinc I summon thee, Sun SPARC chip mentioned
secure random generator
- figure out all the math to make one myself
- pragma Import(C, "__gcc...")
- System.Machine_Code
- use the insecure random generator
WolfSSL
i'm not adding a set of dlls to my project
Import openssl then
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
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
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
heh
which wouldn't help much if it were free; that thing is horrible to read
They knew
waah waah look at me I need everything to be foss I can’t stand using proprietary software that actually just works
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...
uuuuuughhhhh
1,337 lines of rust and all you made is a box decoder
all those ada files and all you made is a special box (png) decoder
pal the time i made an mp4 box decoder in roblox was at maximum 400/500 lines
Ok but how many features did you skimp on
zero
bet you didn’t decode the audio
neither did this guy
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
I think so yeah, also rustfmt likes to use more lines to be pretty in a lot of cases
Yeah
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)
understandable
static ada programs tend to be quite large for what they do, where as
lemme go check your rust app
what
is this cause of the debug data? how do i turn that off
strip = "debuginfo"
cargo b --release
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
i'd imagine a rust hello world program is smaller than an ada one though
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
okay yeah somethings going on here that i can't see
13 MB for hello world doesn't sound right
Compile in release mode idk
thats what im doing
I might pull in a library for a proper thread pool tho
with roughly the same arguments (except for "panic" since that'd require messing with gnat exception handling)
very minor
Hm do panic = "unwind" for Rust then
if i cheat and dynamically link the executable i instead get
Try this
god this takes forever to compile
Nuh uh
sure lemme install zig
should note dynamically linking will do some odd stuff to exception handling too
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
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."
Accounted for by using an imported function
Also… not my problem! If your random is compromised you have bigger issues
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…
what the flip
not the gif I wanted to send
This mf couldnt even do simple unchecked conversions 🙏
die
Nuh uh
Well
For everything outside of streams yeah
But using a String as a byte buffer and reinterpeting is so useful
Ada should just read the record correctly, shouldn't need to do what is basically a C typecast
oop 🤢
Orrrr in my case a weirdly sized modular type
Besides you don’t use Unchecked convs when reading off records
hm question, do I make a thread pool from scratch or just use a crate
@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
Sure that’s fine
Noo it must be more scary
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
I’m pretty sure this can’t be exploited in the way it’s used though
but… I suck at cryptography
just make it take a fixed time
- figure out how long it takes to generate number
- wait enough time to make it take constant time
- ez
Ohhh but I don’t wannnaaa become sudoooo
@spare quartz ok try this
hm
dies
interesting
I just ignore them
Idk I’m probably doing something wrong
This was able to have a massive throughput
what is that
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
Oh it just says Touyoko
Oh
Literally “Touyoko Inn”
my .com!!!
yeah I used the website url to figure out what it said
and it just says the name
lmao
バカ猫
I mean you can start really simple lol
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 😭
Well I know at a high level it’s just take structure A, turn it into instructions but like
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
Also wouldn’t this technically be a transpiler?
Compiler - translates to machine code
Transpiler - translates to another language
At least as far as I understand it
Wouldn't Machine code just be a language the cpu supports
Intrinsics of the human language
urghhh microsoft why did you omit the value 0x0010
@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
cuz its something deprecated
average microsoft docs
wheres the thing that gives the link date
they could at least put it in the docs...
I mean its microsoft their docs are siht
uhhh, CREATED_AT probably
Well I suppose so
A langauge has semantics to it though
Machine code is simply just “instructions”
Tbh I may just make an overarching PE record and have both a way to read it in and pretty-print it
Well thankfully Ada 2022 added custom ‘Images
…how
function My_Image (Self : whatever) return Unbounded_String;?
Hold on I need to find my glasses
The procedure call is defined by the aspect Put_Image
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”
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
What if we just use netcat/nmap
it needs encryption so the nsa can’t snoop
thats what DTLS is for
Knowing you that’s probably been backdoored
❌
Also no way you put a matrix screenshot here
shh

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..!


wdym
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
mmm could
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;
mfs when they antagonize a design instead of its use
what
my pc....is booted into arch 🤢
linux user.. its over..
sleep
nnnnnnnnnooooooooo



