Log of #mupdf at irc.freenode.net.

Search:
 <<<Back 1 day (to 2020/05/25)Fwd 1 day (to 2020/05/27)>>>20200526 
azix I'm using MuJS in my project, but i didn't understand some things even though using the reference and examples,i download the latest release, but there is no comments on the code to describe it.11:03.13 
sebras azix: hi! what is is that you don't understand?11:26.45 
azix some functions and mechanisms on MuJS source code .11:49.59 
  sebras: on MuJS source code, there is no comments to describe on functions and mechanisms and some variables.11:58.52 
kens azix if you want help you're probably going to have to be specific. Nobody is going to run through the source code with you. I'd suggest you explain which specific functions/variables you need help with.12:06.30 
azix ok kens,what is state and what does it contain, the deference between js_newboolean and js_pushboolean? what js_isundefined, js_setglobal do? i didn't understand how stack indices work?12:22.49 
  and why stack indices sometimes are negative indices??12:24.04 
  js_pop(js_State *J, int n), what "n" mean?12:35.44 
kens azix, I'm afraid I'm not a MuPDF developer, and this is specific to MuJS which I know even less about, you need ator to answer your questions. He is probably on vacation since he isn't here today.12:41.56 
  I'd suggest coming back tomorrow and check the logs to see if he has replied12:42.14 
  Oh actual;ly, his nick is here, I just didn't see it12:42.56 
  He may reply12:43.02 
azix ok kens thank you for helping me but i just want to ask you if ly and ator are MuJS developers?12:46.11 
kens MuJS is ator's personal project12:46.34 
  I don't know who ly is12:46.43 
  sebras knows a bit about MuJS I think, but really I think you need Tor to answer the questions12:47.18 
ator azix: https://mujs.com/reference.html12:48.18 
azix i didn't understand some things even though using the reference and examples ator, there is no comments to describe functions and mechanisms and some variables on the source code..12:50.25 
  ator, this what i didn't understand: the deference between js_newboolean and js_pushboolean? what js_isundefined, js_setglobal do? i didn't understand how stack indices work?12:52.32 
  and why stack indices sometimes are negative indices, js_pop(js_State *J, int n), what "n" mean?12:52.53 
  what is state (Js_State) and how it works, what does it contain?12:54.16 
ator stack indices are explained in the reference manual under "The Stack" heading13:10.29 
  "The stack values are accessed using stack indices. Index 0 always contains the this value, and function arguments are index 1 and up. Negative indices count down from the top of the stack, so index -1 is the top of the index and index -2 is the one below that."13:10.37 
azix ator the deference between js_newboolean and js_pushboolean? what js_isundefined, js_setglobal do?13:11.17 
ator "The interpreter state is bundled up in the opaque struct js_State. This state contains the value stacks, protected environments, and environment records."13:11.19 
  js_newboolean -- Create and push objects on the stack. That creates a "new Boolean()" object.13:11.42 
  js_pushboolean pushes a primitive boolean.13:11.50 
  isundefined returns true if the value is the "undefined" value.13:12.08 
  js_setglobal sets a global variable, as the name implies.13:12.31 
  If this is too hard to understand, maybe MuJS is not the right library for you. There is no "beginner" documentation, I'm afraid.13:13.11 
azix js_pushundefined??13:13.22 
sebras azix: there is a primitive value called undefined in javascript. js_pushundefined, like js_pushboolean pushes that value onto the stack.13:17.26 
  azix: why are you interested in mujs? what is it you want to use it for?13:17.46 
  ator: mujs:sebras/master has a trivial commit for you. because I noticed creat over there.13:20.07 
azix sebras: i want to embed a very lightweight script languages on my project, i found many languages, i interested with lua because its simple and cross platform, but its contains many library and features, as i said i want very lightweight script language, i try to stripping lua to make it very tiny contains only core functions, but unfortunately i13:41.14 
  found MuJS, its very simple and tiny and the exactly right library for me, has a similar C interface to lua, but when when i wanted to include it on my project, i found some problems, any, any source code of any project, contains description and small documentation of the code as a comments, but the source code of this project (MuJS) contains only13:41.14 
  code, and the reference "https://mujs.com/reference.html" does not contains anything, when i ask for helping, the owner of project (ator) said: "No place for beginners".13:41.15 
  sebras: that's why i am interested in mujs.13:44.40 
sebras azix: well, mujs does not have documentation for beginners. maybe an example of a project using mujs would help you. I think avih has successfully integrated mujs in to his project (this one? https://github.com/avih/mpv).13:51.24 
avih it's not my project. i maintain the mujs integration in mpv, but mpv is mainly maintained by wm413:52.12 
sebras avih: I knew that, I made a simplification.13:52.46 
  avih: but I didn;t know about wm4. :)13:52.52 
  s,;,',13:53.04 
avih always something new to learn :)13:53.06 
  azix: in general, read the docs, try the examples, play with it, get your hands dirty, and hopefully you'll get it. the docs are a bit lacking, but the C integration is very similar to lua or dukpate, so you might look into their docs to get a better feeling of how embedding works.13:55.37 
ator avih: duck paté, I like it!14:00.55 
avih :)14:01.19 
  you said it!14:01.26 
kens Is that pate = head or pate with an acute ?14:01.27 
  pate de foie umm duck ?14:01.45 
  canard ?14:01.52 
avih ator: are you pushing the utf8 thingy?14:01.54 
azix sebras: I did not say that i am a beginner, I did not say that i want documentation for beginners, I did not say that i didn't understand anything, avih: i succeeded to integrated mujs on my project and run some JS scripts, but not fully integration, due to some problems even though using the reference and examples, and even though i get back on14:03.19 
  Lua and dukpate, because mujs code is different.14:03.20 
avih azix: so what exact issues do you have?14:04.25 
Zsolt hi14:04.48 
mubot Welcome to #mupdf, the channel for MuPDF. If you have a question, please ask it, don't ask to ask it. Do be prepared to wait for a reply as devs will check the logs and reply when they come on line.14:04.48 
Zsolt does somebody know a good deskew software?14:05.15 
azix i suggest the project (MuJS) programmers, to make comments on the source code to describe functions and its arguments, variables,... , this project is based on the Lua project despite its using java script language, has a similar C interface to lua, but lua source code contains comments to describe somethings, and its reference14:05.25 
  "https://www.lua.org/manual/5.3/" describe everything, not like the MuJS project.14:05.25 
  avih: i succeeded to integrated mujs on my project and run some JS scripts, but not fully integration, due to some problems even though using the reference and examples, and even though i get back on Lua and dukpate, because mujs code is different.14:06.14 
avih you already said that. what is the actual issue? what's missing? (other than code comments)14:07.09 
ator Zsolt: imagemagick has a -deskew option in its convert command14:08.43 
Zsolt thanks ator14:09.02 
azix avih: i already explain and specify actual issues and what's missing, I got a reply "No place for beginners".14:13.29 
  i suggest the project (MuJS) programmers, to make comments on the source code to describe functions and its arguments, variables,... , this project is based on the Lua project despite its using java script language, has a similar C interface to lua, but lua source code contains comments to describe somethings, and its reference14:13.55 
  "https://www.lua.org/manual/5.3/" describe everything, not like the MuJS project.14:13.55 
ator just try to read the source. it's not that hard to understand.14:14.50 
avih azix: this? "this what i didn't understand: the deference between js_newboolean and js_pushboolean? what js_isundefined, js_setglobal do? i didn't understand how stack indices work?"14:14.52 
  anything else?14:14.55 
ator half of your questions are answered in the reference document that you complain contains "nothing"14:15.20 
avih newboolean pushes a boolean object, pushboolean pushes a boolean value. isundefined tests whether or not the value at some stack index is JS `undefined'. setglobal is like setpoperty but of the global object. you do need to be reasonably familiar with JS and the spec (ES 5.1) to understand the docs. stack indices are pretty much the same as lua, including negative indices (maybe different with the 1/0 base, not sure)14:18.58 
azix yes avih, i have and I'm using JavaScript and the es5 specifications, i interested in mujs as i said i want very lightweight script language, its very simple and tiny and the exactly right library for me, i will read the source, and using reference and examples, I did not say that i am a beginner, I did not say that i want documentation for14:21.55 
  beginners, I did not say that i didn't understand anything, i succeeded to integrated mujs on my project and run some JS scripts, but not fully integration, but i suggest the project (MuJS) programmers, to make comments on the source code to describe functions and its arguments, variables,...14:21.55 
avih well, it is what it is. code/comments style is a personal thing and vary between projects. the code is not overly complex and you should be able to make your way around if you insist on reading the source. accept it as it is.14:23.24 
  if you have specific places where you think a comment would help, you can ask about them, or, preferably, understand it and send the comment in a PR so that the next person has easier time understanding14:24.05 
azix ator, i didn't said that reference document contains "nothing", the reference document is helpful for me, check the logs i said that reference document doesn't contains everything.14:26.05 
avih so just state explicitly what's missing.14:26.32 
ator you said: `the reference "https://mujs.com/reference.html" does not contains anything.'14:28.17 
azix yes avih, i suggest the project (MuJS) programmers from now on to make comments on the source code to describe functions and its arguments, variables,... like any project, not writing only code.14:28.38 
ator azix: that's quite different from "doesn't contain everything"!14:29.01 
avih you're repeating yourself, and i already replied to the comments thingy. what's missing other than comments?14:29.10 
azix so ator i just got it wrong, i used reference and it helped me to integrate mujs on my project and run some JS scripts, but not fully integration.14:31.25 
avih WHAT IS MISSING FOR YOU?14:32.03 
azix thank you avih, i will take your suggestions to trying read the docs well, try the examples, play with it, and get back to lua or dukpate docs, i just reply to ator that i just got it wrong and i used reference and it helped me, even you avih you admitted that the docs are a bit lacking.14:38.26 
avih i've had enough of this meta talk. either be specific or you're unlikely to get real help.14:39.11 
azix i didn't get any real help !!!, someones said me no place for beginners and someones just repeats what the reference docs contains that you said that are a bit lacking, and someones said meta talk, that you all for real help.14:44.31 
  thank you all for the real help.14:45.07 
avih i've asked you like 10 times, what's you're actual issue other than code, i never saw one reply. only what you said and didn't say and what replies you got. last chance, what do you need to make progress?14:45.47 
azix <CRUDE EXPLETIVE DELETED> community.14:46.19 
sebras azix: both ator and avih tried to explain the what the functions you asked about do.14:46.21 
kens azix language!14:46.29 
avih :)14:46.50 
kens LOL14:46.53 
sebras ator: well, that settled it.14:46.54 
ator enough.14:46.55 
kens I was going to do that if he didn't start behaving14:47.08 
sebras avih: thanks for making an attempt at helping.14:47.21 
avih not a very successful one, apparently :)14:47.40 
ator he was misbehaved and angry from the start. thanks for having so much patience avih: )14:47.41 
  well, he says he wasn't a beginner. that proves it!14:47.55 
  -.-14:48.01 
avih :)14:48.02 
sebras ator: did you see the typo commit I did for mujs or did you lose that ?14:48.38 
  ator: I also noticed that you have a number of commits on mujs:tor/master. are those waiting for a review?14:49.19 
ator sebras: the typo commit LGTM14:49.35 
  tor/master commits are waiting for review, I think14:49.54 
sebras ator: want me to push mine anyhow?14:50.02 
ator the embedded 0 and utf-8 stuff should be fine, I think you went over those before14:50.19 
  dunno if we want to push the TypedArray extension14:51.17 
  but the rest you can push14:51.22 
  it's a small extension, but it's also not part of ES514:51.41 
sebras ator: I'm not sure I've LGTMed "Issue 133: Eliminate recursion in GC scanning phase."14:54.19 
  have I?14:54.22 
  I remember seeing it, but I'm not sure I understood it.14:54.36 
ator don't think you have14:54.38 
azix hello I'm back again15:04.35 
  just want to say that you have to make comments on your <CRUDE EXPLETIVE DELETED> source code avih, ator, sebras, and maintenance the docs, and make some comments in your <CRUDE EXPLETIVE DELETED> commits.15:07.29 
kens KICK #mupdf azix15:08.51 
  oops15:08.55 
sebras ator: I'm going to have to have some help if I'm going to understand the issue 133 commit.15:14.12 
twlc_rev hello I'm back again, i'm azix, <CRUDE EXPLETIVE DELETED> you kens for kicking me.15:16.13 
sebras I can see that J->gcroot will be a linked list of objects based on what order they have jsG_markobject() called on them. but I don't yet understand the implications of that.15:16.14 
twlc_rev ator you said "he says he wasn't a beginner. that proves it" get back to the logs, i said " I did not say that i am a beginner, I did not say that i want documentation for beginners, I did not say that i didn't understand anything" not "i'm not a beginner" ,i said that I'm not looking for documentation for beginners.15:16.15 
  bye <CRUDE EXPLETIVE DELETED> community, remeber to make comments on your <CRUDE EXPLETIVE DELETED> source code avih, ator, sebras, and maintenance the docs, and make some comments in your <CRUDE EXPLETIVE DELETED> commits, bye and enjoy the <CRUDE EXPLETIVE DELETED> community.15:16.21 
kens What a muppet15:16.59 
ranio_mastimotho KICK #mupdf kens15:19.27 
kens You're not making any friends here15:19.45 
ranio_mastimotho KICK #mupdf avih15:19.51 
sebras ranio_mastimotho: you know that we can see that you are logging in from the same ip address, right?15:20.02 
kens I have it right in front of me :-)15:20.16 
ranio_mastimotho i said that i'm azix15:20.30 
avih wtf is wrong with this guy15:23.50 
chrisl Needs a hug :-)15:24.03 
kens Needs a slap15:24.09 
avih did he actually make all that noise because there are not enough comments to his liking?!15:26.39 
kens As far as I can see, yes. Presumably he thinks comments in the code are The One True Way15:27.06 
ator sebras: think of gcroot as a queue/stack15:28.19 
  anything I haven't seen yet (as noted by the 'gcmark' identifier) is pushed to the queue15:28.38 
avih kens: wait, you mean there's another true way?!?15:28.47 
kens Certinaly, one per developer :-)15:29.01 
ator then I pop one thing from the top of the queue, anything I can reach from that, which I haven't seen yet, I push to the queue15:29.05 
avih :)15:29.06 
sebras kens: :)15:29.06 
ator and repeat until nothing remains15:29.11 
sebras ator: is gcmark a boolean in this context?15:29.39 
ator sebras: I start by adding all the GC roots to the 'gcroot' queue15:29.41 
  gcmark is an integer of the current gc run, so basically a boolean15:29.57 
  it flip-flops between two values, so we can later go through the entire list of objects (the 'gcnext' list) and free the ones that weren't marked as seen this run15:30.56 
  I'm eliminating recursion by putting stuff to recurse onto a queue instead15:31.17 
  or stack, or what have you15:31.23 
sebras I was thinking of it as a linked list from J->gcroot.15:31.52 
avih ator: that sounds nice15:31.53 
  (eliminate recursion)15:32.05 
sebras but yeah, you do pop it, so queue is probalby more like it.15:32.07 
ator sebras: that's how the queue/stack is implemented15:32.07 
  push stuff to the head of the linked list15:32.21 
  pop from the head15:32.23 
  the order is actually irrelevant15:32.37 
  it's just a list of 'items seen but not scanned yet'15:32.49 
  anything we've seen is marked with the 'gcmark'15:33.01 
avih ator: so when you pop you also free?15:33.27 
sebras so before "Scan objects until none remain." we have essentially a queue of all the prototype objects and environments as I understand it. then the while loop will go through those and mark their dependencies.15:33.32 
  ok.15:33.36 
ator sebras: yes. and anything those objects see, will go onto the queue as well.15:33.59 
sebras yes15:34.06 
ator and when the queue is empty, we've scanned everything reachable from the roots.15:34.11 
  and then we can go through the allocation list and free the ones that weren't seen15:34.27 
sebras and then we can gc anything where gcmark is not the expected value.15:34.35 
ator avih: no, the popping is just to take it off the work list. the freeing is in a later loop.15:34.40 
sebras ok, satisfied.15:34.52 
avih ator: where's this patch? (i'm familiar with the GC before this patch)15:35.43 
ator avih: first commit on tor/master15:35.54 
  "Issue 133: Eliminate recursion in GC scanning phase."15:36.01 
avih ator: anything changed with your gitweb hosting? i'm unable to access http://git.ghostscript.com/?p=user/tor/mujs.git;a=summary15:37.09 
sebras avih: I can reach it.15:37.34 
ator avih: it's just slow :(15:37.38 
  I can reach it too15:37.41 
sebras avih: link to commit: http://git.ghostscript.com/?p=user/tor/mujs.git;a=commitdiff;h=e4846fc3e53748ceba35f45de8b9116e06a092a1;hp=90aca80865e28a1b9be9bc5ef1118438f62e4f8f15:37.56 
avih huh, weird. maybe an isp issue? i my web seems to work...15:38.02 
ator maybe azix decided to launch a ddos attack to make us improve our comments!15:38.03 
avih ok, i can see that last URL15:38.19 
  and now "my" URL also works.15:38.37 
  must have been some temporary $whatever15:38.47 
  ok, jsG_markobject is good. i added it too in various patches.15:40.07 
  no, actually, i added jsG_markvalue15:40.30 
  ator: so basically you chain all objects instead of recursing into them, yes?15:42.57 
  hmm.. i don't actually identify the elimination of any recursion at the patch, only the fact that chaining gets used15:44.01 
ator avih: before we had jsG_markobject which called itself recursively (by calling jsG_markvalue)16:25.44 
  avih: now all jsG_markobject does is add the object to the queue, it does not recurse16:26.04 
  jsG_scanobject which is called iteratively, takes an object from the queue adn calls jsG_markproperty (which calls markobject, which adds stuff to the queue, but does not recurse)16:26.35 
hisacro I followed this log https://ghostscript.com/mupdfirclogs/2019/01/15.html to set WM_CLASS on mupdf-gl I have added the following to fg_window_x11.c http://ix.io/2nqS and built it.. but gives segmentation fault when run, any ideas why?19:25.45 
sebras hisacro: I notice that you do not check the return values from XSetWMProtocols and XSetClassHint19:27.53 
  does any of them fail?19:27.57 
  do, not does. do! :)19:28.10 
  hisacro: if you compile mupdf using "make sanitize" and then run "./build/sanitize/mupdf-gl mydocument.pdf" does it print a backtrace indicating what went wrong?19:29.35 
  hisacro: an alternative could be to run the build binary in valgrind and see if _it_ can print a backtrace where the problem appears.19:30.00 
hisacro sebras rebuilt with sanitize http://ix.io/2nra, is it because of how *classhint initialized20:05.33 
  sebras, thanks I didn't set "classhint = XAllocClassHint();" it works now20:31.26 
sebras hisacro: nice!20:31.35 
  hisacro: I just noticed you answer and was going to try it myself.20:31.48 
hisacro btw any reason why this isn't included mainstream20:32.37 
sebras hisacro: ator knows that better than I do. but feel free to submit a patch on bugs.ghostscript.com. unless we take it on, at least we can point others to what you did. :)20:35.14 
pedr0 quite a remarkable day in this channel today, I've read the whole thing just now.21:12.32 
hisacro_ sebras, I filled it as bug but guess I messed with formating https://bugs.ghostscript.com/show_bug.cgi?id=702438#a021:37.15 
 <<<Back 1 day (to 2020/05/25)Forward 1 day (to 2020/05/27)>>> 
ghostscript.com #ghostscript
Search: