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
_whitelogger has joined #picolisp
rob_w_ has joined #picolisp
rob_w has quit [Ping timeout: 258 seconds]
broono has joined #picolisp
broono has quit [Quit: Leaving]
_whitelogger has joined #picolisp
orivej has quit [Ping timeout: 248 seconds]
_whitelogger has joined #picolisp
rob_w_ has quit [Quit: Leaving]
freemint has joined #picolisp
<freemint> Hi
<DKordic> Hi freemint.
<freemint> Do you happen to know how you make picolisp a default shell for one user?
orivej has joined #picolisp
<DKordic> freemint: Does `--shell' Option in (man 8 "usermod") help?
<DKordic> IDK how to use any Lisp as a Shell. Do You have something to share?
<freemint> An idea
<freemint> I may get an server soon and on that server i will host a text-based game. My idea is that allow user to join via ssh as the game user and they get dropped in custom repl which is a picolisp programm
<DKordic> Interesting. https://en.wikipedia.org/wiki/MOO ?
<freemint> Still
<freemint> yes
<freemint> I have no solution for doing timesharing in lisp
aw- has joined #picolisp
<aw-> hi all
<aw-> curious why there is @xm.l and @xml.l -
<aw-> err @lib/xm.l and @lib/xml.l
<Regenaxer> Hi aw-! @lib/xm.l is a reduced functionality
<Regenaxer> I never needed the full version
<Regenaxer> Normal XML file parsing was always possible with @lib/xm.l
<Regenaxer> @lib/xml.l is from Tomas Hlavaty who thought it necessary
<Regenaxer> Things like embedded comments
<freemint> Regenaxer: I am thing about my Moo at the moment. How would you have multiple user execute arbritary code on a shared database so that performance does not suffer whena few programms are stuck in infinte loops?
<Regenaxer> Look at what is there. Lots of pil database programs
<Regenaxer> oops
<Regenaxer> anyway
<Regenaxer> Pil is all about that
<Regenaxer> You should really study more what is there already, before starting fancy things
<aw-> oh I see
<aw-> Regenaxer: thanks!
<freemint> Was that directed at me or at aw-?
<Regenaxer> at freemint
<Regenaxer> aw- did his homework :)
<freemint> :(
<freemint> I read everything on the wiki about databases
orivej has quit [Ping timeout: 240 seconds]
<freemint> Who was interested in Moving Object Databases (MOD)?
<Regenaxer> freemint, good. So you know that each user has her own session in its own process, so an infinite loop does not harm (as long as there are enough CPUs to handle the load)
<freemint> Yes
<cess11> I've used both xm.l and xml.l but usually only xm.l is needed.
<freemint> I am still unsure about the combination of locks and infinite loops
<cess11> MODB has quite big extraction and military industry interests attached to it so that's probably where one ends up with a product like that.
<Regenaxer> Locks are set in a DB application only at very specific moments
<Regenaxer> freemint, I would recommend that you just go ahead, build a model etc, before worrying too much
<cess11> Yeah.
<freemint> Is " It does, however, not synchronize the state of objects cached on different processes, and may in particular result in inconsistencies, if a transaction changes a set of interdependent objects, and other processes have some of these objects cached and some not." a problem in praxis?
<cess11> Not really.
<freemint> how often does that happen?
<Regenaxer> In which context is the above sentence?
<cess11> In practice it is uncommon to use such intertwined models, I think.
<Regenaxer> Usually objects *are* synchronized in the processes
<Regenaxer> I have never fully read that article, sorry
<cess11> I think it is from unified development or some other tutorial document. For a single process a cached state in an object '{23456} might look different than it does to other processes, that only has access to the earlier state read in from disc
<Regenaxer> I think this part is written a bit unlucky
<freemint> Ok
<Regenaxer> in the following paragraph he proceeds to explain 'dbSync' etc
<freemint> yes he/she does
<freemint> Are there any "she"s in the pil community?
<Regenaxer> Yes
<cess11> The mailing list has a female engineer, I think.
<Regenaxer> I know at least one, from India, so it is not obvious from we name for me
<cess11> Lindsay or somesuch. At least she seems to use pil for technical applications in an academic context.
<Regenaxer> The above article is from Erik Gustafson
<cess11> Male, probably nordic name.
<cess11> Anyhow, locking and db corruption from caching isn't much of a practical issue, more a theoretical one.
<Regenaxer> I think Eric wanted to stress how important correct usage of (dbSync) is
<cess11> '(commit 'upd) solves these inconsistencies between processes, usually.
<Regenaxer> T
<freemint> ok that makes me less woried
<cess11> Don't worry, hack away and see what happens.
<Regenaxer> The one I meant was Nehal Singhal
<freemint> I think about creating an user with picolisp + my_game.l as default shell and people login into the game via sshing in to that user.
<cess11> A segfault a day keeps Java away.
<freemint> :D
<Regenaxer> Don't know if names reflect the gender in India too
<Regenaxer> cess11, haha
<Regenaxer> May I twitter that?
<cess11> Of course.
<Regenaxer> I cite your nick, all right?
<cess11> Sure.
<Regenaxer> :)
<freemint> That approach results in the fact that each user process is not a child process.
<cess11> It will have some nasty security implications, opening shells for the general public like that.
<Regenaxer> yes, but you can start the server by itself, and have users connect with 'psh' or something similar
<Regenaxer> cess11, right
<Regenaxer> I would go with a browser gui
<freemint> cess11: Why?
<Regenaxer> https access
<Regenaxer> psh or some other shell gives lot of power to the user
<cess11> Because you will have to design the OS or keep it in extremely virtual and fleeting instances.
<freemint> Do not understand
<cess11> A basic Linux shell is all that's needed to get root, usually.
<freemint> you do not get a linux shell, you get a game shell
<Regenaxer> ok, a well-defined text interface
<freemint> the default shell is picolisp + mygame which has it's own repl and removes all picolisp comands to the user by default
<cess11> Sounded to me like leaving authentication and tunneling to some SSH lib, which sounds like the OS in practice.
<freemint> I am not carring about authentification
<cess11> So people connecting are really authenticating against the OS and OpenSSH, not your application, instead it starts after login.
<freemint> wrong
<freemint> there is one user called the game
<freemint> ssh game@server
<cess11> In the OS?
<freemint> yes
<Regenaxer> You can simply put the name of a start pil script into /etc/passwd
<freemint> you get prompted with the game repl
<Regenaxer> And this should not be a REPL
<Regenaxer> just a loop accepting game commands
<cess11> Then this is a system user that could be used for privilege escalation and you'll need to put a lot of effort into controlling what it can do and how.
<freemint> Ok do you have any better idea which meets my requirements?
<cess11> Set up a proxy, expose a text interface there, don't allow players to use system accounts on the server.
<freemint> I want the user to have a pure text interface usuable via any console which communicates encryptedly with my server (no player passwors in the clear) without the user having to install an dedicated client
<Regenaxer> The /etc/password way is optimal. I use it often to start read-only tmux sessions for remote people
<cess11> While working on the engine I'd probably just set up TCP or UDP on a port and filter remote traffic on it, then solve the proxying once I know how the engine will work.
<cess11> Most likely it will be best to put a SSL on it, like HTTPS or similar. nginx or httpGate would be good, I think.
<cess11> It will take more effort to develop a system for interpreting commands and shuffling game state than exposing it over a network.
<freemint> ... i do not understand what cess11 suggest
<cess11> Don't embed it into the server OS, keep it a locked down userland application with its own auth.
<cess11> Outsource tunneling to nginx or httpGate rather than using a clumsier system like OpenSSH, which really is for system administration.
<freemint> But i want it to be a plain-text protocol encrypted over some channel
<cess11> And figuring out how to create, save and presenting interpretations of game data will probably take a lot more time than setting up a terminal like interface.
<Regenaxer> indeed
<cess11> Sure. Use a proxy software like nginx or httpGate, map a port to the application and you're done.
<Regenaxer> Still, I would users let ssh to a script which in turn sends text commands to the server on localhost
<Regenaxer> the server makes sure to accept only local connections similar to psh
<Regenaxer> and accepts *only* commands for the game, no repl or so
<freemint> yes
<freemint> but if something accepts commands, does evaluation and print a result and then loops it is a repl
<Regenaxer> The ssh user is without password
<Regenaxer> the game server authenticates each session
<freemint> yes
<Regenaxer> no evaluation
<Regenaxer> Same issue like a browser GUI
<Regenaxer> there is not enough power to the user
<Regenaxer> All logic happens in the server
<freemint> yes
<freemint> Later i would distrubte the game
<Regenaxer> ok
<freemint> that would enable users to run their own local server
<Regenaxer> I would start with a browser gui anyway, it is the simplst
<freemint> but in the beginning i want to use an easier model to develop for
<Regenaxer> can be text fields in the browser
<freemint> i could just execute the game client in picolisp
<Regenaxer> T
<freemint> i get the game evaluation loop
<freemint> it talks with the database
<Regenaxer> you dont need an explicit loop
<Regenaxer> it is in the gui
<Regenaxer> just display the state of relevant objects in the browser
<Regenaxer> and modify them with commands
<cess11> Defining classes and messages for them is probably easier.
<Regenaxer> texts, buttons, checkboxes etc
<Regenaxer> cess11, right
<freemint> I do not want a gui (for now)
<Regenaxer> You can use +UB trees to track positions of objects
<Regenaxer> text gui
<Regenaxer> The point is that all you need is there already
<Regenaxer> text, but you can also use the open streetmap libs to show where each object is for example
<cess11> You'll need some UI:s under development. Instead of starting off writing one or more you could start with designing the game engine and keep the testing on a simple web GUI. Then when you know how your engine will work you'll know better how to put terminal menus and whatnot on top of it.
<Regenaxer> yes
<Regenaxer> Just debug the game in your own repl
<Regenaxer> (msg> Obj)
<Regenaxer> etc
<Regenaxer> Later worry how to present it to users
<cess11> It doesn't matter if you present on a DOM or a client application you wrote as long as the engine is written in a sound, modular style.
<Regenaxer> how they access it
<cess11> And deciding on how to track, mutate and save states in the game world will use most of your resources, I think.
<freemint> Does the +UB tree takes care of moving objects too?
<Regenaxer> not "take care"
<Regenaxer> it is an index
<freemint> ok
<Regenaxer> so if it moves, the index changes
<freemint> so the server has to that for it move continously
<freemint> *to do
<cess11> Ah, right, it's a multidimensional index class.
<Regenaxer> Yes, one process could run and move some objects all the tinme
<Regenaxer> Multi-dim, and you can 'collect' areas
<Regenaxer> or select
<freemint> read the doc
<Regenaxer> so find all objects which are near you
<Regenaxer> The OSM demo uses it heavily
<freemint> So if the users add objects which act on their own the server needs to execute their code
<Regenaxer> to display a view
<Regenaxer> yes
<Regenaxer> The code will be stored with the objects of course
<freemint> how do i prevent the server to die on infiniti loops
<cess11> I see.
<cess11> Extremely useful.
<Regenaxer> freemint, the serve should never die. It does nothing except starting and synchronizing sessions
<cess11> By defining exits from them.
<Regenaxer> that's critical
<cess11> Right, the loop will be in the client probably.
<Regenaxer> The "mover" is one or many child proceses too
<Regenaxer> not user clients probably
<freemint> cess11: the loop can not be client
<Regenaxer> running independent from logged-in users
<freemint> ok
<Regenaxer> freemint, there is no loop
<cess11> Ah.
<freemint> there is no spoon
<Regenaxer> well, there are loops in the processes
<Regenaxer> 'task's usually
<Regenaxer> so the loop itself is in pil
<freemint> I see there is no central game loop
<Regenaxer> right
<freemint> there are interacting parts sending messages
<freemint> How would i recover if some process dies for some reason?
<cess11> Persistent data will be around when that user reconnects.
<Regenaxer> This will happen often, eg. if a user loses connection
<Regenaxer> no problem
<freemint> and a server moving objects process?
<Regenaxer> Perhaps his objects freeze, and must be cleaned up
<aw-> Regenaxer: quick question: would you consider (text) on a large file "slow"? if so, recommend an another approach?
<Regenaxer> I think (text) is pretty efficient
<aw-> ok thanks!
<Regenaxer> Perhaps better than a long (pack ...)
<cess11> I think OS file I/O will be the bottleneck with both pack and text in reading it into pil.
<cess11> *' x 2
<Regenaxer> T
<Regenaxer> :)
<freemint> Let me reformulate. Can i later extend my system so that faulty parts are restarted, code that always fails is detected?
<cess11> Yes.
<Regenaxer> watchdogs for example
<cess11> Like '+ when you start pil, it injects into functions and allow for more control over their execution.
<freemint> huh? tell me more
<Regenaxer> '+ means debug mode
<Regenaxer> like
<freemint> about watchdogs
<cess11> The debug mode in the REPL. I think the file is @lib/dbg.l. You could do something similar, but in object messages.
<Regenaxer> check @bin/watchdog
<freemint> there is nothing on the wiki about them
<Regenaxer> different purpose though
<Regenaxer> A watchdog keeps track of something, and does something if something goes wrong ;)
<Regenaxer> many somethings
<freemint> and who watches the watchdogs?
<cess11> Who curries the curried?
<Regenaxer> The meta-watchdogs
<Regenaxer> can be circular
<cess11> What watches what could be decided by state in the VM.
<freemint> Is it preferable to have 3 watchdogs watching eachother and the system or should you have a meta watchdog?
<cess11> Depends.
<cess11> A small system, won't matter much.
<freemint> it will grow i hope
<Regenaxer> There is always something else which was not anticipated
<cess11> Do what's fast and reliable. If it's big you'll need to test what approach uses the least amount of resources.
<Regenaxer> Better have the watchdogs on remote machines hen
<Regenaxer> then
<Regenaxer> in case the local one crashes
<freemint> that will happen when i distribute the DB
<Regenaxer> T
<Regenaxer> But I would worry about all that later!
<freemint> Oh and they should send email when a server is physiccaly down
<Regenaxer> This is what bin/watchdog does
<cess11> Sounds like pingdom or somesuch would be a good tool for that.
<Regenaxer> I get a mail every few days
<cess11> Right.
<Regenaxer> Usually only a report running too long
<Regenaxer> recovers by itself
<Regenaxer> But I log in an strace the process immediately
<freemint> Regenaxer: you worked with distributed pil DBs. Have you also found away to have somuch redundancy than N server can fail permanently without the application haing any problems?
<Regenaxer> In that case there was no redundancy
<freemint> ok
<freemint> How would you go about it?
<Regenaxer> I one failed, whe data would arrive later when it was up again
<Regenaxer> did not think about it yet
<Regenaxer> I *do* have redundancy in all production apps
<Regenaxer> using ssl -> replicate
<freemint> ah
<Regenaxer> so that always a backup server exists
<Regenaxer> Can be switched to if the current server fails
<Regenaxer> The mirror has all changes till the last few seconds
<freemint> Does the backup server when he becomes active server create another backup server?
<Regenaxer> no
<Regenaxer> could be done
<Regenaxer> the mirror could mirror itself
<freemint> Gow to deal with Ne-splits?
<Regenaxer> but must be set up beforehand
<freemint> *how to deal with net-splits
<Regenaxer> Ne-splits?
<Regenaxer> ah
<Regenaxer> no idea
<Regenaxer> users must switch to the new ip address
<Regenaxer> of the mirror
<Regenaxer> ok
<Regenaxer> sorry
<Regenaxer> have to get things done
<Regenaxer> you find out! :)
<freemint> Ok
<freemint> i will have to get things in my stomach
<Regenaxer> good idea
<Regenaxer> afp
<cess11> Redundancy decisions won't makemuch sense until there's a system to replicate or safeguard.
<cess11> My workflow starts in the REPL. Depending on what I need done it will start in a few different ways, usually either '(make (in "File" ... or '(class +ObjectType ... (dm operation
<cess11> Redundancy and session handling can always be added as an abstraction layer if it isn't easy to integrate, so these things can be left out until later.
<cess11> *make much
<cess11> It's a good idea to define a quick and dirty document model and start taking notes in the REPL.
<cess11> Then '(mapcar show (head 10 (collect 'dat '+MyNote] will show what has or needs to be done next in the project.
<cess11> It will be easy to extend this model with relations to other types of objects in the project, like '+Link to '+Any acting like hypertext to anything from user profiles to configuration objects.
<freemint> sounds like an lispy work flow
<cess11> Or Smalltalk:y, perhaps.
<cess11> Squeaky, maybe.
<cess11> It's a convenient way to keep track of things. The object db is sort of like an autosave function that substitutes for the object explorer windows of bigger Smalltalk or Lisp environments.
tonton has joined #picolisp
<freemint> cess11: Regenaxer The literature on distributed systems says : You can not provide the same service 2 times (netsplit) if you want consistency in the end in the general case. So all the protocols are made to deice unpon a new leader with >50% of the total vote
aw- has quit [Quit: Leaving.]
<cess11> It depends. What is consistency?
<cess11> What gets persistent and not seems like an easier problem to solve.
orivej has joined #picolisp
<rick42> herro
<rick42> sorry to be away so long
<rick42> i hope everyone is well
<rick42> i forgive you, Regenaxer. lol! | 2017-10-28 <Regenaxer> on the other hand, the greek have not a single word for "receipt" haha
<Regenaxer> Thanks rick42!! And welcome back! :)
<rick42> :)
<Regenaxer> yeah, you are half-greek
<rick42> on my mother's side
<rick42> my family name is Hanson, and sometimes I joke that it was shortened when my family came over, it used to be Hansonopoulos. :)
<rick42> some people believed me :)
<Regenaxer> haha!
<Regenaxer> The other half is swedish, right?
<rick42> almost. norwegian
<Regenaxer> ah
<rick42> and german. my father's mother's family name was Pfrimmer
<Regenaxer> wow
<rick42> being both northern and southern europoean is quite confusing
<rick42> :)
<Regenaxer> A good mix I think
<Regenaxer> big gene pool :)
<rick42> hehehe
tonton has quit [Ping timeout: 240 seconds]
tonton has joined #picolisp
freemint has quit [Ping timeout: 260 seconds]
DKordic has quit [Ping timeout: 240 seconds]
alexshendi has joined #picolisp
alexshendi_ has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
alexshendi_ has quit [Ping timeout: 248 seconds]
orivej has quit [Ping timeout: 260 seconds]
orivej has joined #picolisp