10:58 < heinrich5991_> matricks: in case of an interpreted script, would it be sufficient if it advertised its own max memory usage (stack only) and maximum instruction count? 10:59 <@matricks> you could do stuff like that 11:00 <@matricks> the thing I like about small is that it knows the memory usage from start apparently 11:00 <@matricks> I havn't looked into how it does it however 11:01 < heinrich5991_> well, it says it knows it when it doesn't recurse, and this way you can (simply) calculate its maximum stack usage by considering all calls to be taken 11:01 <@matricks> yeah 11:02 < heinrich5991_> the instr count problem still stands though 11:02 < heinrich5991_> but it seems (from what I can tell) that pawn would allow for segfaults 11:02 <@matricks> I solved that issue in my language by only allowing to skip instructions, not jumping back :) 11:03 <@matricks> heinrich5991_: they perform bounds checking and you will get an error back I think 11:03 < heinrich5991_> yea, but that even disallows the simplest loops, such as for player-player collision 11:03 <@matricks> heinrich5991_: this was ment for rendering of stuff 11:04 <@matricks> heinrich5991_: and you can handle the cases where you have to loop by making the real gamecode call the functions for every p2p collision resolve etc 11:04 < heinrich5991_> the manual said something about being careful with non-initialized memory as strings are zero-terminated and when printed could cause a segfault 11:05 <@matricks> oh-shi... 11:05 <@matricks> dunno, I havn't used it for anything or looked into it that much 11:06 < heinrich5991_> it seems that pawn isn't very much documented, got that from a tutorial 11:06 < heinrich5991_> https://wiki.alliedmods.net/Introduction_to_sourcepawn#Caveats 11:07 < heinrich5991_> I didn't find a documentation for the bytecode yet 12:04 <@matricks> heinrich5991_: that caveat seems quite bad :/ 20:09 < heinrich5991> matricks: you said that you created some language with forward-only jumps 20:11 < heinrich5991> do you still have the bytecode reference or whatever you compiled to? 20:26 <@matricks> heinrich5991: yes 20:27 < heinrich5991> I'd like to read it, if that was possible 20:29 <@matricks> I can dig it out a bit later, a bit busy right now 20:30 < heinrich5991> ok, thank you :) 20:34 < Dunedune> matricks: whoa that's interesting, what are its purposes? 20:34 <@minus> still working matricks? 20:35 <@minus> start work at half past 6, go home before everyone else :D 21:34 <@matricks> Dunedune: experiment with sending code to the client for rendering 21:34 <@matricks> minus: no, cleaning appartment, running errends etc 21:35 <@matricks> heinrich5991: going through backups now 21:35 <@matricks> heinrich5991: found it 21:36 < heinrich5991> that was quick 21:36 <@matricks> I'm pro like that 21:36 < heinrich5991> ordered backups :) 21:36 <@matricks> heinrich5991: not really 21:36 <@minus> well-organized backups, nice 21:36 <@matricks> just looked through the latest backup 21:36 < PsychoGod> mmm, something interestid is going on :3 21:37 <@matricks> http://matricks.se/vm/vm.tar.gz 21:37 <@matricks> http://matricks.se/vm contains all the files as well 21:37 <@matricks> compiler.py == the compiler 21:38 <@matricks> test.cpp + opcodes.h is the virtual machine + test 21:38 <@minus> such macro 21:38 <@minus> looks /very/ minimal 21:38 <@matricks> it is 21:39 <@matricks> but it should almost do everything that is needed for the client to render game objects 21:39 <@matricks> and you can easily extend it 21:40 <@matricks> compiler == 550 lines of python :) 21:41 <@matricks> erh.. you need the CBurkVMBuilder in test.cpp as well yeah. 21:43 <@matricks> okey.. the test.cpp does some other stuff as well 21:43 <@matricks> it uses macros and some fancy c++ to run functions as produce vm bytecode for em :D 21:43 <@matricks> haha, I don't remember doing that 21:45 <@minus> "i must've been drunk" 21:45 <@matricks> that was kinda cool :) 21:46 <@matricks> but yeah, the actual virtual machine is like.. 100 lines of code 21:46 <@matricks> 150.. 21:47 <@matricks> and there is a way to crash it ;) 21:47 <@matricks> perhaps... 21:47 <@matricks> 5 points to the one who can figure it out 21:48 <@minus> call 0 21:48 <@matricks> call doesn't do anything 21:48 <@minus> aw 21:49 <@matricks> okey, you can't crash it :) 21:49 <@matricks> floating point exceptions are not enabled by default 21:55 <@matricks> it's kinda fun how little code you need todo a small vm with compiler these days 21:56 < EastByte> thanks to python 21:56 <@matricks> among other things 21:59 <@matricks> and people need to stop competeing in paragliding if Maurer is involved :D 21:59 <@matricks> Maurer == A god in the paragliding world 22:00 <@matricks> he have won the hardest, most challening competition 3 times in a row now 22:01 < EastByte> wow that's great :) 22:01 < EastByte> now continue working on cool projects :D 22:02 <@matricks> I'm gonna finish up my cleaning of my appartment 22:02 < EastByte> lol how long does this take? 22:02 <@matricks> 1 more hour perhaps 22:02 < EastByte> ... 22:02 <@matricks> been cleaning the balcony etc 22:02 <@matricks> cleaning out some closests 22:03 <@matricks> too many gay people in them 22:03 <@matricks> and I spent loads of money today \o/ 22:03 < PsychoGod> D: it's not good with gay people 22:03 <@matricks> ordered my tandem gear 23:20 <@matricks> aaaand... almost done 23:20 <@matricks> :) 23:21 < heinrich5991> matricks: how many registers does your machine have? 23:21 <@matricks> heinrich5991: the vm? 23:21 < heinrich5991> yes 23:21 <@matricks> none 23:22 <@matricks> registers == memory more or less 23:22 < heinrich5991> move r4, r6 23:22 < heinrich5991> aha 23:22 <@matricks> you don't have registers and memory.. you just have registers.. or memory :) it's called both :) 23:22 < heinrich5991> so you have only-addressable-by-constant memory? 23:23 <@matricks> at the time I wrote that, yes 23:23 <@matricks> you could easily add an indirect move 23:23 <@matricks> or "load" 23:24 <@matricks> MACRO_OPCODE(LOAD,REG,REG,NON,mem[p0] = mem[mem[p1]], "load r%u, r%u") // load rDEST, r[rSOURCE] 23:24 < heinrich5991> in theory, could one use LLVM to compile to one's bytecode? 23:24 <@matricks> there.. done 23:24 <@matricks> heinrich5991: "yes" 23:24 <@matricks> heinrich5991: and no 23:24 < heinrich5991> matricks: what you wrote is still unsafe 23:24 <@matricks> as soon as you get a jump instruction, you are bone 23:24 <@matricks> boned 23:25 <@matricks> heinrich5991: nope 23:25 <@matricks> heinrich5991: it's safe 23:25 < heinrich5991> is mem a class? 23:25 <@matricks> oh wait... 23:25 <@matricks> 2 sec 23:26 <@matricks> MACRO_OPCODE(LOAD,REG,REG,NON,mem[p0] = mem[mem[((size_t)p1)%CBurkVM::MEMORY_SIZE]], "load r%u, r%u") // load rDEST, r[rSOURCE] 23:26 <@matricks> there 23:26 <@matricks> or.. is size_t signed? :) 23:26 < heinrich5991> size_t is unsigned 23:26 <@matricks> then there :) 23:27 < heinrich5991> why not abort the VM on out of memory access? 23:27 < heinrich5991> have you prevented div by 0 btw? 23:27 <@matricks> heinrich5991: div by 0 -> inf 23:28 <@matricks> heinrich5991: you could halt execution if you want 23:28 <@matricks> heinrich5991: I just made an example 23:28 <@matricks> wait.. I did that opcode wrong :D 23:29 <@matricks> MACRO_OPCODE(LOAD,REG,REG,NON,mem[p0] = mem[((size_t)mem[p1])%CBurkVM::MEMORY_SIZE]], "load r%u, r%u") // load rDEST, r[rSOURCE] 23:29 <@matricks> there 23:29 <@matricks> bleh 23:30 <@matricks> it will have some issues however :D 23:30 <@matricks> as you are casting floats to ints 23:30 < heinrich5991> well, you don't have enough registers to cause strange things I guess 23:31 <@matricks> the thing isn't really tested or so, just made as a small test 23:32 <@matricks> hmm, I should finishing watching that movie I started watching yesterday :D 23:34 < Elzeph> matricks, what's the title? 23:34 <@matricks> Nymphomanic 23:35 <@matricks> got Vol II left to see 23:35 <@matricks> stupid long movie :) 4 hours.. and that's the short version