00:04:06  * kevwiljoined
00:09:27  * kazuponjoined
00:14:08  * kazuponquit (Ping timeout: 265 seconds)
00:19:23  * kevwilquit (Ping timeout: 252 seconds)
00:23:42  * coolaj86joined
00:48:06  * mmalecki[food]changed nick to mmalecki
01:03:28  * sveisveiquit (Read error: Connection reset by peer)
01:03:46  * sveisveijoined
01:56:16  * kazuponjoined
03:23:53  * Golesjoined
03:37:57  * Golesquit (Remote host closed the connection)
03:41:10  * tim_smartchanged nick to tim_smart|away
05:05:47  * tim_smart|awaychanged nick to tim_smart
05:31:18  * tim_smartchanged nick to tim_smart|away
06:20:46  * tim_smart|awaychanged nick to tim_smart
08:02:12  * DarkGodjoined
08:08:21  * kazupon_joined
08:09:55  * kazuponquit (Ping timeout: 260 seconds)
08:43:45  * kazupon_quit (Ping timeout: 260 seconds)
09:36:09  * joshthecoderquit (Quit: Leaving...)
09:42:39  * tim_smartchanged nick to tim_smart|away
12:41:29  * indexzerojoined
12:41:29  * indexzeroquit (Client Quit)
13:09:41  * Golesjoined
13:29:48  * indexzerojoined
13:30:53  * indexzeroquit (Client Quit)
13:43:21  * indexzerojoined
14:46:37  * indexzeroquit (Quit: indexzero)
14:47:08  * indexzerojoined
14:48:44  * devurandomjoined
14:48:47  <devurandom>Hi!
14:49:04  <devurandom>How do I use an SQLite3 database with Luvit? I am currently trying to use LuaSQL within my Luvit script, but apparently Luvit is not designed to load binary Lua modules (.so)...
14:50:09  <creationix>devurandom, luvit can load them with minor modifications
14:50:29  <creationix>the extension has to be .luvit instead of .so
14:50:48  <creationix>also the module can't use blocking I/O (which I'm pretty sure luasql does)
14:50:59  <devurandom>:(
14:51:01  <creationix>and the module has to be lua 5.2 style (returning the exports table)
14:51:45  <devurandom>LuaSQL does the latter. But if the former makes it not work, that does not help me. :(
14:51:54  <devurandom>How do you use databases with Luvit?
14:52:03  <creationix>devurandom, would you be interested in a non-blocking sqlite binding. I'm thinking of doing small projects for sponsorship like Mike Pall does with luajit
14:52:13  <creationix>luvit isn't used for many webapps as far as I know
14:52:52  <devurandom>You mean I pay you to write a luvit-sqlite3 binding? Sadly I cannot afford that.
14:53:09  <creationix>understood
14:53:18  <creationix>so what are you trying to build?
14:53:23  <creationix>maybe I can help anyway
14:53:28  <devurandom>There is a remote chance my employer would, but I'd need to see some references, at least, to convince him.
14:53:54  <creationix>so the first question they will have is why use luvit instead of stock lua?
14:54:04  <creationix>since luasql already works with normal lua/luajit
14:54:05  <devurandom>I would like to write a simple server in Lua, with simple authentication (pam or ldap), which receives some data over http and stores it in a database. As bonus features I would like to write a web frontend that displays the contents of that database and presents a form to enter new data.
14:54:33  <creationix>how persistent does the database need to be?
14:54:40  <devurandom>#lua recommended luvit or nginx-lua. Since I already heard of luvit, I tried it first.
14:54:59  <creationix>have you heard of my luv project?
14:55:05  <devurandom>creationix: permanent - some in-memory database does not help me.
14:55:13  <devurandom>creationix: Yours? No.
14:55:17  <creationix>it's like luvit, but more compatable with normal lua, luarocks, etc..
14:55:31  <creationix>also I started a lua-in-browser project last weekend
14:55:46  <creationix>my goal is to make a web framework like luvit, but more lua ecosystem friendly
14:55:50  <creationix>you can even use lua in the browser
14:56:30  <creationix>https://github.com/creationix/brozula, https://github.com/creationix/moonslice-luv, https://github.com/creationix/luv
14:56:32  * Golesquit (Remote host closed the connection)
14:56:55  <devurandom>The thing I will write will be damn small. Just a few lines. We will use it to track students and the points they received for the exercise that accompanies an university course at our institute.
14:57:41  * Golesjoined
14:57:58  <creationix>I think what you need is a common requirement. Do you mind if I use your requirements to help design the framework?
14:58:34  <creationix>regarding persistence, maybe couchdb?
14:58:46  <creationix>no need for a database driver there, just use the luvit http client
14:59:14  <devurandom>Currently we use EtherPad (some web based collaborative editor), but that is ugly to use to edit ascii-art tables and it is also very slow on my netbook. So my idea is to write a small server that basically just forwards data into a database, a small commandline client to enter new data, and a web based frontend which can also display the database contents.
14:59:38  <devurandom>brb
15:00:01  <creationix>also depending on how fast the database has to be and how much data will be stored in it, a simple pure-lua db could be written using luvit APIs
15:02:10  <devurandom>What do you mean "common requirement"?
15:04:24  <creationix>I mean, people often want a simple database-backed webapp with some web front-end
15:04:25  <devurandom>Really does not need to be fast. About 5 people will (spread over the whole week) enter maybe 200 lines into the database. Aprobably even lower number of people will be interested in listing the contents of that database.
15:04:30  <creationix>this is why rails was so popular
15:04:39  <devurandom>"was"? is not anymore?
15:05:03  <creationix>I guess it still is, but the performance profile of rails isn't the best when compared to something like node.js
15:05:12  <creationix>especially if you ever want to push data to the client
15:05:20  <creationix>or talk to slow clients (like mobile devices)
15:05:28  * indexzeroquit (Quit: indexzero)
15:05:58  <creationix>luvit/luv perform similairly to node.js, but in lua
15:06:04  <creationix>and using a *lot* less ram overhead
15:08:15  <devurandom>Oh, I assume no one of my 5 users will try to use their phone or tablet to enter the data. They'll probably sit at home or in the university while reading the students exercise answers (is there a good word for it? It's "Abgabe" in german) and noting down the points they receive.
15:08:29  <devurandom>lot less ram than node.js?
15:08:43  * indexzerojoined
15:08:52  <creationix>yep
15:09:00  <devurandom>That sounds awesome. Currently we have to restart the etherpad (which runs in node.js) once a week, because it consumed all the ram of the webserver... ;)
15:09:35  <devurandom>Thanks for the CouchDB tip. I will look into that! :)
15:10:15  * indexzeroquit (Client Quit)
15:10:44  <creationix>but for something that small, it's not unheard of to just write the entire database on every change to a new file
15:10:52  <creationix>and to an atomic move over the old file when done
15:10:59  <creationix>encoded as msgpack or json or something
15:11:48  <devurandom>Also nice.
15:11:53  <devurandom>I could even encode it as Lua... :)
15:12:01  <creationix>yep
15:12:14  <creationix>I called that format ltin
15:12:20  <creationix>Lua Table Interop Notation
15:12:27  <creationix>even wrote a luvit module for it
15:12:53  <creationix>https://github.com/luvit/ltin/blob/master/ltin.lua
15:13:03  <creationix>parsing is just the lua parser in a sandbox
15:13:09  <devurandom>But that file-based approach would break, when two users start entering data at the same time, wouldn't it?
15:13:21  <creationix>there is just one server right?
15:13:27  <creationix>it's the luvit server that writes to the file
15:13:47  <creationix>just put a lock variable in there to now open the file if it's already being written to.
15:13:49  <creationix>a write queue
15:14:10  <creationix>or a dirty flag
15:14:14  <devurandom>Ah.
15:14:21  <creationix>it's not really a queue since the db is global and in-memory
15:14:44  <creationix>so when done writing, check if there is a dirty flag and start the write again
15:15:00  <devurandom>I have to remember that in Luvit the server process keeps running, and not like in PHP, a process for each http request is created.
15:15:07  <creationix>yep
15:15:29  <creationix>anyway, time for breakfast, if I'm not on here, you can mail me at tim at creationix.com or ping me on twitter at @creatoinix
15:15:43  <creationix>*@creationix
15:16:08  <devurandom>So then I could just make the http handler stuff write requests into that queue and create another thread that writes it to the file.
15:16:53  <devurandom>Then I could even use the same file format as we do now in the etherpad editor...
15:17:08  <devurandom>creationix: Thanks!
15:36:23  * spionquit (Ping timeout: 246 seconds)
15:41:31  <devurandom>creationix: Meeeeeep... https://github.com/creationix/lhttp_parser.git is apparently not Lua 5.2 compatible: lhttp_parser.c:363:1: error: unknown type name ‘luaL_reg’ -- and more
15:43:46  <creationix>yeah, I'm having trouble being 5.1, 5.2, and luajit compatable
15:43:55  <creationix>I'll take a patch if someone knows how to solve that
15:44:16  <creationix>for now I'm targeting 5.1 and luajit
15:44:50  <devurandom>https://github.com/devurandom/lualdap/commit/b785fbd7ad0b17d33bb26b9d6c1cee207117eae4#L1R22 << An example of how to make it lua 5.2 and 5.2 compatible.
15:45:11  * indexzerojoined
15:45:33  <devurandom>luaL_Reg is afaik already present in Lua 5.1
15:50:06  * spionjoined
15:52:35  <devurandom>How would I run moonslice-luv with luajit?
15:53:08  <devurandom>@creationix
15:55:48  <creationix>This is the app I was going to finish for me lua workshop talk https://github.com/creationix/luv-chat
15:56:08  <creationix>I just put all the moonslice modules in my path https://github.com/creationix/luv-chat/blob/master/server.lua#L3-L4
15:56:18  <creationix>and moonslice-luv is a recursive git repo
15:56:29  <creationix>so clone it with the --recursive flag
15:56:38  <creationix>and run make in it to build luv and lhttp_parser
15:56:53  <creationix>I think the makefile assumes luajit is installed to PREFIX=/usr/local
15:57:14  <creationix>eventually I may put it all into luarocks, but I want to finish the code first before I worry about packaging
15:57:41  * kevwiljoined
16:01:13  <creationix>devurandom, ^
16:01:32  <devurandom>creationix: Hm, I currently have trouble porting lhttp_parser to Lua 5.2
16:01:57  <devurandom>You use setfenv, which is not available anymore and there is no simple replacement.
16:02:06  <creationix>hmm
16:02:07  <devurandom>Do you have an idea how to replace that easily?
16:02:19  <devurandom>Or: What do you use it for?
16:02:20  <creationix>luv uses that extensivly
16:02:33  <creationix>I thought the C side still had it
16:02:39  <devurandom>Ah, I have an idea.
16:02:50  <devurandom>I think it could be replaced by an upvalue.
16:02:53  <creationix>it's for linking a table to the userdata so I can store callbacks in it
16:02:59  <creationix>that would work
16:03:05  <devurandom>Since you only access it via getfenv, is that correct?
16:03:07  <creationix>just any table that can be accessed from the userdata
16:03:34  <creationix>right, in luv at least i have custom __index and __newindex metamethods for reading and writing it
16:03:46  <creationix>I think I did the same in lhttp_parser, I don't remember
16:04:13  <devurandom>Ok, I don't have time atm, but I will try to change that.
16:04:25  <creationix>cool, thanks
16:04:27  <devurandom>(Somewhen during the next days)
16:04:40  <devurandom>Will create a pull-request when I am finished, if that is ok.
16:06:02  <creationix>sure thing
16:06:31  <creationix>I'm working on adding closure support to brozula and child_process support to luv today
16:08:42  <devurandom>Note the first paragraph here: http://www.lua.org/manual/5.2/manual.html#8.1
16:09:46  <devurandom>Though I dont yet understand that user-value thingy.
16:09:57  <devurandom>gtg now, bye!
16:10:01  <devurandom>And thanks for your help!
16:12:44  <creationix>good luck, you're welcome
16:13:18  * kevwilpart ("WeeChat 0.3.9.2")
16:21:41  * philips_quit (Excess Flood)
16:23:12  * philips_joined
16:35:37  * indexzero_joined
16:35:37  * indexzeroquit (Read error: Connection reset by peer)
16:35:37  * indexzero_changed nick to indexzero
16:58:59  * spionquit (Ping timeout: 246 seconds)
17:02:02  <devurandom>creationix: Another question: What is the actual difference between Luvit and Luv? From the name I would guess that Luv is Luvit with using a JIT, but I guess that would be too easy...
17:02:29  <creationix>luvit is a standalone platform that uses libuv and luajit
17:02:35  <creationix>luv is just libuv bindings for lua
17:02:41  <creationix>and not the same bindings that luvit uses
17:02:50  <creationix>it's my second attempt at writing libuv bindings for lua
17:03:09  <devurandom>So you wrote all of it? Luvit and Luv?
17:03:22  <creationix>though lhttp_parser is the same bindings to http_parser that luvit uses, just packaged standalone
17:03:40  <creationix>I wrote the first half of luvit, rphillips and others at Rackspace helped finish luvit
17:03:46  <creationix>luv is all my creation
17:04:30  <creationix>so at a high level, luvit is a node.js clone, but using luajit and lua instead of v8 and javascript
17:04:52  <creationix>it's not very compatible with the outside lua ecosystem. It just happens to use the same language
17:05:12  <creationix>luv on the other hand is meant to be used with normal lua
17:05:19  <devurandom>Does Luvit have a benefit over Luv? I.e. something it does better?
17:05:20  <creationix>it's a library, not a platform
17:05:26  <creationix>I hate lua's module system
17:05:33  <creationix>luvit has a much nicer one imho
17:05:40  <creationix>and being all bundled in a single binary is nice
17:05:52  <creationix>you just install luvit on your server, and all luvit scripts know what to expect
17:05:54  * indexzeroquit (Quit: indexzero)
17:06:10  <creationix>http, https, tcp, udp, good modules, etc..
17:06:26  <creationix>you know it's luajit 2.0 with 5.2 compat flags turned on
17:06:39  <creationix>there is only one runtime to support
17:06:44  * daurnimatorquit (Changing host)
17:06:45  * daurnimatorjoined
17:06:48  <devurandom>What's wrong with Lua's modules?
17:06:55  <creationix>with vanilla lua, they could be using lua 5.1, lua 5.2, luajit and any number of compile-time flags
17:07:02  * indexzerojoined
17:07:10  <creationix>I just don't like how lua's require path search works
17:07:17  <creationix>it's very hard to make reusable modules
17:07:24  <creationix>everything assumes globally installed modules
17:07:35  <creationix>with node-style modules, it's more flexible, ad-hoc, and simpler
17:07:53  <creationix>just `require('./foo')` to use the foo.lua file in the same folder as the calling script
17:07:58  <creationix>it doesn't matter how you got there
17:08:00  <devurandom>Hm, yeah, you have to set LUA_(C)PATH. I already had figure that out - used hardcoded paths before. ;)
17:08:20  <creationix>also the search path in luvit for non-relative modules is neat
17:08:22  <devurandom>Yeah, that, too.
17:08:37  <devurandom>(same folder as calling script)
17:08:44  <creationix>it's ./modules, ../modules, ../../modules, ../../../modules, ...
17:09:01  <creationix>so you can install your libraries in a modules folder and share it as globally or locally as you wish
17:09:10  <creationix>just depending on how high up the tree you put it
17:09:10  <devurandom>Actually I thought that is insane. Trying all possible ../modules up to /.
17:09:23  <devurandom>Oh, and what happens on Windows, where it is \\?
17:09:35  <creationix>there is special code for windows paths I think
17:09:37  <creationix>but the idea is the same
17:09:38  <devurandom>In Lua I always used . as dirsep
17:09:48  <creationix>all the way up to C:\\modules or whatever
17:10:30  <devurandom>So if you like Luvit over Lua, why did you write Luv?
17:10:42  <devurandom>s/like/prefer/
17:11:09  <creationix>because lua people don't like luvit
17:11:14  <creationix>it's not lua, it's based on lua
17:11:20  <creationix>I want to appeal to lua people too
17:11:24  * kevwiljoined
17:11:44  <creationix>also I think I can hack luvit style require on top of lua using an external library
17:11:48  <devurandom>So you want to rebuild Luvit on top of Luv?
17:11:51  <creationix>the module loaders are pretty mutable
17:11:59  <creationix>not really
17:12:03  <creationix>I see them as two projects
17:12:20  <creationix>though luv itself (not the whole moonslice project) will hopefully be part of luvit someday
17:12:27  <creationix>so I only have one set of lua-libuv bindings
17:13:03  <devurandom>Yeah, replacing package.searchers should be rather simple. I never did it (just removed most of them, so package.preload has to be used instead), but the docs make it look easy.
17:13:50  <devurandom>(luv part of luvit) -> That is basically what I meant when I said rebuild Luvit on top of Luv.
17:13:53  * indexzeroquit (Quit: indexzero)
17:14:11  <creationix>right, the libuv-lua bindings are just a small part of luvit
17:14:19  <creationix>so I wouldn't really be rebuilding luvit
17:14:24  <creationix>just changing out a library it uses
17:14:28  <devurandom>Ah, ok.
17:14:41  <creationix>the whole moonslice project is closer to luvit in scope
17:15:16  <creationix>though moonslice adds a little sugar for webapps
17:15:25  <creationix>luvit is primitives only
17:15:42  <devurandom>And why dont you use moonslice in luvit?
17:15:54  <devurandom>If both do basically the same thing...
17:15:54  * kevwilquit (Client Quit)
17:16:01  <creationix>luvit is a node.js clone
17:16:07  <creationix>moonslice is a very different API style
17:16:17  * kevwiljoined
17:16:31  <creationix>but there is no reason (other than the require differences) that prevents anyone from using the moonslice libraries in luvit
17:16:43  <devurandom>Hm, I guess I'll have to take a closer look. ;) Didnt notice that yet.
17:16:46  <creationix>it's not tightly coupled to luv on purpose
17:17:10  <creationix>in fact, luvit.io is running on an older version of moonslice that was written for luvit
17:17:13  <creationix>before I started luv
17:17:34  <devurandom>So luvit is basically built for users of node.js who want everything to look as closely as possible, but just want to use Lua instead?
17:17:34  <creationix>you can see the various parts at https://github.com/luvit/
17:17:43  <creationix>more or less
17:17:46  <devurandom>k
17:17:59  <creationix>at least, that's what it has become
17:19:35  <devurandom>Thanks for your answers! :)
17:24:48  * spionjoined
17:31:53  * spionquit (Ping timeout: 246 seconds)
17:49:57  * tim_smart|awaychanged nick to tim_smart
17:56:17  * indexzerojoined
18:00:34  * indexzeroquit (Client Quit)
18:18:16  * indexzerojoined
18:21:03  * spionjoined
18:28:17  * indexzeroquit (Quit: indexzero)
18:43:25  * kevwilquit (Ping timeout: 246 seconds)
18:50:11  * joshthecoderjoined
18:50:51  * indexzerojoined
18:52:09  * kevwiljoined
18:59:17  * tim_smartchanged nick to tim_smart|away
19:23:44  * indexzeroquit (Quit: indexzero)
19:26:38  * indexzerojoined
19:41:22  * tim_smart|awaychanged nick to tim_smart
19:41:46  * dvvpart
19:42:27  * kevwilquit (Ping timeout: 252 seconds)
19:43:29  * kevwiljoined
19:48:02  * spionquit (Ping timeout: 246 seconds)
20:19:02  * indexzeroquit (Quit: indexzero)
20:51:51  * spionjoined
20:55:40  * indexzerojoined
21:33:36  * Goles_joined
21:33:58  * spionquit (Remote host closed the connection)
21:35:56  * Golesquit (Ping timeout: 244 seconds)
22:07:54  * joshthecoderquit (Quit: Leaving...)
22:31:03  * indexzeroquit (Quit: indexzero)
22:36:03  * joshthecoderjoined
22:45:53  * Goles_quit (Remote host closed the connection)
22:59:41  * indexzerojoined
23:07:14  * DarkGodquit (Remote host closed the connection)