<cess11_>
I think Forth and pil will be among the best tools for this coming world.
<Regenaxer>
yep
<cess11_>
Because these morons will actually pump out these little stickers with PIII-like performance and all sorts of weird hardware interfaces, so scripting pil style and driver hacking Forth style will be quite useful.
<aw->
cess11_: thanks for the link
<beneroth>
"The computer will cost less than ten cents to manufacture" wow. impressive
<beneroth>
thx cess11_
<aw->
yeah
<aw->
awesome for pil
<Regenaxer>
indeed
<aw->
totally
<beneroth>
Regenaxer, " It's intended to help track the shipment of goods" sounds like our friends
<Regenaxer>
exactly
<Regenaxer>
supply chain
<cilz>
with regards to privacy, I'm not sure to be happy with that though "Within the next five years, cryptographic anchors [...] will be embedded in everyday objects and devices,"
<Regenaxer>
yes, evil
<cilz>
...
<cilz>
yes it's a big concern
<aw->
isn't a SIM card as powerful as an x86 from the 90s?
<cess11_>
Yeah, it'll be quite horrific but also something we'll need to cope with because such a large being as IBM can't stop itself.
<aw->
faraday cages for all
<cilz>
hélas!
<cilz>
aw-: right
<cess11_>
SIM are tricky and a bit clunky and not as general purpose as these coming products.
<cess11_>
But yes, there's some interesting aspects to putting some NFC in all of them.
<aw->
hmmm there's no details on this IBM thing
<aw->
does it actually have an x86 instruction set?
<Regenaxer>
Let's hope it is arm64 ;)
<aw->
or RISC-V
<aw->
this article is so bad, it lacks any details
<beneroth>
cess11_, privacy will become more and more a luxury for rich guys only (so no benefits of transparency, first some ages of darkness and surveillance I would say).
<cess11_>
I think it is something not x86 but comparable. They haven't told much yet and all they say is that they have prototypes.
<cess11_>
beneroth: Yeah, and hackers that mess up their own identities in weird ways to avoid profiling and whatnot.
<beneroth>
just wait until everyone and their dog analyses every DNA trace someone leaves behind.
<cess11_>
Yep.
<aw->
beneroth: agree
<aw->
cess11_: like in Minority Report
<beneroth>
aye
<cess11_>
But these things will come. It will be seen as necessary by logistics companies that manage the big ports.
<beneroth>
and who doesn't want personalized ad posters in the street instead of boring ads? eh?
<cess11_>
Those who understand them.
<cess11_>
It will be interesting to see how the big companies will react to ransomware type attacks that undermine or destroy their blockchain thingies further down the line.
<aw->
beneroth: then I can finally have a valid reason to start marketing my adblocker eyewear invention
<beneroth>
cess11_, well already happened, see the NotPetya attack.
<beneroth>
aw-, blinkers?
<cess11_>
Yeah, but we aren't reliant on such techniques being wielded by companies yet, which we most likely will be unless the next financial crash halts this.
<beneroth>
T
<aw->
beneroth: haha
<cess11_>
And I'm not so sure we'll see such crashes like the Depression, Recession, Flash Crash and so on again, because it might be possible to channel those disturbances through military spending and destruction.
<beneroth>
I also think that the widespread destruction attacks by hackers was largely only test runs yet.
<cess11_>
Yep.
<beneroth>
the IBM thingy: power: photo-voltaic cell. wow.
<cess11_>
Yeah. And then they will make them water resistant and able to take power from liquids as well, so we'll fill the oceans with networking little computers attached to garbage.
<beneroth>
lets see where this project is in 10 years. and if we start to copy it.
<cess11_>
We already have. Just not in the police but in the secret services and banks and insurance companies.
<cess11_>
They try it out on its muslim and black minority communities, insurance companies and firms like PwC pick out the raisins and apply them where the law allows.
<cess11_>
*their
<beneroth>
I would say the error is that the law allows it. the law is the angle to improve this. companies are like AIs, working towards their central optimization function (usually: making money) within the possibilities the system/game allows.
<beneroth>
the introduction of computer AI will only accelerate this, not change it somehow.
<beneroth>
but if "=" is missing in the string, you end up with '("dest" . "dest"))
<beneroth>
or '(NIL)
<cess11_>
If I understand the problem something like 'car to grab the key from the '(mapcar pack generated list and then either 'for or more mapping on the 'cdr would work?
<aw->
too complicated
<aw->
i simplified
<aw->
no need for all this
alexshendi has quit [Read error: Connection reset by peer]
<beneroth>
good :)
<beneroth>
simpler is better
libertas has quit [Ping timeout: 240 seconds]
libertas has joined #picolisp
libertas has quit [Ping timeout: 256 seconds]
<Regenaxer>
ret
orivej has joined #picolisp
<m_mans>
Hi all!
<Regenaxer>
How about (and (mapcar pack (split (chop "dest=loc") "=")) (cons (car @) (last @] ?
<Regenaxer>
Hi m_mans!
libertas has joined #picolisp
<aw->
Regenaxer: is there a way to prevent pil from converting \n to ^J ?
<Regenaxer>
The behavior of the reader is hard coded
<Regenaxer>
I thought you parse it yourself?
<Regenaxer>
character-wise?
<aw->
wjat
<aw->
wait..
<Regenaxer>
Only 'read' (and 'str') handle such escapes
<aw->
damnit
<aw->
i knew something was off
<Regenaxer>
:)
<Regenaxer>
$ cat a
<Regenaxer>
a\nb
<Regenaxer>
$ pil +
<Regenaxer>
: (in "a" (line))
<Regenaxer>
-> ("a" "\\" "n" "b")
<aw->
why only 'read' and 'str' ?
<Regenaxer>
Lisp s-expression syntax parsing
<Regenaxer>
string syntax here
<Regenaxer>
(char) (line) etc. don't
<aw->
why does 'str' do it?
<Regenaxer>
it can "read" from a string
<Regenaxer>
same machinery as 'read' internally
<Regenaxer>
comments etc
<Regenaxer>
'str' always reads list though
<aw->
:(
<Regenaxer>
It is used by eg. $ pil -'foo bar'
<aw->
where can I find the list of other characters such as ^J ?
<aw->
and ^T etc
<Regenaxer>
: (str "a b # c")
<Regenaxer>
-> (a b)
<Regenaxer>
There is no such list
<Regenaxer>
^ denotes a CTRL character
<Regenaxer>
in (read)
<Regenaxer>
in strings only
<Regenaxer>
for internal symbols ^ is not special
<aw->
the list of ctrl characters which start with ^
<aw->
there's a list
<aw->
there must be
<Regenaxer>
no
<Regenaxer>
it is simply 64 substracted
<aw->
so how does it know that \n is ^J ?
<Regenaxer>
ASCII 1 ... 32
<Regenaxer>
ah backslash
<Regenaxer>
there are only a few
<Regenaxer>
\n \r and \t I think
<aw->
and \0 ?
<Regenaxer>
See testEscA_AF in @src64/io.l
<Regenaxer>
It is newline, return, tab and decimal
<aw->
ah ok
<aw->
ok thanks! i think another bug in my JSON lib :( .. it shouldn't convert \n to ^J .. it should be \\n
<Regenaxer>
\n to ^J seems good to me (?)
<aw->
it works fine for converting JSON -> Pil.. but it can't go back from Pil <- JSON
<aw->
Pil -> JSON ^J should become \n, not a literal newline haha
<Regenaxer>
I see, JSon does not take ^J
<aw->
it does but when you (prinl "^J") it makes a newline
<Regenaxer>
but it is a newline, you could just keep it
<Regenaxer>
yes
<aw->
no, nobody knows what ^J is
<aw->
it should go back to \n
<Regenaxer>
gives a line break
<Regenaxer>
so you convert a 3-liner to "abc\ndef\nghi\n" ?
<Regenaxer>
I would keep the lines as they are
<aw->
i'm not sure yet..
<aw->
i need to run some tests
<Regenaxer>
Depends on the use case perhaps
<aw->
you can't keep the lines.. JSON doesn't handle newlines
<Regenaxer>
BTW, the \ syntax is in doc/ref.html#transient-io
<Regenaxer>
The combination of a backslash followed by 'n', 'r' or 't' ...
<Regenaxer>
There cannot be a newline in a JSon string?
<aw->
it's invalid according to the spec
<aw->
only space is allowed
<Regenaxer>
I see
<aw->
ok thanks, i'll look at the doc and adjust my code
<Regenaxer>
For what purpose do you use JSon?
<aw->
everything
<Regenaxer>
Have you looked at 'jq'? I used it for some JSON operations
<aw->
i have a bunch of stuff written in various programming languages, it's the only stable/universal format that I can trust to be interpreted correctly
<aw->
yes i've used jq on some systems.. it's just a command-line program for JSON
<Regenaxer>
right
<aw->
i don't want to shell out to that each time i process JSON in picolisp
<Regenaxer>
It makes life easier by filtering JSon
<Regenaxer>
ok, right
<aw->
ideally everything everywhere would be in PicoLisp, then we wouldn't need JSON ;)
<aw->
also I stay away from YAML, it's an abomination
<Regenaxer>
You don't have control over the other systems? Cause then I would use PLIOT on all instead
<Regenaxer>
PLIO
<aw->
no i don't
<Regenaxer>
ok
<aw->
some windows, some not even interpreted by me
<aw->
yes PLIO is nice
<Regenaxer>
PLIO is the easiest too
<Regenaxer>
There is Java, C and JS
<Regenaxer>
(JS only reading iirc)
<cess11_>
Sometimes what one wants in the JSON is easier to pick out with expressions like '(match '(@Key ":" @Value) ... or something similar rather than generic JSON parsing.
<cess11_>
Not sure if this could apply but I commonly do this and then build objects from the interesting parts.
<cess11_>
The other way is fairly straightforward, though I haven't had any newline troubles yet.
<Regenaxer>
yes, I also prefer just to pick out things instead of full parsing
<Regenaxer>
but then with 'from' and 'till'
<Regenaxer>
is also the fastest by far
<cess11_>
Yeah, on occasion I want to keep a subroutine and rewrite it to 'from, 'till structures instead of 'match, which I use for flexibility at the REPL.
<cess11_>
s/structures/expressions
<Regenaxer>
eg pick the bitcoin rate from a JSON site:
<Regenaxer>
(in '("@bin/ssl" "blockchain.info" 443 "de/ticker")
<Regenaxer>
He meant the possible escapes with '\' in pil reader
<beneroth>
ah, ok. I understood him looking for the definitions of ^J ^T ^etc
<beneroth>
which is basically just a hax-like mapping of the binary ascii value, as you said :)
<Regenaxer>
yep
shpx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shpx has joined #picolisp
mtsd has quit [Quit: Leaving]
<aw->
thanks beneroth, as Regenaxer said i was looking for the ones in the pil reader
<aw->
it's fixed now, I'll push a new version of json lib shortly
shpx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alexshendi has joined #picolisp
<beneroth>
aw-, cool. I'm using your lib, so we will upgrade :)
<aw->
Regenaxer: i decided to keep ^J ^M ^I once converted to pil
<aw->
and instead, i just convert them back to \n \r \t when generating JSON
<aw->
this way it works as expected in both places
<Regenaxer>
great
<aw->
so ^J -> \n, and \n -> ^J
<Regenaxer>
With ^J you mean the character "^J" in pil?
<Regenaxer>
ie (char 10) ?
<aw->
yes
<aw->
yes exactly
<Regenaxer>
ok
<Regenaxer>
For pil it is the natural (or only) representation
<Regenaxer>
\n is only a read-macro kind of
<Regenaxer>
What really exists is only the unicode char 10
<Regenaxer>
And in pil it is always in the name of a symbol
<aw->
yes i use the unicode chars in other places
<Regenaxer>
It is *all* unicode
<Regenaxer>
(char 65) = "A" is also unicode
<Regenaxer>
In this range (till 127) unicode and ascii are the same though
<beneroth>
it's about '("^J") vs (char 10) vs '("\" "n")
<beneroth>
so JSON standard is bascially saying that (char 10) should be encoded as the two characters "\" "n" within JSON (because (char 10) in JSON is reserved and/or illegal), aw- ?
<Regenaxer>
What I want to say is that \n or ^J or (char 10) are always a byte with the value decimal 10 in a symbol's name. The rest is only representation for I/O
<Regenaxer>
"\10\" is also legal in pil
<Regenaxer>
'print' always outputs "^J" in pil
<Regenaxer>
only 'read' is so variable
<Regenaxer>
(all for the records, you all probably know ;)
<aw->
ok
<aw->
beneroth: no it's not
<aw->
it's about \n vs ^J
<Regenaxer>
in JSON only \n is legal as far as I understood
<Regenaxer>
In pil itself there is no such thing, only a byte 10
<aw->
only \n?
<aw->
no
<aw->
i dont know what you guys are talking about
<aw->
i'm very confused
<Regenaxer>
You said ^J is not understood by JSon
<aw->
i never said that
<Regenaxer>
only \n
<Regenaxer>
oh
<aw->
JSON is not a language
<Regenaxer>
So it accepts ^J too?
<aw->
i don't know how that sstatement makes sense
<Regenaxer>
It is a syntax
<aw->
of course it does
<aw->
it doesn't accept literal new lines within a string
<aw->
that's all
<beneroth>
why not?
<beneroth>
so it doesn't accept (char 10) within a string
<beneroth>
right?
<aw->
ex: {"test":
<aw->
"res"} == invalid JSON
<aw->
a new line here
<beneroth>
so in JSON, "^J" and "\n" is not exactly the same thing as (char 10), while in pil it (usually) is the exact same thing
<Regenaxer>
I don't believe Json accepts two characters ^ and J to mean "newline character"
<aw->
err sorry
<aw->
that's allowed
<Regenaxer>
^J is only pil
<aw->
ex: {"test": "str
<aw->
str"} == invalid JSON
<aw->
a new line here
<aw->
JSON is NOT a language
<aw->
i don';t know why you keep saying that
<Regenaxer>
right, but it is a syntax
<Regenaxer>
" delimits strings
<Regenaxer>
etc
<Regenaxer>
" is not part of the string data, it is syntax
<aw->
you can very well have a JSON string like: {"test":"^J"}
<aw->
that's fine
<aw->
nowhere does it say you can't do it
<Regenaxer>
I think you confuse it
<aw->
and you can even have {"test":"\"^J\""}
<aw->
but you CAN NOT have: {"test":"st
<aw->
rrr"}
<Regenaxer>
I think you mean "^J" when sent from pil
<Regenaxer>
which is *not* two characters ^ and J
<aw->
i mean the actual ^J, not a newline
<aw->
please stop
<aw->
we're arguing about nothing
<aw->
it's fine
<aw->
it works
<aw->
this is a pointless discussion
alexshendi has quit [Read error: Connection reset by peer]
<Regenaxer>
hmm, not very convincing
<Regenaxer>
Where did you find that ^J is newline in JSon?
<aw->
just read the SPEC
<aw->
don't ask me
<aw->
IT'S NOT
<aw->
for the 10th time i keep telling you it's not
<Regenaxer>
15:14 <aw-> you can very well have a JSON string like: {"test":"^J"}
<aw->
yes, the characters ^ and J placed next to each other
<aw->
is 100% allowed
<aw->
i keep telling you, a NEWLINE is not allowed
<aw->
newline
<aw->
in the string
<Regenaxer>
But this is a string with 2 chars, not a newline in JSon
<aw->
not the characters ^J, but an )___actuall___( newline
<aw->
yes, right
<Regenaxer>
So {"test":"\n"} is not allowed?
<aw->
yes it is
<aw->
it's in the spec
<aw->
the string can have \b \f \n
<Regenaxer>
and {"test":"^J"} too? Meaning newline?
<aw->
and \r \t and \uNNNN
<Regenaxer>
right
<aw->
NO, you can NOT put a control character in a JSON string
<Regenaxer>
but "^J" does not mean newline in JSon
<beneroth>
so everyone who stores a bitcoin wallet on its computer is probably a child abuser (and probably even distributor of child porn?) in most jurisdictions
<beneroth>
s/its/their
<beneroth>
correction: I'm not sure if a wallet does necessarily contain the chunks of the blockchain which could be interpreted as child porn.
dtornabene has quit [Remote host closed the connection]