log☇︎
1000+ entries in 0.116s
bvt: i would try to make some sort of write-up about this. i wanted to suggest making a Ada library that exposes a subset of Linux system calls without C code, because i clearly needed it for the tempfile.
diana_coman: yes; basically Ada makes it easy enough to not have to force anything; funny how Ada is in fact *very* accommodating - where it makes sense to be
mircea_popescu: slowly but surely a republican ada style manual is shaping up (and through the exact http://btcbase.org/log/2018-10-23#1865304 process, at that!) ☝︎☟︎☟︎
asciilifeform: would be pretty great if instruction to 'i want blog' n00b wasn't 'install this here 200MB of ??? liquishit', but instead 'build this here 100kB ada'.
lobbes: it would be an interesting project to learn some basic ada with
diana_coman: mircea_popescu, once this is in place, it should be relatively painless to swap at a later stage (whenever available) the C rsa/mpi for an Ada implementation since it's basically kept well separate
diana_coman: will probably cut it in 2 parts two, namely the wrappers first and then the whole big .vpatch bringing in everything needed (mpi, keccak, oaep-but-this-time-from-ada-only)
diana_coman: and everything will be called from Ada only, not the other way around
diana_coman: and then Ada will call those
diana_coman: in other news from the smg comms front: the rsa pack/unpack turned a bit nastier than the nice serpent because (of course!) of the C element; basically the rsa operations are in C (mpi mess) while the oaep is in Ada and the current eucrypt wrapper is fine but doing the ugly dance of C to Ada *and back*; my solution to this is to decree that there will be only ONE direction of calls namely from Ada to C (because Ada is the main, desired par
phf: no no, that's an unreleased enable sha512, so my point is that it must be something in ada/c interop, or the particular way i do it in vdiff: ksum works though it uses same interface, vdiff sha512 works though it uses an architecturally identical sha interface.
phf: hmm, i wonder if it's maybe c/ada interop? straight ksum gives me the answer, and it uses the same incremental mechanism (already trie)d
asciilifeform: phf: it's an ada stack overflow, so almost certainly in keccak
asciilifeform: mircea_popescu: reminds me, i prolly oughta genesis 'horsecocks' aka mmap-for-ada
deedbot: ave1 rated spyked 2 << wrote a scheme in Ada
ave1: !!rate spyked 2 wrote a scheme in Ada
mircea_popescu: things are kinda deliberately made to dovetail with ada, so i hope they do and if they don't we fix.
asciilifeform: back when i wrote in c, i also serialized/deserialized 'just once', when casting packet to the correct struct, but to precisely nail down the latter required gcc-specific pragmas, as c per se does not give this ability. but in ada the required knobs are standard.
asciilifeform: of all the various items asciilifeform has used over the yrs, ada ( and not even 'modern', but even back in ada-83 ) has the absolute sanest support for strict record layout that actually worx as described
diana_coman: it might really be that my ada-fu is not up to the task yet
bvt: it seems that 'c strings' in ada are still controlled by ada mechanisms, i.e. they are ada strings (with bounds checking), just with null byte in the end
a111: Logged on 2018-10-15 03:01 mircea_popescu: bvt "Ada exposes no functions that have 'exclusive open' semantics, so I imported C
bvt: re naming: i agree that it clashes with Ada naming convention. will rename to Temporary_File.
a111: Logged on 2018-10-15 01:53 phf: oh i guess i see why that would be tricky, because of the specialization. i don't know enough ada yet to know how to fix that... perhaps just renaming it to Temporary_File is sufficient
ave1: and in that code, another way to send strings from Ada to C; http://p.bvulpes.com/pastes/GZtAH/?raw=true
a111: Logged on 2018-10-15 01:13 phf: so it looks like bvt is correct, there's no way to make ada's Create throw an exception if the file already exists
mircea_popescu: bvt "Ada exposes no functions that have 'exclusive open' semantics, so I imported C ☟︎
phf: oh i guess i see why that would be tricky, because of the specialization. i don't know enough ada yet to know how to fix that... perhaps just renaming it to Temporary_File is sufficient ☟︎
phf: (when i proposed the name i was thinking that it will be a wrapper around http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-A-8-1.html#p6
phf: the other thing, and that's somewhat of a personal preference, i think Create_Temporary_File should either act identical to create or be called something else. right now it clashes with ada's naming convention
phf: so it looks like bvt is correct, there's no way to make ada's Create throw an exception if the file already exists ☟︎
asciilifeform: ( and afaik in ada -- it aint )
asciilifeform: ( recall, i have my own working block eater in ada, posted last yr, but currently was looking into 'binary-types' in application to btc trad encoding )
asciilifeform: ada deliberately does not offer equiv of #ifdef, because ifdefism is retarded. so you're left with this method, afaik.
Mocky: so long as you can assume one tru packet size, you can get some ada benefits + extra simplicity, that you don't get otherwise, no?
asciilifeform: diana_coman has a 'generic' ver, a kind of ada cheat i suggested ; but it has minus of preventing restriction encapsulation, as well as inevitably moar complex receiver (mine handles one size and one size only)
bvt: right, Ada.Directories.Exists was the missing piece.
phf: bvt: this doesn't need much C, it's a loop with a termination condition of not Ada.Directories.Exists(Filename), and the tricky part is the construction of said Filename. it could be a Prefix ("vpatch.") + keccak hash(salt + pid + time + ???).
bvt: i will give it a try. i'm still learning ada, will have to take a look at how strings and interfacing with C are done properly.
phf: i like that ada will create a temp file for you and then clean it up on empty string, though that's a bit too magical (the interface, not the behavior)
bvt: The code in question is in gcc/ada/adaint.c in function __gnat_tmp_name (char *tmp_filename), http://wotpaste.cascadianhacker.com/pastes/cxakJ/?raw=true
bvt: 2. Ada internally uses mkstemp(3) to generate a random name when empty string is passed as filename to Open procedure.
deedbot: asciilifeform rated bvt 1 << n00b, ada/vtronics experiments
asciilifeform: !!rate bvt 1 n00b, ada/vtronics experiments
bvt: GNAT 2016 runtime deletes all files with temp bits at the Finalization stage, so everything should work fine. (Not an ada specialist, so when finalization is actually run is a mistery to me)
mircea_popescu: if not -- learn ada or sql or something.
phf: differ is also c code, i wanted to figure out how to make the rename tracking algo pure ada, and then have it drive the differ, rather than writing more c code, but i'll see if i can manage it
diana_coman: aaand if I get it right, GNAT.CRC32 uses Ada.Streams.Stream_Element and it expects a String as input so overall it really sounds like back to GNAT.Sockets style, ugh
a111: Logged on 2015-12-12 00:23 asciilifeform: adlai: http://cs.fit.edu/~ryan/ada/programs << mega-collection of examples
diana_coman: really? I thought there was a site you were recommending precisely for "good ada code", wasn't there?
asciilifeform: diana_coman: interestingly, just about my entire collection of vintage ada, with the exception of that little serpent thing, qualifies for this museum.
asciilifeform: diana_coman: thing is eminently fit for 'museum of sad ada'
mod6: yeah, this is the right approach imho. it's what i'd do with my ada-vtron, if it ever does breathe.
mod6: I had started on a ada vtron last year, but I got hung up with some of the string handling, and the fact that I had to use shell-outs for pgp. I'd like to get back to it at some point. I would love to dispense with the shell outs - and can probably do so, but not until 'peh' is finished.
diana_coman: (it can be done though, if one really wants it, basically an Ada task to be repeated hourly, but I don't see the benefit to that)
asciilifeform: really the stringism routines ( which imho yes oughta be in a udp lib, they make it possible to write complete udpism proggy ) oughta be baked in native ada form..
diana_coman: asciilifeform, the IP_To_String will return a string with null chars (in Ada: Character'Val(0)) at the end for IPs that are shorter than 16 chars (e.g. 98.20.105.41); I'm in 2 minds whether to make it change those to spaces (keeps size same) or otherwise return some len; since it's your lib though: what is your take on it?
phf: hmm, i have the path set, but i don't have either of the ADA_* vars
a111: Logged on 2018-09-22 03:05 phf: ave1: i'm getting the following error http://p.bvulpes.com/pastes/49Tie/?raw=true when building ada-musl-cross-2018-06-01. i feel like it came up before, but i'm having hard time finding the thread
phf: ave1: i'm getting the following error http://p.bvulpes.com/pastes/49Tie/?raw=true when building ada-musl-cross-2018-06-01. i feel like it came up before, but i'm having hard time finding the thread ☟︎
phf: is ada-musl-cross-2018-06-01 the latest version of ave1's ada?
diana_coman: in other pleasant surprises, this generic thing in ada is very useful
asciilifeform: ave1 was asking re scenario where 'say i make pdp11.c for yer lib, and you changed the ada trunk, naowat'
asciilifeform: btw one of the items i have in the deep freezers, is a trb with block db ripped out, replaced with (half-finished, sadly) ada mmap thing
a111: Logged on 2018-09-14 13:35 a111: Logged on 2017-06-06 19:40 asciilifeform: mod6, phf , et al : http://nosuchlabs.com/pub/ada/horsecocks.tar.gz << i dun recall posting this before, so here it will live, for nao : unofficial release of mmaptron
asciilifeform: ( ada uses 'green' threading, rather than os's, but iirc the os threads are involved ultimately )
diana_coman: fwiw, I'm also quite grateful that ave1 published it now - it pointed me to ada inline assembler (I hadn't really looked at it before!) and it gives me some time to hopefully get a bit more used to it *before* I'll need it anyway
mircea_popescu: ada threading still seems as promising as it did weeks ago. few things survive this long lol
diana_coman: http://logs.bvulpes.com/trilema?d=2018-9-18#431566 -> I'm thinking of 2 there ; asciilifeform's lib also provides I think a good interface - I don't see any reason why one couldn't just change /swap the underlying .c file with ada or asm at a later date without having to change otherwise anything of whatever one builds on top of the lib (i.e. relying on the lib's interface)
a111: Logged on 2018-09-18 13:05 diana_coman: for completeness, version 3. GNAT.Sockets.Thin that is an Ada wrapper on C system calls containing however questionable approaches (e.g. returning access to String so effectively a pointer but worse than this: allocating memory on the heap and leaving the de-alloc to the caller...)
diana_coman: asciilifeform, ah, I forgot to mention it explicitly but yes, my tests include ave1's gnat as well as adacore's gnat; this is pretty much for any ada code I test
asciilifeform: diana_coman: imho that functionality belongs in a udp lib ( given as it demands knowledge of how ip is represented ) but prolly oughta be a troo ada thing, not a callout. however implementing it would double the mass of the proggy
asciilifeform: diana_coman: observe, my lib is somewhat unorthodox, it tries to abstract entirely over the os socket, nails down a fixed packet length, ipv4 4evah, no 'nonblockisms' - who wants these, can implement via ada task; no dnsism supported at all, etc
mimisbrunnr: Logged on 2018-09-18 12:37 diana_coman: to round this whole thing up: 2 days ago it seemed I had only the gnat.sockets/ thin layer option which wasn't fit for purpose; now I have 2 more options: 1. ave1's ADA implementation of UDP sockets using directly ASM inline 2. asciilifeform's light UDP sockets lib that uses C code for needed UDP sockets calls but provides an Ada wrapper so that any code using the lib can call Ada methods
diana_coman: asciilifeform, if I understand your lib correctly, it aims to expose only a strict & minimal set of UDP calls; atm it uses C code for the actual socket part but in principle this layer could be replaced at a later time by some Ada layer while keeping the rest as it is, correct?
diana_coman: for completeness, version 3. GNAT.Sockets.Thin that is an Ada wrapper on C system calls containing however questionable approaches (e.g. returning access to String so effectively a pointer but worse than this: allocating memory on the heap and leaving the de-alloc to the caller...) ☟︎
diana_coman: to round this whole thing up: 2 days ago it seemed I had only the gnat.sockets/ thin layer option which wasn't fit for purpose; now I have 2 more options: 1. ave1's ADA implementation of UDP sockets using directly ASM inline 2. asciilifeform's light UDP sockets lib that uses C code for needed UDP sockets calls but provides an Ada wrapper so that any code using the lib can call Ada methods only
asciilifeform: for the rare exception, ada standard actually gives the tools to bake a custom heap that uses specified storage and allocation algos, bypassing the os derpery entirely
mircea_popescu: anyway -- fuck 'em, i deeply fucking care some nobody-on-a-stick meanwhile joined the churchgoing group. whatever. but in matters of actual interest : you "were working" on an ada networking socking thing ; ave "was working" on ~same. had diana_coman not said "here's what ~~~I AM ABOUT TO DO~~~", we would have never known. if the wastefulness of this approach isn't directly obvious...
diana_coman: at any rate ave1 this doesn't look bad at all in that it is an ada layer rather than just wrapping the c calls
ave1: I'm also working on a thin networking layer for Ada (using direct system calls in inline assembler). I got stuck on some inline assembly details and once that was resolved I got stuck on the whole select/epoll/kevent support and so forth. So at this point, http://btcbase.org/log/2018-09-16#1850668 applies. ☝︎
mircea_popescu: how are you going to handle the weird data models implied by teh nutty syscalls in an ada proggy ?
mircea_popescu: are you going to write an ada program to treat c-defined syscalls as black boxes and spit out ada acceptable output ; opr are you going to write a c program to treat c-defined syscalls as compatriots and spit out ada acceptable output ?
mircea_popescu: diana_coman but would the wrapper be c or ada ?
diana_coman: I don't know what an "ada system call" is, to answer that question; my aim is indeed to wrap them in one place so that everything else makes ada calls and doesn't care
mircea_popescu: more specifically : what exactly is the limit of the "c-ness" of the system calls ? can we pretend they're ada system calls until they are ?
mircea_popescu: diana_coman would this be written in ada then ?
asciilifeform: ( tho will add, ada Strings actually work with arbitrary garbage, given as they do not use the idiot c 'null termination' paradigm )
asciilifeform: ( tho naturally you won't use ada String for arbitrary octetolade. but same principle. )
a111: Logged on 2016-04-06 15:49 asciilifeform: ada tasks, afaik, is the only sane implementation of parallelism where you ~never~ specify explicit thread
a111: Logged on 2018-09-14 12:37 mircea_popescu: anyway, reading through this, i suspect ada threading may turn out to be a pleasure.
a111: Logged on 2017-06-06 19:40 asciilifeform: mod6, phf , et al : http://nosuchlabs.com/pub/ada/horsecocks.tar.gz << i dun recall posting this before, so here it will live, for nao : unofficial release of mmaptron ☟︎
diana_coman: I recall a link to examples in ada; fwiw I think they are even gone from that link at least; was that "nqb"?
mircea_popescu: anyway, reading through this, i suspect ada threading may turn out to be a pleasure. ☟︎
mircea_popescu: i suspect that the federated calling model of the current bash is actually its strength ; and not necessarily competed by lisp-ada.
a111: Logged on 2018-04-05 19:11 asciilifeform: imho the long-term answer is '3rd way' , i.e. all the crud i wrote in bash, python, etc over the years really oughta be in the hypothetical little-lisp-in-ada from old thread.
asciilifeform: if you want 'modern' (Gb/s+) throughputs, it aint 'ada lines', but transistors. coupla mil of'em.
Mocky: apparently stepanoff wrote the generic list processing for Ada but saw that c++ would be more popular so then wrote stl as researcher at HP
mircea_popescu: and the ada artifact.
ben_vulpes: trinque flagged whitaker's words for me as a latin dictionary (an ada artifact even!)