<< 24-05-2015 >>

00:00:44ekarlsoanything revolutionizing in nim as of late flaviu ?
00:02:26flaviuI haven't been keeping up lately either.
00:02:39flaviuFrom what I can tell, lots of small improvements.
00:03:25flaviuThere's been an absurd amount of bikshedding on these two PRs: https://github.com/Araq/Nim/pull/2515 https://github.com/Araq/Nim/pull/2762
00:06:37lllis there a way to {.push hint[XDeclaredButNotUsed]: off.} , for stuff declared inside macros?
00:06:53lllwitouth removing it program wide
00:07:47llli tried inside the macro declaration, at the call site combination of both, even inside the parsestmt itself lol
00:08:40flaviulll: Export the thing?
00:08:41*Ven joined #nim
00:09:04lllexport what?
00:09:14lllthe macro?
00:09:24flaviuwhatever is giving you the "declared but not used" warning.
00:09:41flaviuSo if you generate a proc, make it public.
00:14:22lllmmmm but its a library, i didnt want to have to export those symbols, whatever that will work for now, ill rethink my solution later
00:15:04lllthx
00:15:06*dddddd quit (Ping timeout: 272 seconds)
00:17:34*Trustable quit (Remote host closed the connection)
00:19:04*flaviu quit (Remote host closed the connection)
00:19:21*flaviu joined #nim
00:19:44*jbomo joined #nim
00:26:47*epichero quit ()
00:27:02*epichero joined #nim
00:28:00*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:33:48*taesoo joined #nim
01:05:07*flaviu quit (Read error: Connection reset by peer)
01:09:43*flaviu joined #nim
01:11:04*key_ joined #nim
01:11:52*Kingsqueee joined #nim
01:12:05*Matthias247 quit (Read error: Connection reset by peer)
01:14:00*epichero_ joined #nim
01:14:30*keypusher quit (Read error: Connection reset by peer)
01:14:31*Kingsquee quit (Read error: Connection reset by peer)
01:14:31*epichero quit (Ping timeout: 264 seconds)
01:18:10*flaviu quit (Ping timeout: 265 seconds)
01:22:25*Roin_ joined #nim
01:28:41*Roin quit (*.net *.split)
01:36:29*darkf joined #nim
01:42:02*adu joined #nim
01:53:47*epichero_ quit ()
01:54:03*epichero joined #nim
02:10:12*adu quit (Ping timeout: 256 seconds)
02:21:55*strcmp2 quit (Quit: sleep like a boss)
02:22:14*notfowl is now known as fowl
02:22:14*fowl is now known as 16WAA1160
02:24:06*16WAA1160 is now known as fowlmouth
02:24:52*fowlmouth is now known as fowl
02:32:13*cyraxjoe_ joined #nim
02:33:48*cyraxjoe quit (Ping timeout: 252 seconds)
02:35:01*jrenner1 joined #nim
02:35:32jrenner1is there a way to get the size (number of items) in an enum?
02:54:50*boydgreenfield joined #nim
02:55:36*johnsoft joined #nim
03:12:29reactormonkjrenner1, high(type) -1 might work, but only if it's continuous
03:36:46ggVGchow can I make c2nim add importc directives to each function without also using dynlib?
03:39:14jackvggVGc why do you need to?
03:40:07*vikaton joined #nim
03:40:23vikatonHi
03:40:35*epichero quit ()
03:40:50*epichero joined #nim
03:45:42ggVGcjackv: well, firstly I don't know why I would need the dynlib directive for my use case, but more importantly the current c2nim seems to output an incorrect dynlib directive without quotes, which chokes on my current nim version
03:46:56jackvhmm, idk, I'll let someone who knows something answer this one
03:48:52fowlggVGc: it expect dynlib to be a symbol
03:49:25jrenner1is there a way to make an object run code on construction (other than writing a proc to create it)?
03:49:32fowlIe libname. Then at the top you have a diff libname set for each platform
03:49:41ggVGcfowl: okay. but all I actually want is the importc directive for all my headers. can I do that? I don't need dynlib at all actually
03:49:53Varriountjrenner1: Not really. Nim objects are fairly similar to C structs.
03:49:54fowlggVGc: pass header
03:50:01jrenner1Varriount: ok I just wanted to check
03:50:05fowlTo c2nim
03:51:20fowljrenner1: len(enum.low .. Enum.high) maybe or high - low + 1. Length only makes sense if its contiguous though
03:52:21*vendethiel- quit (Ping timeout: 250 seconds)
03:57:44*BitPuffin|osx quit (Ping timeout: 245 seconds)
03:57:59ggVGcfowl: I don't want the header directive either though. I just want the importc. am I doing something very weird? this seems like pretty normal usage
03:58:10*johnsoft quit (Ping timeout: 265 seconds)
03:58:26*johnsoft joined #nim
03:59:00fowlggVGc: weird from c2nim, where is the function if not in a header or dynlib
03:59:45ggVGcfowl: it will be statically linked in later when the final executable is built
04:01:00ggVGcfowl: I have some existing C code, and I am writing a nim module to use with it. I want to compile this nim module to C, and then build everything using gcc(since that is the current project workflow). So I just want some nim stubs of existing C functions so I can use it in the nim module.
04:01:19ggVGcfowl: it all works fine if I add importc directives manually. But I'd like c2nim to do it for me
04:05:51vikatoncan we c2nim the linux operating system?
04:06:13Varriountvikaton: Could you clarify your question?
04:06:54fowlggVGc: its weird to have neither header or dynlib. Esp coming from c2nim. What are you translating if not a header
04:07:01VarriountggVGc: If I recall correctly, there's a c2nim specific pragma that allows you to 'inject' nim code, as well as a predefined macro for detecting if c2nim is scanning the file.
04:07:08*jrenner1 quit (Quit: WeeChat 0.4.2)
04:07:20vikatonit was more of a joke than a serious question :P
04:07:44ggVGcfowl: I am translating a header. But there is no dynamic library since the implementations are linked statically in the final build.
04:08:32Varriountvikaton: c2nim can be used with regular C files, however it's ability to translate C idioms to Nim are... limited.
04:08:32ggVGcfowl: and the header directive just complicates things since then nim tries to find the original header, which it shouldn't care about. I just want nim to know the signatures of my C functions.
04:08:47VarriountggVGc: importc?
04:09:33Varriounthttp://nim-lang.org/docs/manual.html#foreign-function-interface-importc-pragma
04:09:45VarriountThe header pragma isn't *required*, I don't think.
04:12:20ggVGcVarriount: right, that's what I'm asking about. How to get c2nim to only add importc and nothing else. But I am patching c2nin to do that now
04:12:27ggVGcsince it apparently is not a common use case
04:12:29ggVGcwhich is weird to me
04:12:45VarriountggVGc: Most people use shared libaries, or modify the generated output.
04:13:09VarriountggVGc: By the way, what editor are you using?
04:13:19ggVGcVarriount: vim, why?
04:13:24ggVGcpretty obvious I would reckon
04:13:54VarriountHow would it be obvious to me? You could be using emacs... or eclipse ;D
04:14:36VarriountI ask, since I recommend to anyone using Sublime Text to download the NimLime plugin (which onionhammer and I develop)
04:14:39fowlggVGc: c2nim output always requires massaging
04:14:52Varriount^ Or the input
04:15:22VarriountYou usually need to get rid of all the ifdefs (module_name)
04:15:54ggVGcVarriount: well, my nickname is a vim command. thought that was why you were asking
04:16:30VarriountggVGc: Neat!
04:18:52*vikaton quit ()
04:19:32*ddl_smurf quit (Quit: ddl_smurf)
04:19:54*vikaton joined #nim
04:20:05*vikaton quit (Client Quit)
04:36:58*intra joined #nim
04:40:18*taesoo quit (Ping timeout: 252 seconds)
05:02:14*taesoo joined #nim
05:21:57*dtscode quit (Remote host closed the connection)
05:57:42*dtscode joined #nim
06:05:11Varriountonionhammer: Any idea why, in sublime text, Settings.add_on_change would appear to do nothing?
06:15:20*taesoo quit (Ping timeout: 272 seconds)
06:29:22*TEttinger quit (Ping timeout: 255 seconds)
06:32:54*boydgreenfield quit (Quit: boydgreenfield)
06:35:12*kumool joined #nim
06:37:53*kumul quit (Ping timeout: 246 seconds)
06:38:20fowlVarriount: there's a new version of nimline out?
06:38:26*sepisoad_ joined #nim
06:38:45*superfunc quit (Quit: Page closed)
06:42:31*dtscode is now known as charmander
06:51:39*kumool quit (Quit: Leaving)
06:58:26*charmander is now known as bulbasaur
07:02:12*jbomo quit (Ping timeout: 272 seconds)
07:04:17*vendethiel joined #nim
07:10:39*pregressive quit (Remote host closed the connection)
07:12:45Varriountfowl: I'm trying to get it out the door, but keep finding things to refactor.
07:19:37*nande quit (Remote host closed the connection)
07:23:55*MyMind joined #nim
07:27:35*vendethiel quit (Ping timeout: 246 seconds)
07:42:54*MyMind quit (Ping timeout: 252 seconds)
07:55:10*xcombelle joined #nim
07:56:57ggVGchow do I correctly create this Camera object and get a pointer to it? https://gist.github.com/3f8f14e20ca8f8d42715
08:02:18*gmpreussner|work quit (Read error: Connection reset by peer)
08:03:18*epichero quit (Remote host closed the connection)
08:12:04*BlaXpirit joined #nim
08:14:31*cyraxjoe_ is now known as cyraxjoe
08:22:07reactormonkggVGc, I don't think you need all of the importc statements btw
08:22:16ggVGcreactormonk: output from c2nim
08:22:25reactormonkggVGc, ok, then just keep it
08:22:39reactormonkfor allocating new stuff, go via new(cam)
08:22:44reactormonkthen you can assign the single fields
08:23:39ggVGcreactormonk: well, I need to pass a ptr to a wrapped C function. I used cast[ptr Camera](cam)
08:23:42ggVGcseems to do what I want
08:24:07reactormonkno need to cast from what I see
08:24:48ggVGcreactormonk: because you don't have the call site where I need a ptr
08:25:13ggVGcreactormonk: I misstated my question I guess. I needed to make a ref into a ptr
08:25:37reactormonkggVGc, ah ok. addr gives you the address
08:26:14ggVGcyeah, that doesn't help either
08:26:25ggVGca ref is already an address
08:26:26reactormonkI know :-/
08:26:36reactormonka ref is a managed address
08:26:37ggVGcanyway, the cast is what I was looking for
08:26:39ggVGcright
08:26:41reactormonknope, it's not
08:26:44ggVGchence why I needed the cast syntax
08:26:55ggVGcI just started with Nim a few hours ago
08:26:56reactormonkbecause the memory is still managed by the GC and might get cleaned up
08:27:17ggVGcreactormonk: it won't get cleaned up while the ref is still in scope
08:27:31reactormonkggVGc, that's true, but still a rather flanky assumption
08:27:36ggVGcreactormonk: I am not passing the ownership to the C function. I am merely letting it interact with my reference
08:28:09ggVGcI don't think it's a bad assumption. Pretty sure I know exactly how this is all happening, and the generated C is what I wanted. If Nim removes my reference while I am still using it, that's a major bug
08:28:19ggVGcand the C function I am calling takes no ownership
08:28:30reactormonkggVGc, anyway, http://nim-lang.org/docs/manual.html#types-reference-and-pointer-types
08:28:36ggVGcthe calling code owns the ref, so it's fine for Nim to GC it when I'm done
08:29:44ggVGcreactormonk: I don't see how it can be unsafe to pass a GC-managed reference to a C function that assumes no ownership of it. Am I missing something fundamental?
08:31:25reactormonkggVGc, ah, new can only be used for traced memory (e.g. ref)
08:32:47ggVGcreactormonk: I am not following you. Is there a problem with this or not? https://gist.github.com/5b5f2c38b0eb97dca93f
08:33:58reactormonkggVGc, might be, if cam goes out of scope but the function returns something with a reference to cam and you return that.
08:37:15ggVGcreactormonk: well, that would be dumb. I am very aware of how to deal with memory and scope and garbage collectors. All I asked initially was how to get a raw pointer from a ref. I am fully aware I am now writing unsafe code, but I am very certain of where the scope for cam starts and ends, and that the C functions do not assume ownership.
08:37:37ggVGcreactormonk: if there isn't something very special with Nim, I don't think you're telling me much news
08:38:19*silven_ is now known as silven
08:38:31ggVGcreactormonk: how could cam go out of scope in the pasted example?
08:39:16reactormonkggVGc, I would assume you modify some global variable via camSetActive? seems to have some side effects
08:40:27ggVGcreactormonk: as I said I am quite aware of how to deal with scopes and memory ownership, and that these C functions do not assume ownership, but here you go, https://gist.github.com/c3b8ccbbba31b882a627
08:41:01reactormonkggVGc, perfect.
08:41:18reactormonknuff said. But if you need something outside the GC, the alloc0 is the way to go
08:49:14*Matthias247 joined #nim
09:01:14*MyMind joined #nim
09:05:10*cyraxjoe_ joined #nim
09:06:30*cyraxjoe quit (Ping timeout: 252 seconds)
09:09:23*vendethiel joined #nim
09:10:53*JinShil joined #nim
09:15:29*Senketsu joined #nim
09:33:38*vendethiel quit (Ping timeout: 252 seconds)
09:34:18*OnO joined #nim
09:35:17AraqggVGc: reactormonk is wrong, your code is fine. well I didn't look at it, but from the conversation it's obvious you know what you're doing
09:35:44reactormonkAraq, meh, ok.
09:35:53Araq;-)
09:36:02Araqhow's the nimsuggest bug hunt?
09:36:11*Kingsqueee quit (Quit: Konversation terminated!)
09:36:54reactormonkugly
09:37:08reactormonkI honestly don't know where to look right now :-/
09:37:54*boopisaway is now known as boop
09:39:25Araqmsgs.nim implements the filename->index mapping
09:39:41Araqand you said the file index is not re-used
09:39:55Araqso ... it's pretty obvious where to look?
09:42:48*Ven joined #nim
09:43:04*vendethiel joined #nim
09:48:25*milosn quit (Ping timeout: 258 seconds)
09:48:39reactormonkI still need to figure out how it should look like
09:49:09reactormonkbecause the situation where it's called the second time is not really easily inferrable from how to the compiler works, because the compiler never gets a second compile instruction
09:50:00*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:56:00*sepisoad_ quit (Ping timeout: 256 seconds)
09:59:50*ddl_smurf joined #nim
10:01:32*ddl_smurf quit (Client Quit)
10:10:57*MyMind quit (Ping timeout: 240 seconds)
10:11:31*pregressive joined #nim
10:15:51*pregressive quit (Ping timeout: 250 seconds)
10:16:31ggVGcAraq: Why can't variants be compile time checked?
10:20:57Araqreactormonk: so inject some writeStackTrace() calls
10:21:17AraqggVGc: they can and are but it's hidden under some switch
10:28:04ggVGcAraq: hm, I have fieldChecks on, and --experimental. Still don't get a compile error on code that crashes in runtime with FieldError
10:30:16Araqit's warning[proveField]:on, I think
10:31:16ggVGcAraq: oh, thanks. That does give me warnings at least. Where is this documented?
10:31:31Araqiirc in the compiler guide
10:32:44Araqer ... no it is not. yay
10:32:48Araqalso wtf
10:32:58Araqhttp://nim-lang.org/docs/nimc.html#nim-idetools-integration
10:33:05Araqwhy does this still exist?
10:34:01ggVGcAraq: why is that warning not made into a standard error?
10:34:27ggVGccompile time check of variant types is the difference between being usable or not at all for me
10:34:38Araqit would break too much code
10:35:18Araqand it's more expressive this way, I often have something like:
10:35:46Araqfor i in 0 ..< safeLen(n): access n.kids[i]
10:36:01Araqwhere safeLen returns 0 when n.kids cannot be accessed
10:36:16Araqso it's safe but the compiler is too stupid to realize
10:43:13ggVGcAraq: should be able to solve cases like that in compile time too though, but I guess that's a feature for the future
10:43:38Araqindeed.
10:46:56*ingsoc joined #nim
10:51:26ggVGcAraq: hm, I think that warning is too strict. Shouldn't this be all good? https://gist.github.com/0da22145e6b2efc62712
10:51:37ggVGcI get Warning: cannot prove that field 'n.intVal' is accessible [ProveField]
10:51:59Araqlol
10:52:28Araqthere is hardly any dataflow analysis involved
10:53:07Araqyou should compare it to what a FP language requires you to write:
10:53:17Araqcase n.kind
10:53:27Araqof nkInt: n.intVal = 3
10:53:32Araqelse: discard
10:53:53ggVGcyeah, I see. So they're not actually compile checked yet then
10:54:08ggVGcI was looking for what haXe has with enums
10:54:22Araqthey are checked as good as Haxe does it.
10:54:24ggVGcanyway, all good. just wanted to know how it was
10:54:32ggVGcalright
10:55:07Araqin fact, the checking already is better
10:55:37Araqif n.kind != nkString: n.intVal = 3 # works, irrc
10:57:55ggVGcAraq: so, should this work? https://gist.github.com/34e84fd80fff37096295
10:58:00ggVGcbecause it still errors for me
10:58:38Araqno, it shouldn't. cause 'n' is a global variable.
10:59:57Araqyou have to use less toy'ish toy examples to see if it works for you
10:59:59ggVGcah, with a let binding it works
11:00:32ggVGcI just want to know what I can assume to be checked
11:00:47Araqyou can treat the warning as an error.
11:01:32Araqyou need to adapt your coding style slightly to make the prover happy, but it should work out just like in FP languages
11:06:04*dddddd joined #nim
11:06:51*banister joined #nim
11:18:35*ingsoc quit (Ping timeout: 246 seconds)
11:21:42Araqdom96: what do you think of versioning in the language?
11:21:43*stefantalpalaru joined #nim
11:21:55dom96Araq: what do you mean?
11:22:10Araqproc toUpper(s: string): string {.version: "0.11.4".} # in unicode.nim
11:22:31Araqimport unicode {.version: "0.11.2".} # doesn't import toUpper
11:23:32Araqhowever, this doesn't mean we have multiple versions of unicode.nim in the stdlib
11:24:00Araqit's only a means to freeze imports
11:25:35Araqbut then it shouldn't be done via the import statement
11:27:17stefantalpalaruHi. How are libraries specified with dynlib located? I'd like to move the path outside of the code, but -p:"..." is ignored for this purpose and I can't use gorge in this particular file to determine the path (the file is lib/system/mmdisp.nim because I'm messing with a new GC)
11:28:07Araqstefantalpalaru: sounds like you confused everything :P
11:28:34Araqdynlib uses dlopen, so the OS does the path handling
11:28:47Araq-p is for Nim's import/include statements
11:29:44Araqand lib/system/mmdisp can **include** (not import) external Nim code
11:29:49*ddl_smurf joined #nim
11:30:28Araqso ... -p:path_to_my_new_gc_stuff should work
11:31:02Araqyou can also override where the compiler looks for system.nim via --lib
11:31:15dom96Araq: meh
11:31:18dom96I don't like it
11:31:22Araqgood.
11:39:41Araqlol
11:39:57Araqflaviui replaced CRC with SHA1 in the compiler.
11:40:07Araq*flaviu
11:42:04Araqdom96: is the optionals module ready for review?
11:42:27dom96I believe so
11:53:09*banister quit (Read error: Connection reset by peer)
12:04:21*banister joined #nim
12:09:15*strcmp1 joined #nim
12:11:05*filcuc joined #nim
12:29:02*HakanD joined #nim
12:30:31*HakanD_ joined #nim
12:30:55*strcmp1 quit (Quit: Leaving)
12:31:23*strcmp1 joined #nim
12:33:45*HakanD quit (Ping timeout: 240 seconds)
12:59:45*filcuc quit (Ping timeout: 256 seconds)
13:07:51*Matias joined #nim
13:08:24*thotypous quit (Disconnected by services)
13:08:26*Matias is now known as thotypous
13:15:19*ingsoc joined #nim
13:15:19*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:17:59*MyMind joined #nim
13:24:50*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:31:14*bjz quit (Quit: Textual IRC Client: www.textualapp.com)
13:31:35*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
13:32:04*BlaXpirit quit (Remote host closed the connection)
13:32:29*filcuc joined #nim
13:33:57*BlaXpirit joined #nim
13:34:36*OnO joined #nim
13:35:31AraqggVGc: just read some logs, use #header instead of #dynlib for c2nim
13:35:44*OnO quit (Client Quit)
13:40:27*HakanD_ quit (Quit: Be back later ...)
13:40:54*HakanD_ joined #nim
13:43:47*BlaXpirit_ joined #nim
13:43:47*BlaXpirit is now known as Guest71244
13:43:47*Guest71244 quit (Killed (card.freenode.net (Nickname regained by services)))
13:43:47*BlaXpirit_ is now known as BlaXpirit
13:45:54*HakanD_ quit (Ping timeout: 276 seconds)
13:47:36*Sembei quit (Max SendQ exceeded)
13:47:58*MyMind quit (Ping timeout: 264 seconds)
13:48:48*Sembei joined #nim
14:00:54*flaviu joined #nim
14:04:15*gmpreussner|work joined #nim
14:04:24*MyMind joined #nim
14:06:40*Sembei quit (Ping timeout: 272 seconds)
14:14:02*milosn joined #nim
14:17:45*ozra joined #nim
14:19:58*HakanD_ joined #nim
14:20:26*xcombelle quit (Remote host closed the connection)
14:20:38*HakanD__ joined #nim
14:22:49*Siecje joined #nim
14:23:35federico3Araq: I just ran into http://forum.nim-lang.org/t/602 on a 64-bit unix
14:23:50*darkf quit (Quit: Leaving)
14:23:55ozraHi. Anyone in here who can help me fill in some blanks in my understanding? What does `[PType * PType]` mean in `proc TypeEqualsAux(a, b: PType, s: var set[PType * Ptype]): bool` ?
14:24:21Araqozra: it's pseudo code, a set of tuples
14:24:38*HakanD_ quit (Ping timeout: 265 seconds)
14:25:02Araqnowadays written as HashSet[(PType, PType)]
14:25:09ozraAha, it's not nim syntax?
14:25:15Araqnah
14:25:30Araqand this description is a bit too low level
14:25:34ozraah, ok, I felt like I totally had missed something..
14:26:48Araqfederico3: Nim can disagree with GCC on how wide a pointer is on any OS.
14:28:44federico3hm, I have gcc-4.9-base:i386 but running a 64-bit kernel
14:29:31ozraThe I guess the `{| ... |}` notation regarding the If statments blocks are manual pseudo also? I wasn't certain when reading it.
14:29:54federico3and build.sh uses uname
14:30:14Araqozra: indeed.
14:30:31ozraok, good, I'm on the right page still then :)
14:30:51*filcuc quit (Quit: Konversation terminated!)
14:31:48*Pisuke joined #nim
14:32:34ozraWhen reading through the man, I saw several examples where a `do ... while` loop would have been the obvious choice for DRY, is that missing (because of do-notation, or other reason)?
14:32:36federico3ok, patched
14:37:12Araqozra: not sure what you mean, 'while true + break' is as DRY
14:38:12ozraMmm, not when a var is init from an expression, placed before while, and then in the loop again..
14:38:42ozraI'll see if I can find a concrete example...
14:39:03Araqno need. 'while true + break' is always DRY
14:39:33Araqvar foo = x()
14:39:43Araqwhile foo != nil: foo = x()
14:39:57Araqcan always be rewritten:
14:39:58Araqwhile true.
14:40:03Araq var foo = x()
14:40:12Araq if foo == nil: break
14:41:11ozraYeah, you're right. But, arguably, it could be cleaner with do-while? Or, what's the rationale behind it if I may ask?
14:43:07ozraSimply limiting the amount of looping constructs?
14:43:10Araqthe rationale is that these looping constructs are misdesigned. both while and do-while suck
14:43:47Araqwhat should be done is to have a general 'loop' + break.
14:43:52ozraHaha, well that has some truth to it, and still we use them ;)
14:43:55ozraI like, that.
14:44:20ozraI was gonna propse an issue regarding a 'loop' or 'for ever' statement. Loop's better. Is there one?
14:44:31ozraissue, I mean.
14:44:33Araqha, I considered introducing 'loop' as a shortcut for 'while true'
14:44:48Araqbut it's easily done with a template
14:45:02Araqtemplate loop(cond, body: untyped) = while true: body
14:45:09Araqer, without the 'cond' lol.
14:45:12ozraYeah. It feels more obvious. Perhaps it should be a stdlib tpl?
14:45:38Araqyeah but 'while true' is the official Python idiom too, so *shrug*
14:45:39ozraEven though we all know "while true" by heart.. but you know..
14:45:45ozrahaha. yeah
14:46:50AraqPython's rationale is that the indentation based syntax leads to 'while' but not to 'do-while'
14:47:05AraqI'm not sure I agree, but there is some logic in the statement
14:47:11ozraMan , I gotta say, just reading through the man, I'm even more impressed with Nim. I'm trying to keep cool headed, because I really have to work on an actual project, but Nim is pulling me in, haha.
14:48:59AraqI'm pleased that we finally documented overloading resolution for 0.11.0. It always felt like a big hole in the spec.
14:49:30ozraThe man, is it generated from source, or mixture?
14:49:48Araqfrom Nim's docgen, via the rst2html command
14:50:05Araqso yes, from source but the source has the ending .txt
14:51:21ozraI figured, perhaps I should make a stab at editing it a bit and make a PR, while I'm still new, so that the things I found unclear could be worded just a bit different to clarify, and fix some (english) grammars..
14:51:45ozraOne so quickly forgets what was unclear, when it's groked and self evident..
14:54:12ozraI saw a lot of "iff" in the non code parts - is this intentional? What up?
14:54:31ozra"Iff this is true then that works like so"
14:54:43Araq"iff" means "if and only if"
14:54:50Araqit's common in math
14:55:01Araqnot a typo :P
14:55:13Araqbut yeah please go ahead and make a PR
14:55:27ozraAha, totally did not know that. No, it was consequent, so I realized there must be something to it :)
14:56:27*JinShil quit (Quit: Konversation terminated!)
14:57:35ozraI'm also curious as to the rationale regarding "command invocation syntax", in Haskell, LS, even coffees, etc. juxtaposition call syntax is the norm, in LS/CS parens are still allowed (which I find important). But, why the artificial 1-arg limitation?
14:58:14ozra(I was first pleased to read it, it's often a problem in LS with the greedy arg grabbing)
14:58:25ozra(for conciseness)
14:58:49Araqso that echo f x, g x does the "obvious" thing.
14:59:02Araqwhich is echo(f(x), g(x))
15:00:11*pregressive joined #nim
15:00:39Araqwell there is a distinction between command statement vs command expression here
15:01:04ozra"Obviously wrong" in those langs, but I see what you mean. Just thinking loud here, because I find merits to both, only this feels a bit ad-hoc. But forcing one-args could be done w. `echo x.f, x.g`..
15:01:11federico3Araq: sound like you prefer RST over asciidoc. Any reason why?
15:01:43Araqthe command statement takes an arbitrary number of args separated by ",", the command expression only allows for 1 argument
15:02:08ozraYes, I'm refering to the expressions..
15:02:37Araqfederico3: I have an RST parser in Nim and no asciidoc parser.
15:03:17federico3I'd be happy to try to add an asciidoc parser
15:03:49*ingsoc quit (Quit: Leaving.)
15:04:50Araqwhat's the difference to RST?
15:05:03Araqany TL;DR of the differences?
15:05:40ozraFunctional programming can benefit a lot from n-ary args in juxtaposition syntax, but then again, often parens are needed to make the intent clear anyway, so it's not a real issue.
15:07:27federico3asciidoc is as readable as markdown but scales up to book-sized documents where latex-like features are required (indexes, glossary, links to figures, footnotes)
15:08:04*kumul joined #nim
15:08:56*Matthias247 quit (Read error: Connection reset by peer)
15:08:57federico3(and the toolchain generates html, pdf, epub straight away)
15:11:43Araqdoes it generate PDF directly or via LaTeX?
15:13:40ozraAraq: I jotted down some test code of constructs I often use, and I realize that nim-command-syntax actually is more obvious when utilizing the dot-notation. Almost all calls I use are un- or binary. I file this in the "great 'ad-hoc' (from my frame of reference...) rule" department.
15:15:19ozraI read in man: "return is allowed in a closure iterator". But what does it do? I couldn't figure out. "Breaks"?
15:15:34Araqozra: justaposition really was introduced for 'spawn' and 'await' to further blur the distinction of keyword vs macro
15:16:06ozraok. I like it in any event :)
15:16:34*jbomo joined #nim
15:16:48Araqozra: 'return' returns from the closure iterator causing the iteration to stop
15:17:03ozraalright, got it.
15:19:45federico3Araq: without, unless you are using LaTeX syntax inside the asciidoc document (e.g. to embed formulas)
15:19:54ozraRegardin exception hierarchy: probably obvious, but just so I have no doubts: "ArithmeticError" regards only integer numbers?
15:20:17AraqI think so, not sure
15:21:04strcmp1is this page suppose to be unstyled? http://nim-lang.org/docs/documentation.html
15:21:30Araqstrcmp1: this page should not even exist
15:24:50*sepisoad_ joined #nim
15:28:07strcmp1ah okay im not sure how i ended up there then
15:28:13*BitPuffin|osx joined #nim
15:28:56ozrastrcmp1: cause google sees everything ;)
15:29:05*TEttinger joined #nim
15:30:27*gokr_ joined #nim
15:31:00*vikaton joined #nim
15:32:57ozraAraq: or any one else, knowing: I might be totally off in my understanding here, but, regarding `static[T]`: why is it not expressed `T{static}`, or then, by extension, `T{const}`, along with `T{lit}` and the others? In C++ that would ofc be a part of the template, and then it could be filled by any const_expr code at compile-time, thus respresenting what nim classifies 'const'. What am I missing here?
15:34:22vikatonDoes nim have a playpen
15:36:21*dhasenan joined #nim
15:36:34Araqozra: static[T] is not an AST constraint, it's a semantic constraint
15:37:09Araqbut it's true that in practice the distinction is kind of weird
15:37:29*Arrrrr joined #nim
15:37:56dhasenanIt looks like there's no builtin wrapper for fork(2). A bit unexpected.
15:38:23ozraYeah, I mean, what differs to the programmer and to the compiler could be separated, in favour of the coders reasonable expectation..
15:38:50ozraAs long as it doesn't complicate compilation to hell
15:39:16ozraIt seems like a reasonable syntax unification..
15:39:33*BitPuffin|osx quit (Remote host closed the connection)
15:39:47*BitPuffin|osx joined #nim
15:40:47ArrrrrWhat are you talking about?
15:40:56ozraI'll study it more so I understand it better - I like the idea of being able to make a param comp-time, instead of expressing it in the typevars-region, like in C++. I have it like this in a DSL I made for LS. Haven't got enough use-cases to get a real feel of pros and cons yet though...
15:43:42ozraArrrrr: Eh, who? Generally?
15:44:17*Siecje1 joined #nim
15:44:50ArrrrrYou said "[17:39] <ozra> It seems like a reasonable syntax unification.."
15:45:27ozraRefering to static[T] -> T{static}, or T{const}
15:45:32AraqArrrrr: read the logs please
15:45:52*Siecje quit (Ping timeout: 244 seconds)
15:46:02Araqdhasenan: at one point I stopped wrapping posix stuff, add it to posix.nim please if it's missing
15:46:41dhasenanAraq: acknowledged.
15:47:04ozraThanks for filling out some blanks for me, I'm in a meta-groked state now. Time to go out walk the dog.
15:48:50dhasenanI need a cross-platform thing anyway, and Windows doesn't provide fork(), so I guess I shouldn't use it after all.
15:49:42*xcombelle joined #nim
15:50:08*filcuc joined #nim
15:51:06*epichero joined #nim
15:52:33vikatonwhat important role does nimbase.h have in the output of C code?
15:55:16Araqvikaton: it's the only hand written C code in Nim.
15:55:24Araqdhasenan: osproc module?
15:56:33*kumul quit (Ping timeout: 256 seconds)
15:57:24*BlaXpirit quit (Quit: Quit Konversation)
15:58:07vikatonAraq: That's impressive, is it basically the set of rules that makes the compiled C code what it is?
15:58:51dhasenanAraq: yes, it's got what I need.
15:59:02dhasenanIt just would have been convenient if all the world were Posix.
16:00:20*epichero quit ()
16:00:36*epichero joined #nim
16:01:49*BlaXpirit joined #nim
16:03:09*johnsoft quit (Ping timeout: 245 seconds)
16:03:49*johnsoft joined #nim
16:05:41Araqvikaton: it's only a set of macros to unify the C compilers a bit, there is not much in it and the codegen could easily not use it
16:09:10*Jesin quit (Quit: Leaving)
16:29:12vikatono
16:32:45*Jesin joined #nim
16:34:32*kumul joined #nim
16:41:13*Noobulator joined #nim
16:41:55NoobulatorHey all, does anybody know if I can use nimble to build a program with -threads:on?
16:42:09*johnsoft quit (Ping timeout: 240 seconds)
16:43:09*johnsoft joined #nim
16:43:37Noobulatornevermind figured it out
16:43:38dom96Noobulator: add --threads:on to a file.nim.cfg file
16:43:45Noobulatoroh that works better
16:45:25NoobulatorWay easier, cheers
16:45:43Araqdom96: are we happy with people using nimble for building software?
16:45:56dom96Araq: of course
16:46:03Araqand if so, should we merge Nake and Nimble?
16:46:11Araqsomehow?
16:46:21dom96no
16:46:36Araqwhy not?
16:46:49dom96Because Nimble must remain simple.
16:47:00dom96It will support the execution of the likes of nake files
16:49:02Araqpeople don't want simple, people want 1 program to learn to build their Nim based software
16:49:39dom96There are more important things to implement at the minute
16:51:44reactormonkAraq, rake + gem or sbt? Gotta say sbt is a fucking complex tool
16:53:28reactormonkand it's already a running joke that there's no good documentation for sbt.
16:56:29vikatonwhats the deal with Nim and wikipedia?
16:57:03strcmp1https://en.wikipedia.org/wiki/Nim_%28programming_language%29 ?
16:57:49strcmp1i see https://en.wikipedia.org/wiki/Nim too but thats not unusual
16:58:43*wb quit (Ping timeout: 244 seconds)
16:58:53reactormonkstrcmp1, yeah, we have som guy leading a vendetta
16:58:59vikatonlol
16:59:30vikatonwe should add the crown for Nim
17:00:26reactormonksure, go ahead
17:00:36*wb joined #nim
17:00:38Arrrrrhah
17:01:29reactormonkI mean https://en.wikipedia.org/wiki/Rust_(programming_language) also has the "too many primary sources"
17:01:41*stefan__ joined #nim
17:02:25Araqone problem is that journals all try to save money, so they let the primary authors write the articles
17:02:48reactormonkbut they don't have like 4 contested deletions - check the talk page
17:05:21dom96We should be happy. We won that last fight.
17:06:50*filcuc quit (Ping timeout: 252 seconds)
17:09:01vikatonreactormonk: I can't, im not confirmed
17:09:15vikatonnor can I think of any wikipedia pages to edit to be confirmed
17:09:32vikatonI think the logo needs to be uploaded to wikipedia itself https://en.wikipedia.org/w/index.php?title=Nim_(programming_language)&action=edit
17:09:59vikatonif someone has a confirmed account, they should upload the image and add the logo
17:10:01*xcombelle quit (Ping timeout: 264 seconds)
17:10:23*BitPuffin|osx quit (Ping timeout: 258 seconds)
17:11:54ozra@Araq @dom96 - I thought Nimble was a package manager? Am I missing something?
17:11:56vikatonNever knew Nim came out in 2008, seems like people are just starting to learn of it now
17:12:47reactormonkvikaton, yeah, was here 3 (?) years ago, with 20 people idiling here... just checked again, 157 O.o
17:13:24vikatonlol
17:13:25Araqvikaton: well it turned out that "bootstraps itself!" is not sufficient for "can develop real software in it" ;-)
17:13:25*Trustable joined #nim
17:13:46vikatonhaha
17:13:58vikatonbetter noticed now than never I guess
17:13:59Araqozra: when people use it for building, it's pretty much a build tool
17:15:38reactormonkAraq, but for executing nim code you gotta invoke the compiler etc.
17:16:17ozraOk. Haven't gotten that far.. I use make to wrap a nim line atm..
17:17:41wbDoes "export X except Y" work? Or does "except" only work for imports?
17:17:54*Noobulator quit (Quit: Page closed)
17:17:57*boydgreenfield joined #nim
17:18:07reactormonkwb, if it doesn't, sounds like something that should be fixed
17:19:02Araqwb: not been implemented
17:19:08Araqand it's a bit dubious IMO
17:19:19reactormonk... that's true
17:19:23Araqin fact, you shouldn't export whole modules
17:19:53Araqwhy is it a module then and not an include file?
17:21:38lllis there a list of warnings and hints available somewhere? i just learned about warning[proveField] which isnt enabled with -w:on and -hints:on
17:22:07*taesoo joined #nim
17:22:46*stefan__ quit (Ping timeout: 246 seconds)
17:23:17Araqlll: I thought nimc.html had it but I was wrong, so the answer is: no.
17:24:45lllis there many warnings and hints that arent enabled with -w:on and --hints:on?
17:24:58*boydgreenfield quit (Quit: boydgreenfield)
17:26:16Araq5
17:26:50Araqvar gNotes*: TNoteKinds = {low(TNoteKind)..high(TNoteKind)} -
17:26:52Araq {warnShadowIdent, warnUninit,
17:26:53Araq warnProveField, warnProveIndex, warnGcUnsafe}
17:29:26lllAraq: thx!
17:29:59lll1 more question: "--patterns:on|off turn pattern matching on|off" i found this in the doc, is there any info on what that is?
17:30:44*wb quit (Read error: Connection reset by peer)
17:33:13*xcombelle joined #nim
17:35:28*wb joined #nim
17:36:46dom96http://www.reddit.com/r/nim/comments/373x6a/nims_future/
17:37:49QuoraI'm having a strange issue with a form posting to jester
17:38:32Quoraone sec while I get the stuff gisted
17:39:38wbyeah, i see why "export x except y" could be iffy. It should be an include, but the module in question is 'math' (ie trying to include it throws "cannot importc variable at compile time" and such), so i'm using import/export. Problem is, apparently the math module acquired `^` in an update and it conflicts with the `^` i've defined.
17:41:09*alphawaffle joined #nim
17:41:25*alphawaffle quit (Remote host closed the connection)
17:41:42Quorahttps://gist.github.com/Heartmender/8200676604eecf58ea4a
17:42:00Quoraif i post "FOO BAR" with this form, the "FOO BAR" never is visible to nim
17:43:21dom96Quora: your textarea needs a 'name' attribute
17:43:50dom96Here is an example https://github.com/dom96/jester/blob/master/tests/alltest.nim#L73
17:44:08Quorai hate webdev
17:44:11*HakanD__ quit (Ping timeout: 265 seconds)
17:44:11Quorathanks
17:44:22lllQuora: lol
17:45:07Quorahttp://puu.sh/hYTxo/87c5d82443.png
17:45:08*Siecje1 quit (Quit: Leaving.)
17:45:09Quora:D
17:45:32dom96Quora: cool. Are you writing a forum?
17:45:49Quoradom96: yeah, I want to do it with material design and the like
17:45:57*Siecje joined #nim
17:46:43dom96Quora: Nice. You could reuse Nim Forum's code base, but I will understand if you want to start from scratch.
17:47:00QuoraI did actually start with the nim forum's code
17:47:18Quorait didn't work very well
17:47:44Quoraso I'm going to dick around a little and maybe PR back with some improvements if I end up fixing things
17:51:44*Siecje quit (Read error: Connection reset by peer)
17:53:03*Ven joined #nim
18:02:21*Arrrrr quit (Quit: Page closed)
18:04:54*Sornaensis quit (Excess Flood)
18:05:32*Sornaensis joined #nim
18:05:46dom96Quora: What's your goal? Just to learn and play with Nim?
18:08:39Quoradom96: I want to deploy and use things that are not php
18:09:09dom96Quora: What issues did you run into with nim forum?
18:09:29Quoratheming
18:09:43lllhey dont hate on php!
18:10:17*vikaton quit ()
18:10:22dom96Quora: It would be nice if you could improve the theming in Nim Forum.
18:11:21Quoralll: I can and I will
18:12:56lllQuora: lol, i mostly hate it too, i work with it almost everyday T_T
18:13:08llland not by choice
18:13:31reactormonklll, oh, I'm currently trying to get some apache + java stuff running
18:13:43sepisoad_I'm quiet confused with asyncdispatch, it is said that it can act as an event loop, but i found it so hard to find a way to use it as an event loop, i wish there was a simpler way to do that
18:14:11dom96sepisoad_: What are you trying to use an event loop for?
18:14:53sepisoad_something like a timeout mechanism where we define a callback function for it
18:15:02lllreactormonk: i try to not start anything new in php, but clients with existing codebase, i cant ask them to rewrite it ;P
18:15:20reactormonklll, yup, I see the problem
18:15:29sepisoad_i want to have a loop that can wait for various user defined events
18:15:38sepisoad_like timeout
18:16:06dom96sepisoad_: Have you tried using sleepAsync?
18:16:14*egrep quit (Quit: Error -38: Black hole has swalled this client.)
18:16:24sepisoad_how sleepAsync can help
18:16:42dom96sepisoad_: It returns a Future which finishes after a set amount of time.
18:16:49*egrep joined #nim
18:17:22dom96var fut = sleepAsync(1000); fut.callback = proc () = echo("Called after 1 second")
18:17:42Araqreactormonk: er ... what? java and apache? how come you don't live for nimsuggest now?
18:18:00lllnim + nginx
18:18:01*OnO joined #nim
18:18:40reactormonkAraq, I'll take a look again as soon as I get enough motivation not to bang my head against the wall because I have no idea wahere to look
18:19:00AraqI told you what to do :P
18:19:05sepisoad_i tried using sleepAsync but maybe i'm a little confused, maybe a sample code can help more
18:19:11dom96lll: That is indeed the superior combo.
18:19:18Araqthat should be your motivation
18:20:08dom96reactormonk: What are you trying to fix in nimsuggest?
18:20:41sepisoad_can you comment on this piece of code? https://gist.github.com/sepisoad/b80ee84517f4146ba73d
18:20:57flaviuI see there's a postgresql module in the stdlib, but has anyone actually worked with postgresql and Nim?
18:21:29dom96sepisoad_: What do you want that code to do?
18:21:41dom96sepisoad_: vs. what it is doing now?
18:21:55Quoradom96: one of the major things I wanted to do was use mysql instead of sqlite
18:22:23dom96Quora: That should be a ~5 line change
18:22:31sepisoad_first of all the code wont wait for callbacks to be called
18:22:40reactormonkdom96, https://github.com/Araq/Nim/issues/2694
18:22:50sepisoad_and if I call runForever() app will crash
18:23:12sepisoad_I know i need a valid dispatcher
18:23:19dom96reactormonk: ahh. Fixing that would be awesome.
18:23:31*Matthias247 joined #nim
18:23:50ozralll: I rewrote a whole code base from php to nodejs just to get rid of php. Regrets. Yeah, I do hate php.
18:23:52reactormonkdom96, taking another look
18:24:22lllozra: lol i work with millions of line of code projects, its not possible to rewrite
18:24:57reactormonkBtw, are the concepts ready enough that we (or I) can start sprinkle the stdlib with it?
18:25:47dom96sepisoad_: I see what you mean
18:25:55ozralll: no, and don't do it ;) I learned the hard way.. Though, I was happy to not having to touch php again ;)
18:26:38ozralll: why nginx + nim, and not just nim? Plus varnish as reverse proxy..
18:26:42dom96lll: A million lines of PHP code... *shudders*
18:26:48lllozra: im not quite sure i would call php-> javascript a big stepup tho
18:27:05llldom96: not a million, 10+ million
18:27:15*dom96 dies
18:27:19llllol
18:27:19sepisoad_dom96, the only i know I can have a dispatcher is to call newAsyncRawSocket, but i dont need a socket at all
18:27:38dom96sepisoad_: hrm
18:27:39flaviulll: What sort of program was this?
18:27:41ozralll: 10+ million PHP app? Arggh.. I'd quit! ;)
18:28:02sepisoad_or maybe i'm wrong!!!
18:28:06ozra...or kill my self
18:28:21ozraand don't do that either. I hear it's permanent
18:29:46ozralll: No, you're right about the js. ofc. I coded it in "jytron" my own transpiler, then switched to livescript, cause it looked like my lang but kept me from changing syntax all the time, not very productive or safe.. I made some really bad choices at that time.
18:29:59llllol
18:30:12llli tried livescript, but it was messy
18:30:26ozraNah, it's clean. You miss types though.
18:30:34lllif you use javascript you should use typescript
18:30:42dom96sepisoad_: You could just catch the error that runForever raises, I know it's not ideal...
18:31:12ozraI hate brace-syntax. Which is a nightmare since I code mostly in C++ (but then again, homebrew hideous transpiler ;)
18:31:46ozraBut now I hope to be able to ditch "everything" for nim for future projects.. Still investigating.
18:32:19sepisoad_dom: yup, you're right, BTW is there any plan to introduce a simpler event loop like mechanism?
18:33:00dom96sepisoad_: Not at the minute. Asyncdispatch was designed for asynchronous IO. You could probably write your own event loop pretty easily.
18:33:29ozralll: curious, once again: why nginx with nim? And not just a reverse-proxy like varnish?
18:33:54dom96ozra: The nim forum runs on top of nginx.
18:34:14ozradom96: what's nginx used for?
18:34:21pigmejozra: proper HTTP support, better static file serving by nginx etc
18:34:45dom96ozra: It serves nim-lang.org's static files and passes requests onto the forum.
18:35:01strcmp1is nim-lang.org running jester?
18:35:16dom96strcmp1: nim-lang.org is not
18:35:22dom96only forum.nim-lang.org is
18:35:42strcmp1ah okay, is nginx a frontend for the forum too?
18:35:47dom96yeah
18:35:50strcmp1nice
18:35:53ozrapigmej: alright, is jester missing something in the http department. I was about to roll out two old sites I have with a jester-brew - they seem to work no probs... Then I can ditch node for those and scale down the vps ram a bit..
18:36:06ozradepartment_?_
18:36:40federico310M of php SLOC? Sounds like facebook...
18:37:05*BlaXpirit quit (Quit: Quit Konversation)
18:37:07lllmagento + ilias combo
18:37:15ozradom96: pigmej: I serve static files from the nim app now, varnish caches and serves them then on.. Arguments against such practise?
18:37:17lllfederico3: ^
18:37:25dom96sepisoad_: tbh, if you don't need asyncio you can just use os.sleep()
18:37:40reactormonkozra, why not just use nginx for static stuff
18:37:44lllflavius: magento + ilias combo
18:37:50pigmejozra: if you need ram, then don't go for varnish ;)
18:38:02ozrareactormonk: but then... why? ;)
18:38:12pigmejozra: because nginx can do it better
18:38:15lllozra: its what its for
18:39:03ozrapigmej: haha, ok, well these sites don't server movies or so, so cache is low. I'll look at nginx :)
18:39:08*BlaXpirit joined #nim
18:39:30pigmejobviously you can choose any other web server, like nxweb
18:39:31lllyou dont need to cache static files ;P
18:39:58reactormonkAraq, btw, https://github.com/Araq/Nim/issues/2759
18:40:02federico3+1 for nginx
18:40:10ozralll: in that case, why not serve from jester?
18:40:21strcmp1federico3, yeah indeed.
18:40:29lllozra: why not from nginx
18:40:33strcmp1thats how ruby/rails websites usually roll, too
18:40:39sepisoad_dom96, if by asyncIO you mean asynchronous input/output then it's not what i'm interested to use ATM
18:40:54ozralll: one more component to care about and configure.
18:41:10sepisoad_dom96, what i need is a simple event mechanism along with callback functions
18:41:15dom96sepisoad_: Why do you need that?
18:41:20lllwhy overload your logic program with static files?
18:41:21dom96sepisoad_: What are you going to be using that for?
18:41:39pigmejor if you really care about resouces (but you probably shouldn't) then you can use lwan but preoptimization is usually a failure
18:41:57lllplus ddosing prevention etc would be easier on nginx
18:42:20lllthats pretty standard setup to run nginx or whatever in front of your dynamic app
18:42:29lllapache or whatever
18:42:42pigmejlll: just not apache, please :)
18:42:58lllpigmej: :)
18:42:59sepisoad_dom96, i want to handle keyboard events withot using SDL or smilar libs
18:43:31ozralll: well, I mean, it's no additional work what so ever. one line and it server. Ddos: varnish... I still need a reverse proxy.
18:43:50sepisoad_dom96, you see that async sockets or files are not helpful in this situation
18:43:59dom96sepisoad_: how are you planning on handling keyboard events without those libs?
18:44:32ozrapigmej: I guess for me it comes down to using as few parts as possible and using what I know, unless there is something wrong.
18:44:36lllsepisoad_: you would have to recode sdl
18:44:37reactormonkfound some cases where nimsuggest actually works twice, but not anymore afterwards ^^
18:44:50sepisoad_dom96, hahaha, i don't know, that's what im about to find
18:45:00dom96sepisoad_: I think on Linux you would need to use GTK anyway
18:45:08dom96sepisoad_: And GTK already provides its own event loop
18:45:58ozrapigmej: lll: what would be the reason for serving with nginx, instead of jester through varnish, I still don't find a reason. (I really do like to know - so I don't roll it out and shit hits the fan..)
18:46:15sepisoad_dom96, on a lower level, on linux we would use epoll on console based apps
18:46:34pigmejozra: just replace varnish with nginx, it will be better and it will allow you more in 99% cases
18:46:48dom96sepisoad_: that's precisely what asyncdispatch uses
18:46:48sepisoad_dom96, i would be nice if we had a similar thing in nim, but portable
18:46:50pigmejfor that 1% it's preoptimization, which is usually a problem
18:47:01dom96sepisoad_: To check whether a socket/file is readable
18:47:26pigmejreactormonk: I sometimes from aporia got also twice, but I think it's cached, because results were the same as before
18:47:27ozrapigmej: alright. I haven't used nginx more than once for some customer, otherwise uses varnish. What are the improvements? Varnish compiles my conf through c++, so it's fuuucking fast..
18:48:24sepisoad_dom96, sorry, i mean poll() not epoll()
18:48:51reactormonkpigmej, nope, it's not cached, because some others I get a different result
18:49:20reactormonkalso, that wouldn't explain why exactly it doesn't work anymore after the second time
18:49:55pigmejhmm
18:52:42*filcuc joined #nim
18:52:44*gokr_ quit (Read error: Connection reset by peer)
18:52:46ozrapigmej: Never heard so much nginx promotion before, so I had to google.. Found a nginx vs varnish test on a blog, I'll sum it up with a quote: "Results for the Small VPS: Varnish wins in a Landslide."
18:53:30*boydgreenfield joined #nim
18:53:30reactormonkozra, varnish is a cache, nginx is a front server
18:53:39ozraAnd in fairness: "Results for the Medium-Sized Linode VPS: Nginx wins by a Nose."
18:55:33ozrareactormonk: yes, I've only used it as reverse-proxy and cache, and always served statics from the apps them selves (self serving) the last five years and haven't had a problem. That's why I'm curious about why it seems the opinion here is that lifting static serving out is imperative. Is there some specific reason? Static serving has never crashed my apps..
18:56:32reactormonkozra, it's easier to mess with imo if it's in nginx. Also, setting up ssl via nginx is easier because more documentation
18:56:48pigmejozra: in case of web server benchmarks => there is no valid test there, you can probably easily do a test and show that webserver A is better than B
18:56:51lllive never seen varnish used ever
18:56:56pigmejmaybe except apache
18:58:03pigmejozra: the whole thing is, varnish is not a webserver it's a cache
18:58:08lllexactly
18:58:20lllaka givemeallyourram
18:59:02ozrapigmej: definitely. I'm just trying to figure out here if there's a legit reason why I should switch my 5+ years of serving strategy.
18:59:27lllozra, i just wouldnt even have my aplication bother with static files
18:59:41lllless attack vectors too
18:59:54ozralll: haha, ok. Well, I have tight limits on cache size, so if that's it, I'm good. As long as I'm not doing something potentially dangerous I haven't considered :)
19:00:13ozralll: yes, I try to catch that in varnish. Might be holes though.
19:01:19lllall i know is that i never used varnish, and associate it with "webscale mongodb" type of stuff
19:01:28lllaka useless for 99% of sites
19:01:48ozraThanks for discussing it a bit. I will have a look at nginx just to widen the horizon and re-evalute my use-cases just in case. Always good to brush of some dust..
19:02:11ozralll: I just associate it with reverse-proxying real fucking fast ;)
19:02:16pigmejozra: the biggest idea => nginx has vhosts, in varnish you have to write several ifs
19:02:23Araqreactormonk: doesn't look hard to fix
19:02:32pigmejalso, http rev proxy is not a best protocol ;-)
19:02:34lllnginx does that as fast as varnish
19:03:01lllif you dont need the cache, imo dont use varnish
19:03:05ozrapigmej: I've written a script that generates it automatically from my sites, so that's a no-brainer. And writing it manually is a no-brainer too..
19:04:05reactormonkstuff I've found out: the dirtyIdx is always 5, so file number 5 is the one suggested on. But the projectFile is 5 the first time and 4 (!= 5) everytime afterwards... maybe that one sucks?
19:04:23ozraMaybe it's just me, but I find that clearer than abstracting it out as vhosts like in apache and apparently nginx. Well, what ever makes your clock tick :)
19:04:30dom96Personally, I have never actually considered varnish but I will look into it.
19:05:20ozralll: nginx acts as cache - kif kif - no? Or do you rely on serving files each time, no etags checks, letting the OS cache disk accesses??
19:05:40pigmejozra: nginx got recently quite recent cache
19:05:56lllwhat i mean, is varnish caches in memory
19:06:22ozraOk, perhaps we should stop polluting nim irc with this, I realize we've strayed quite OT - thanks for your input.
19:06:23lllits what its for
19:06:47lllplus debian -> sudo apt-get install nginx
19:07:00reactormonkozra, we have #nim-offtopic
19:07:37ozralll: sudo apt-get install varnish? Well, in ubuntu, sorry, don't know about debian straight..
19:08:00ozrareactormonk: ah, thanks, sorry for polluting here..
19:08:08reactormonkgo to #nim-offtopic with anything about nginx or varnish plz
19:08:13reactormonkI'm getting giddy on the banhammer
19:09:20reactormonknope, the file index doesn't matter. I tossed the logic that changes the main project file, no change :-/
19:10:27pigmejreactormonk: ;D
19:11:27*lll left #nim (#nim)
19:11:31*jbomo left #nim (#nim)
19:12:18dom96nah guys.
19:12:21dom96OT stuff is fine
19:12:36dom96unless there is a lot of Nim discussion happening at the same time :)
19:12:39reactormonk:-(
19:12:53reactormonkBut but but I wanted to ban someone
19:13:38*Crocodick joined #nim
19:14:00pigmejreactormonk: rotfl ;d
19:18:56reactormonkhrm, the second time it actually seems to compile towards the project main file, not the file I'm asking for (in sug mode)
19:19:43reactormonkAraq, another problem is that sug and use want different compile patterns - use wants the full project compiled, sug only the ones imported - or should I just make it compile the full project in both cases?
19:21:55ozrareactormonk: put on your ray-bans and be cool about it ;)
19:23:55*filcuc quit (Quit: Konversation terminated!)
19:23:58*sepisoad_ quit (Ping timeout: 264 seconds)
19:25:49*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
19:26:15Araqreactormonk: that logic already exists
19:27:25*OnO joined #nim
19:27:32reactormonkAraq, I haven't seen it
19:27:53reactormonkwell, wait
19:27:57Araqreactormonk: in the nimsuggest module
19:28:01flaviureactormonk: A ban for off-topic discussion is a little harsh. kicking might be more reasonable.
19:28:30reactormonkflaviu, yeah, sure. I just call it banhammer because it's more idiomatic than kickhammer
19:28:58reactormonkAraq, oh, right. Just not sure if it would work as expected.
19:29:10*kumul quit (Ping timeout: 258 seconds)
19:32:29*xcombelle quit (Quit: Leaving)
19:36:23*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
19:38:29*OnO joined #nim
19:42:37*kumul joined #nim
19:45:38*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
19:51:51*pregressive quit (Remote host closed the connection)
19:51:52reactormonkAraq, ok, the fix was easier than expected...
19:59:03reactormonknow it works everytime BUT the first one :D
20:03:56Araqyay
20:04:01Araqthat's cool
20:08:42reactormonkhttps://gist.github.com/d88b6c930c85fbc53442 <- any idea why the compiler bails here?
20:08:47reactormonkError: type expected
20:09:05Araq: vs =
20:09:17Araqexecute(cmd = ideSug, "", "", 1, 0)
20:11:49reactormonkhuh. But it still just exists.
20:12:28Araqyou mean nimsuggest doesn't continue after this error?
20:13:01reactormonkno, I correct that, I'm running this proc before serve, but serve never hits
20:13:31reactormonkah ok, doesn't like the empty string.
20:14:00Araqthere are globalErrors and localErrors; globalErrors raise an exception, this is later handled but often by then it's too late, since the node with the line info we're interested in has been skipped
20:14:41Araqthis is the problem number 1 for 'nimsuggest'
20:15:19dom96reactormonk: We don't ban or kick around here anyway :P
20:15:37Araqand the reason why we try to avoid globalError()
20:16:16reactormonkAraq, I see. I'm currently trying to make nimsuggest compile the project
20:17:17reactormonkah ok, gotta set the whole error max stuff
20:17:59*boydgreenfield quit (Quit: boydgreenfield)
20:22:37*jbomo joined #nim
20:23:50reactormonkAraq, https://github.com/Araq/Nim/pull/2782
20:24:16reactormonktake a look at the first commit
20:27:49strcmp1im new to nim, and trying to write my first macro. i think i must be doing something weird, because keepIf() doesn't seem to return control to the caller... https://gist.github.com/strcmp/d5399c7e66ce13078b5a - any ideas?
20:28:31reactormonkstrcmp1, does it get to the beginning of the macro?
20:29:03strcmp1yeah, it works fine until i call keepIf
20:30:20*gsingh93 joined #nim
20:30:24reactormonkdoes the code work outside the vm e.g. when not in a macro?
20:30:32strcmp1not sure ill try
20:31:14reactormonkthe code in the macro is executed by the VM, which might be buggy here
20:31:27dom96indeed
20:31:43dom96possibly a bug in the VM's implementation of anonymous procs.
20:32:23strcmp1this works fine https://gist.github.com/strcmp/d92f424c6c1ec01146ac it prints "hi" and "oh"
20:34:40reactormonktime for a bug report?
20:37:32*boydgreenfield joined #nim
20:38:20strcmp1sure ill file one, im a few commits behind so ill update first and then open an issue if its still a problem
20:47:55*intra quit (Ping timeout: 265 seconds)
20:48:34*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:02:52*shevy joined #nim
21:11:54*kumul quit (Ping timeout: 245 seconds)
21:19:58*kumul joined #nim
21:20:28*boydgreenfield quit (Quit: boydgreenfield)
21:22:28wtwbsirius: you're welcome :)
21:32:19*gsingh93 quit (Ping timeout: 265 seconds)
21:33:43Araqreactormonk: you left the debug code quitCalled() active and the patch makes no sense
21:34:26reactormonkAraq, yup, and I think the debug code is helpful in case stuff goes wrong, because quit will probably never be called unless something goes wrong
21:35:05Araqso the idea is that compileProject() without any file recompiles the project
21:35:29Araqand the recompilation logic sees the dirty file and acts accordingly
21:35:40ozraFrom manual: "complex statements always have to be intended" -> "indented" I assume?
21:35:52Araqozra: yep
21:35:58ozracool
21:36:58reactormonkAraq, that's for new files added to the project. Any files included by the main file at startup are compiled and following that they should be known
21:37:04reactormonkozra, feel free to correct it by PR
21:38:04*banister joined #nim
21:38:49Araq resetModule dirtyIdx
21:38:50Araq if dirtyIdx != gProjectMainIdx:
21:38:52Araq resetModule gProjectMainIdx
21:38:54Araqso it is reset, it should be recompiled
21:40:25reactormonkit isn't :-/
21:40:29reactormonktest with https://github.com/Araq/Nim/issues/2694
21:40:58Araqso let's continue, resetModule does this:
21:41:18*Amun_Ra joined #nim
21:41:20Araq if fileIdx <% gCompiledModules.len:
21:41:22Araq gCompiledModules[fileIdx] = nil
21:41:23Amun_Rahi
21:41:44Araqand also this:
21:41:46reactormonkso it removes all the knowledge of the module from the cache.
21:41:47Araq if fileIdx <% gMemCacheData.len:
21:41:49Araq gMemCacheData[fileIdx].needsRecompile = Yes
21:42:25reactormonkSo how do I make it work for new files too?
21:42:30reactormonkAmun_Ra, sup
21:43:11AraqcompileModule then calls getModule which just looks at gCompiledModules
21:44:27Amun_Rareactormonk: I just found out nim and started "evaluating"… ;>
21:44:28reactormonkwhich makes it recompile.
21:44:38dom96Amun_Ra: Witam :)
21:44:42reactormonkAmun_Ra, currently in the process of fixing the idetools
21:44:44*BitPuffin|osx joined #nim
21:44:47Amun_Radom96: cześć :>
21:45:09Araqbut maybe checkDepMem() is wrong, this part looks suspicious:
21:45:17Araq if gMemCacheData[fileIdx].needsRecompile != Maybe:
21:45:19Araq return gMemCacheData[fileIdx].needsRecompile
21:45:25reactormonkAraq, the isKnownFile is only false if the file hasn't been seen before
21:45:38Araqhow can we know this for sure here already without checking its dependencies?
21:45:39reactormonkeven if you call resetModule, it will still be true
21:46:48reactormonkAraq, Maybe apparently marks it might be needed because of dependencies
21:47:29reactormonkYes -> go for it No -> nope Probing -> recursing Recompiled -> ...
21:47:36Amun_Ra;150R
21:48:05ozraAraq: Does the docgen handle Unicode? Could be better to use a disambigous char-combo for '{| ... |}'
21:51:10ozrareactormonk: I'm on it :)
21:51:29reactormonkdom96, https://github.com/Araq/Nim/pull/2543 *poke*
21:56:34*Ven joined #nim
21:57:10dom96reactormonk: thanks, re-reviewed.
21:57:30dom96Github really needs to notify when a PR changes
21:59:08reactormonkI assigned you, maybe that helps
21:59:33dom96hrm, perhaps
22:05:55*ozra quit (Ping timeout: 246 seconds)
22:06:59reactormonkAraq, probably ugly, but it works in the cases I tested it
22:08:11Araqreactormonk: what do you mean? your PR makes no sense as it doesn't fix the bug, it circumvents it
22:09:55reactormonkAraq, ok, kicked that part. With the current commit, it works everytime except for the first one.
22:10:40Araqha ok let's see
22:10:56BlaXpiritreactormonk, what was the close about https://github.com/Araq/Nim/pull/2515#event-312663366
22:11:13BlaXpiritoh yeah..
22:11:23Araqwtf? but if it's already known it's ... oh hrm
22:11:37reactormonkBlaXpirit, https://github.com/Araq/Nim/pull/2762#issuecomment-105064625
22:12:35Araqreactormonk: the point of this test is "if the module belongs to the project"
22:12:48Araqbut that's only true for the first time
22:13:04Araqafterwards it's a known file and yet not part of the dependency graph ...
22:13:13Araqso yeah ... we need to change this
22:13:35Araqthe dep graph should have multiple "entry" points
22:15:33reactormonkafter the first compileProject(), isKnownFile should be true for all files in the dependency graph
22:15:36*kumool joined #nim
22:15:57Araqreactormonk: exactly
22:17:05dom96reactormonk: You might want to comment why you closed BlaXpirit's PR
22:17:05*stefantalpalaru quit (Quit: Leaving)
22:17:14reactormonkdom96, can do
22:17:31BlaXpiritgood that someone took over. i had no idea though.
22:18:02dom96reactormonk: thanks
22:18:03reactormonkBlaXpirit, sorry :-/
22:18:32*kumul quit (Ping timeout: 244 seconds)
22:19:14Araqso ... should I merge this?
22:19:20*Kingsquee joined #nim
22:19:47BlaXpiritwhat exactly
22:19:51reactormonkBlaXpirit, I see your view, and I also see why dom96 doesn't want to add more functionality.
22:20:04BlaXpiritwell i expressed the same view, but not to such extent
22:20:06reactormonkPersonally, I hope I can add some more functionality on it in terms of concepts
22:20:13dom96Araq: The Optionals PR?
22:20:45Araqyes
22:21:04BlaXpiriti don't mind, except i'm not really the author :p
22:21:48reactormonkBlaXpirit, https://github.com/flaviut/Nim/commit/d3ab60c8310328b2838b42f0998515ddbb8a6ac4 solved
22:22:14BlaXpiritgreat
22:22:19dom96Araq: I think so
22:22:38Araqhrm so it now misses the super cool ?= template.
22:22:45BlaXpiriti know, right??
22:23:16Araqoh well I'll add it later when I use the module
22:23:22*taesoo quit (Ping timeout: 255 seconds)
22:23:28Araqtoo sexy to miss.
22:23:34*Pisuke quit (Ping timeout: 245 seconds)
22:23:44BlaXpiritwith the direction the module has moved to, such a template would have to be named with words
22:23:54Crocodickwhy is the 'option' type isnt using a case object?
22:24:15AraqCrocodick: no point it's all hidden anyway
22:25:18fowlWhat is the official use case for option[t]
22:25:36fowlAsync procs could use it instead of exceptions I guess
22:25:37Araqfowl: new regex module needs it
22:25:56flaviuMy objective with #2762 is to be as minimal as possible to reduce bikeshedding.
22:26:12reactormonkbikeshedding?
22:26:14flaviuIt doesn't seem to be working :P
22:26:22BlaXpiritwent too far
22:26:24reactormonkAraq, so why do you want multiple entry points to the dependency graph?
22:26:27*boop is now known as boopisaway
22:26:30flaviureactormonk: http://bikeshed.com/
22:28:12Araqreactormonk: cause that models reality?
22:28:51reactormonkAraq, hm. Ok. But how come that would be a problem with the current system? You're only gonna have one entry point per compile
22:29:59*epichero quit ()
22:30:09Araqflaviu: your goals are good and so is this module. I'd simply export a single 'case object' type with every field public, but that's just me
22:30:38reactormonkAraq, hm. Anything you export is gonna stick.
22:30:48Crocodickwhats the compilet param "--patterns:on|off turn pattern matching on|off" ?
22:30:49reactormonkI would rather start with concepts and then think about the API
22:30:56Crocodickcompiler*
22:31:18AraqCrocodick: a misnamed feature. "patterns" here refers to TR macros
22:31:20*kumool quit (Ping timeout: 252 seconds)
22:31:26Crocodickok thx
22:31:39*boopisaway is now known as boop
22:32:22Crocodicki dont see why the Maybe case object isnt just exposed, and let everyone use it as they please
22:32:42Crocodickthat way there is no bikeshedding lol
22:32:50*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:33:13reactormonkCrocodick, we might want to extend the API at some point
22:33:27reactormonkbut I still think a case object would be cleaner
22:33:35Araqreactormonk: meh, I don't see the point in the abstraction.
22:34:12Araqmore likely is we get more support for pattern matching in the language and then the 'case object' will get the new features out of the box and the hidden impl won't.
22:34:25Crocodickyes please!
22:34:34flaviuAraq: It's always possible to change it to a case object.
22:34:38reactormonkCrocodick, just comment on the PR
22:34:47Crocodickok sure
22:34:50flaviuBut it'd never be possible to change if *from* a case object.
22:34:51reactormonkAraq, sooo for now can we go ahead with the nimsuggest fix?
22:34:55Araqbut enough time has been spent on this. and flaviu is right.
22:35:08Araqso just merge it now and be done with it
22:36:17dom96Araq: Can we get ADTs too?
22:36:19Araqreactormonk: I guess.
22:36:43Araqdom96: we already have them but the syntax is a bit ugly.
22:36:48flaviudom96: Make a macro!
22:37:34dom96Araq: Should we just use macro to make it nicer then?
22:37:38dom96*macros
22:38:03AraqI don't think this can be done yet, but yes.
22:38:13*ozra joined #nim
22:38:39dom96flaviu: Oh. I agree with BlaXpirit. I think we need `$`.
22:38:51reactormonkflaviu, no `$`? O.o we need that
22:38:52Araqand 'hash'
22:38:58Araqlol
22:39:10reactormonk^ yup
22:39:20Araqno no no, it's good the way it is. merge it, I say.
22:39:32flaviuI'll send another PR in 30 minutes to fix all that.
22:39:37dom96and 'makeMeMillions'
22:40:05BlaXpiritnext day: new pull request "add useful features" where the bikeshedding will continue
22:40:05dom96Araq: You can merge it now if you want.
22:40:20reactormonk`$` and hash, then go I say
22:40:51flaviuBlaXpirit: Exactly! But I can safely create APIs that depend on it in the mean time.
22:41:00BlaXpiritright
22:41:12Araqwhen defined(sex): template `?=` ... # any chance for this?
22:41:13*dgym joined #nim
22:41:23reactormonkwhat does ?= do?
22:41:35BlaXpiritsee the awesome tutorial
22:41:39Araqit unpacks
22:41:55BlaXpirithttp://blaxpirit.com/f/nim/optionals.html
22:42:24Araqreactormonk: ok, so I guess your original patch was fine, let's merge that instead
22:43:12dom96I don't like it.
22:43:14dom96Looks like a comparison
22:43:17reactormonkAraq, https://github.com/Araq/Nim/pull/2784
22:43:18BlaXpiritAraq, you may notice that not a single operator is used in flaviu's vision of the module
22:43:19dom96when it's not actually comparing
22:43:30BlaXpiritthe `?=` name doesn't make any sense now
22:43:31reactormonkyeah, I don't think chaining right now is good
22:43:57BlaXpiritespecially now that option is not convertible to bool
22:44:09BlaXpiritopt.unpackInto(var)
22:44:12BlaXpiritor somethin
22:44:18dom96BlaXpirit: bleh
22:44:22dom96we need pattern matching instead
22:44:31*Jesin quit (Quit: Leaving)
22:44:44dom96perhaps even pattern matching in the language
22:44:46dom96not via macros
22:44:53BlaXpiritwhatever, have fun
22:45:03dom96if result == some(x): echo x
22:45:28dom96nvm, that's ambiguous as hell.
22:45:40Araqppfff that's blasphemy, I'm working on macro based pattern matching
22:45:48dom96Araq: I've already had one written.
22:45:53Araq:O
22:46:02Araqwhere?
22:46:07*BlaXpirit quit (Quit: Quit Konversation)
22:46:32dom96it's in one of my issues
22:46:40dom96because I hit a bug before I could finish it
22:46:45Quorahas anyone made an "ORM" in nim?
22:47:16AraqQuora: yes, OnO has stuff that works already I think
22:47:26Araqbut he's actively working on it
22:47:29QuoraOnO is an acronym?
22:47:32Quoraah
22:47:46ozraI'm used to the v: ?T meaning a maybe, and 'x ?= y' meaning "if x is null, set it to y"
22:48:09reactormonkAraq, done.
22:49:30reactormonkpigmej, ok, ready to go.
22:50:22Quorahow would a mutable global work in a jester application?
22:50:39Quorawould requests be processed in order they are recieved?
22:50:39reactormonkQuora, sounds bad
22:52:32*pregressive joined #nim
22:52:39flaviuQuora: Sounds like you should use a database instead.
22:52:52Quorayeah
22:53:08QuoraI'm wondering how I would do that without having the template code do sql queries
22:53:20*Jesin joined #nim
22:53:46flaviuI'm having trouble understanding "template code do sql queries"
22:54:38dgymhello, I'm trying to port a tiny stack based VM to nim, but it seems to be spending 90% of its time in genericAssign while transfering 16 byte Object variants (Cells) to and from its stack (seq[Cell] or array[..., Cell])
22:54:46Quorahttps://github.com/nim-lang/nimforum/blob/master/main.tmpl#L179-L225
22:55:01dgymany tips on speeding up copying of small objects?
22:55:59flaviuQuora: I'm not too familiar with webapp architecture, but I think MVC is what you're looking for.
22:56:05Quorayeah
22:57:18*pregressive quit (Ping timeout: 258 seconds)
23:00:11Araqdgym: ha, now that's a good question. there are a couple of options:
23:00:45Araq* make your object variants not use any GC'ed data, this way the compiler will emit memcpy instead
23:01:20Araq* switch over to a register based VM which doesn't have these copies in the first place
23:01:42reactormonkAraq, GC'ed data are strings and seqs?
23:02:02Araq* get rid of the 'case' and have an object with a handful of fields, this should trigger a faster assignment operation
23:02:08Araqreactormonk: and closures and refs
23:02:14dgyminteresting, but unfortunate, I'm only porting to nim because I want its GC :)
23:02:41Araqtry to mark the object .shallow but I don't think this has any effect
23:03:11Araqdgym: btw Nim's own VM uses a register based VM
23:03:18*taesoo joined #nim
23:03:25Araqbut not only for this reason
23:03:27dgymyes I tried that, it then spent 90% of its time in genericShallowAssign instead
23:03:36Araqlol
23:03:54dgymwell it was worth a try :)
23:04:14Araqyou can also use the GC, but don't use GC'ed *types* in your core object
23:04:34Araqand instead have a couple of GC_ref and GC_unref calls to keep stuff from being collected
23:05:24Araqbut you should really use a register based VM anyway
23:05:43AraqIME it's the *simpler* VM design
23:06:08dgymok, the manual GC_ref might be doable
23:07:15dgymI'm not convinced I could make a register based vm in my time constraints but I'll have a little look into it
23:07:35dgymmany thanks for the tips
23:08:39*bulbasaur is now known as dtscode
23:08:48dom96Quora: The templates are inside procedures, if you look at the top of the .tmpl. You can pass state to them.
23:09:03Quorayeah
23:09:08QuoraI was hoping not to do that though
23:09:11Quoraer
23:09:13Quoratoo much of that*
23:09:48QuoraI'm not making sense, I should go nap
23:11:43Araqdgym: you can always steals from the compiler/vm*.nim modules
23:12:14Araqwhich is a big VM, but you can just copy the instruction encodings etc. and trim it down
23:12:17dom96Quora: You're making plenty of sense. Doing that is not so bad I think.
23:12:30dgymwhat is the nim vm used for?
23:12:48Araqcompile time evaluation, in particular macro evaluation
23:14:32reactormonkAraq, nice PR streak :-)
23:14:44Araqthe bytecode instructions lead to pretty good code sequences, much better than what you get out of the box for any stack based VM
23:16:08Araqbut on-the-fly common subexpression elimination would help quite a bit. (which you cannot really do with a stack based VM)
23:17:01dgymif you had to benchmark it against standard Lua and Python what sort of outcome would you be hoping for?
23:17:10dom96Araq: Just to remind ourselves: https://github.com/Araq/Nim/issues/2785 :)
23:17:40AraqI benchmarked it against Python and won
23:18:06ozraAre semicolons and commas interchangeable in parameter lists, or are there any devils in the details?
23:18:08dgymnice
23:19:17flaviu(a, b: int), a and b are ints.
23:19:33flaviu(a; b: int). b is an int, I have no idea what a is.
23:20:07ozraalright. thanks
23:21:37Crocodickhttp://pastebin.com/raw.php?i=NLTbqvZM would a PR that push these warning off around those lines be welcome?
23:22:52AraqCrocodick: not around those lines, but for system.nim.
23:24:42Crocodickwhat about? gc.nim, sysstr.nim, widestrs.nim, repr.nim
23:24:52Araqall part of system.nim
23:24:56Crocodickok
23:28:18*Trustable quit (Remote host closed the connection)
23:30:40ozraflaviu: what is the point of the two, why not just ',' - do you know?
23:31:07Araqozra: you can use just ','
23:31:10flaviuozra: Well, I recently used it for generic parameters.
23:31:17flaviu[A, B; C: Foo]
23:31:29flaviuA and B can be whatever, but C must be a Foo.
23:31:58*boydgreenfield joined #nim
23:32:17ozraArag: flaviu: Is it fair to say that it is pointless in procs (since untyped pars are depreceated), and so only serves a purpose in generics?
23:32:31Araqflaviu: that was possible before we had ';' too: [A, B: typedesc, C: Foo]
23:32:54flaviuAraq: Good to know.
23:33:08Araqbut yes, ozra you can say that
23:33:21ozraAraq: what was the reason for its introduction, of curiosity?
23:33:41*Matthias247 quit (Read error: Connection reset by peer)
23:33:48Araqpeople requested proc foo(a, b: char; x, y: int) as it's more readable than proc foo(a, b: char, x, y: int)
23:34:25ozraThat is so fucking reasonable! It does serve a purpose :-)
23:34:52Araqyeah, even I had to agree eventually and add it to the language.
23:35:46*Strikecarl joined #nim
23:35:53ozraRightly so, languages with id:type has always annoyed me _when it comes to params_ - this solves it and I hadn't even thought of it. haha.
23:36:23StrikecarlAight so, i've been trying to make a program that downloads an .exe, really basic yes i know.
23:36:27StrikecarlBut i get a SSL error
23:36:29Strikecarlwhen i do so
23:36:37ozraI jot down some notes about it in the man proc intro, since it has bugged me..
23:36:53ozrathe commas vs semis that is..
23:37:16Strikecarl"Error: unhandled exception: SSL support is not available. Cannot connect over SSL. [HttpRequestError]"
23:37:20StrikecarlHow do i fix this.
23:37:31Quora-d:ssl
23:37:31AraqStrikecarl: compile with -d:ssl
23:40:48StrikecarlAraq
23:40:58Strikecarlhttp://i.imgur.com/RI30fZy.png
23:41:12Quorainstall that dll file?
23:41:24StrikecarlI ran it on my VM
23:41:32StrikecarlDo i install .dll on vm or ?
23:41:39flaviuwell, you have to have a copy of openssl laying around to use -d:ssl
23:41:53Strikecarlkk
23:41:59QuoraStrikecarl: google that dll file name or something
23:42:39StrikecarlI just place in Aporia folder?
23:43:11Quorayou place it anywhere in your windows PATH
23:43:14Strikecarlkk
23:43:17Araqno, next to the produced .exe
23:43:29QuoraAraq: it also looks in %PATH% on windows IIRC
23:43:43Quorawindows dynamic library security is odd
23:43:50Araqplease don't explain to me how windows works
23:44:02Quoraokay
23:44:14Araqchances are high I know better than you :P
23:44:46Araq(yes, you're right about the %PATH% but next to the .exe is how you should do it for deployment)
23:45:05dtscodeAraq: Windows works by first invoking the kernel
23:45:14dtscodeBet you didn't know that
23:45:28flaviudtscode: nah, I'm pretty sure that the bootloader comes before the kernel.
23:45:50dtscodeThats not a part of windows though
23:46:09dtscodeOtherwise we would have to factor in the magic elves at the beginning of the boot phase
23:47:09TEttingerwindows works using the power of imagination and children's tears
23:48:29TEttingerDID YOU KNOW that Bill Gates is really an incarnation of Tlaloc, Aztec god of rain, who the tears of children would be offered to ensure that drought would not befall their people?
23:49:06TEttingerwhy do you think he cares about malaria so much?
23:50:07*boop is now known as boopisaway
23:50:42ozraTEttinger: It, and IE, are also powered by the tears of developers. Don't forget those poor bastards!
23:51:06TEttingerheh
23:51:37CrocodickAraq: https://github.com/Araq/Nim/pull/2786
23:52:20Araqholycowbatman?
23:52:25Crocodickye?
23:52:33*bjz joined #nim
23:52:37Araqdid you know you're a scientist?
23:52:43Crocodickwhat lol
23:53:25Araqhttps://www.youtube.com/watch?v=AcMEckOyoaM
23:54:13Crocodicklol
23:54:23Strikecarlgreat
23:54:30Strikecarlnow everything 404's <.<
23:54:46Strikecarlwe're all good that this doesnt 404 aight? also dont open the file https://docs.google.com/uc?authuser=0&id=0B4MlHB8bp9rvVmtwRzIyWFRXWEE&export=download
23:55:03StrikecarlMaybe its cause i am logged into the drive account i can download it? :/
23:58:32StrikecarlDoes it follow redirects?
23:58:38Strikecarlso if i shorten the link it won't work?