ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Picolisp latest found at http://www.software-lab.de/down.html | check also http://www.picolisp.com for more information
eeproks has joined #picolisp
dtornabene has joined #picolisp
reich has quit [Ping timeout: 265 seconds]
abel-normand has joined #picolisp
abel-normand has quit [Ping timeout: 240 seconds]
rob_w has joined #picolisp
cilz has joined #picolisp
<cilz> good morning ;-)
<Regenaxer> Good morning cilz!
<cilz> Hello Regenaxer
beneroth has joined #picolisp
<beneroth> hi all
<Regenaxer> Hi beneroth
<beneroth> Guten Morgen Regenaxer :)
orivej has joined #picolisp
<cilz> hello beneroth
<beneroth> hi cilz
<cilz> :)
orivej_ has joined #picolisp
orivej has quit [Ping timeout: 260 seconds]
dtornabene has quit [Ping timeout: 265 seconds]
mtsd has joined #picolisp
<Nistur> greetings all
<Regenaxer> Hi Nistur
<tankf33der> Regenaxer: question about native again
<tankf33der> native malloc 3
<tankf33der> init 3 bytes with byte function
<Regenaxer> ok
<tankf33der> how pass this 3 bytes buffer area to native call ?
<Regenaxer> as a pointer to the malloc'ed memory
<Regenaxer> (let P (malloc ..) .. (byte ..) .. (native .. P ..
<tankf33der> i see
<Regenaxer> Do you need 'byte'?
<Regenaxer> You can set init data directly in a struct
<tankf33der> i want read big files
<Regenaxer> ah, ok
<tankf33der> 16MB file takes 40secs
<tankf33der> yea
<Regenaxer> I see, not very efficient
<Regenaxer> you can read the whole file as a number perhaps
<tankf33der> i have two different native functions for sign files
<Regenaxer> (rd 'cnt)
<Regenaxer> ok
<tankf33der> pass (list 1 2 3) and pass malloced buffer and get different results :)
<Regenaxer> So (rd 'cnt) and then pass this number to the struct? Not sure
orivej has joined #picolisp
<tankf33der> i will try
orivej_ has quit [Ping timeout: 256 seconds]
<Regenaxer> yeah, should work
<Regenaxer> I just wonder if 'rd' is faster
<tankf33der> like this ?
<Nistur> I've finally found a project which I can use lisp for that isn't just configuring emacs, and I _think_ picolisp is something that ticks all the boxes for me... as long as I can get it compiling and running on Windows, and interfacing with .dlls... primary development platform will be linux x86 and x64, but I'll need it working on Windows... so yeah, I'll probably have a lot of newbie questions in here to
<Nistur> coerce my project into life
<Regenaxer> Nistur, pil does not run directly on Windows
<Regenaxer> only in Linux mode perhaps, have not tried
<Nistur> I got miniPicoLisp compiling and running in msys2
<Regenaxer> tankf33der: yes, (rd 16726760), but I'm not sure atm if you can pass numbers bigger than 16 bytes to 'native
<tankf33der> rd works forever
<Nistur> unfortunately that required it to be bundled with msys2.dll, so I'm trying to recompile it with plain mingw-w64 without msys, which should use msvcrt and SHOULD work, but it is having 64bit teething issues for some reason
<Regenaxer> Nistur, pil needs POSIX
<Regenaxer> tankf33der, how about mem-mapping the file?
<Regenaxer> mmap()
<Nistur> Regenaxer: what POSIXy stuff does it require specifically?
<Nistur> I am not averse to adding a little NT compatibility code myself...
<Regenaxer> hmm, a lot
<Regenaxer> many system calls
<Regenaxer> fork(), select(), fcntl() etc.
<Regenaxer> The whole picolisp machinery depends deeply on it
<Regenaxer> it is a Unix shell in this sense
<tankf33der> Regenaxer: even pass malloced buffer doesnt work
<Regenaxer> tankf33der, in which sense?
<Nistur> Regenaxer: I guess my only option is to use the version with msys2.dll then which I guess is fine :P
<Nistur> it should provide a mostly POSIX compliant layer
<Regenaxer> Nistur, not sure, I have no experiences with Windows
<Regenaxer> ok, I see
<Regenaxer> I think some people here experimented with it
<Nistur> mingw/msys provide a minimalist GNU POSIX environment on Windows
<Regenaxer> ok
<Regenaxer> At least you need to rebuild picolisp with the proper constants
<Regenaxer> in src64/defs.l
<Nistur> it's already got configuration for cygwin and mingw (cygwin being another similar solution, msys2 being based on cygwin I believe)
<Regenaxer> I think tankf33der tried with cygwin recently?
<Regenaxer> at least fcntl() does not work in cygwin
<tankf33der> T
<Regenaxer> I tried many years ago
<tankf33der> Nistur: i cant understand why waste time on windows
<Nistur> I couldn't get the main picolisp compiling unfortunately, not ENTIRELY sure what the differences are with miniPicoLisp at this point... but I think mini- is probably enough functionality for me? I think it still has native calls?
<Regenaxer> How about a docker container?
<Regenaxer> miniPicoLisp should work
<Regenaxer> but it is plain vanilla C
<Regenaxer> not very useful for applications outside embedded things
<tankf33der> malloc buffered works now.
<tankf33der> issue closed.
<Regenaxer> cool
<Nistur> tankf33der, Regenaxer: my project is a very silly one, and if you remove some of my rather arbitrary limitations, other solutions might be better... but basically, I've hacked together some Bash scripts to use imagemagick to combine renders of Lego models into an instruction booklet ( https://github.com/nistur/lips ) but it only currently works on macOS, and probably Linux as I have not used anything mac
<Nistur> specific (just that the software to produce the renders doesn't run on Linux... yet)... I would LIKE to have more people be able to use this, as it seems like a useful thing (and people have commented as such) but most users are... less technical and Windows users... so I'd like to be able to provide a version which works on Windows. I could rewrite as .bat easily, but then I'd have two separate systems
<Nistur> to maintain. I could write in something like python, but then I'd have to bundle the windows version with a gigantic runtime. I could write in lua, but I'm bored of lua. As I said or at least hinted at earlier, I've been looking at an excuse to use a lisp for something... so if I can provide a simple runtime, and a few scripts, that runs easily for non-tech Windows people, and it would satisfy my desire
<Nistur> to brush up on Lisp, and my other partially forced requirement is that it's interpreted so to cut down on iteration of the scripts (which are already quite slow because imagemagick takes its sweet time...)
<Nistur> wow, sorry, didn't mean to dump an essay, I just got carried away...
<tankf33der> Regenaxer: pastebin link, 15secs -> 0.6secs
<Regenaxer> yes, I see the pastebin
<Regenaxer> cool, so why was it so slow before?
<Regenaxer> Nistur, no problem :)
<tankf33der> because of list of 16M bytes in it.
<Regenaxer> Not much traffic here anyway usually ;)
<Regenaxer> tankf33der, it is faster if you alloc heap first
<Regenaxer> (gc 400) or so
<Regenaxer> then the *first* load is a lot faster
<Regenaxer> Otherwise it calls 'gc' many times for small pieces
<tankf33der> faster
<tankf33der> files can be any size, i dont want depend on gc call
<Regenaxer> I often call (gc ..) for apps where I know they need lots of heap
<tankf33der> T
<Regenaxer> no problem anyway
<tankf33der> should i try implement mmap or malloc+byte is ok ?
<tankf33der> new is always fun. :/
<Regenaxer> yeah :)
<Regenaxer> Experimenting with mmap() might be useful also for other applications
<tankf33der> i just want read fast files with any size.
<tankf33der> yeah.
<Regenaxer> yep
<Regenaxer> it maps files directly to memory
<Regenaxer> no copying of file data
<tankf33der> i will try.
<Regenaxer> great
<Nistur> (apologies for the delay, had my daily "standup" skype call for work... normally I can only really type on here while I'm compiling which with this project is... frequent and frustratingly long) tankf33der: I'm wasting my time with Windows because the end user is not me :P
<tankf33der> Nistur: ok
<Nistur> plus I like massaging code to run on various platforms
<tankf33der> then install full PicoLisp on cygwin or msys
<Nistur> do you think there's any need to have picolisp running on PS2? I have a devkit set up
<Nistur> :P
<Regenaxer> What CPU is it?
<Nistur> custom MIPS
<Nistur> ... I don't think anyone does any development for PS2 any more... it's not old enough for retro homebrew guys to target (yet?) but it's not new enough to tempt non-retro people
<Nistur> it just happens to be something I have set up at home
<Regenaxer> Pil64 is not ported to Mips (yet)
<Nistur> it's only 32 bit :P
<Nistur> and I see the "yet" :P
<Regenaxer> ah, ok
<Regenaxer> hmm
<Nistur> I mean, this is a games console from '99
<Nistur> It has two programmable vector processing units though, which make for interesting coding... they are 128 bit wide
<Nistur> 4x 32 bit floating point vectors
<Nistur> if memory serves correctly
<Nistur> (it's been a LOOOOOOOOOOONG time since I've done any actual PS2 dev)
<Nistur> I set up my devkit so I can port some of my current silly projects to run on it for fun
orivej has quit [Ping timeout: 245 seconds]
orivej has joined #picolisp
<Nistur> random question... does picoLisp run on a RPi?
<Nistur> ... it compiles
<Nistur> I had to remove -m32
<Nistur> it also appears to run
<Regenaxer> yes
<Regenaxer> Not sure how the situation is on a Pi3
<Regenaxer> ie arm64
<Nistur> I don't have a pi3 yet
<Regenaxer> ok
<Nistur> I have tried this on a Banana Pi because it's what I have turned on right now at home :P
<Regenaxer> Arm64 is better
<Regenaxer> good
<Regenaxer> The problem with Pi3 seems to be that the OS is not full 64-bit yet
<Nistur> but I can test it on a B, B+, 2, Zero, ZeroW... and a few other non-pi SBCs for fun :P
<Regenaxer> :)
<Nistur> that makes my dev easier :P I use my pi's as a weird computer setup so I can work on it from multiple computers without messing around with version control, trying to remember which machine I made changes on... I still obviously use git but if _I_ am just working in one place...
<Regenaxer> You could try Termux on Android then
<Regenaxer> There pil is available out of the box
<Nistur> hmmm?
<Nistur> how would that make it easier?
<Regenaxer> just apt install picolisp
<Nistur> Hmm, but I'd still be working on my projects in multiple locations
<Regenaxer> Me too, but my base and working environment is Termux
<Regenaxer> on a Tablet
<Nistur> I don't like using my Android devices for more than very minimal communications, I need a proper keyboard, the more clicky the better... but if I _were_ to use one of them, I'd prefer to just SSH into my pi, as I do with my other computers
<Regenaxer> ssh to various hosts
<Regenaxer> I don't even have a notebook any more
<Regenaxer> tablet-only, very nice
<Regenaxer> mobile and flexible :)
cilz has quit [Ping timeout: 260 seconds]
<Regenaxer> this IRC runs on a server in my basement, and I connect via ssh to tmux on it
<Nistur> I have a 2012 MacBook Pro which I'm attempting to get rid of, it's too big to carry around everywhere, and I don't like macOS much... I only use it as an SSH client into my pi
<Nistur> I am in the process of switching to a... 2013(I think) Asus transformer T100TA
<Nistur> but it's an awkward beast
<Nistur> EFI is 32 bit, but CPU is 64 bit, so most x64 install media won't boot, as they don't include grubia32.efi
<Nistur> and it's a strange beast, with various bits of hardware not hanging off PCI bus or USB like is "normal" but off SDIO
<Nistur> so my normal flavour (Arch) struggles with it
<Regenaxer> tough
<Nistur> the only install I could get working was Ubuntu 15.04, which someone coaxed into working
<Nistur> but I've just updated to 17.10 and it actually works better than before
<Nistur> so there's something
<Nistur> but yeah, I just use all my computers as terminals into my pi setup
<Nistur> even my PC at home sort of :P
<Nistur> my PC setup is... non-standard
<Nistur> I guess the transformer is pretty much a tablet, but I only ever use it with the keyboard attachment, so I'm sort of trying to tend towards what you're doing
<Nistur> but I'm using screen and not tmux on my 'server' :P
<Regenaxer> The keyboard is what I wanted to get rid of first of all. Always makes trouble as it is a delicate mechanical device, and takes up by far too much space
<Nistur> I cannot live without a keyboard. I am disappointed that the last few phones didn't have a qwerty keyboard :(
<Nistur> I detest touchscreens with a passion
<Regenaxer> I'm working tablet-only since 2015 now
<Nistur> I'm glad it works for you, but I just couldn't... I am using a Model M keyboard at work, and a similarly clicky keyboard at home, but with USB so it'd work on the Pi
<Nistur> I don't like using the laptop keyboards much, but I couldn't go to touchscreen
<Nistur> I like the idea of a chorded keyboard though :P I have tried to use one on the phone before... not sure which I tried, but I still prefer big clicky keys
<Nistur> I was actually looking at (or, rather fantasising and drooling over) getting an even larger (and lispier!) keyboard for my home computer
orivej_ has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
mtsd has quit [Quit: Leaving]
abel-normand has joined #picolisp
orivej_ has quit [Ping timeout: 265 seconds]
<Nistur> d'oh picoLisp/src doesn't build on macOS :(
<Regenaxer> Probably since they use LLVM
<Regenaxer> clang
<Regenaxer> dynamic arrays are not supported. End of game ;)
<Nistur> yeah
<Nistur> 'will never be supported'
<Nistur> I can try and get gcc to build it with... it's a bit annoying, but I think it's possible :P
<tankf33der> Regenaxer: mmap required file descriptor, can i use fd from (open) or should implement open via native too?
<Nistur> tadaa, using gcc as acquired from homebrew, and I have picolisp on macOS :P
<tankf33der> cool.
<Nistur> this makes me a happy panda.
<Nistur> now that I have it running on my target platforms to some extent, I can now make it do things!
<tankf33der> did you run tests ?
<tankf33der> try
<tankf33der> pil "@lib/test.l" +
<Nistur> I shall do that now :)
<tankf33der> should be OK back
<Nistur> hrmmm, how do I set where @lib will look? I haven't yet installed it, I would like to keep things local for at least a little longer
libertas has quit [Ping timeout: 256 seconds]
<Nistur> huh. Apparently on macOS I cannot write to /usr/lib... even as root
<Nistur> I need to turn off SIP to do so -_-
abel-normand has quit [Ping timeout: 240 seconds]
<Nistur> I cannot do that on this machine
<Nistur> ((*/ (- (usec) U) 100000))
<Nistur> [test/src/main.l:115] 4 -- 'test' failed
<Nistur> commenting out that test, the rest pass though :)
<Nistur> just in case anyone was interested (and this is in no way useful, I was just bored during a compile) but you can use upx to compress picolisp and on macOS it will reduce the filesize from 266K down to 122K... still passes all tests fine (apart from the one above) so I assume it hasn't munged any functionality, not that I expected it would
<cess11_> Why macOS?
<cess11_> It's almost as hard to cope with as Windows.
<cess11_> Proper BSD or Linux is better.
<Nistur> most of my machines are Linux boxes, but I have a need (/desire) to target Windows and macOS... I've already dumped an essay above, I won't subject anyone to that again
<Nistur> cess11_: but yes, macOS is a pain in the neck
<Nistur> Regenaxer: I am making the assumption you're the (original?) dev for PicoLisp, am I correct?
grp has joined #picolisp
michelp has quit [Quit: ~]
michelp has joined #picolisp
<tankf33der> i've implement b2sum on picolisp on mmap
<tankf33der> works faster than b2sum from GNU :)
<Regenaxer> ret
<Regenaxer> Nistur cool! Good news
<Regenaxer> tankf33der, I think 'open' is fine
<Regenaxer> Nistur, (dev) correct
rob_w has quit [Quit: Leaving]
<tankf33der> 3GB iso file.
<Regenaxer> fast indeed!
<Regenaxer> using mmap()?
<tankf33der> yeap
<tankf33der> bitbucket link above
<tankf33der> but takes more memory.
<Nistur> Regenaxer: so you've been developing PicoLisp since I was 1 year old (According to wikipedia). Nice! :P I hope one of my projects at some point lives that long
<Regenaxer> :)
<Nistur> unfortunately what I do professionally is gamedev, which generally has a rather short shelflife
<Regenaxer> true
<viaken> I was only 4.
<viaken> That's seriously impressive, Regenaxer.
<viaken> Testament to the power of a dedicated BDFL.
<Regenaxer> It kind of ran by itself all the time. I implemented what I needed at each moment
* Nistur wonders if he can get lisp back into gamedev
<Nistur> *back into more mainstream gamedev
<Nistur> although, I think NaughtyDog did sneak some lisping into The Last of Us
<Nistur> so maybe I'm not best place to push anything :P
<Nistur> I have a friend what keeps wanting to/trying to make a 'spiritual successor' to Naughty Dog's previous lisp system... so far he has an empty github I think :P
<Regenaxer> ok, so he should populate it with pil code :)
<Nistur> what he's trying to reproduce is 'GOAL' "Game Oriented Assembly Lisp"... a native compiled lisp :P He keeps talking about bootstrapping it by building an interpreted lisp, and then writing a compiler in that
<Nistur> He can write a compiler in pil though :P
<tankf33der> or emulator
<Regenaxer> yes, but I think he wants the same language. And pil is not oriented to compilation
<Regenaxer> s/oriented/suitable
<Nistur> yeah in all his talks, he's mentioned using the same language throughout... although what language that is changes
<Regenaxer> hehe
<Nistur> Regenaxer: what is it about pil which makes it unsuitable?
<Regenaxer> The internal VM. A compiled Lisp must call the built-in functions from compiled code, but pil's interals are usable only in an interpreter
<Regenaxer> The built-in functions *are* the interpreter
<Regenaxer> That makes it simple and fast, but not compilable
<Regenaxer> simple and fast, but more importantly more flexible
<Nistur> but you could recreate those functions in a separate compiled runtime?
<Regenaxer> not really
<Nistur> I'm not suggesting you do this, I'm just pondering :)
<Regenaxer> yes, I know the question
<Regenaxer> it was my initial design decision
<Regenaxer> At that time I was working also on a compiled Lisp. But I'm convinced that a compiled Lisp is not a good idea
<Regenaxer> "recreate those functions" would mean to duplicate almost all
<Regenaxer> and still could not use them this way
<Nistur> fair enough
<Regenaxer> eg. consider how these functions do evaluate or not-evaluate individual arguments depending on the context
<Regenaxer> A compiler must decide this statically
<Regenaxer> So you get a different language
<Nistur> hmm
<Nistur> so you could make a pil-like language, but not pil itself... pil with caveats :P It sounds like an interesting (and possibly, if you say it's not a good idea, pointless) project regardless
<Regenaxer> exactly
<cess11_> Lisp is mainstream in game development.
<cess11_> King uses Clojure, for example.
<Nistur> oh? I wasn't aware. I did have an interview with them, but their programing test was to create bejeweled in C/C++ with no engine and I think I took too long, but I had a fulltime job at the time
<Regenaxer> Nistur, interesting yes, and perhaps not necessarily pointless. I just believe it will be a less powerful language
<Nistur> they're owned by Activision now though (who I ended up getting a job with so...)... so I'm wondering how long they will get to keep that. Activision lets studios keep autonomy, but also make it much easier to converge on their tech
<cess11_> As in a 10x10 matrix, coloured objects and some functions for shuffling it about?
<Nistur> kind of, but they wanted it shiny, with animations and stuff
<Nistur> they provided some basic art assets
<cess11_> So Glut too, then.
<Nistur> yeah, I think some very basic libraries we were allowed
<Nistur> weren
<Nistur> *weren't expected to write it totally from scratch
<Nistur> just couldn't use Unreal, Unity, Love2D, or something
<Regenaxer> The pil flight simulator does basic 3D animation stuff without any library
<Regenaxer> ie. any external lib, only @lib/z3d.l
<Nistur> how is the rendering done?
<Regenaxer> A Z-buffer algo
<Regenaxer> that's why "z"3d
<Nistur> aha
<Regenaxer> The simulator which uses it is in "misc/rcsim.l"
<Nistur> I'll take a look at it
<cess11_> You probably want to take a look at @lib/simul.l too.
<Regenaxer> There is also something in the wiki: https://picolisp.com/wiki/?rcsim
<Nistur> yep, I've seen that page :) I was most impressed
<Regenaxer> with a video :)
<Regenaxer> hmm, video does not work any more?
<Nistur> the video worked for me
<Nistur> I'll have to check it when I'm home as I don't have access to a x64 Linux box here
<Regenaxer> hmm, not in Chrome on Android it seems
<cess11_> Where should 'fkey be defined?
<Regenaxer> Could be in the main function
<Regenaxer> or load misc/fkey.l
<Regenaxer> misc/rcsim.l uses it too
<Regenaxer> Ahh!
<Regenaxer> You mean where it is defined? It is in the line editor
<Regenaxer> @lib/led.l or @lib/eled.l
reich has joined #picolisp
<Regenaxer> Now I went down to my cellar
<Regenaxer> Tried rcsim on the server on X11 :)
<Regenaxer> It needs to install libxext-dev
<Regenaxer> But now it works just fine
<Regenaxer> Cool, did not try it for years!!
<Nistur> :D
<cess11_> Aha, I'll take a look at those.
alexshendi has joined #picolisp
<Nistur> Regenaxer: I just noticed, another Bavarian!
<Regenaxer> Yes, at least most of my time :)
<Regenaxer> Originally Berlin
<Nistur> well, my family is originally from near Dusseldorf, but I was born near Munich
<Nistur> apparently when we moved to UK when I was younger, I had a particularly strong Bavarian accent
<Nistur> :P
<Regenaxer> hehe
<Regenaxer> Now you live in Munich again4
<Regenaxer> ?
<Nistur> no, I'm still in UK
<Regenaxer> ok
<Nistur> I just noticed the address on the bottom of one of the files :P
<Regenaxer> Langweid?
<Nistur> yep
<Nistur> almost got a job in SW Germany at Christmas
<Nistur> but unfortunately it fell through
<Regenaxer> :(
<Nistur> turns out I took a little too long to apply, and someone else applied directly (I'd been introduced via a recruiter) so they gave the job to that person, despite me apparently having one of the best programming test responses that they'd seen
<Nistur> using recruiters has benefits and obvious issues
<Regenaxer> T
<Nistur> Regenaxer: there's no version control repo or anything for picolisp, is there?
alexshendi has quit [Ping timeout: 260 seconds]
<Regenaxer> There was google code, and after it shut down some members here maintain one, m_mans and tankf33der for example
<Regenaxer> thx!
<tankf33der> up to date
<tankf33der> every several hours
<Nistur> danke schon
<Nistur> at some point I'll look into how to do accents on here. I've used my mbp for too long
alexshendi has joined #picolisp
orivej has joined #picolisp
<Nistur> Hmmm, if I'm exposing things from a native library, I'll wrap them up in functions obviously... is there a recomended way to scope/namespace them? just prepend the name of the function with a prefix or...?
alexshendi has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
alexshendi has joined #picolisp
<Nistur> Hmmm, I cannot seem to be able to use native... everything I try just gives me native -- Undefined
<Nistur> I think that's enough tinkering for one night
grp has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 256 seconds]
<cess11_> Nistur: No 'native in mini, I think.