00:53:30
##forth
<veltas>
crc: Well I think redraw() is the slow bit (although some lag is caused by waiting for KEYUP for input)
00:53:44
##forth
<veltas>
But I too am struggling to sort out these performance issues
00:54:08
##forth
<veltas>
I tried rewriting with SDL_Surface because that's supposedly better for pixel performance
00:54:51
##forth
<veltas>
It seems like there's more than a couple issues with SDL's bitmap performance, and the docs aren't a lot of help trying to do the right thing
00:55:22
##forth
<veltas>
Ironically 3D is really easy, but 2D pixel stuff is really slow
00:56:39
##forth
<veltas>
It could be forced VSYNC, in which case redraw() might do better being limited to once a frame
05:03:59
##forth
<MrMobius>
are you writing directly to memory with a pointer?
05:04:26
##forth
<MrMobius>
I think I ended up using a texture for this. there are multiple ways to so it and a huge speed difference between them
06:36:52
##forth
<ghodawalaaman>
!gforth 1 1 + .
06:36:52
##forth
<gforth_eval_bot>
2
06:37:19
##forth
<ghodawalaaman>
crc: I have made this simple bot, however it's still in work in progress
06:37:31
##forth
<ghodawalaaman>
It's just a illustration of how the bot will work
06:38:00
##forth
<ghodawalaaman>
you can play with the bot :)
06:38:44
##forth
<ghodawalaaman>
!gforth : SQUARE dup * ; 5 SQUARE .
06:38:44
##forth
<gforth_eval_bot>
25
06:38:53
##forth
<ghodawalaaman>
!gforth : SQUARE dup * ; 10 SQUARE .
06:38:54
##forth
<gforth_eval_bot>
100
06:39:35
##forth
<ghodawalaaman>
the bot is running inside a docker container
08:50:52
##forth
<veltas>
MrMobius: If you've got any code for this somewhere and could dig it out it would be appreciated
08:51:21
##forth
<veltas>
But I do suspect one issue is that redraw() which converts the VRAM into a surface or texture and then copies it to screen; is being called more often than it needs to be
08:51:44
##forth
<veltas>
Once for every 'update', like every time a character is drawn, rather than once per display refresh
08:53:28
##forth
<veltas>
And so there may be some unrequested vsync fuckery, or it could simply be a lot faster to just replace refresh() with refresh_next=1 and put refresh() in the main loop to only occur if (refresh_next && timer() > REFRESH_PERIOD)
08:55:50
##forth
<veltas>
!gforth s" ls /" system
08:55:50
##forth
<gforth_eval_bot>
bin
08:55:56
##forth
<veltas>
!gforth bye
08:56:03
##forth
<veltas>
!gforth 5 .
08:56:04
##forth
<gforth_eval_bot>
5
08:56:29
##forth
<ghodawalaaman>
veltas: it's running inside docker container
08:56:42
##forth
<veltas>
Yeah I saw that
08:57:10
##forth
<ghodawalaaman>
it's only priting the first line of the output
08:57:15
##forth
<ghodawalaaman>
I have to make some changes in the code
08:57:33
##forth
<ghodawalaaman>
the bot is currently in alpha, I just wanted people to experiment with it
08:57:53
##forth
<veltas>
Is the network part running outside of docker?
08:58:37
##forth
<veltas>
!gforth s" which gforth" system
08:58:38
##forth
<gforth_eval_bot>
/usr/bin/gforth
08:58:55
##forth
<ghodawalaaman>
veltas: wait I forgot to disable internet access of the docker
08:59:11
##forth
<veltas>
Might want to do that
09:00:05
##forth
<veltas>
I'm not actually going to try and pwn you, but whenever someone puts a bot in IRC I will try and discover the issues with it because they quite often have huge security holes
09:00:36
##forth
<ferret>
veltas: i am the most unhackable person on earth
09:00:54
##forth
<ferret>
thanks to XEN lol
09:05:49
##forth
<veltas>
!gforth s" ls / | fold -w" system
09:12:13
##forth
<veltas>
What's unfortunate is that the VRAM for ilo-x is *almost* an SDL bitmap format, it's just going to require byteswapping because it's most-significant-bit and we can't assume a big endian platform
09:12:40
##forth
<veltas>
But I don't think the byteswapping and blitting I'm doing slows it down much at all
09:13:18
##forth
* ghodawalaaman is back :)
09:13:51
##forth
<ghodawalaaman>
veltas: yes, my friend found a lot of issues with it and we fixed it
09:13:57
##forth
<veltas>
Nice
09:14:17
##forth
<veltas>
!gforth s" ls / | tr '\n' ''" system
09:14:40
##forth
<veltas>
Are pipes just not allowed or am I bad at this
09:14:41
##forth
<ghodawalaaman>
!gforth s" ls " system
09:15:04
##forth
<ghodawalaaman>
tr: when not truncating set1, string2 must be non-empty
09:15:04
##forth
<veltas>
Could be both
09:15:11
##forth
<ghodawalaaman>
Try 'fold --help' for more information.
09:15:17
##forth
<ghodawalaaman>
this is the error log I see
09:15:21
##forth
<veltas>
!gforth s" ls / | tr '\n' ' '" system
09:15:21
##forth
<gforth_eval_bot>
bi
09:15:35
##forth
<veltas>
!gforth s" ls / | tr '\n' ' '" system
09:15:36
##forth
<gforth_eval_bot>
bi
09:15:40
##forth
<vms14>
:0 a forth bot
09:15:51
##forth
<vms14>
!gforth ." :D" cr
09:15:52
##forth
<gforth_eval_bot>
:D
09:16:15
##forth
<veltas>
!gforth s" mount" system
09:16:15
##forth
<gforth_eval_bot>
overlay on / type overlay (rw,relatime,lowerdir=/var/lib/docker/overlay2/l/4LWISPM42NNOCWYCC7IUF7ZYPY:/var/lib/docker/overlay2/l/XAVLZGBSSYTD6WFZY742GETCOZ:/var/lib/docker/overlay2/l/S2ZTY6O5GF6FT3UCBWZS3VQ44Z:/var/lib/docker/overlay2/l/WIBSR5UVBO4VZ4VNZV4YYZ3FG4:/var/lib/docker/overlay2/l/KSLMI4CNZO2BCOA3HPANSOQU63:/var/lib/docker/overlay2/l/LSEW6SGPU75NJXWBP7C3HT3NCS,upperdir=/var/lib/docker/overlay2/0a8c5a43adb
09:16:31
##forth
<vms14>
oh it can flood
09:16:44
##forth
<ghodawalaaman>
vms14: no it only prints the first line of the output
09:16:47
##forth
<vms14>
!gforth cr cr cr
09:17:01
##forth
<xn435>
!gforth s" gforth" environment? [IF] type [THEN]
09:17:02
##forth
<gforth_eval_bot>
0.7.3
09:17:03
##forth
<vms14>
what if the first line is large
09:17:26
##forth
<veltas>
Then it prints under 512 bytes
09:17:38
##forth
<veltas>
It cut it off earlier
09:17:38
##forth
<vms14>
then it's fine
09:18:29
##forth
<vms14>
ghodawalaaman it's cool that you made this bot
09:18:47
##forth
<ghodawalaaman>
Thank you :3
09:19:04
##forth
<vms14>
it will be handy when discussing anything about forth
09:19:08
##forth
<veltas>
Yes it is great ghodawalaaman, this will be very useful if it stays up and doesn't get you hacked
09:19:41
##forth
<xn435>
I'm afraid to try [BEGIN] ." asdf" [AGAIN]
09:19:47
##forth
<ghodawalaaman>
there is currently a vulnerability that let's you execute arbitary IRC command from the bot
09:20:06
##forth
<ghodawalaaman>
xn435: the command will timeout
09:20:08
##forth
<veltas>
You might want to ask pragma in #c what he did to secure his compiler bots
09:20:29
##forth
<vms14>
pragma is a perl dev
09:20:31
##forth
<xn435>
!gforth ." /nickserv"
09:20:31
##forth
<gforth_eval_bot>
/nickserv
09:20:54
##forth
<ghodawalaaman>
xn435: the second line will be executed as an IRC command
09:21:02
##forth
<ghodawalaaman>
don't do something malicious with it please
09:21:06
##forth
<xn435>
!gforth cr ." /nickserv"
09:21:09
##forth
<ghodawalaaman>
veltas: I will ask him thank you!
09:21:21
##forth
<xn435>
nah I don't intend to :)
09:21:23
##forth
<xn435>
nice bot
09:21:35
##forth
<ghodawalaaman>
:3
09:22:30
##forth
<veltas>
vms14: He's got it running GCC so it's definitely sandboxed
09:22:44
##forth
<veltas>
And given what #c is like I'm assuming it's quite secure by now
09:22:59
##forth
<vms14>
the perlbot is also sandboxed
09:23:18
##forth
<vms14>
you cannot mess with it
09:24:35
##forth
<vms14>
I made one for my toy lang once, but you could rm -rf my system xd
09:25:41
##forth
<vms14>
didn't bother to prevent anything, but in my case I could remove harmful words
09:27:54
##forth
<vms14>
ghodawalaaman I assume you made a restricted user for the bot
09:28:45
##forth
<ghodawalaaman>
right now I haven't, I have to fix a lot of issue/vulnerability yet, but thank you for the suggesting
09:28:56
##forth
<ghodawalaaman>
right now it's more like proof of concept type bot
09:29:30
##forth
<vms14>
this channel is small so there is less chance that someone will mess with it
09:29:50
##forth
<vms14>
but it can happen anyways and you should be aware
09:30:55
##forth
<vms14>
for now you could try to fix the most dangerous problems until you learn how to improve it
09:31:23
##forth
<ghodawalaaman>
yeah, I will make it more usable and secure!
09:31:29
##forth
<vms14>
if you make a user you can mess with the path env variable so it won't find the commands like ls
09:31:38
##forth
<ghodawalaaman>
hopefully till weekend I will have a good version of the bot
09:31:43
##forth
<vms14>
still io is a problem
09:32:32
##forth
<ghodawalaaman>
vms14: changing path variable is a neat idea
09:32:42
##forth
<vms14>
but if the user has no write permissions then it's fine
09:33:02
##forth
<ghodawalaaman>
yeah
09:33:57
##forth
<vms14>
you can also redefine some forth words
09:34:58
##forth
<vms14>
!gforth : system ." :D" cr ;
09:35:28
##forth
<xn435>
!gforth s" unix/socket.fs" included 2048 BUFFER: buf s" example.com" 80 open-socket dup s\" GET /\r\n\r\n" rot write-socket 500 ms dup buf 2048 read-socket type close-socket
09:35:29
##forth
<vms14>
!gforth s" ls" system
09:35:50
##forth
<vms14>
oh forgot the bot was offline lol
09:38:19
##forth
<ghodawalaaman>
xn435: I forgot to disable interenet of the docker container
09:39:04
##forth
<ghodawalaaman>
internet*
09:39:17
##forth
<xn435>
yeah that could be an issue
09:39:22
##forth
<ghodawalaaman>
vms14: I will connect it again after I fix the issues :)
09:41:53
##forth
<xn435>
I'm wondering if creating a custom wordlist and limiting memory reads and writes would be enough to secure it
09:42:21
##forth
<xn435>
that is, only allowing to write and read from specific ranges
09:43:07
##forth
<vms14>
it also has to prevent infinite loops, like some kind of watcher that will kill the process after a timeout
09:43:29
##forth
<xn435>
yeah he mentioned that it would time out
09:43:56
##forth
<vms14>
but there is always someone smarter that finds a way
09:54:32
##forth
<veltas>
I had considered doing a Forth VM specifically designed to be run as a sandbox, e.g. for IRC or whatever situation it needed to be safe
09:54:44
##forth
<veltas>
You can adapt existing VM's, e.g. ilo, and make them safe
09:55:01
##forth
<veltas>
ilo is already nearly there, it just needs memory bounds checking really
09:55:21
##forth
<veltas>
So doing a sandboxed konilo bot would be quite easy
09:56:23
##forth
<veltas>
But we need an ANS Forth, Forth 2012 etc because most of our questions are about classic/standard forths
09:57:13
##forth
<veltas>
The other idea was to treat the VM like a sort of old mainframe, and allow people access to private storage as well as shared storage for communicating with each other
09:57:19
##forth
<veltas>
And sharing programs in blocks
09:57:55
##forth
<veltas>
People could define their own command aliases in blocks
09:58:24
##forth
<veltas>
There's a ton of fun stuff that can be done here, we forget sometimes that the internet is quite fun
10:01:58
##forth
<pgimeno>
and on top of that there's securing the interpreter itself of course
10:03:12
##forth
<pgimeno>
well that's mainly for parsing links
10:07:35
##forth
<pgimeno>
but if it's going to output user-generated text, it may give you ideas of things to prevent (like certain chars)
13:22:34
##forth
<veltas>
MrMobius: Try 4 is actually what crc was using, except for STREAMING option which I tried and it made no difference
13:22:44
##forth
<veltas>
I wonder if there's a difference in drivers affecting things here
13:24:45
##forth
<veltas>
Assuming try 4 is the source shown
13:25:03
##forth
<MrMobius>
yes
13:25:17
##forth
<MrMobius>
see line 27
13:26:47
##forth
<veltas>
I'll try delaying to refresh rate tonight probably, with the streaming texture
13:27:08
##forth
<veltas>
And if that works well enough I'll fix the input lag too
13:27:19
##forth
<veltas>
Or anyone else is welcome to give it a go
13:28:14
##forth
<MrMobius>
what's the issue?
13:31:16
##forth
<veltas>
ilo-sdl is slow basically
13:32:05
##forth
<veltas>
You can try building it and run, and stuff like `catalogue` prints very slowly
13:33:03
##forth
<ghodawalaaman>
pgimeno: Thank you for the link!
15:22:57
##forth
<ghodawalaaman>
I have added the bot again
15:23:25
##forth
<ghodawalaaman>
however It still has some vulnerability which I couldn't fix
15:23:59
##forth
<ghodawalaaman>
gforth_eval_bot will work fine unless someone actually trying to crash the bot
15:24:19
##forth
<ghodawalaaman>
!gforth 1 1 cr . cr .
15:24:28
##forth
<ghodawalaaman>
!gforth 1 1 +
15:24:49
##forth
<ghodawalaaman>
!gforth 1 1 +
15:25:26
##forth
<ghodawalaaman>
!gforth 1 1 + .
15:25:27
##forth
<gforth_eval_bot>
2
15:25:40
##forth
<ghodawalaaman>
!gforth 1 1 . cr .
15:25:41
##forth
<gforth_eval_bot>
1
15:25:51
##forth
<ghodawalaaman>
It also have support for multiline output now
15:26:50
##forth
<ghodawalaaman>
s/have/has
15:42:00
##forth
<dzho>
!gforth 42 EMIT
15:42:00
##forth
<gforth_eval_bot>
*
15:42:26
##forth
<dzho>
!gforth : tostar 42 emit ; tostar
15:42:27
##forth
<gforth_eval_bot>
*
15:42:39
##forth
<dzho>
!gforth tostar
15:42:52
##forth
<dzho>
sorry
15:43:15
##forth
<ghodawalaaman>
dzho: it's ok, you can test it now :)
15:43:51
##forth
<ghodawalaaman>
!gforth tostar
15:43:59
##forth
<ghodawalaaman>
!gforth 1 1 + .
15:44:14
##forth
<dzho>
!gforth : tostar 42 emit ; 91 emit tostar
15:44:19
##forth
<dzho>
derp
15:44:26
##forth
<ghodawalaaman>
I don't know why it's disconnecting
15:44:31
##forth
<ghodawalaaman>
smh
15:44:35
##forth
<dzho>
!gforth 91 emit
15:44:35
##forth
<gforth_eval_bot>
[
15:44:50
##forth
<dzho>
!gforth 89 emit
15:44:51
##forth
<gforth_eval_bot>
Y
15:44:59
##forth
<dzho>
!gforth : tostar 42 emit ; 89 emit tostar
15:45:00
##forth
<gforth_eval_bot>
Y*
15:45:11
##forth
<dzho>
ok maybe I'm just picking horrible example characters
16:21:20
##forth
<ghodawalaaman>
!gforth : x 1000 0 DO I . LOOP ; x
16:21:21
##forth
<gforth_eval_bot>
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
16:21:37
##forth
<ghodawalaaman>
all the vulnerabilities are fixed now
16:22:08
##forth
<ghodawalaaman>
I will wait 1 day, if no bugs are discovered I will host it on my VPS
16:30:53
##forth
<user51>
!gforth : r recurse ; r
16:30:53
##forth
<ghodawalaaman>
*OS command line*:-1: Return stack overflow
16:31:04
##forth
<ghodawalaaman>
maybe I should print the error messages too
16:31:04
##forth
<user51>
that's the nice version.. now for the evil version
16:31:11
##forth
<user51>
: r rdrop recurse ; r
16:31:18
##forth
<user51>
!gforth : r rdrop recurse ; r
16:32:29
##forth
<ghodawalaaman>
user51: the bot is still fine
16:32:57
##forth
<ghodawalaaman>
!gforth : R dup * ; 1223 R
16:33:07
##forth
<user51>
ghodawalaaman: well done. :)
16:33:21
##forth
<ghodawalaaman>
!gforth : R dup * ; 1223 R .
16:33:22
##forth
<gforth_eval_bot>
1495729
16:33:26
##forth
<user51>
!gforth rdrop
16:33:55
##forth
<ghodawalaaman>
the bot won't remeber any WORD definitions
16:34:11
##forth
<ghodawalaaman>
bot launches a new instance of gforth everytime
16:35:40
##forth
<veltas>
"All the vulnerabilities are fixed now" bold claim lol
16:35:52
##forth
<veltas>
Nice job ghodawalaaman
16:37:00
##forth
<user51>
ghodawalaaman: maybe it should accept PMs
16:37:10
##forth
<user51>
also, my final test
16:37:18
##forth
<user51>
!gforth words
16:38:11
##forth
<veltas>
!gforth : x 0 0 do i . loop ; x
16:38:16
##forth
<gforth_eval_bot>
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
16:46:38
##forth
<ghodawalaaman>
veltas: Thank you!
16:47:13
##forth
<ghodawalaaman>
user51: yeah, maybe but coding that is tricky
21:32:17
##forth
<KipIngram>
Well, I got kind of revved up on the idea of a Forth processor again yesterday and today. Had a couple of thoughts about it that were new for me, and it perked my interest again. Been eyeing my Artix A7 kit. :-)
22:07:52
##forth
<veltas>
For whatever reason this patch has vastly improved performance for me, so hopefully that helps you too
22:08:04
##forth
<veltas>
I changed to STREAMING in there but not sure if that even makes any difference
22:09:21
##forth
<veltas>
Well it probably makes difference in certain scenarios, but I don't think that was the limiting factor
22:49:09
##forth
<veltas>
If you just OR SDL_WINDOW_SHOWN with SDL_WINDOW_RESIZABLE then the window is resizable
22:49:23
##forth
<veltas>
And just do_redraw=1 on any SDL_WINDOWEVENT
22:49:49
##forth
<veltas>
So that it actually redraws if you unhide or resize the window
22:50:00
##forth
<vms14>
veltas what are you doing with sdl?
22:50:06
##forth
<vms14>
some app or a game
22:50:51
##forth
<veltas>
What am I not doing with it
22:50:51
##forth
<vms14>
:0
22:51:10
##forth
<vms14>
I only played a bit with xlib, but it was very cool
22:51:21
##forth
<vms14>
I made a charmander walking on the screen with xshape
22:51:30
##forth
<veltas>
crc previously tried SDL and ran into performance issues which I think I've fixed (at least for me I have, I don't know if it will fix for him too)
22:51:43
##forth
<vms14>
it was a non rectangular window changing it's shape with the frames of the sprite
22:52:32
##forth
<veltas>
I wanted SDL because I wanted a resizable window, and didn't know how to do it for X
22:55:40
##forth
<veltas>
X Is Applicable For Point-Of-Sale?
22:55:43
##forth
<vms14>
ConfigureNotify events
22:56:27
##forth
<vms14>
do you mean if it makes sense to make a point of sale app with xlib?
22:56:31
##forth
<veltas>
I also like that SDL is cross platform
22:56:34
##forth
<vms14>
if you mean that, then no
22:56:50
##forth
<veltas>
No don't worry vms14, making a joke about xentrac's filename
22:56:58
##forth
<vms14>
ah lol
22:59:41
##forth
<xentrac>
veltas: X is a f****** piece of s***
23:00:20
##forth
<vms14>
the funny thing is that wayland is not much better xd
23:08:36
##forth
<GreaseMonkey>
handling window resizing in X? there's 2 events, and one of them is definitely not the one you want
23:09:55
##forth
<GreaseMonkey>
the one you don't want is the one with "Resize" in its name, specifically "ResizeRequest"
23:11:25
##forth
<GreaseMonkey>
i *think* you want something like ConfigureNotify?
23:11:54
##forth
<veltas>
Classic IRC, I said I don't want to use X, and everyone tells me how to use X
23:12:07
##forth
<veltas>
Oh well at least I learned something about tech I never want to use
23:13:11
##forth
<veltas>
Is that because ResizeRequest is the *request*, and the resize triggers a ConfigureNotify? And if you intercept the ResizeRequest then it never happens?
23:14:47
##forth
<veltas>
This reminds me of win32. They're very similar, except win32 isn't always a network protocol
23:24:01
##forth
<xentrac>
that sounds right
23:56:38
##forth
<veltas>
Looks like the X demo crashes so it probably still needs some stuff added
23:57:13
##forth
<veltas>
#653 I mean