ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
Dragon-Warrior has joined #picolisp
Dragon-Warrior has quit [Read error: Connection reset by peer]
Dragon-Warrior has joined #picolisp
Dragon-Warrior has quit [Quit: ERC (IRC client for Emacs 26.1)]
alexshendi has quit [Read error: Connection reset by peer]
aw- has joined #picolisp
ubLIX has quit [Ping timeout: 246 seconds]
aw- has quit [Quit: Leaving.]
aw- has joined #picolisp
rob_w has joined #picolisp
<DKordic> freemint: You said recently that Lisp syntax could be more uniform. I wonder how?
f8l has quit [Read error: Connection reset by peer]
wuehlmaus has left #picolisp ["Aus, die Maus"]
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
<freemint> DKordic, i really dislike the read macros in PicoLisp, i think those (including comments) should be in s-expr too
<DKordic> freemint: I absolutely agree!
<freemint> that would mean that the reader would need a complete redesign, and experimented with how to implement it.
<freemint> I am not yet sure how to handle macros encountered during evaluation but my macros have one interesting property that allow them to bend the syntax more.
<freemint> DKordic, here is a challange: that inspired my design, can you write a function that has the same function as ~ and if not what information would you need to build a ~ macro
<Nistur> mornin'
<Regenaxer> How should such a read macro look like?
<Regenaxer> Hi Nistur
<Nistur> hello :)
<Regenaxer> They should be as short as possible (non-disturbing)
<Regenaxer> So they are single-char
<tankf33der> can somebody pump this item if have account.
<tankf33der> thanks.
<DKordic> IMHO "read" is yet another lib. I am looking to refactor it. Read Macros would be another lib based on straightforward "read" that execute Read Macros, like "unquote". IMHO Incremental "read" is _required_ by EMACS!
<Regenaxer> How is that lit then *read* into the system? :D
<Regenaxer> s/lit/lib/
<Regenaxer> tankf33der, this page is empty in w3m (?)
<freemint> Here is my solution, when m is our macro for ~ (9 (m 8 7)) should be (9 8 7) that means the evaluation of the macro has to replace/modify the cell that pointed to the list containing marco now evaluated.
<tankf33der> Regenaxer: yea, seems so
<Regenaxer> freemint, no idea what you are talking about
<Regenaxer> *read* macro runs *before* any cell is cons'ed
<freemint> Regenaxer, i was still talking to DKordic about what would be needed to be done to replace the picolisp read macros with macros that completely fit themselvess in to S-EXPR
<Regenaxer> No idea what you mean though
<beneroth> you can easily build your own "macros" with FEXPR and (curry) .. but read-macros are evaluated during reading, so they need to be built into the VM
<freemint> beneroth, but i can not built a replacement for ~ that way
<Regenaxer> Perhaps you mean something like the Forth "immediate" bit
<beneroth> freemint, you can with ~
<beneroth> eh
<Regenaxer> I thought about it, but found it not good
<beneroth> freemint, `backtick
<freemint> ` is not S-EXR either
<Regenaxer> yeah, and an immediate flag lets you omit the `
<Regenaxer> cause it knows it by itself
<Regenaxer> But this is a major break with philosopy
<Regenaxer> So I discarded the idea, and we must write ` before it
<freemint> You can not built a function f in Picolisp such that: (1 ( f 2 3 )) is ( 1 2 3 )
<beneroth> I sometimes think the possibility to add custom read-macros to the reader would be nice - BUT it probably would in consequence just end with the lisp curse... splitting into more dialects, losing picolisp as a language
<Regenaxer> freemint, yes, thats what I'm talking
<DKordic> freemint: Clearly it would not be a function.
<Regenaxer> 'f' would have an "immediate" bit
<Regenaxer> See in Forth what that means
<Regenaxer> It means that an immediate word in Forth is executed immediately
<Regenaxer> during read so to say
<freemint> If you want to built a "freemint-macro" that does that, the freemint-macro would have to know and modify the cell that points to (f 2 3). Namely (cdr ( 1 (f 2 3))
<Regenaxer> So it is Forth's way of read macros
<Regenaxer> But it limits
<Regenaxer> An immediate word is *always* immediate
<Regenaxer> I think current way is best (1 2 `(* MY_CONST 16) 9)
<Regenaxer> Would you want '*' be immediate?
<Regenaxer> No
<Regenaxer> So you must write an immediate function for every read macro
<Regenaxer> ` is much better. General and flexible
<Regenaxer> and just a single, non-disturbing character
<freemint> You could easily built ` in my model
<Regenaxer> I don't want. You do it
<freemint> this would require mayor changes to eval and make code more "syntax-general" at the cost of making PicoLisp more complicated internally and as beneroth noted "being more syntax general is not a good thing maybe". To summarize PicoLisps syntax is not as uniform as it *could* be but it is as uniform as it *should* be.
<freemint> I did implement it myself and saw how clunky it felt and how inconvinient the freemint-macros were. Good design Regenaxer
<Regenaxer> What is wrong with ` ? It makes things clear, nothing behind the scenes
<Regenaxer> Don't get carried away again with fancy obfuscations
<beneroth> <Regenaxer> Don't get carried away again with fancy obfuscations
<beneroth> T
<beneroth> it's easy to get carried away :)
<beneroth> just look at java *giggles*
<beneroth> or Perl m(
<Regenaxer> Yeah, we see in C++ where that leads to
<freemint> Using ` is the right decision. But DKordic asked me what i ment by "Picolisps syntax is not as uniform as it could be".
<beneroth> hm.. I don't think in C++ it's the "carry away with rules/obfuscations" that is the problem.. more like they wanting to push more features in it, when it is already too broad, and its very hard to find a unused syntax for new featues *g*
<Regenaxer> Perhaps it is not clear (at least to me) how far the term "syntax" goes
<beneroth> I agree with you Regenaxer in spirit of course, slight nitpick :)
<beneroth> T
<freemint> ` is bad when the only thing you are concerned with is making the syntax as *uniform as possible at all cost* since none of us actually want that ` is the right "trade off"
<beneroth> well
<Regenaxer> Perhaps ` is rather semantic than syntax?
<beneroth> can't be more uniform than an sequence of 0 and 1, no ? :P
<Regenaxer> hihi
<freemint> beneroth, it can, a terminated sequence of 0's
<Regenaxer> true
<Regenaxer> So "uniform" means "carries less information"
<freemint> Again a case where making the syntax more uniform makes everything suck more
<freemint> Uniform means: has a simpler grammar.
<Regenaxer> ok
<Nistur> is the picolisp website down or is it just me? :S
<Regenaxer> picolisp.com works
<Nistur> says server not found here
<Nistur> weird
<Regenaxer> uh
<Nistur> ahh, google links https, which doesn't work for some raisin
<Nistur> but http works
<Nistur> or maybe not
<freemint> A lisp with "freemint-macros" would really just have a file containing only SEXPR. but since ~ actually adds features that violate how pure SEXPR works and we want to keep that feature the reader and the interpreter(which can now encounter freemint-~) would have to be more complicated, which is not what we want really.
<freemint> https://picolisp.com/wiki/?home works for me
<Nistur> maybe only some requests are getting through from here :S
<Regenaxer> From UK?
<Regenaxer> Perhaps already brexited?
<Nistur> hah maybe
<Regenaxer> :(
<freemint> Regenaxer, can you find yourself agreeing with the statement: "PicoLisp's syntax is not as uniform as it could be, but it is as uniform as it should be"?
* Nistur wonders if he could just do X forwarding and run firefox on his home machine
<aw-> Nistur: i've tried that, works surprisingly well
<aw-> easier to just setup a VPN or Proxy
<Regenaxer> freemint, I can agree. For me most of non-uniformity is because of the delimiters
<Regenaxer> Nistur, or an ssh tunnel
<Nistur> aw-: maybe, but I've got to run another VPN for work
<Regenaxer> to home machine
<Nistur> yeah
<razzy> (feel free to ignore this) i think reader macros (like `) should be part of editor like glasses-mode in emacs. not language at all. to be perfectly clear that they are there for user. code should be published in both ways.
<freemint> Regenaxer, i would say read macros are the only source of non-uniformity as far as S-EXR is concerned.
<razzy> that reminds me, how could i run code through just macro-reader to get "pure" lisp code?
<freemint> I am not sure what you mean by delimitera
<freemint> *dellimiters
<Regenaxer> The rules that delimits an atom
<freemint> like?
<Regenaxer> : Delim ascii " \\t\\n\\r\\\"'(),[]`~{}"
<freemint> razzy, (doc 'read)
<Regenaxer> from src64/glob.l
<freemint> OH you are right
<Regenaxer> ` and ~ are fine for me
<Regenaxer> as ( ) .
<Regenaxer> they are the meta chars
<freemint> but those are easy to express in grammar i think.
<Regenaxer> Why not ` and ~ then?
<Regenaxer> they are like '
<Regenaxer> and ( ) and .
<freemint> . would also have to go but there is getting rid of ( ) in pisp
<freemint> *Lisp
<Regenaxer> In this view ( and ) are also read macros
<Regenaxer> and /
<Regenaxer> oops
<Regenaxer> I mean "."
<Regenaxer> The *reader* has a syntax
<Regenaxer> using all those chars
<Regenaxer> ` and ~ are not special
<Regenaxer> like . for dotted pairs, or (a b .) for circular lists
<Regenaxer> all these things are just reader syntax
<freemint> would be the only delimiters remainng (,)," although even "a" could be replace with (string 'a)
<Regenaxer> But the syntax of the *lang*?
<Regenaxer> it is only (function ... args ...)
<freemint> exactly
<freemint> *(string (. quote a))
<Regenaxer> Comma is also read macro
<freemint> Regenaxer, i can not find myself arguing this case anymore. It is the results of optimizing the wrong thing and i tried with the result that i felt very brittle and more verbose.
<Regenaxer> No, it is good and necessary to explore such things
<Regenaxer> As I said, I too think about "immediate" symbols
orivej_ has quit [Ping timeout: 246 seconds]
<Regenaxer> Could be implemented easily
<Regenaxer> But it is this obfuscation which *looks* nifty
<Regenaxer> ... but still obfuscates things :)
<razzy> freemint: (doc 'read) does not help me. asm i do not want to dissasemble
<razzy> nvermind
orivej has joined #picolisp
<Regenaxer> razzy, you mean: "how could i run code through just macro-reader to get "pure" lisp code"
<Regenaxer> Just (read)
<Regenaxer> and the macros are gone :)
<Regenaxer> Then 'pp'
orivej has quit [Ping timeout: 255 seconds]
<beneroth> Regenaxer, yeah () is a read-macro too, building a list :D
<Regenaxer> T
<freemint> mhh i built my own website with PicoLisp but not only the website but also the source looks like an ugly mess.
<Regenaxer> Ugly in which regard?
<freemint> I pastebin it
<Regenaxer> ok
<freemint> The main.l is small enough
<freemint> (load "@lib/http.l" "@lib/xhtml.l" "sites.l")
<freemint> (de reload () (load "sites.l"))
<freemint> (allowed NIL "!projects" "!vita" "!blag" "@site.css" "!me" "!reload")
<freemint> (server 80 "!me")
<freemint> website visible under schäg.de ( xn--schg-noa.de ),
<freemint> wait i just found a bug
<razzy> Regenaxer: i will try
<Regenaxer> freemint, not so ugly. Perhaps needs more uniform indentation ;)
<freemint> main.l lib.css and sites.l (the pastbin) are stored in the same folder but lib.css is always 404, why?
<Regenaxer> I'm not sure about your setup. You run through nginx
<Regenaxer> sites.l doesnt matter, it is not loaded as an URL
<Regenaxer> main.l neither
<Regenaxer> Try "@lib.css"
<freemint> true the 404 comes from nginx, weird
<Regenaxer> I think thats also what is allowed
<Regenaxer> ah, no
<Regenaxer> I do (trace 'httpEcho) in such cases
<Regenaxer> to see what it tries to fetch
<freemint> I am so frustrated by manualling having to kill the server everytime i make a change to sites.l
<freemint> or any file
<Regenaxer> I test in a terminal first
<Regenaxer> just ^D
<Regenaxer> Also, instead of putting all in functions, I would make single-page files
<Regenaxer> Then they are reloaded automatically
<Regenaxer> Server is restarted only if main.l changed
<Regenaxer> (which is seldom or never)
<freemint> I tried to do that with sites.l but when i !reload, i only load in the forked off process not in the parent
<Regenaxer> you have no sessions, so reload makes no sense
<freemint> I have my own !reload which (load "sites.l") i noticed that that made no sense
<Regenaxer> If you stay with single-site, then first test in terminal and just kill with ^C
<Regenaxer> and start from shell history again
<freemint> What is trace httpecho supposed to do? I did not think it did anything
<Regenaxer> 3 key strokes :)
<Regenaxer> httpEcho runs when images, .js, .css etc are sent by the server
<Regenaxer> ie not .l and not !foo
<Regenaxer> .l and !foo are executed immediately
<freemint> nothing happen when it schäg.de/@lib.css was accessed
<Regenaxer> and no error?
<Regenaxer> (html 0 Ttl *Css .. should send it
<Regenaxer> you may have to clear the browser cache!
<freemint> no, next i will talk to the il server directly to see if nginx is to blame, css link appers in the source.
<Regenaxer> shift-reload the page in the browser
<Regenaxer> I think it *is* sent
<Regenaxer> but only once in the beginning
<Regenaxer> shift-reload
<Regenaxer> then watch the trace of httpEcho
<freemint> nginx eats it
<Regenaxer> really? :(
<freemint> i check with the nginx guys
<freemint> maybe my config is bad
<freemint> Yes
<beneroth> make a extra location {} block in nginx conf to deliver the static files, it's faster if nginx delivers them :)
<Regenaxer> Cant you debug first locally, without nginx?
<beneroth> pastebin nginx config?
<freemint> curl localhost:80/@lib.css (on the machine with pil but not nginx) works as expected
<Regenaxer> ok, good
<Regenaxer> in your code you have "lib.css" without @
<Regenaxer> is it in the current working dir?
<freemint> I want that really, but i changed it for @ since i knew that would work, once i got nginx working again i bend it back to my own css
<Regenaxer> ok, right
<freemint> beneroth, the nginx.conf https://pastebin.com/QBGijMYp
<freemint> sites-enabled/xn--schg-noa.de https://pastebin.com/gx5yK8iP
<freemint> If you need any other file i can pastebin it for you too.
<beneroth> my firefox said "Blocked loading mixed active content “http://schäg.de/@lib.css”"
<beneroth> you should include it using https. or without protocol and domain... e.g. "/@lib.css"
<beneroth> hm.. T I get 404 for https://schäg.de/@lib.css
<freemint> beneroth, can not reproduce
<freemint> the first thing the 404 i can
<beneroth> <link rel="stylesheet" type="text/css" href="http://xn--schg-noa.de:80/@lib.css"/>
<beneroth> why http://xn--schg..... ?
<beneroth> just /@lib.css
<beneroth> shorter.
<beneroth> but yeah, not the underlying issue really..
<freemint> beneroth, blame 'http for that as *Css i give him "@lib.css"
<beneroth> kk
<freemint> However the http:// :80 part is really weird
<Regenaxer> Probably results from (baseHRef)
<Regenaxer> I dont remember well ;)
<freemint> Did i forgot some *Variables for it to be so ugly?
<Regenaxer> I don't think so
<Regenaxer> Perhaps look at doc/tractatus.l for a simple plain-HTML example?
<freemint> the problem seems to be nginx. I will look for insights how to make my lisp nicer in tractatus
<freemint> @doc/tractatus not found
<Regenaxer> oops, it is not in the release
<Regenaxer> You can fetch the source from the site
<Regenaxer> Then download Source
<freemint> why does the source link work?
<Regenaxer> it is a function
<Regenaxer> (hehe, just has .l at the end ;)
<freemint> not noticed
<Regenaxer> (de tractatus.l () ...
<freemint> omg, a self hosting quine
<freemint> making the css a function is not the worst idea either
<Regenaxer> true, kind of quine
<Regenaxer> a big read macro ~(let ...
<freemint> that thing is a giant beautiful hack
<Regenaxer> css is a function cause I wanted to pack it all into a single sucrce file
<freemint> beneroth, no answers from #nginx yet
<Regenaxer> yeah, lot of fun :)
<beneroth> look into nginx log files
<beneroth> /var/log/nginx/...
<freemint> beneroth, access.log said it was accessed but error.log shows nothing
<beneroth> weird
orivej has joined #picolisp
freemint has left #picolisp ["Leaving"]
freemint has joined #picolisp
ubLIX has joined #picolisp
ubLIX has quit [Ping timeout: 250 seconds]
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
orivej has quit [Ping timeout: 250 seconds]
rob_w has quit [Quit: Leaving]
aw- has quit [Quit: Leaving.]
orivej has joined #picolisp
f8l has joined #picolisp
alexshendi has joined #picolisp
orivej has quit [Ping timeout: 250 seconds]
Regenaxer has quit [Ping timeout: 264 seconds]
ubLIX has joined #picolisp
Regenaxer has joined #picolisp
orivej has joined #picolisp
freemint has quit [Ping timeout: 268 seconds]
freemint has joined #picolisp
freemint has quit [Ping timeout: 240 seconds]