01:56
bjork1intosh has quit [Ping timeout: 260 seconds]
02:54
pablo_escoberg has quit [Quit: Client closed]
03:46
geri has joined #picolisp
03:49
<
geri >
(cant use the native alias cause old version)
05:38
geri` has joined #picolisp
05:39
geri` has quit [Client Quit]
05:40
<
geri >
ive killed emacs but somehow my buffers were fine; magic
05:49
<
abu[7] >
Good morning
05:50
<
geri >
ive switched shebang from pil to picolisp and now my script runs 2x faster
05:51
<
geri >
as if it couldnt get any more insane
05:52
<
abu[7] >
I have not studied it, but what is important is the naming conventions
05:52
<
abu[7] >
(dst) should be (Dst) etc
05:52
<
abu[7] >
Otherwise you get unexpected conflicts
05:53
<
geri >
is every argument captialized
05:53
<
geri >
i had a conflict with file, so now its dst
05:53
<
abu[7] >
Every "locally bound symbol"
05:53
<
geri >
like everything i write basically?
05:53
<
abu[7] >
There is a chapter on naming conventions in @doc/ref.html
05:55
<
abu[7] >
I always wonder why people use "#!/usr/bin/env pil"
05:55
<
abu[7] >
Why not simply "#!/usr/bin/pil" ?
05:55
<
abu[7] >
env wastes the argument
05:56
<
geri >
cause only thing in /usr/bin i have is env lol
05:56
<
geri >
i use env for everything except /bin/sh cause its supposed to always be there
05:57
<
geri >
i.e. portability reasons
05:57
<
geri >
but yeah you cant do stuff like #!/usr/bin/env bash -e by default for example, which sucks sometimes
05:58
<
abu[7] >
The point in pil is that you can use #/any/path/pil
05:58
<
abu[7] >
and "#!/any/path/pil <arg>"
05:58
<
abu[7] >
I don't understant what advantage "env" has
05:59
<
geri >
it doesnt matter where pil is installed globally
05:59
<
geri >
so if i set up pil to be in ~/pil and add ~/pil/bin to $PATH my scripts will still work
05:59
<
geri >
+- setting up library stuff
06:00
<
geri >
and i dont need to patch shebangs for that either
06:00
<
geri >
what do you usually use for argument in shebang?
06:00
<
abu[7] >
I usually have /usr/bin/pil and /home/abu/pil21/bin/pil etc
06:01
<
abu[7] >
So I specify in the hashbang which one to use
06:01
<
geri >
well you kinda need to do it because one is for dev and another one is for "prod"
06:02
<
geri >
except you can still use dev shebang and itll work fine even if other one uses env, long as you dont add incompatabilities by adding both to $PATH
06:02
<
abu[7] >
Sometimes I had also different ones for prod
06:02
<
abu[7] >
e.g. pil64 for old apps
06:02
<
geri >
idk, im not yet at a level to use 4 different pil interpreters on one machine
06:03
<
abu[7] >
How does 'env' know the right path if it is not the standard?
06:03
<
geri >
it can find anything in $PATH
06:03
<
geri >
for me #!/usr/bin/env picolisp resolves to
06:03
<
geri >
#!/nix/store/0wd45b94yzpbgshv19g9hj77sj2k5kjd-picoLisp-20.6/bin/picolisp
06:04
<
abu[7] >
OK, no worry, I was just wondering
06:04
<
abu[7] >
I don't use env
06:05
<
geri >
basically for portability env is king, but for security you wanna hardcode all paths
06:05
<
geri >
but if someone can mess with your $PATH youve likely got bigger problems t
06:06
<
geri >
han someone just adding malicious a script to your path
06:06
<
geri >
but if youre really paranoid you want to disable all execution rights
*and* hardcode all paths to stuff that can be running
06:14
<
abu[7] >
Looks good
06:15
<
geri >
and runs even better B)
06:15
<
geri >
9x faster than emacs lisp version
06:15
<
abu[7] >
Do you call (sysdefs "unistd") somewhere?
06:15
<
abu[7] >
to set the value of PATH_MAX
06:16
<
geri >
idek what it does
06:16
<
abu[7] >
sysdefs is for system constants
06:16
<
abu[7] >
otherwise PATH_MAX is NIL
06:17
<
abu[7] >
Just call (sysdefs "unistd") at start somewhere
06:20
<
abu[7] >
Minor detail: (= NIL (info File)) is better (not (info ...
06:20
<
abu[7] >
But 'not' also can usually be avoided
06:21
<
abu[7] >
by using the reverse conditional
06:21
<
abu[7] >
(when (info ...) ...
06:22
<
abu[7] >
As (not (= .. becomes (<> ...
06:22
<
abu[7] >
Just cosmetics
06:22
<
geri >
so in symlink? i can replace not = with <>?
06:23
<
geri >
i use a bunch of when's and unless'es but cant really do that when i need to return a single boolean
06:23
<
geri >
like in symlink? function
06:24
<
abu[7] >
'when' and 'unless' return NIL if the condition is not met
06:25
<
geri >
ye, although idk how to apply it to symlink function
06:25
<
geri >
cause you usually use when to do stuff when a conditon is true
06:25
<
geri >
and here i only need to know if that condition is true, not do anything
06:26
<
abu[7] >
Isn't this correct? (and (info File T) (info File) (<> (car @) (car (info File T))))
06:27
<
geri >
thing is, you can have empty symlinks, pointing nowhere
06:27
<
geri >
thats what (= NIL (info File)) checks
06:27
<
abu[7] >
or (let? I (info File T) (and (info File) (<> (car @) (car I]
06:27
<
abu[7] >
to avoid duplicate info calls
06:28
<
abu[7] >
(info is a bit expensive)
06:28
<
geri >
okay lets see...
06:29
<
abu[7] >
Or jusbn (<> (car (info File)) (car (info File T))) :)
06:30
<
abu[7] >
wont work if both info calls are NIL
06:30
<
geri >
problem is (info File T) will return something for any file
06:31
<
geri >
so im adding more conditionals to make sure
06:31
<
abu[7] >
But (let? I (info File T) (and (info File) (<> (car @) (car I] should work, no?
06:32
<
geri >
ig it should, im just processing it really slowly
06:33
<
abu[7] >
Probably I over-simplified
06:34
<
geri >
i mean, i understand how its going, but logic is not as obvious
06:34
<
geri >
lemme just test it rq
06:36
<
geri >
it doesnt see a void link as a link...
06:36
<
geri >
thats when (info File T) is true but (info File) is false
06:37
<
geri >
(de symlink? (File) (let? I (info File T) (or (not (info File)) (<> (car @) (car I)))))
06:37
<
geri >
seems to work
06:38
<
geri >
double not though xd
06:38
<
abu[7] >
I think this is not right
06:38
<
geri >
logic is "link file exists, source file either doesnt exists or link and source are different kinds of files"
06:39
<
abu[7] >
(not (info File)) overwrites '@'
06:39
<
abu[7] >
So instead of (or (not ... use (and ...
06:40
<
geri >
how do i check that file either doesnt exist or is different from the link with an "and"?
06:42
<
geri >
oh it might also mess up if i symlink symlinks
06:42
<
geri >
maybe theres a neat C function for this and im dumb
06:42
<
abu[7] >
perhaps :)
06:43
<
abu[7] >
But is this not correct? (let? I (info File T) (and (info File) (<< (car @) (car (info File T)))))
06:43
<
abu[7] >
It seems a direct translation of your first version to me
06:43
<
geri >
no, it yet again falls over on void symlinks
06:44
<
geri >
you can have a symlink that points nowhere, but its still a symlink
06:44
<
abu[7] >
I forgot I above
06:44
<
abu[7] >
(let? I (info File T) (and (info File) (<< (car @) (car I))))
06:44
<
geri >
check it with ln -s nowhere test
06:44
<
geri >
its called a broken symlink, nvm
06:45
<
abu[7] >
yes, but <> should fail then
06:45
<
abu[7] >
(I have not tested here)
06:45
<
geri >
<> wont fail, cause nil is nil
06:46
<
geri >
but its (car I) vs info
06:46
<
abu[7] >
But (info File) is not NIL
06:46
<
geri >
so they are different but not
06:46
<
geri >
if it doesnt exist it is NIL
06:46
<
abu[7] >
I just shortened your original version
06:47
<
abu[7] >
(not (= etc
06:47
<
geri >
idk man im confused at this point
06:47
<
geri >
let me try if readlink can do it
06:47
<
abu[7] >
Yes, better anyway :)
06:48
<
geri >
do we have a function to expand paths somewhere
06:48
<
geri >
not only @ but ~ and / too
06:49
<
abu[7] >
~ does expand in pil21
06:49
<
geri >
with (path)?
06:49
<
geri >
ive managed to compile newest version and vip works too but i havent fixed libs yet
06:50
<
abu[7] >
yes, (path) knows ~
06:51
<
abu[7] >
: (path "~/foo")
06:51
<
geri >
ill package newer one a little faster
06:51
<
abu[7] >
-> "/data/data/com.termux/files/home/foo"
06:51
<
geri >
you're working from a phone??
06:51
<
abu[7] >
I don't use laptops since 2015
06:52
<
geri >
thats very epic
06:52
<
abu[7] >
only Termux on Phone
06:52
<
geri >
do you use a physical keyboard tho
06:53
<
geri >
oh, those circles are
*your* *actual* keyboard?
06:54
<
abu[7] >
The tablet is out of use meanwhile
06:54
<
abu[7] >
Thinking to buy a larger phone though (Pixel Fold)
06:54
<
geri >
i got a glove80 so i know about weird keyboards but this is pretty out there :D
06:55
<
abu[7] >
But Pil21 was all developed on 6 inches
06:55
<
geri >
yeah thats honestly amazing
06:55
<
abu[7] >
Penti takes time to learn
06:56
<
geri >
i use a 32 key setup
06:56
<
abu[7] >
But then it is really nice to be able to work anywhere
06:56
<
abu[7] >
How 32 keys?
06:57
<
geri >
asdf are themselves when pressed but super alt ctrl shift when held
06:57
<
geri >
also takes some time to get used to but i can type anything and its really comfy
06:57
<
abu[7] >
Interesting
06:58
<
geri >
i want one of those real 34 key keebs some time, they're so cute
06:58
<
geri >
and ultra portable too
06:59
<
geri >
# if File points to anything other than itself - it's a symlink
06:59
<
geri >
(de symlink? (File) (<> (readlink File) File))
06:59
<
geri >
it works lol
07:00
<
abu[7] >
I see, you really focus on keyboards?
07:01
<
geri >
i honestly used it only for like 4 months, but its so comfy
07:02
<
geri >
99% of stuff i do could be done in termux but it doesnt feel as homey as my linux setup
07:02
<
geri >
although ive been thinking about switching to phone-only a few times cause its so much more portable and energy efficient
07:03
<
abu[7] >
So I think optimal is a foldable phone
07:03
<
abu[7] >
A more portable tablet )
07:04
<
geri >
if i were to go mobile only rn i cant see myself doing anything other than just docking it and using a big screen w/ normal keyboard at home
07:04
<
abu[7] >
Don't know how durable they are
07:05
<
abu[7] >
For me is important to have it while walking or in the train
07:05
<
abu[7] >
I never work at a desk
07:06
<
geri >
not as durable as normal phones afaik
07:06
<
geri >
i mean, if you dock your phone you can work with proper ergonomics and then just undock and work whereever however
07:07
<
geri >
imo best of both worlds
07:07
<
abu[7] >
Penti is a lot more comfortable
07:07
<
geri >
maybe you also need to check out 34 keys)
07:07
<
abu[7] >
I use it also with my PC in the basement
07:07
<
geri >
but yeah thats fair
07:08
<
geri >
is it touchscreen
07:08
<
abu[7] >
No, I cant carry it in my pocket
07:08
<
geri >
penti is for touchscreens no?
07:08
<
abu[7] >
I drive my PC in the basement via phone + Termux and Penti via ssh
07:09
<
geri >
yeah thats how i debugged the build
07:09
<
abu[7] >
The output is on my TV screen if I need a big display
07:09
<
abu[7] >
But keyboard is always Penti
07:09
<
abu[7] >
Penti serves also as mouse
07:09
<
abu[7] >
by tilting the phone
07:10
<
abu[7] >
But I use the TV only seldom
07:10
<
abu[7] >
a few times a month perhaps
07:10
<
abu[7] >
only to view PDFs etc
07:11
<
geri >
did you write penti too
07:12
<
geri >
plant a tree, raise a son and make your own programming language and your own keyboard too
07:14
<
abu[7] >
Like you do with 32 kb
07:14
<
geri >
i got a gaming layer too, although rebinding everything can be a little tedious
07:15
<
geri >
im curious, have you done a typing speed test before on the penti?
07:16
<
abu[7] >
Not really. In fact I was faster with 1--finger touch typing
07:16
<
geri >
1 finger touch typing xd
07:20
<
geri >
just realized my symlink function actualy matches non existant files
07:21
<
geri >
(de symlink? (File) (and (info File t) (<> (readlink File) File) ) )
07:21
<
geri >
now it seems fine
07:22
<
geri >
if link file exists and points to anything other than itself
07:22
<
geri >
i keep on messing it up
07:22
<
abu[7] >
't' is a fun :)
07:22
<
geri >
what does it do
07:22
<
geri >
actually it shouldnt matter cause info checks if last arg is anything but nil no?
07:23
<
geri >
but yeah, i keep on messing it up ~w~
07:23
<
abu[7] >
It returns T
07:24
<
abu[7] >
(t (a) (b)) is the same as (prog (a) (b) T)
07:24
<
abu[7] >
Similar for 'nil'
07:24
<
geri >
do stuff and return t or nil?
07:25
<
abu[7] >
Useful if only a single exe is allowed
07:25
<
abu[7] >
e.g. in 'if'
07:25
<
abu[7] >
(if (x) (t ...) (foo) (bar))
07:26
<
geri >
why not just use progn
07:26
<
geri >
inb4 "less typing"
07:26
<
abu[7] >
(prog (a) (b) T) is longer, yes
07:26
<
geri >
spaces between closing parens are to easier see where to check for starting paren right?
07:27
<
abu[7] >
yes, only for that
07:27
<
geri >
from cl and elisp it looks very jarring honestly
07:28
<
abu[7] >
Dunno, I do this from early on
07:28
<
abu[7] >
Saw it somewhere
07:28
<
geri >
idk, i started when editors could already highlight paren pairs
07:29
<
abu[7] >
This is independant
07:29
<
abu[7] >
It is more readable
07:30
<
abu[7] >
to see where the exe on this line ends
07:30
<
geri >
maybe once i get used to it
07:30
<
abu[7] >
Not for the paren balancing
07:30
<
abu[7] >
Not a big thing, just cosmetics
07:31
<
geri >
if that were what would put me off from using the language id be no better than 90% of lisp haters
07:31
<
aw- >
hi geri, welcome to PicoLisp
07:33
<
geri >
i think im ready to collect a personal library already :D
07:35
<
geri >
i used (native "@" "getenv" 'S "HOME") before finding out that sys does that xd
07:36
<
abu[7] >
That's always the problem :)
07:37
<
abu[7] >
To find what is there
07:37
<
geri >
yeah, i think i saw it in some other code of yours
07:38
<
abu[7] >
I also forget such things occasionally
07:39
<
abu[7] >
Often grep around
07:39
<
geri >
only after you told me about (doc) had i found all the files are there for me to grep through
07:44
<
geri >
id honestly find it easier to find stuff in browser interface if it were all in one html file
07:47
<
geri >
thank god for grep
07:47
<
abu[7] >
With "grepping" I thought more about sources though
07:48
<
abu[7] >
Especially old projects in my case
07:49
<
geri >
dont have any to be able to relate
07:49
<
abu[7] >
How did I do that 10 years ago?
07:49
msavoritias has joined #picolisp
07:49
<
geri >
i started with linux like 4 years ago
07:50
<
geri >
and now im also an enthusiast programmer
07:51
<
geri >
but for me first writing a fast language and then also writing yourself an editor in that sounds insane
07:52
<
abu[7] >
It all accumulated over the years
07:52
<
geri >
were first versions of picolisp slow?
07:52
<
abu[7] >
Sometimes it is easier to write your own
07:53
<
geri >
yeah, i script a lot of things
07:53
<
geri >
instead of using note taking apps and stuff like that
07:56
<
geri >
i wrote tetris at least
07:57
<
abu[7] >
I never tried to write tetris
07:59
<
geri >
its in CL and uses ncurses
08:00
<
geri >
only real struggle was figuring out how to do rotation
08:00
<
geri >
in the end i just hardcoded relative coordinates
08:00
<
geri >
but it works and feels pretty snappy too
08:01
<
abu[7] >
Did you see Pil Chess?
08:01
<
geri >
no, but ive seen sources yesterday
08:01
<
geri >
gonna check later
08:01
<
abu[7] >
You can try online
08:02
<
abu[7] >
Or in PilBob
08:02
<
abu[7] >
Or in PilBox
08:03
<
geri >
ive written cli chess before too, hadnt figured out move generation though
08:03
<
geri >
this is honestly amazing
08:07
<
geri >
is there any difference between adding @lib.l to shebang vs (load)ing?
08:08
<
abu[7] >
Both go down to 'load' internally
08:09
<
geri >
@lib syntax is defined in lib.l right?
08:09
<
geri >
will load know how to expand @'s if lib.l is loaded in same call
08:11
<
abu[7] >
The 'path' logic is used for all file accesses
08:11
teddydd has quit [Ping timeout: 255 seconds]
08:11
<
abu[7] >
Built in the base system
08:14
<
abu[7] >
Yes, not in @lib.l
08:15
<
geri >
@lib expands to just lib in my packaged version
08:15
<
geri >
i mustve messed something up
08:16
<
abu[7] >
Expanding with e.g. 'path'?
08:16
teddydd has joined #picolisp
08:16
<
abu[7] >
It is not a packaging issue I think
08:17
<
geri >
(path "@lib/net.l") -> "lib/net.l"
08:17
<
abu[7] >
@ is expanded from the invocation
08:17
<
abu[7] >
This may be correct
08:17
<
geri >
gotta check how @ gets expanded
08:17
<
abu[7] >
if your current dir is at this place
08:17
<
geri >
if its hardcoded to /usr/lib/picolisp no wonder it doesnt owrk
08:18
<
geri >
cause usr/lib doesnt exist xd
08:18
<
abu[7] >
It in not hardcoded
08:19
<
abu[7] >
'pil' determines it on the fly
08:19
<
geri >
how does it do that?
08:19
<
abu[7] >
Ah, maybe you used the wrong 'pil'
08:19
<
abu[7] >
exec ${0%/*}/bin/picolisp ${0%/*}/lib.l @ext.l "$@"
08:20
<
abu[7] >
the one in pil21/bin/pil is for /usr/bin iirc
08:21
<
abu[7] >
bin/picolisp determines the path from the first file argument
08:21
<
abu[7] >
(usually lib.l)
08:22
<
abu[7] >
Probably 'env' gets it wrong!!! :D
08:22
<
geri >
im trying to make it work with pure picolisp executable rn
08:22
<
abu[7] >
that's fine
08:22
<
abu[7] >
I have such scripts too
08:23
<
abu[7] >
On Termux I have:
08:23
<
abu[7] >
#!/data/data/com.termux/files/home/pil21/bin/picolisp /data/data/com.termux/files/home/pil21/lib.l
08:24
<
abu[7] >
Ugly though
08:25
<
geri >
extremely ugly
08:25
<
geri >
isnt there also a max size for shebang
08:25
<
abu[7] >
May well be
08:26
<
geri >
okay it expanded properly
08:26
<
geri >
very interesting
08:28
<
geri >
yeah it has to be actualy first argument
08:28
<
geri >
rip env with pure picolisp executable
08:28
<
abu[7] >
So in any case, the first file passed to bin/picolisp must have the relatave or absoluutte path
08:28
<
geri >
relative to the executable?
08:29
<
abu[7] >
No, to the current working dir
08:29
<
abu[7] >
For example, I start production apps in /home/app
08:29
<
abu[7] >
or /home/app/foo
08:30
<
abu[7] >
when in foo, it is started as ../pil21/pil ...
08:31
<
abu[7] >
PATH is irrelevant
08:31
<
geri >
but PWD is relevant then
08:31
<
geri >
which is probably fine for some things
08:31
<
geri >
okay, my wrapper works
08:31
<
abu[7] >
You have control in each app what to start
08:32
<
geri >
now just gotta find out why even (+ 1 2) takes a full second
08:33
<
geri >
the original packager uses make gate
08:34
<
abu[7] >
Perhaps you'll need HTTPS
08:34
<
geri >
its trying to load https lib on every call?
08:35
<
abu[7] >
No, it is a separate proxy
08:36
<
geri >
then whats the idea behind needing https
08:37
<
abu[7] >
@doc/httpGate.html
08:40
<
geri >
no rule for `make gate`
08:40
<
geri >
is that part outdated?
08:41
<
geri >
maybe i didnt use proper ssh package - i was trying to use openssl
08:42
<
abu[7] >
No support for pil64 any more :)
08:43
<
geri >
i dont quote understand how its related to execution delay though
08:44
<
abu[7] >
Speed in general is OK?
08:46
<
geri >
segfault lol
08:47
<
geri >
and now this is there unistd finally decides to get sysdef'd
08:47
<
geri >
bootstrap actually runs fine
08:47
<
geri >
very interesting
08:48
<
geri >
so repl is slow as hell but execution is fine
08:48
<
geri >
i forgot to add one thing to the wrapper sec
08:49
<
geri >
lets just try patching shebang
08:51
<
abu[7] >
Pil64 has no sysdef mechanism
08:51
<
geri >
is my 4yo version pil64?
08:51
<
abu[7] >
and also does not use standard readline
08:52
<
abu[7] >
Must be if it makes "gate"
08:54
<
geri >
wait so im using the version before the llvm rewrite?
08:54
<
geri >
and its still this insanely fast??
08:55
<
geri >
this is amazing
08:55
<
abu[7] >
Pil64 is written in assembly even
08:55
<
abu[7] >
a generic assembler
08:55
<
abu[7] >
should go to @src64
08:56
<
geri >
i should add vip to bin sec
08:56
<
abu[7] >
'vi' was in pil64, it called Vim
08:56
<
abu[7] >
No need for bin
08:57
<
geri >
cant find any of vim vi v lol
08:57
<
abu[7] >
Vim or Vip are called from the REPL
08:57
<
abu[7] >
Not sure if Vip was already in pil64 too
08:58
<
geri >
i was wondering the hell that language was
08:58
<
geri >
cause looks like lisp for like 2 seconds
08:59
<
abu[7] >
Pil was first C, then PilAsm, and now PilSrc (LLVM)
09:00
<
geri >
[/nix/store/bm3j6k0aj6dpp1737jixcd643b1dj4zm-pil-21/lib/picolisp/lib/map:1] !? (while (read) (let priv~Sym @ (if (get priv~Sym '*Dbg) (set @ (read)) (put priv~Sym '*Dbg (cons (read)))))) while -- Undefined
09:00
<
geri >
thats when using + with my package
09:01
<
geri >
what a fun adventure!
09:02
<
geri >
oh wait i know
09:04
<
geri >
and now repl is fine
09:04
<
abu[7] >
I really recommend to switch to the current version
09:05
<
geri >
i said i just fixed current version
09:05
<
geri >
so i can actually switch to it
09:05
<
abu[7] >
Oh! Cool, did not understand :)
09:15
<
geri >
nice and fast and with %@ alias)
09:17
<
geri >
how much does picolisp without pil wrapper actually include?
09:18
<
abu[7] >
Quite a lot
09:18
<
abu[7] >
bin/picolisp and then (all)
09:19
<
abu[7] >
All what is in @src
09:21
<
abu[7] >
BTW, '%@' is more than an alias. It is also a little more efficient
09:21
<
geri >
a very good alias!
09:22
<
geri >
oh, you call mkdir -p in lib.l instead of reimplementing it
09:22
<
geri >
original version of bootstrap script was like a shell script - it called test and ln and rm
09:22
<
geri >
and was like a billion times slower than emacs script
09:23
<
geri >
did `call' improve a lot since pil64?
09:23
<
abu[7] >
No relevant change I think
09:24
<
abu[7] >
What could be improved?
09:25
<
geri >
idk, but removing external calls reduced my script's running time from 0.3 seconds to 0.01
09:25
<
geri >
it could be something was wrong with pil64
09:25
<
geri >
*with my pil64
09:25
<
abu[7] >
'call' has overhead in general
09:26
<
abu[7] >
forking, doing tty stuff
09:26
<
geri >
yeah, but my shell script uses external calls for a ton of things and still ran like 4 times faster
09:26
<
abu[7] >
Better than calling mkdir would be a native call
09:26
<
abu[7] >
But you don't usually create tons of dirs
09:27
<
abu[7] >
A single call does not matter
09:27
<
abu[7] >
Instead of (
09:27
<
abu[7] >
Instead of (call "rm"
09:27
<
geri >
im planning to use pil for scripting mainly, so maybe ill accumulate a whole lib for these kinds of things
09:27
<
geri >
cant promise anything yet
09:27
<
abu[7] >
I sometimes do a native link call
09:27
<
abu[7] >
Native is as easy for mkdir
09:28
<
geri >
except for -p
09:30
<
geri >
replacing test -L call with a symlink? function decreases execution time form 0.249 seconds to 0.013 seconds
09:30
<
geri >
at least in my case cause its done in a loop a bunch of times
09:32
<
geri >
its near like 40 calls though
09:34
<
geri >
if i want to define 3 functions that do the same thing but are called differently, how could i do that?
09:35
<
abu[7] >
Usually you can interprete the args
09:36
<
abu[7] >
dispatch on the type
09:37
<
abu[7] >
Can you show a simple example?
09:38
<
geri >
just define 3 identity functions foo bar baz
09:38
<
geri >
im wondering how i could neatly map native functions to pil functions + curious
09:38
<
geri >
mostly curious
09:39
<
abu[7] >
3 identity functions?
09:39
<
abu[7] >
(def 'baz foo)
09:39
<
abu[7] >
((X) X) :)
09:39
<
geri >
oh you can do aliases like that?
09:40
<
geri >
like do (de NAME (thing) thing) for 3 things in a loop
09:40
<
abu[7] >
The identity function is just 'prog'
09:40
<
abu[7] >
faster than ((X) X)
09:40
<
geri >
thats interesting but its just an example
09:41
<
abu[7] >
(for Sym (...) (def Sym ...
09:41
<
geri >
thats just one thing id do with a macro in cl cause defun is a macro
09:41
<
abu[7] >
No macro needed, as defining is not compilation
09:41
<
abu[7] >
So a function like 'def' is good
09:42
<
abu[7] >
You can also use 'set'
09:42
<
geri >
okay lets go the other way
09:42
<
abu[7] >
(set 'baz foo)
09:42
<
abu[7] >
(setq baz foo)
09:42
<
geri >
how do i force `de` to actually evaluate its first argument
09:42
<
abu[7] >
That's what 'def' does
09:42
<
abu[7] >
'de' is just a quoting frontend to 'def'
09:43
<
abu[7] >
just 3 lines
09:44
<
geri >
like set vs setq
09:45
<
geri >
its neat that (vi) actually works now
09:45
<
geri >
and i didnt even add vip to path yet
09:46
<
geri >
in @lib.l, why use strings for arguments?
09:46
<
abu[7] >
Transient symbols
09:47
<
abu[7] >
file-local
09:47
<
geri >
arent function arguments always local though?
09:47
<
geri >
for example in abort
09:48
<
abu[7] >
The bindings are local, but not the symbols
09:48
<
abu[7] >
They may conflict
09:48
<
abu[7] >
There is a section in the FAQ
09:50
<
geri >
oh, overriding string value for translation is neat
09:50
<
abu[7] >
"Are there no problems caused by dynamic binding?"
09:53
<
abu[7] >
Instead of transients we can now also use (private)
09:54
<
geri >
okay, magical
09:56
<
abu[7] >
@lib.l uses transients to be as lightweight as possible
09:57
<
abu[7] >
Must stop, bbl
09:57
<
geri >
i also gotta go for a stroll
11:32
<
geri >
is vip any configurable?
11:34
<
geri >
just want to change colors slightly honestly :D
11:36
<
geri >
its against simplicity so i wouldnt be surprised if not
11:45
<
abu[7] >
Your suspition is quite right, but you can redefine anything in ~/.pil/viprc or local .viprc files
11:46
<
abu[7] >
Or of course directly in @lib/vip.l
11:47
<
geri >
straight-up override anything?
11:48
<
geri >
that sounds real fun
11:48
<
abu[7] >
'undef' perhaps first
11:48
<
abu[7] >
or 'patch' stuff
11:49
<
abu[7] >
The viprc files are loaded in 'vip' namespace
11:51
<
abu[7] >
You can e.g. (setq GREEN BLUE) :D
11:54
<
geri >
thats amazing
11:54
<
abu[7] >
There is a @doc/viprc.sample
11:57
<
geri >
i should check the doc directory better
12:00
<
abu[7] >
I have ".pilrc" and ".viprc" in most working dirs locally
12:01
<
geri >
im far from ready to go that way xd
12:01
<
abu[7] >
No hurry ☺
12:01
<
geri >
if you told me you never leave a pil interpreter id honestly believe you
12:02
<
geri >
almost like emacs users
12:02
<
geri >
but way more style
12:03
<
abu[7] >
Thanks! I have no experience with emacs
12:04
<
geri >
ive used vim + tmux for a year or so
12:04
<
geri >
my emacs setup is pretty much the same thing but everything is hackable and interspectable and easy to integrate
12:04
<
geri >
but i think its gonna be easier for you to write your own emacs than get into this one
12:04
<
abu[7] >
Ah, yeah, tmux is great
12:05
<
abu[7] >
I have it on all machines
12:06
<
geri >
i have some sort of vi clone on every machine i have
12:53
<
geri >
gotta hack on some stuff, laters
12:54
geri has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.3)]
15:00
bjorkintosh has joined #picolisp
15:00
bjorkintosh has joined #picolisp
16:59
chexum has quit [Ping timeout: 260 seconds]
16:59
chexum has joined #picolisp
17:01
casaca has joined #picolisp
18:20
msavoritias has quit [Ping timeout: 256 seconds]
19:04
pablo_escoberg has joined #picolisp