00:04:54  * SinisterRectusquit (Read error: Connection reset by peer)
00:19:30  * SinisterRectusjoined
01:40:48  * DarkGodquit (Ping timeout: 260 seconds)
03:14:53  * rgrinbergquit (Ping timeout: 258 seconds)
03:40:21  * APNGquit (Ping timeout: 248 seconds)
03:46:14  * APNGjoined
03:59:31  * APNGquit (Ping timeout: 268 seconds)
05:04:30  * SkyRocknRolljoined
07:30:25  * DarkGodjoined
09:10:37  * Sonijoined
09:17:03  * SinisterRectusquit (*.net *.split)
09:17:05  * DarkGodquit (*.net *.split)
09:17:06  * boxofroxquit (*.net *.split)
09:17:06  * erlbot--quit (*.net *.split)
09:17:07  * CapsAdminquit (*.net *.split)
09:17:08  * mmickoquit (*.net *.split)
09:17:09  * rchquit (*.net *.split)
09:17:10  * endouquit (*.net *.split)
09:17:12  * songgaoquit (*.net *.split)
09:17:13  * SkyRocknRollquit (*.net *.split)
09:17:13  * inexquit (*.net *.split)
09:17:18  * konobiquit (*.net *.split)
09:17:24  * ^vquit (*.net *.split)
09:17:27  * visionikquit (*.net *.split)
09:17:31  * ksheedloquit (*.net *.split)
09:17:31  * jpleauquit (*.net *.split)
09:17:32  * rphillipsquit (*.net *.split)
09:17:36  * urzdsquit (*.net *.split)
09:17:40  * creationix_quit (*.net *.split)
09:17:40  * sharpobjectquit (*.net *.split)
09:17:41  * indexzeroquit (*.net *.split)
09:17:41  * rje_quit (*.net *.split)
09:17:42  * Soniquit (*.net *.split)
09:17:43  * dobsonquit (*.net *.split)
09:17:47  * daurnimatorquit (*.net *.split)
09:17:47  * bjornquit (*.net *.split)
09:17:47  * Xequit (*.net *.split)
09:17:48  * Namidairoquit (*.net *.split)
09:19:18  * Xejoined
09:19:53  * daviddiasquit (Ping timeout: 245 seconds)
10:09:45  * bjornjoined
10:09:45  * daurnimatorjoined
10:09:45  * dobsonjoined
10:09:45  * APNGjoined
10:09:45  * SinisterRectusjoined
10:09:45  * jpleaujoined
10:09:45  * rphillipsjoined
10:09:45  * visionikjoined
10:09:45  * konobijoined
10:09:45  * rchjoined
10:09:45  * endoujoined
10:09:45  * songgaojoined
10:09:45  * mmickojoined
10:09:45  * ksheedlojoined
10:09:45  * CapsAdminjoined
10:09:45  * erlbot--joined
10:09:45  * ^vjoined
10:09:45  * inexjoined
10:09:45  * SkyRocknRolljoined
10:09:45  * DarkGodjoined
10:09:45  * Namidairojoined
10:09:45  * daviddiasjoined
10:10:28  * APNGquit (*.net *.split)
10:10:29  * dobsonquit (*.net *.split)
10:10:31  * daurnimatorquit (*.net *.split)
10:10:31  * bjornquit (*.net *.split)
10:10:32  * SinisterRectusquit (*.net *.split)
10:10:33  * Namidairoquit (*.net *.split)
10:10:33  * DarkGodquit (*.net *.split)
10:10:34  * erlbot--quit (*.net *.split)
10:10:34  * CapsAdminquit (*.net *.split)
10:10:34  * mmickoquit (*.net *.split)
10:10:35  * rchquit (*.net *.split)
10:10:35  * endouquit (*.net *.split)
10:10:36  * songgaoquit (*.net *.split)
10:10:36  * SkyRocknRollquit (*.net *.split)
10:10:36  * inexquit (*.net *.split)
10:10:38  * konobiquit (*.net *.split)
10:10:40  * daviddiasquit (*.net *.split)
10:10:42  * ^vquit (*.net *.split)
10:10:43  * visionikquit (*.net *.split)
10:10:46  * ksheedloquit (*.net *.split)
10:10:47  * jpleauquit (*.net *.split)
10:10:47  * rphillipsquit (*.net *.split)
10:10:50  * Xequit (Excess Flood)
10:28:07  * SinisterRectusjoined
10:28:07  * jpleaujoined
10:28:07  * rphillipsjoined
10:28:07  * visionikjoined
10:28:07  * konobijoined
10:28:07  * rchjoined
10:28:07  * endoujoined
10:28:07  * songgaojoined
10:28:07  * mmickojoined
10:28:07  * ksheedlojoined
10:28:07  * CapsAdminjoined
10:28:07  * erlbot--joined
10:28:07  * ^vjoined
10:28:07  * inexjoined
10:28:07  * SkyRocknRolljoined
10:28:07  * DarkGodjoined
10:28:07  * Namidairojoined
10:28:07  * daviddiasjoined
10:28:07  * Xe-joined
10:28:07  * bjornjoined
10:28:07  * daurnimatorjoined
10:28:07  * dobsonjoined
10:28:07  * APNGjoined
10:28:39  * boxofroxjoined
10:28:39  * urzdsjoined
10:28:46  * creationix_joined
10:28:46  * sharpobjectjoined
10:28:46  * indexzerojoined
10:28:46  * rje_joined
10:29:26  * Xe-quit (Changing host)
10:29:26  * Xe-joined
10:35:09  * daviddiasquit (Changing host)
10:35:09  * daviddiasjoined
10:41:17  * Xe-changed nick to Xe
12:36:46  * SkyRocknRollquit (Remote host closed the connection)
13:07:54  * rgrinbergjoined
15:50:32  * rgrinbergquit (Ping timeout: 268 seconds)
16:19:46  * rgrinbergjoined
17:18:00  * rgrinbergquit (Read error: Connection reset by peer)
17:38:16  * rgrinbergjoined
18:23:02  <creationix>APNG hit a pretty serious problem. https://github.com/luvit/luvit/pull/932#issuecomment-253363964
18:25:40  <APNG>creationix, you're supposed to use local modname = ... and require(modname .. ".whatever")
18:25:54  <APNG>the modname declaration goes at the top of the file, before any function scopes
18:26:10  <creationix>APNG right, but that assumes you know where a module is installed
18:26:18  <APNG>creationix, it doesn't
18:26:34  <APNG>1 sec
18:26:40  <APNG>http://www.lua.org/manual/5.3/manual.html#pdf-require
18:27:06  <APNG>Once a loader is found, require calls the loader with two arguments: modname and an extra value dependent on how it got the loader. (If the loader came from a file, this extra value is the file name.)
18:27:12  <creationix>I mean you need the full modname relative to one of the entries in the global package search path
18:27:40  <creationix>oh, interesting
18:27:45  <APNG>i.e. save "local modname = ... print(modname)" without quotes to a file, then require that file
18:28:07  <APNG>when I say ... I mean literal ..., not something you're supposed to replace
18:28:11  <creationix>APNG I see
18:28:22  <creationix>is that a lua 5.3 thing? I don't remember that from before
18:28:30  <APNG>uh
18:28:36  <APNG>it's *at least* 5.2+
18:28:42  <APNG>and I think LuaJIT has it too
18:28:52  <APNG>oh
18:28:55  <APNG>in 5.1: Once a loader is found, require calls the loader with a single argument, modname.
18:29:29  <creationix>I wonder if we can backport it somehow
18:30:06  <APNG>hmm this is interesting...
18:30:08  <APNG>1 sec
18:30:10  <creationix>but currently, it looks in package.loaded with a key that I can't control before any loader
18:30:31  <creationix>so unless I patch luajit itself I can't get around this afaik
18:30:47  <APNG>creationix, you can rely on the lua 5.1 behaviour
18:31:09  <APNG>both lua 5.1 and lua 5.3 pass the module name to the loader
18:31:22  <APNG>idk why you'd rely on ppl using the 2nd argument
18:31:34  <APNG>I don't use the 2nd argument and neither should you
18:37:25  <APNG>but eh I can try I guess https://github.com/LuaJIT/LuaJIT/issues/223
18:42:31  <creationix>APNG the problem isn't the loader. It can get the info it needs from debug
18:45:08  <APNG>creationix, also, assuming standard dot notation, modname:gsub("^.-%.[^.]+$", "%1") should return the parent module
18:45:21  <APNG>altho an utility function would probably be better in that case
18:45:41  <creationix>APNG the problem isn't loaders
18:45:46  <APNG>local modutils = require "modutils"; require(modutils.parent(modname) .. ".whatever")
18:45:47  <creationix>the problem is the cache
18:45:56  <APNG>creationix, yes, this solves the cache problem
18:46:08  <APNG>because you're always passing full paths
18:46:20  <APNG>"modname" isn't just the last part of the name
18:46:26  <APNG>"modname" is the fully qualified name
18:46:40  <APNG>so if you require "a.b.c.d", "modname" will be "a.b.c.d"
18:46:48  <creationix>are you suggesting a resolve() function like squeek502 suggested?
18:47:22  <APNG>creationix, not needed, just "require(modname .. "filename")"
18:47:25  <APNG>uh
18:47:28  <APNG>.. ".filename"
18:47:46  <creationix>but how do you get modname?
18:48:13  <APNG>https://github.com/luvit/luvit/pull/932#issuecomment-253601510
18:48:24  <APNG>it's a vararg
18:48:37  <APNG>creationix, try that example
18:48:39  <APNG>as-is
18:48:43  <APNG>don't attempt to modify it >.>
18:51:32  <creationix>it's a shame loaders can't modify the cache key before matching
18:53:11  <creationix>APNG so that is an option. I can maybe make it clean enough to work
18:53:17  <creationix>but what about files in the luvi bundle?
18:55:10  <APNG>creationix, cease using debug.* and everything'll work just fine
18:56:38  <creationix>APNG yes, I see how `...` can replace debug.*, but I still see cases it's not enough
18:57:05  <APNG>creationix, I see backwards compat cases if that's what you're asking
18:57:33  <APNG>modname .. ".whatever" should *always* work
18:57:33  <creationix>I need files in the luvi bundle (inside the zip) to work the same with relative requires as files on disk
18:57:45  <APNG>uh
18:57:50  <APNG>modname .. ".whatever" should work
18:58:04  <creationix>assuming modname has something about the bundle in it and I have a custom loader
18:58:11  <creationix>I still need to prototype it to be sure
18:58:15  <APNG>assuming you have a custom loader
18:58:17  <APNG>and only that
18:58:31  <APNG>a custom loader that provides a virtual filesystem based on the .zip
18:58:32  <creationix>the other problem is the weird ... syntax
18:58:37  <creationix>but I may be willing to live with that
18:58:49  <APNG>the weird vararg syntax?
18:58:51  <APNG>uh
18:59:01  <APNG>there's a reason I recommend local modname, modpath = ...
18:59:03  <creationix>yes, I've never seen a language require vararg syntax to do relative required
18:59:06  <APNG>instead of just ... .. ".whatever"
18:59:15  <APNG>uh
18:59:22  <creationix>sure, like I said, I need to test it out
18:59:22  <APNG>lua doesn't let you specify block-level arguments
19:06:05  <creationix>APNG, does lua have any sort of module index feature?
19:06:14  <creationix>like foo/init.lua can be loaded with require 'foo'?
19:07:04  <APNG>creationix, yes
19:07:08  <APNG>I mean
19:07:13  <APNG>that's done by package.path
19:07:21  <creationix>oh right
19:07:30  <APNG>it has entries for "./?.lua' and "./?/init.lua"
19:07:46  <APNG>or w/e
19:08:02  <creationix>hmm, I see './?.lua;/usr/local/share/luajit-2.1.0-beta2/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua'
19:08:08  <APNG>you can also use "foo.lua" and "foo/whatever.lua" if you don't wanna use "foo/init.lua"
19:08:19  <creationix>missing "./?/init.lua"
19:08:30  <APNG>you can add it if you need it
19:09:21  <APNG>creationix, huh
19:09:28  <APNG>5.3 includes ./?/init.lua
19:09:31  <APNG>must be a 5.1 thing
19:09:36  <creationix>probably
19:09:43  <APNG>uh
19:09:51  <APNG>no it's actually a 5.3 thing
19:10:02  <APNG>lua 5.2 doesn't have ./?/init.lua either
19:10:10  <creationix>it's a shame luajit will never migrate to 5.3
19:10:14  <APNG>meh
19:10:18  <APNG>just add it yourself >.>
19:10:23  <APNG>you don't need to patch luajit for that
19:10:42  <APNG>(package.path = "./?/init.lua" .. package.path or w/e)
19:10:47  <creationix>the thing is I support luv in plain luajit, plain lua 5.1, lua 5.2, lua 5.3 and luvi
19:10:54  <creationix>I can customize things in luvi, but not the others
19:11:25  <APNG>you can customize things in any of them, technically
19:11:34  <creationix>so that's yet another line of boilerplate at the top of luv apps
19:11:35  <APNG>you can touch package.path in any of them
19:11:46  <creationix>I can't, the application author has to
19:11:52  <creationix>I just document how
19:11:53  <APNG>uh
19:11:58  <APNG>I do it in my modules all the time .-.
19:12:21  <APNG>alternatively you can implement a whole separate global environment for luv modules
19:12:26  <APNG>and provide a luv.require
19:12:32  <APNG>but uh
19:12:35  <creationix>I'd rather not go that route
19:12:38  <APNG>wait that's what you're trying to get away from
19:12:53  <creationix>let's just see how minimal and clean I can make the boilerplate and document it cleanly
19:12:58  <creationix>*clearly
19:13:05  <APNG>but yeah I do it in my modules all the time .-.
19:13:22  <APNG>altho I do full splitting and testing and stuff
19:13:29  <APNG>I don't just blindly append stuff
19:13:42  <creationix>so basically, I'll not support relative requires at all. Just add a loader for luvi paths and document best-practices for relative requires
19:14:26  <creationix>that might work, we'll see. I need to also consider how it will interact with lit package layouts
19:30:13  <APNG>creationix, just a few notes: ./* require paths should be a last resort - that's why Lua 5.2 changed the require order
19:30:13  * rgrinbergquit (Ping timeout: 248 seconds)
19:30:34  <APNG>IMO you're supposed to set root module path in package.path
19:30:46  <creationix>yes I know that's the lua way
19:31:15  <creationix>but I don't like it. Though it looks like there is no other way that doesn't go against lua
19:31:16  <APNG>as in package.path = rootmodulepath.."/?.lua;" .. rootmodulepath.."/?/init.lua" .. package.path
19:31:35  <creationix>APNG right, and I could do that in luvi
19:31:44  <creationix>as well as inject a custom loader to load into the luvi bundle
19:31:53  <creationix>with bundle entries in package.path
19:33:03  <APNG>creationix, I take it your old module system doesn't let me put "thebin" and "config.lua" in the same folder and require"config" from inside the "thebin" luvi app?
19:33:36  <creationix>APNG sure it does
19:33:59  <creationix>luvit 2.x loads main using require instead of dofile
19:34:19  <APNG>creationix, no you don't understand
19:34:20  <creationix>luvit foo.lua translates to `require './foo.lua'` essentially
19:34:24  <APNG>"thebin" is a packed luvi app
19:34:33  <creationix>I know
19:34:35  <creationix>so is luvit
19:34:36  <APNG>as in, it's a .zip
19:34:42  <APNG>OH
19:34:46  <APNG>ok
19:34:59  <APNG>uh
19:35:00  <APNG>I mean
19:35:30  <APNG>why do you require the main module?
19:35:41  <APNG>do you use the cache?
19:35:51  <creationix>because luvit 2.x doesn't use native require at all
19:35:56  <creationix>it's just a fallback as last resort
19:36:02  <creationix>and doesn't integrate well
19:36:08  <APNG>ok
19:36:13  <APNG>in other words it's stupid, lol
19:36:18  <creationix>that's luvit's require
19:36:26  <creationix>no, I'm just using lua for what it was designed
19:36:32  <creationix>to be embedded in a real system ;)
19:36:40  <APNG>uh sure
19:36:45  <APNG>you're using lua for what it was designed
19:36:47  <creationix>the lua cli tool even says it's just a sample application
19:36:55  <APNG>but you're not using lua how it was designed
19:37:14  <creationix>how many game systems that embed lua use custom require systems?
19:37:20  <creationix>or disable require alltogether?
19:37:27  <APNG>how many game systems that embed lua support require? >.>
19:38:19  <APNG>and as far as anyone other than the creators is concerned, those games don't use lua
19:38:41  <creationix>so here is the confusion
19:38:50  <creationix>lua the scripting platform vs lua the language/vm
19:39:10  <creationix>luvit is using lua the language/vm and happens to export it's own scripting platform that is close to lua.exe
19:39:22  <creationix>it's just close enough to be really confusing
19:39:24  <APNG>lua the language, lua the vm, lua the stdlib, lua the REPL/interpreter
19:40:13  <APNG>you can use the VM without the language by emitting bytecode yourself
19:40:34  <APNG>you can use the language without the VM by using any of the many alternative lua implementations (including luajit)
19:40:34  <creationix>yep, I've done that before too
19:41:29  <APNG>you can use the lua stdlib from a non-lua language *and* vm by emitting bytecode for an alternative lua VM implementation directly
19:42:02  <APNG>and the REPL/interpreter is just the standard interface for the language+VM+stdlib
19:46:49  * rgrinbergjoined
19:52:38  <APNG>creationix, note how they're separate APIs: you depend on the VM if you wanna mess with bytecode, you depend on the REPL/interpreter if you're fiddling with command output and stuff
19:53:22  <APNG>for the language you depend on it if you're writing Lua <insert version here>, and it's statically checked
19:54:26  <APNG>for the stdlib you can actually test it at runtime so it's a bit more flexible (e.g. you might test for table.pack or table.move and fallback to your own impls - or simply disable the features that depend on them altogether)
19:56:24  <APNG>... eh just pay me if you want me to endlessly output these blogpost-quality messages >.>
19:56:35  <APNG>(lol)
19:58:01  <APNG>(I might be slightly bored)
20:06:13  <creationix>APNG thanks for the suggestions. I'll see if I can make it work
20:06:23  <creationix>I need to get back to other work for a while
23:23:08  * LuaStonedjoined