seninha has quit [Remote host closed the connection]
<aw->
pablo_escoberg71: hi, it seems you're going to end up doing exactly what i'm doing in my sqlite library
<aw->
you need to skip the idea of trying to "pipe" commands to sqlite3
<aw->
sqlite3 accepts commands as arguments
<aw->
sorry, it accepts *queries* as arguments
<aw->
so you'll need to use (call) our (out) or (in)
<aw->
in my case, i use (in (list 'sqlite3 ...) to simultaneously call the command WITH arguments (i.e: the query) and read the output using (until (eof) ...) or whatever
<aw->
in all my time coding in PicoLisp, i've _always_ struggled trying to "pipe" stuff as you're doing, because it's not like running a bash script or shell commands.. until you accept the LISP way of doing things, you'll constantly struggle
<pablo_escoberg71>
OK, you make an excellent point, aw. And I will use it to further my argument with my client to expose their DB via API rather than making me work with it directly. I think this will be the straw that breaks the camel's back. So THANK YOU! And provisionally, THANK YOU AGAIN! For now, I'm abandoning this code base in the (very reasonable) hope
<pablo_escoberg71>
that I will instead end up having somebody (possibly me but I really hope not) write a simple API wrapper for the thing in Ruby.
<aw->
seems quite drastic
<aw->
you're implying that picolisp can't solve your problem even though we've spent 2 weeks giving your solutions
<aw->
i even published a tiny drop-in lib from a previously closed source project, which interfaces very well with sqlite
<pablo_escoberg71>
I really don't mean to imply any such thing.
<aw->
unfortunately it doesn't scale to 1,000,000 users so i guess your ruby wrapper will be better
<pablo_escoberg71>
In fact, I'm sure I could solve this with enough work. But I really shouldn't have to, given that it would take a fraction of the work to just expose the DB via an API.]
<pablo_escoberg71>
This is 2023, FFS!
<pablo_escoberg71>
Still absolutely LOVING picolisp and hoping to expose some blockchain primitives to it (cue the wailing and gnashing of teeth)
<pablo_escoberg71>
but regardless of the language/ecosystem, the folks responsible for a DB should not expect anybody outside to access it directly. It's just wrong. Full stop.
<pablo_escoberg71>
And this little debacle proves it beyond any doubt.
<pablo_escoberg71>
(ok, not really a debacle; the only failed experiments are ones you don't learn from, but still...)
<pablo_escoberg71>
(and, BTW, whereas this may not work out for sqlite or any other DB, I imagine there are plenty of programs that can be usefully controlled this way)
<abu[m]>
Hehe. On 2023-06-27 I said: "We had many people here being carried away with enthusiasm about fantastic ideas, who quickly disappeared and never showed up again"
<abu[m]>
I should have added: "Without listening to what we told them"
<pablo_escoberg71>
Well, I do listen. It may take a while to penetrate, but I really do listen :D
<pablo_escoberg71>
And unless I'm unwelcome, I have no plans to disappear...
<abu[m]>
Of course you are welcome!
<pablo_escoberg71>
TY. Just making sure. Some communities are really hostile to blockchain stuff...
<abu[m]>
Speaking for me, I'm not hostile to blockchains, though I think that except for cryptocurrencies they are overhyped
<pablo_escoberg71>
agreed.
<pablo_escoberg71>
but "currency" is taking on new meanings as a consequence.
<pablo_escoberg71>
And as long as there is no hostility, there are no issues :D
abu[7] has joined #picolisp
msavoritias has joined #picolisp
rob_w has joined #picolisp
pablo_escoberg71 has quit [Quit: Ping timeout (120 seconds)]
pablo_escoberg has joined #picolisp
pablo_escoberg has quit [Ping timeout: 246 seconds]
<abu[7]>
I (re)learned from the recent discussion: We must make clear that PicoLisp makes ONLY sense if one first FULLY understands three fundamental concepts: Symbols, Read and Eval. How they interact with - and depend on - each other.
<abu[m]>
And this is too often not the case here
stux has quit [Server closed connection]
stux has joined #picolisp
seninha has joined #picolisp
<tankf33der>
In another two words - memory model.
<tankf33der>
Imho
<abu[7]>
Not only memory
<abu[7]>
It is how the reader works (read-macros, namespaces etc.) and what evaluation really means (quote, fexprs etc.)
<abu[7]>
What is evaluated when?
m_mans has joined #picolisp
<abu[7]>
In PicoLisp, the reader is what is the compiler in other langs, and 'eval' determines what happens when
<abu[7]>
How symbols are bound in which environment
<abu[7]>
So it is these three concepts, symbols, read and eval, which make up the language
<abu[7]>
The rest like numbers, lists, I/O etc is secondary, and usually easily understood
<abu[7]>
Without really understanding these fundamentals, people do funny things like putting quotes and read-macros in the wrong places
<tankf33der>
T
m_mans has quit [Read error: Connection reset by peer]
m_mans has joined #picolisp
rob_w has quit [Remote host closed the connection]
m_mans has quit [Remote host closed the connection]
pablo_escoberg has joined #picolisp
<pablo_escoberg>
Agreed. What drew me to picolisp was the simplicity of the VM. I have vague ambitions about maybe turning it into a smart contract language because gas could be charged per cell, making that whole nightmare a lot easier. But once I got going, I got way ahead of myself. The picolisp reference page and tutorial bear reading repeatedly. The
<pablo_escoberg>
do a good job of making clear how things work. But I guess they don't make clear just how critical it is to internalize these concepts. As I continue to internalize this stuff, I'll try to come up with examples that uniquely demonstrate some of picolisps unique powers/gotchas (yes, they are very frequently the same thing, especially here). I
<pablo_escoberg>
will, of course, discuss here and post on the wiki.
<abu[7]>
Great!
<abu[7]>
And I think I need to focus more on explaining the above three concepts and their interactions
<abu[7]>
They are more critical than I was aware of
<abu[7]>
To me they looked natural
pablo_escoberg has quit [Quit: Client closed]
pablo_escoberg has joined #picolisp
<pablo_escoberg>
Of course they look natural to you! You created/selected them and have been working with them for decades. To someone coming in fresh, with experience in radically different languages, it can be very confusing.
<abu[7]>
T
<pablo_escoberg>
Here's something interesting I'm having a hard time wrapping my head around: There are probably a dozen different builtins that take code with an optional count, run it, and return the result. eval, up, run, prog (and ilk). I get the feeling it's mostly about execution/read contexts and there seem to be some methods (env, trail, etc) to work
<pablo_escoberg>
with the contexts themselves. The details, however, escape me.
<abu[7]>
This is right, for eval and run
<abu[7]>
and in a related meaning 'up'
<abu[7]>
moment
<abu[7]>
'prog' not
<abu[7]>
The count is usually not critical, it specifies an env offset, and is relevant only for '@'
<abu[7]>
I suggest you forget that for the moment
<pablo_escoberg>
ah, ok. One less thing to worry about :)
<pablo_escoberg>
but what is the point of having all these different methods? why prog prog1 prog2 eval run up? I get the need to have an eval, but why these others? Not sure, but I suspect there is something critical here that I'm missing.
<pablo_escoberg>
I sort of feel like if I get why all these are necessary and how they differ, I will be somehow enlightened :)
<abu[7]>
The three prog's are needed in a context where only a single expression is allowed, e.g. the true-clause in an 'if'
<abu[7]>
'eval' evals an 'exe', and 'run' runs a 'prg'
<abu[7]>
See the explainations at the beginning of the function list in @doc/ref.html
<pablo_escoberg>
YES! OK, I'm pretty sure that's where the answer lies. I need to look at it a few more times and see if I get it.
<abu[7]>
These terms, like var, any, exe, prg, fun etc
<abu[7]>
Important to understand the refs
<pablo_escoberg>
right. Now I'm confused about the difference between an executable expression and a list thereof. I thought lists and executable expressions were essentially interchangeable.
<pablo_escoberg>
here exe and prog seem to me like they should be the same thing...
<abu[7]>
Not at all. A prg is a list of exe's
<pablo_escoberg>
But isn't an exe also a list of exe's?
<abu[7]>
If an exe is expected and you pass a prg, it surely crashes
<pablo_escoberg>
oh, I see
<abu[7]>
It takes the CAR of the prg as a function
<abu[7]>
((foo bar) (bla blub))
<abu[7]>
It evaluates (foo bar) and calls the result as a function
<abu[7]>
Maybe it is desired
<pablo_escoberg>
so passing that to eval will crash it?
<pablo_escoberg>
oh, wait, I think I kind of get it. The CAR is either a param list or a function.
<abu[7]>
It all depends
<abu[7]>
(+ 3 4) the car + is a function
<abu[7]>
Same is ((intern "+") 3 4)
<pablo_escoberg>
right
<abu[7]>
((intern "+") 3 4) is an exe still
<abu[7]>
((print 1) (intern "+") (print 4)) is a prg
<abu[7]>
It all depends on the context how it is used
<abu[7]>
and how it is interpreted
<pablo_escoberg>
right.
<pablo_escoberg>
but which one of these is used determines how it's interpreted.
<abu[7]>
yes, *how* it is used
<abu[7]>
(eval Exe) or (run Prg)
<pablo_escoberg>
ok, lots more reading and playing around to do. Thanks for the insight. I think that's enough for me to get it.
<abu[7]>
'if' for example takes two exe's and one prg
<abu[7]>
ok
<pablo_escoberg>
hang on, please finish that thought.
m_mans has quit [Remote host closed the connection]
<abu[7]>
msavoritias has quit [Remote host closed the connection]
<pablo_escoberg>
OK, so I figured that out finally. Tried to figure out a way to explain it to somebody just coming in, but really the only change I would recommend to the documentation is placing a strong emphasis on the difference between exe and prg. It's a pretty big foot gun for newbies and I've shot myself with it repeatedly.
<pablo_escoberg>
As my foot heals, I have another question: Is there any kind of http client available, or do you need to use (connect (print (read)) or something like that?