log☇︎
1300+ entries in 0.158s
diana_coman: calling from C something that might look like this in ada: procedure getstring(input: in Interfaces.C.char_array; Output out Interfaces.C.char_array)
diana_coman: no requirement re format, it's really: pass this here char * to Ada safely and recover this String from Ada via an "out String" parameter (char * on C side)
diana_coman: ave1, my current solution is to pass the length as a separate parameter indeed and in addition to actually copy octet by octet; To_C and To_Ada still fail me on occasion so I can't really rely on them - this might be of course because I don't fully understand them yet; in any case, please write it up, pretty please
a111: Logged on 2018-02-28 15:07 diana_coman: ave1 have you ever passed a char * from c to ada in such a way that ada actually sees the correct length for it? there is something I don't quite understand there as To_C seems to use Target'Length so the length should be set
ave1: diana_coman: this, http://btcbase.org/log/2018-02-28#1786496, triggered a short dive into the whole array sending mechanism in Ada. Will write it up and post tomorrow, yes it is possible but you'll need to make some internal structure that Ada uses. Also I doubt it is much better than sending the pointer with a separate length parameter. ☝︎
asciilifeform: ada folx: re making ada strings out of the c variety : strlen(char *) is a potentially lethal op ( suppose the nullterminator is missing ) so it will never be called implicitly by ada. you gotta either call strlen deliberately on c side, and then form ( can be on stack , declare ... Foo : String(1 .. Length) ... , say, a la http://btcbase.org/patches/ffa_ch4_ffacalc#L53 ) a proper ada string and copy the cstring into it.
diana_coman: ave1 have you ever passed a char * from c to ada in such a way that ada actually sees the correct length for it? there is something I don't quite understand there as To_C seems to use Target'Length so the length should be set ☟︎
diana_coman: ave1, aha, byte by byte was what I ended up doing at testing stage just to see it really working; hopefully I'll still get it working properly with To_C as such and then I can still avoid the C.Strings, stick with the procs To_Ada and To_C; it's not going to be pretty but at least the mess is as small as I can see a way to do it now
ave1: BTW for an Ada IRC bot experiment, I'm working with buffers on both sides (ADA <--> C) and moving bytes one by one. This seems to deliver the cleanest code. (but will probably not ever be Mbytes per second)
diana_coman: ave1, tbh I've been trying to avoid .c.strings at least but atm it looks set to still make its way in because calling ada stuff from c and getting char * result is an even worse mess with interfaces.c only (i.e. with char_array vs chars_ptr)
ave1: the fun of C strings, I hope you can use the procedure versions of To_Ada and To_C.
ave1: finally done describing minimal runtime creation for gnat ada: http://ave1.org/2018/gnat-and-zero-foot-print-runtimes/.
spyked: http://btcbase.org/log/2018-02-26#1786219 <-- hey, that sounds like a really neat project, I wouldn't mind adding it to the list. on a related note, /me has been on a sort of semi-holiday for the last 2 months, which led to a lot of exploration on items of potential republican interest. e.g. the ada lisp scriptlang, an irc logger bot (which I could spin into a rss bot), the text browser thing and some out-of-the-blue ro-en Trilema ☝︎
mircea_popescu: hey, keep with the zero overhead ada compiles
ave1: Also, as it happens on some bot code in ADA, but this is slow going
ave1: http://btcbase.org/log/2018-02-26#1786219, I'm working on custom runtime / zero footprint ada code ☝︎
a111: Logged on 2018-02-23 15:45 mod6: I was thinking lsat night about my version of V in Ada, and am using shellouts there for the gpg related things. even with an integrated FFA, still need to add in an integrated Keccac from s.mg - those two I can work around. Others might be harder than it sounds.
mod6: I was thinking lsat night about my version of V in Ada, and am using shellouts there for the gpg related things. even with an integrated FFA, still need to add in an integrated Keccac from s.mg - those two I can work around. Others might be harder than it sounds. ☟︎
diana_coman: I'll focus for now on eucrypt; it has anyway ada-c integration itself so I'll see what I have by the end
mircea_popescu: diana_coman i guess once the eucrypt adventure is sealed a cover letter re ada-c integration may be a good idea, for future reference.
diana_coman: well, I can talk only about gprbuild from ada being bright enough
mircea_popescu: in other news : as work on eucrypt is winding down -- the whole item is just about complete, needs serpent and we've decided to add an oaep-rsa wrapper (mostly as a pretext to do some ada-c interop testing), so roughly speaking by end of month it should actually be done -- we're moving on to shaping up the eulora client-server comms model. this will mostly be a design discussion, will take place in #eulora, prolly take up som
mod6: hmmmod6@localhost ~/ada/alf/ffa/ch10/ffa/ffacalc $ command -v tr
asciilifeform: idea is a http server in <1000 ln of ada, approx. ☟︎
mircea_popescu: http://btcbase.org/log/2018-02-02#1779409 << this should prolly be standard preface of ada behaviour discussions ; ffa or non-ffa related. asciilifeform maybe you should add it as a comment you know ? at the top of the pile, "if anything's strange say @me in #trilema, please preface the saying with and-here's-my-grep-v" ☝︎
ave1: but also adacore docs i see: http://sandbox.mc.edu/~bennet/ada/gnat_ug/gnat_ug_4.html#SEC46
asciilifeform: ^ for reasons unknown to me, ada's standard character i/o routines mutilate newlines. so ffacalc imports the standard unixland ones.
asciilifeform: the 'main is in ada; some imports from c' variant is also illustrated in ffa, in http://btcbase.org/patches/ffa_ch4_ffacalc/tree/ffa/ffacalc/cmdline.ads
a111: Logged on 2018-02-01 21:24 phf: diana_coman: ty, i'll try wiring it in, and keep you posted. i assume ada<>c interop is pretty straightforward, though i won't have a chance to try until later next week. suddenly busy
diana_coman: phf, ada<->C interop was quite straightforward last time I tried it, didn't take much at all; you'll need to add a few exports iirc
phf: diana_coman: ty, i'll try wiring it in, and keep you posted. i assume ada<>c interop is pretty straightforward, though i won't have a chance to try until later next week. suddenly busy ☟︎
BingoBoingo: <asciilifeform> what exactly is 'ada apache' ? << Done right prolly something similar to lighttpd without the C
asciilifeform: meanwhile, in entomology, gem , 'Ada is arguably more successful in its domain not because of its ridiculous verbosity, but because it has higher level features, separation of concerns, safety checks, development teams focused on embedded programming, aircraft specialists and programmers working on the compilers, etc. One could still take all of these same Ada experts, brainwash them, and have them (or another team with more sense) i
asciilifeform: fwiw ada's built-in sane threading and non-semaphoric thread-to-thread info passing features make it an inviting idea.
mp_en_viaje: i expect ada's "works" ~same
asciilifeform: what exactly is 'ada apache' ?
a111: Logged on 2018-01-29 17:10 asciilifeform would like to see a complete wwwtron in ada. but does not have any spare arms presently for such a thing.
mp_en_viaje: http://btcbase.org/log/2018-01-29#1778035 << an ada lamp would need you know, the a and the m. it may be possible to write a sqlizer in ada ; but i have my doubts an ada apache is actually possible. ☝︎
asciilifeform would like to see a complete wwwtron in ada. but does not have any spare arms presently for such a thing. ☟︎
mod6: yes. I'm starting to love ada, at least, syntactically. The way you've used it, is very straight forward -- at least once one understands how array access / slices work.
asciilifeform: the other fortunate bit, at least re ffa, is that it is not complicated from the ada pov
mod6: The good news is, I started really digging into ada and your sneak-previews early last year.
mod6: Some of this is my fault, I've been trying to keep up here. Getting kinda swampped with a bunch of things at once. But! These are all good things. FFA, eucrypt, ada, vtron stuff, et. al.
mircea_popescu: diana_coman i would right now like to, for a great piece i'm writing, link to "The choice of Ada as programming language for this implementation" specifically out of all http://www.dianacoman.com/2018/01/25/eucrypt-chapter-7-keccak-sponge/ because that's the sort of fine tuned context linkage i use. wut do ?
asciilifeform: mircea_popescu: not in ada planet.
diana_coman: this is why I said earlier "check endianism at runtime" because yes, in ada you can get that
asciilifeform: ( tldr : ada tells you the endianism of the box you're on )
caaddr: the hovercars will be programmed in ada
asciilifeform: mircea_popescu: i question the wisdom of keeping the gcc-ada bullshit on life support.
asciilifeform: gnat has a deliberately brittle behaviour re the restriction pragmas -- if you use one it doesn't know about, it barfs. ( and i'm not even convinced that this is wrong. half of the appeal of ada is that it takes 'postel's law', rips off its head, and fucks the stump ) ☟︎
caaddr: instead we have... what do we have? we have the blockchain but we're still using dns. we have common lisp but we're still using scheme, or, worse, clojure. we have ada but we're using rust. "we" being "we the people", as in the redditoid masses
caaddr: I wonder how early in such a stack you would add the kind of compile time protections that ada guarantees. compile time protections seem to be the hardest thing to keep a programming language at "fits in head" size
caaddr: it would be nice to bootstrap an entire operating system from machine code to forth to some strange mix of forth and ada, ada, then tinyscheme, and finally a sane common lisp subset
asciilifeform: caaddr: and gcc-ada had reproducible build ?! where?
asciilifeform: it exists strictly so that people cannot easily build just about any nontrivial ada proggy.
spyked: thanks shinohai. :D the plan is to (at the very least) periodically share items of republican interest that I'm working on (e.g. ada lisp). progress has been very slow so far, but it's picking up
asciilifeform: upstack re the impossibility of translating the safety of an ada program's nearby-modifications-phasespace to c -- i suspect that mircea_popescu's thesis re 'files are not separate units' not only is troo, but does not go far enuff :
mircea_popescu: and yet a bundle of c that produces exact same binary as your ada compiler does -- could be written
mircea_popescu: and, back to the trunk, we've not even discussed the horror of translation. suppose you write a thing, in ada. suppose another, who works on a lisp tree, takes your thing and identically translates it to lisp (here defined, that on any correct machine his code will in all cases behave indentically to yours). what's your v to do here ?
mircea_popescu: why not actually do it then, and first construct an ada circular ring lisp-memory stack first ?
asciilifeform: ada working in normal mode typically won't even let you take a pointer of an object on the stack.
asciilifeform: ( the ada passing by reference semantics give you almost anything that c programmers typically want from pointerism )
asciilifeform: ( spoiler : you can trivially implement linked list without -- properly speaking -- pointers, but with integers, this also came up in the earlier 'lisp in ada' thread )
asciilifeform: nao that i think about it, it doesn't even have to introduce 'access types' ( pointers in ada ) , can use ordinary integers
asciilifeform: apeloyee: here's another idea from my notes , that would do the job : to dispense with the array representation for the stack, in favour of linked list. ada permits the definition of a 'not null' pointer type (whose non-nullity is checked on every reference) .
a111: Logged on 2018-01-07 04:53 esthlos: issue resolved by moving to 2016 ada
a111: Logged on 2018-01-09 17:59 mircea_popescu: hows teh ada musling coming along ?
mircea_popescu: hows teh ada musling coming along ? ☟︎
asciilifeform: without an ada compiler at all.
asciilifeform: figure applies to errything. i.e. for any given nontrivial ada proggy, the cost of the checks is about 2x.
BingoBoingo: Major projects in this channel include hardware TRNGs, OS replacement utilities written in ADA, and other peer to peer and noone else communications tools
PeterL: http://btcbase.org/log/2018-01-06#1766126 << so I was like "how hard could this be?" and I am trying to wrap my head around what this comes from, so I open up the gpg source code, and bleh, code is sooo much easier to read when it is written in ada by asciilifeform! ☝︎
esthlos: issue resolved by moving to 2016 ada ☟︎
esthlos: https://wiki.gentoo.org/wiki/Project:Ada
esthlos: asciilifeform: ada woes, am I missing a library? http://wotpaste.cascadianhacker.com/pastes/ndFJX/?raw=true
asciilifeform: this is not actually possible in a general way, it'd have to ~understand~ cpp, ada, cl, whatevers
mircea_popescu: that's mp-plaintext, almost exactly your ada
asciilifeform: that being said, gprbuild ( what ffa uses instead of gnumake ) seems to make very effective use of a kind of interpreted subset of ada
asciilifeform: phf: i force-format my ada. this only affects indents tho
asciilifeform: and i find it especially infuriating when they slither into islands of sanity like ada
mircea_popescu: http://btcbase.org/log/2018-01-04#1763745 << /me dutifully follows, and duly falls upon "2) What was not implemented until recently was functions returning unconstrained arrays. This is a very tricky thing to do, as I'll describe in a moment. The week before Tri-Ada, I added a temporary, kludgy implementation to GNAT. About the only thing it had to say for itself is that it worked, but it creates serious memory leaks. It ☝︎
danielpbarron: i guess he's gonna learn himself some ada, or lisp if anyone wants. feel free to instruct him
danielpbarron: he was asking for a job so i asked if he had tits, he didn't, so i said do you know lisp or ada
danielpbarron: there's a bunch of ongoing projects in here, and ADA is a prefered language
danielpbarron: !!rate jpxe 1 aspiring ADA coder i found in the l0de chan
asciilifeform: ( same as -- in ada )
asciilifeform: ( nor does ada )
asciilifeform: imho it needs the ada schemetron.
a111: Logged on 2017-12-27 02:01 asciilifeform: picture a kind of 'multiverse ada', where you dun call foo(bar), but instead foo:somepatchid(bar:somepatchid) etc, explicitly conforming to 'multiversism'...
phf: knuth managed to do a lot to keep tex what it is, given that he's essentially a pacifist academic. there aren't many other examples (common lisp, ada) where preservation has been taken to this extreme.
asciilifeform: picture a kind of 'multiverse ada', where you dun call foo(bar), but instead foo:somepatchid(bar:somepatchid) etc, explicitly conforming to 'multiversism'... ☟︎
shinohai: Logged 13:19 +l0de yes, I'm a gyp >>> dasracist.ada
asciilifeform: it loses to ada in re: clarity and bound-guarantees
asciilifeform: ^ used in place of , rather than in addition to, Ada.Command_Line
mircea_popescu: http://btcbase.org/log/2017-12-20#1755188 << ada has rotted your mind!!11 ☝︎
a111: Logged on 2017-12-11 20:01 diana_coman: asciilifeform, fwiw I read it as in went through it line by line and with pencil and paper; ran it too at the end, played a bit around with tests and that; and since we are at this, nitpick: in FZ_Swap why T:=X if already initialised at declaration or what am I missing of Ada in there?
mircea_popescu: esthlos ada. see ffa for a basis
asciilifeform: ( ada params are a moar complicated matter than ffa might suggest: when reading heathen proggies you will encounter such things as 'aliased' i.e. pointerola , and related items. )
asciilifeform: and, naturally, the standard, http://www.ada-auth.org/standards/12rat/html/Rat12-4-2.html
asciilifeform: ( these are different animals in ada planet )