01:40:23  * boxofroxjoined
01:43:27  * rgrinbergquit (Ping timeout: 268 seconds)
02:08:08  * creationixquit (Ping timeout: 250 seconds)
02:08:15  * creationixjoined
03:06:35  <Yorlik>Is there a way to run luvit in monitoring mode such, that like nodemon it autorestarts on a file change?
03:06:47  <Yorlik>Or some extarnal app doing that ?
03:08:38  <daurnimator>why would you restart??
03:18:08  <Yorlik>In devgelopment?
03:18:32  <Yorlik>Autoreloading server and site is a handy thing to have
03:26:54  <daurnimator>why restart the server? just reload the codwe
03:34:59  <Yorlik>Oh - is there a command for that ?
03:36:22  <Yorlik>No console input .. no clue how you woulkd do that
04:07:36  * Yorlikpart ("Leaving")
05:22:01  <SinisterRectus>hmmm. print(require == _G.require) why is this false?
05:30:41  <SinisterRectus>oh i think i get it... the custom require is in the script's env
05:31:35  <SinisterRectus>print(getfenv(1).require == require) is true... makes sense now
06:08:37  * SkyRocknRolljoined
06:12:01  * SkyRocknRollquit (Max SendQ exceeded)
06:12:51  * SkyRocknRolljoined
06:59:11  * SkyRocknRollquit (Remote host closed the connection)
07:21:12  * rendarjoined
08:23:29  * DarkGodjoined
11:32:37  * CapsAdminquit (Remote host closed the connection)
12:57:32  * Yorlikjoined
16:26:00  * Namidairoquit (Ping timeout: 260 seconds)
16:31:29  * Namidairojoined
16:31:30  * Namidairoquit (Changing host)
16:31:30  * Namidairojoined
18:30:28  * rendar_joined
18:33:38  * rendarquit (Ping timeout: 252 seconds)
18:54:59  <Yorlik>I started porting my old node.js app and am now hitting a wall, that the relative requires , e.g. in stream.init don't work, Is there a good primer somewhere how to set up a project? Or did I miss something ? I put luvit in a subdirectory ("luvit") and a "lua" subirectory there has all the lua scripts, like net, stream, etc.. I put this into my LUA_PATH and LUA_CPATH and the modules get found except the relative
18:54:59  <Yorlik>require like "Stream = require('./stream_core').Stream" doesn't work.
19:21:21  <SinisterRectus>built-in luvit libraries don't use paths. just do local stram = require('stream')
19:21:24  <SinisterRectus>stream*
19:21:50  <SinisterRectus>stream has an init file that loads the subfiles
19:22:16  <Yorlik>I tried that, but it didn't find the module
19:22:25  <Yorlik>I wonder if I screwed up my luvit build
19:25:47  <Soni>ask creationix
19:30:26  <Yorlik>Seems I got a buig eliminated and it sortof works - but now "rolePerms=JSON.parse(fs.readFileSync("config/roleperms.json" , {encoding="utf8"} ))" seems not to find the file.
19:30:47  <Yorlik>Is there a change in how file paths are evaluated?
19:31:17  <Yorlik>Also it seems not to matter which directory separator I choos (I'm on windopws here and used \\)
19:33:10  <Yorlik>trying a testfile directly inside my app folder also doesn't get found -- seems I need to get a basepath first here ...
19:33:13  <creationix>readfile takes paths as-is
19:33:16  <creationix>relative to cwd
19:33:37  <creationix>builtins modules are required as non-relative same as node
19:34:07  <creationix>luvit doesn't require json files like node
19:34:37  <creationix>this is the mapping of the internal modules https://github.com/luvit/luvit/tree/master/deps
19:34:40  <Yorlik>I think I'll switch to simple Lua tables for my configs
19:35:05  <creationix>require('stream/stream_core') should work
19:35:42  <creationix>Just tested, `require('stream/stream_core').Stream` works
19:37:59  <Yorlik>I think I'll need to get used to some specialties here. All in all porting doesn't look too painful yet - I didn't use many fancy modules.
19:38:10  <Yorlik>But some names seem different.
19:38:21  <Yorlik>crypto is in https I assume?
19:38:36  <Yorlik>and I wonder if there is an equivalent to body.parser
19:39:18  <Soni><creationix> luvit doesn't require json files like node
19:39:21  <Soni>NODE DOES WHAT?!
19:39:44  <creationix>you can require a json file as if it was a js file
19:39:59  <Soni>yes, I know that
19:40:01  <Soni>but WTF
19:40:06  <creationix>the data itself will be the exports
19:41:04  <creationix>Yorlik remind me what body.parser does?
19:41:16  <creationix>I didn't do the stream code in luvit since I can't stand working with node streams
19:41:46  <Yorlik>Some service functions to access body data I think - really I'll have to look it up in my code again mayself .. lol .. I haven't touched this for months
19:41:49  <creationix>I believe it was ported fairly faithfully from the node source by an intern at Rackspace
19:42:21  <creationix>this was during a time that I wasn't the luvit maintainer. Sorry I don't know more
19:42:40  <Yorlik>I had a talk mith my codeveloper yesterday and we decided to switch to luvit, so we can spare us the js hassle and stickj with one scripting language
19:42:59  <creationix>how large is your node codebase?
19:43:00  <Yorlik>We will also just use s simple message interface between luvit and the gameserver
19:43:03  <rphillips>https://github.com/luvitrocks/body-parser
19:43:07  <Yorlik>Not too big
19:43:21  <Yorlik>The biggest part was the polymer website
19:43:33  <creationix>personally I would rewrite it using the new coroutine based APIs instead of the mostly-node-clone APIs
19:43:35  <Yorlik>It was a very simple rest api
19:43:51  <creationix>weblit makes for a nice express/connect like framework
19:44:09  <creationix>https://github.com/creationix/weblit
19:44:13  <Yorlik>Is weblit in luvit or would I have to aDD IT TO MY APPß
19:44:36  <Yorlik>ß=?
19:44:37  <creationix>it's a third-party library
19:44:46  <Yorlik>KK
19:44:56  <creationix>just do `lit install creationix/weblit` or add `creationix/weblit` to your package.lua
19:45:01  <Yorlik>Is there a conventient waqy to get the base path of my app?
19:45:20  <Yorlik>or do i have to go through debug.getinfo?
19:45:21  <creationix>a simple module could get it pretty easy
19:47:16  <creationix>For example, create a file "libs/root.lua" that contains `return require('path').join(module.dir, '..')`
19:47:27  <creationix>then just `require('root')` and you'll have the base path
19:47:51  <creationix>anywhere in your app tree can require this as just 'root'
19:48:36  <creationix>that's if you're using luvit 2.x. If you're using luv with the newer require system something similar can be done
19:49:03  <creationix>(2.x is latest released luvit)
19:49:25  <Yorlik>usinmg 2.11
19:59:28  <Yorlik>Used this one: pRoot = debug.getinfo(1).short_src:match("^(.+)main.lua$")
20:17:36  <Yorlik>How would you solve if 2 authors have identical package names?
20:17:46  <Yorlik>what would lit install do?
20:29:54  <creationix>Yorlik lit doesn't handle many edge cases
20:30:08  <creationix>but you can create local aliases in your package.lua
20:30:38  <creationix>foo1= "creationix/foo@version", foo2="other/foo@version"
20:30:51  <Yorlik>So in case that happens I'd do it manually, use an alias and just git the module somewhere
20:30:54  <creationix>I've never actually seen this used
20:31:33  <creationix>well if you alias manually in package.lua, a normal `lit install` will put it in the aliased place automatically
20:32:02  * travis-cijoined
20:32:03  <travis-ci>luvit/luv#294 (master - a4a66bb : Tim Caswell): The build passed.
20:32:03  <travis-ci>Change view : https://github.com/luvit/luv/compare/e4f2a80b7f7a...a4a66bbe32e7
20:32:03  <travis-ci>Build details : https://travis-ci.org/luvit/luv/builds/174584888
20:32:03  * travis-cipart
20:32:26  <creationix>now when lit isn't flexible enough, even with the alias system, you can make deep trees like npm used to do by default. The luvit require resolver supports this.
20:32:44  <creationix>but then you'll need to manually or semi-manually manage your deps
20:33:10  <Yorlik>Not too bad.
21:03:46  <Soni>creationix, hey can you bring the whole luvit.io down for a day?
21:04:06  <creationix>why?
21:04:25  <Soni>I want the internet to go down for a day
21:04:32  <Soni>because of trump
21:04:49  <Soni>do literally the opposite of what he wants
21:05:03  <Soni>(eh I'm a bit evil)
21:17:03  <Yorlik>creationix - you were referring to the new coroutine based API before - where would I look in the documentation for that ?
21:25:10  <Soni>Yorlik, it's an external module
21:25:37  <Yorlik>Did he mean weblit?
21:26:05  <Soni>I believe so
22:07:41  <creationix>sorry, not much in the way of docs yet
22:07:54  <creationix>look for the creationix/coro-* packages
22:08:00  <creationix>and yes, weblit uses them, as does lit itself
22:08:16  <Yorlik>Thanks !
22:12:54  <Yorlik>So - now that I have dabbled with node and luvit - shall I learn Golang? ;)
22:13:13  * Yorlikis getting silly as a function of uptime ...
22:20:41  <Yorlik>OHHHH !! I like what is eee ! You made a coro postgres client !
22:20:46  <Yorlik>Very nice !
22:50:51  * rendar_quit (Quit: std::lower_bound + std::less_equal *works* with a vector without duplicates!)
23:02:41  <Yorlik>"fs.readFile(ROOT.."testfile.txt")" gave me "\deps\coro-fs.lua:129: attempt to yield across C-call boundary"
23:02:54  <Yorlik>where fs = coro-fs
23:03:12  <Yorlik>Is there a special way how I would have to use these functions?
23:07:22  <Yorlik>I see .. fs.open returns a yield - so i can call these functions only inside a coroutine?
23:12:00  * ^vquit (Ping timeout: 260 seconds)
23:13:18  <Soni>Yorlik, uh...
23:14:36  <Soni>idk how it works entirely
23:15:06  <Soni>try coroutine.wrap the function that calls it?
23:15:08  <Soni>idk .-.
23:15:09  <Yorlik>I'm just trying to understand it and realize my knowledge of coroutines needs a refresher
23:15:31  <Soni>but yes, you're supposed to call it from a coroutine
23:15:40  * ^vjoined
23:15:42  <Soni>not sure how you'd spawn more coroutines tho, ask creationix .-.
23:16:04  <Yorlik>coroutine.create(function)
23:16:18  <Soni>that creates new coroutines
23:16:26  <Soni>but eh nvm .-.
23:16:43  <Yorlik>But I didn't do really deep coding with it. I once made a simple non blocking tcp client with it
23:17:05  <Yorlik>But these coro thingies are much more sophisticated
23:18:09  <Yorlik>An introductory article about the architecture would be helpful though...
23:20:18  <Soni>yeah idk if there is one