176900+ entries in 0.112s

phf: generally "things
that might have different size" is not a
trivial
thing
to pack. (that's why
there's complexity in ASN.1, because of variable run length encodings)
phf: it was an example of what "byte packing protocol" is. designing proper byte packing protocol is left as an exercise
to
the reader
phf: depends on
the protocol
phf: like i said elsewhere, sexp is not a data exchange format, it's a way of writing common lisp code. various extensions are
there
to facilitate
the process of programming. it's a folly
to look at sexp and go "oh, so simple! lets just store our data in it! lets rpc with it
too!" because
that's not really what it's designed for
mircea_popescu: "o look, it also has #. in it, gotta load #.parser on
top of + parser now".
mircea_popescu: ah i
thought you were just loading a parser spuriously.
phf: well,
the intent was
to make
this
thing evaluate before
the data structure is fully read.
phf: well, i put it
there ~intentionally~
mircea_popescu: asciilifeform different sort of problem,
that's for data entry
this is for proper outputs.
phf: did you intentionally put #. or it just happened
to be
there? i
think
that you're looking at
that sexp and you recognize its form, but #. is just some fluff?
mircea_popescu: for
the curious : yes, i also have
this problem in speech, especially when discussing complicated
things with complicated women, and
the solution
THERE is
the sort and short rule. which in relevant part says here
that "(1 #.(+ 1 1) 3)" could NEVER be interpreted as "(+ 1 1)" because "(+ 1 1)" was a shorter statement of
that and it wasn't used.
phf: not with asn.1, because it's a serialization format, not actual RPC. you can certainly do
the call with wire/remote, and no "macros" involved in
the process
mircea_popescu: phf serialization can at best be a packaging.
the issue is, can i say "here's a function
that
takes a parameter and outputs "your mom's a python" and
the data payload is function(is
that you daddy)" in order
to convey
the string "your mom's a python" ?
phf: asn.1 is nothing of
the kind, nor is cmucl's wire. it's your
typically byte packed binary formats
mircea_popescu: if you;'re going
to have adnotated data and
the adnotations are macros and who
the fuck knows what goes on, you've got a miserable protocol.
mircea_popescu: phf
this is like saying "this website prevents xss by using base64".
phf: most lisp rpc is done using serialization/deserialization protocols. personally,
that is also my preferred method, something like asn.1 or
the format cmucl's wire uses
mircea_popescu: but nevermind
the processor for a second.
the discussion here is data interchange.
phf: mircea_popescu: well, sexp ~is~ code, primarily it's for writing your programs, not ~storing~ data.
there's no such
thing as sexp internally
phf: so if you want
to use common lisp's readtable/printer for data interchange, you'd better ~specify~ what your sexp actually is
mircea_popescu: the best and handiest way
to illustrate
this folly is, "imagine if your vlc
tried
to mpfhf every film you played"
mircea_popescu: phf and
the reason for
this is
that it
tries
to
take it as code.
phf: well, i brought up
the whole mutability of readtable, because
that fact usually
trips up novices when dealing with lisp reader. "oh i can just use sexps for everything" and
then you do (format ...) on your largish data structure and you get something
that's rather non-trivial
to parse (an example would be
the WOT.sexp)
mircea_popescu: but i can say you not merely should, but absolutely must.
the cornerstone of wire protocol is a firm, protocol-derived guarantee of
there being no such
thing as bad data.
mircea_popescu: phf i don't know if you can or if you can't, not sufficiently experienced with
the
thing.
phf: can't you say
the same about lisp? you establish your data format (i.e. a READTABLE
that you're going
to use for reading it), at which point modifications
to
that readtable makes for broken machine.
the standard specifies how, e.g. number reader works, so if your readtable uses standard number reader 5 is 5
mircea_popescu: everything sucks where
there can be such a
thing as "this is
the
table of possible inputs and
these are
the
three
that set it on fire".
mircea_popescu: the very possiblity of even having such a
thing as "broken data", by eg naming your kid "-- DROP
table students;" is why i agree with
the sql sucks sentiment.
mircea_popescu: phf but
that is, for
the needs of
this mental model, a broken machine. not broken data.
phf: i mean, any system can be
tweaked into "number five
to have
the capacity
to really be four". pretty much a standard exercise "oh
tweak
this memory location and now all your
TRUEs are FALSE111"
mircea_popescu: and
this is fundamental and won'[t go away nor can it with money and reputations involved.
mircea_popescu: i STILL don't want my number five
to have
the capacity
to really be four.
phf: mircea_popescu: well, in
that case
there's no value
to lisp ~at all~, since
the bulk of lisp advantage comes from
this fact. but pretending
that you somehow can get not-this with a
turing machine results in what we have now
mircea_popescu: in
the end, here's mp's heresy : lisp never caught on for none of
the usually discussed reasons. lisp never caught on because
that core advertised principle is both fucking dumb and fucking useless.
phf: lisp has its own kind of
trisector: a person whose mind is so blown by
the whole code/data
thing
that he's convinced one can build "real AI" using a handful of self modifying macros
mircea_popescu: it's bad enough for my letters abx
to have
the capacity
to really be smileyface or whatever. and i dun like
that, either.
mircea_popescu: yes, but i don't want my number five
to have
the capacity
to really be four.
phf: mircea_popescu:
that whole data/code equivalence is one of
the core (advertised) principles
mircea_popescu: or
the same money it could be excel/emacs (for what is emacs but excel with built in virtual basic ?)
mircea_popescu: phf your excited attempts at playiung with candi's ass, back when she was a virgin, is a plain and very obvious indication of what ~every lisp hacker knows but none dare admit, or
think about. it's a fundamentally dirty language in
that it doesn't, actually, admit
there is even in principle differences between data and code. "oh, it's an array, and here's
the associated macro, so
this .dat file is actually
turing complete". f
phf: there's ISLISP standard, which was supposed
to create a subset of multiple different lisps (like common lisp and scheme, but also eulisp, since designed by europeans). i don't
think anyone (particularly sexp library authors for other languages) ever
tried
to conform
to it.
typical solution is
to have a JSON-like subset of sexps, so
that you can express (FOO "abc" 2), i.e. symbol, string, number and list and nothing else
phf: express
the full range of possible array settings, etc.)
phf: (common lisp sexps are backed by a full blown reader, with multiple non-trivial dispatch macros, so for example '(1 #.(+ 1 1) 3) is a valid sexps
that's read as '(1 2 3), i.e. (+ 1 1) is evaluated at read
time.
there's a dispatch for structs, like #S(FOO :A 1 :B 2) results in a structure foo with
two slots a and b set
to 1 and 2 respectively, but
there's no corresponding constructor for classes.
there's a reader for arrays, but
that one doesn't let you
phf: note
that common lisp's sexps are not an ideal data exchange format
☟︎ mircea_popescu: by
the
time newcomers start asking,
the writ is on
teh bathroom wall.
a111: Logged on 2017-07-08 07:23 sina: mircea_popescu: I am guessing
tmsr is not fond of
things like JSON or YAML
mircea_popescu: if you recall
the data exchange protocol was moving away from csv
towards lispenstrings anyway.
phf: i
thought it would be kind of cool if bots could sling signed lisp strings in privmessages, 0ldsch001 scenetech!
mircea_popescu: and yes,
thius could be done. like,
toiday. and yes
trinque 's irc bot could be expanded
to be a proper connectivity point. and so on.
phf: (all-exposed-functionality) -> ((gossipd:all-message-since "give me all
the gossipd message since a certain
timestamp") ((timestamp fixnum "timestamp (in seconds since epoch) since which messages") ...))
☟︎ mircea_popescu: the problem is again one of synthesis, someone gotta sit down and write
that scary
text. not
the one
to which
there's nothing
to add, but
the one from which
there's nothing left
to remove. "here's how a discovery protocol goes".
mircea_popescu: phf no, i ~know~. he doesn't expect, i don't expect either, but
the difference is im being actively optimistic about it.
phf: mircea_popescu: i
think you could design a pretty straightforward discovery protocol once you decided on
the wire. we can see
this process with irc bots here
mircea_popescu: you want me
to sit here and say "there's fifty different protocols in
this box" ?
phf: in
the WIRE/REMOTE approach you connect
to instance, and do a function call
that
the author
told you about ahead of
time. in one case it might (gossipd:all-message-since
timestamp) in another (ben-vulpes-block-chainer:get-block n)
mircea_popescu: mp's rule of computing design : if you know it's gonna be bad,
take
the
trouble
to make it actually horrible.
mircea_popescu: why not just make a datastruct polymorpher
then, and have
the program just come up with random shit each run
mircea_popescu: and don't
tell me "by-hand optimized datastructs for each app and ad hoc protocols for each connection" if
tyou will
mircea_popescu: asciilifeform you are running a computer. (not crap, an actual
tmsr is happy with machine). when i start mine up, i want
to get some bits from you. maybe it's "what sina said about mp on gossipd". maybe it's "the nth block in
the current blockchain". maybe it's whatever it is. how does it do
this ?
phf: well, right now we don't even have standardized wires (irc and
http come closest in
tmsr infra)
mircea_popescu: the point here being
that what we need is
the convention ; and it'd better be good.
phf: same as you would do it locally. it's a
transparent rpc, not a specified one. so either
the operator does manual discovery, or you define a discovery convention. (and
then
there's middle ground, where you use standard
tooling, like code
to list packages and symbols
to do discovery for you)
mircea_popescu: in a very harsh example : i somehow knew how
to say "like ukr girls" above. i found
this out somehow. how does
the lisp instance find out what
to say so it's meaningful ?
mircea_popescu: phf how does one node discover
the other node's symbolic representation of
the universe ?
phf: cmucl has REMOTE and WIRE packages which let you do rpc between
two instances (naturally it's bit rotted in
the
trunk, and only working version at
this point is on my branch). it's a combination of simple "spin up server/connect
to server", serializer/deserializer and an rpc convention.
mircea_popescu: dun
talk smack about
the pole dancing and stilt wearing crowd until you greco-roman wrestle a coupla.
they're NOT
THAT EASY