<< 03-03-2015 >>

00:01:26flaviuhttps://github.com/Araq/Nim/issues/2247 looks like a bug, right?
00:02:08BlaXpirit_flaviu, ah, investigating the bug haunting nre
00:02:46flaviuBlaXpirit_: Yep. https://github.com/flaviut/nre/issues/5
00:02:51BlaXpirit_i saw
00:05:05Araqflaviu: works for me
00:05:22flaviuAraq: Did you follow every step exactly?
00:05:50Araqno, I named it temp10.nim
00:05:50flaviuAlso make sure to clear up every nimcache before trying to reproduce it.
00:06:52Araqwhy would I? my nimcache doesn't grow a testc.o file on its own
00:07:39flaviuhmm, I can't reproduce it now.
00:08:06Araqthe compiler caches if the .c file has already been compiled
00:08:21Araqyou can use -f to force a build
00:08:25BlaXpirit_Araq, there is a problem for sure, but it's hard to find
00:08:55*a5i quit (Quit: Connection closed for inactivity)
00:09:41flaviuMy editor might be triggering it.
00:09:55flaviuSince it asks nim to compile to check for errors on save.
00:10:57Araq"nim check" shouldn't compile any C code at all
00:12:37*filwit joined #nim
00:15:03*BlaXpirit_ quit (Quit: Quit Konversation)
00:15:11*Mandar quit (Quit: WeeChat 1.0.1)
00:16:12*batok quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
00:21:01*dapz joined #nim
00:23:27*batok joined #nim
00:27:25*Trustable quit (Remote host closed the connection)
00:30:40*pwernersbach joined #nim
00:31:10pwernersbachHow can I prevent nim from declaring my c callbacks as static?
00:31:31pwernersbachI've marked the appropriate callbacks as exportc, but nim declares them as static functions still
00:31:48pwernersbachAlso, do we know if we got into GSOC?
00:32:06flaviupwernersbach: Nim didn't get into GSOC
00:32:30*Sembei joined #nim
00:33:07*dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:34:52*dapz joined #nim
00:35:06pwernersbachflaviu: What was the reason for not getting in?
00:35:35*batok quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
00:35:39flaviupwernersbach: Meeting is on friday.
00:35:50flaviuSo we have to wait until then to know.
00:37:27pwernersbachAw man. Is there a list of accepted projects?
00:38:08Araqhi pwernersbach only 'inline' procs are static iirc
00:38:21Araqwhich is kind of required by C
00:45:24pwernersbachAraq: That's what it was. I'd like to see an unsafeinline proc that declares inline without static though. GCC and Clang accept inline in different compilation units
00:50:03*brson quit (Quit: leaving)
00:50:28*brson joined #nim
00:59:06*dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:01:36*brson_ joined #nim
01:03:11*brson quit (Ping timeout: 244 seconds)
01:13:00*sillesta quit (Ping timeout: 244 seconds)
01:14:23*TEttinger joined #nim
01:15:07*lloydde quit (Remote host closed the connection)
01:15:15*dapz joined #nim
01:17:57flaviuBlaxpirit: https://www.youtube.com/watch?v=45Oet5qjlms
01:18:29*TEttinger quit (Ping timeout: 246 seconds)
01:20:34*a5i joined #nim
01:21:13*TEttinger joined #nim
01:26:48*brson_ quit (Quit: leaving)
01:31:30*nimnoob123 joined #nim
01:32:15nimnoob123can you declare static variables in nim?
01:33:38flaviunimnoob123: What do you mean by "static variables"
01:34:08*darkf joined #nim
01:35:08filwitnimnoob123: yes, depending on your needs. either use 'let' or 'const' in global space
01:36:46*dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:37:23filwitnimnoob123: if you mean a more C#/Java-style static variables (one's associated with a type).. you can actually do that too (with an getter), but the design isn't exactly encouraged in Nim
01:38:35*dapz joined #nim
01:43:09*dapz quit (Ping timeout: 245 seconds)
01:46:47*saml_ joined #nim
01:47:00nimnoob123hmm, I think I know what I can do
01:47:44*fizzbooze quit (Ping timeout: 252 seconds)
01:49:17*epichero joined #nim
01:52:22*BitPuffin quit (Ping timeout: 245 seconds)
01:52:23*woadwarrior joined #nim
02:05:40*vezzy joined #nim
02:05:40*quasinoxen quit (Ping timeout: 255 seconds)
02:14:20MaxdamantusAraq: it looks like the `(int, int)` syntax was already intended.
02:14:23Maxdamantus # XXX support anon tuple here
02:34:30*fizzbooze joined #nim
02:40:13*Menche quit (Quit: Leaving)
02:49:16*nimnoob123 quit (Quit: Page closed)
02:57:59*chemist69_ joined #nim
03:00:29*rkj-b joined #nim
03:00:55*chemist69 quit (Ping timeout: 250 seconds)
03:40:24*dashed joined #nim
03:44:44*fizzbooze quit (Ping timeout: 246 seconds)
03:46:40*fizzbooze joined #nim
03:48:05*rkj-b quit (Quit: ChatZilla 0.9.91.1 [Firefox 35.0.1/20150122214805])
03:49:44*gsingh93 quit (Ping timeout: 272 seconds)
04:13:59*gsingh93 joined #nim
04:14:02*Sornaensis quit (Max SendQ exceeded)
04:14:37*Sornaensis joined #nim
04:14:45*filwit quit (Quit: Leaving)
04:15:28*randomwalk joined #nim
04:18:00randomwalkHey all, I figured out how to fix that c2nim conversion of the in memory libcurl example that I mentioned yesterday. I just had to learn a bit about how Nim deals with c pointers.
04:23:48*gmpreussner|lapt joined #nim
04:23:53*pwernersbach quit (Quit: Leaving.)
04:25:03*gmpreussner|lapt quit (Client Quit)
04:27:20*gsingh93 quit (Quit: WeeChat 1.1.1)
04:27:58randomwalkSome of the issues: c2nim generated csize instead of int...doesn't have c pointer arithmetic in the generated nim code (I added a couple functions)...several pointer casts for cstring...etc. Nim is still awesome :^)
04:28:18*gsingh93 joined #nim
04:39:20*pwernersbach joined #nim
04:39:25*pwernersbach left #nim (#nim)
04:49:40*Jesin quit (Remote host closed the connection)
04:50:06*Jesin joined #nim
04:50:34*randomwalk quit (Quit: Page closed)
04:54:47*jsudlow quit (Ping timeout: 246 seconds)
04:57:17*jsudlow joined #nim
05:01:52*saml_ quit (Ping timeout: 240 seconds)
05:18:55*a5i quit (Quit: Connection closed for inactivity)
05:19:13*elbow_ quit (Quit: Leaving)
05:44:08*dashed quit (Quit: Connection closed for inactivity)
05:44:28*dtscode quit (Quit: ZNC - 1.6.0 - http://znc.in)
05:46:56*vezzy quit (Ping timeout: 256 seconds)
05:47:15*quasinoxen joined #nim
05:51:57*Varriount_ joined #nim
05:54:56*Varriount quit (Ping timeout: 250 seconds)
05:57:10*jholland quit (Quit: Connection closed for inactivity)
06:12:32*kapil___ quit (Quit: Connection closed for inactivity)
06:16:29*awesomo4000 quit (Ping timeout: 245 seconds)
06:26:24*AnxiousGarlic joined #nim
06:26:44*Menche joined #nim
06:26:49*AnxiousGarlic left #nim (#nim)
06:27:22*woadwarrior quit (Quit: quit)
06:31:42*awesomo4000 joined #nim
06:51:58*awesomo4000 quit (Quit: awesomo4000)
07:00:10fizzboozehow do I use the httpserver package to serve static content?
07:00:14fizzboozelike a directory
07:02:46*reem joined #nim
07:19:26*BlaXpirit joined #nim
07:24:39*reem quit (Remote host closed the connection)
07:24:48*bjz joined #nim
07:28:04*bjz quit (Client Quit)
07:30:14*fizzbooze quit (Ping timeout: 245 seconds)
07:31:02*bjz joined #nim
07:37:01*bjz quit (Ping timeout: 256 seconds)
07:44:32*Demos quit (Quit: Leaving)
07:49:32*notostraca joined #nim
07:52:18*reem joined #nim
07:52:25*TEttinger quit (Ping timeout: 252 seconds)
07:53:13*notostraca is now known as TEttinger
07:54:17*gsingh93 quit (Ping timeout: 250 seconds)
07:57:54*reem quit (Remote host closed the connection)
07:58:06*Demon_Fox quit (Quit: Leaving)
07:59:34*reem joined #nim
08:00:38*bjz joined #nim
08:01:55*reem quit (Remote host closed the connection)
08:04:16*reem joined #nim
08:06:43*reem quit (Remote host closed the connection)
08:07:44*dapz joined #nim
08:14:34*xet7 quit (Quit: Leaving)
08:18:53*Trustable joined #nim
08:19:11*reem joined #nim
08:21:38*reem quit (Remote host closed the connection)
08:26:38*dumdum joined #nim
08:30:25*reem joined #nim
08:36:29*dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:48:03dumdumAny shortcut for generating html doc for all *.nim files in a dir?
08:51:14*reem quit (Remote host closed the connection)
08:55:44dumdumnm
08:56:33*sillesta joined #nim
08:58:01*davidterry joined #nim
08:58:17*davidterry quit (Client Quit)
08:58:39*chemist69_ quit (Quit: WeeChat 1.1.1)
08:58:50*chemist69 joined #nim
08:59:31*reem joined #nim
09:01:01*tumult joined #nim
09:02:32*reem_ joined #nim
09:04:20*reem quit (Ping timeout: 265 seconds)
09:06:09*reem_ quit (Remote host closed the connection)
09:10:51*reem joined #nim
09:13:39*reem quit (Remote host closed the connection)
09:15:43*tumult quit (Ping timeout: 246 seconds)
09:25:48*akiradeveloper joined #nim
09:27:30akiradeveloperQuestion: no newtype (like in Haskell) in Nim? I want to acquire typing without runtime cost. Some pragma to annotate that the type is newtype?
09:28:18akiradeveloperor any plan if it doesn't exist now but for future?
09:29:15*reem joined #nim
09:31:40Maxdamantusakiradeveloper: there's `distinct`
09:31:44*BlaXpirit quit (Quit: Quit Konversation)
09:32:51Maxdamantuswhich is pretty much like newtype, except you're meant to be able to call the outer value if the inner one is a proc, and I think you might be able to access fields if it's an object/tuple.
09:33:06Maxdamantusthough the former at least seems to be broken atm in the C backend.
09:34:23Maxdamantus.eval (type a = distinct proc(); var b = a(proc() = discard); b())
09:34:27MimbusMaxdamantus: eval.nim(4, 3) Error: ')' expected
09:34:46akiradeveloperI don't wrap proc so it's ok
09:34:54akiradeveloperI will try. Thanks
09:35:15MaxdamantusIt still works if you unwrap it yourself.
09:36:14akiradeveloperWhat do you mean?
09:38:45Maxdamantusvar b = a(proc() = discard); type emptyproc = proc(); emptyproc(b)()
09:41:09*reem quit (Remote host closed the connection)
09:41:55*reem joined #nim
09:41:57*matkuki joined #nim
09:59:46*reem quit (Remote host closed the connection)
10:00:44dumdumKeep receiving connection refused for auto complete in sublime text 2: http://pastebin.com/83JdzTe8
10:00:57dumdumnimlime plugin
10:02:02*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 35.0.1/20150122214805])
10:02:19*reem joined #nim
10:08:36ekarlso.eval let foo = 1
10:08:39Mimbusekarlso: <no output>
10:14:25*dumdum quit (Quit: Leaving.)
10:27:31*reem quit (Remote host closed the connection)
10:28:19*reem joined #nim
10:28:39AraqMaxdamantus: " I think you might be able to access fields if it's an object/tuple". no you're not able to do that unless you use a pragma
10:28:57MaxdamantusOkay.
10:30:10MaxdamantusRegarding the (int, int) thing, seem to have trouble using it as generic arguments.
10:30:22Maxdamantusgot: ((typedesc[int], typedesc[int]))
10:30:22Maxdamantusbut expected: (T)
10:32:38MaxdamantusSeems weird that parts of the type system see PNodes.
10:33:17Araqwell when you construct the tuple type you need to skip tyTypeDesc
10:33:37AraqMaxdamantus: well that's required for things like 'case x' in objects
10:33:59Araqit's also the foundation for dependent typing
10:35:39MaxdamantusMm, kind of.
10:36:11MaxdamantusIt's the foundation for pattern-based dependent typing.
10:36:29MaxdamantusYou could have a more restricted form that uses a strict notion of values.
10:37:22MaxdamantusIs that a planned feature?
10:37:52MaxdamantusI've seen you can do something similar to the restricted form.
10:39:19Araqwell there is static[T]
10:39:56MaxdamantusYeah.
10:40:20Araqnot sure if that counts as "dependent typing" but I think it does
10:41:43*d3m1gd joined #nim
10:43:57MaxdamantusYes, but it's the sort where you only need to represent values, not ASTs.
10:45:37Araqyeah but we have no concept of "value" in the compiler really. a value is just an atomic AST
10:45:38Maxdamantusin a language like idris you can write something like: (n: Nat) -> (m: Nat) -> (n + m: Nat) -> Nat
10:46:31Maxdamantus(I think that might be how you write it in Agda too, but I haven't looked too much at that)
10:47:30d3m1gdis there something like macroexpand-1 from lisp, where only one macro expanded, so you can see expansion incrementally? I use this three line piece as a full macroexpand: https://gist.github.com/d3m1gd/68fd27f3a8d3fce317d7
10:47:55d3m1gdbtw, i use 0.10.2
10:48:26Maxdamantusactually, I guess the important thing there is that it's properly typechecked. In nim it's only typechecked for each use.
10:49:00MaxdamantusSo you'll be providing a value for n and m, then you know the value for n + m.
10:50:34*Tennis joined #nim
10:50:38*jm116__ joined #nim
10:50:46*jm116__ quit (Remote host closed the connection)
10:52:21*reem quit (Remote host closed the connection)
10:52:51Araqaccording to TAPL "families of types indexed by terms" seems to be the definition of "dependent type". so static[T] does count.
10:53:35Araqbut you're right in that's not what people usually mean by this term
10:54:57Araq"The trend in these languages is toward restricting the power of dependent types in various ways ..."
10:55:36Araqso restricting the term to a value is just fine and still a dependent type system.
10:56:03Araqand now I wonder if C's array type means C has dependent typing
10:56:24MaxdamantusHeh.
10:56:31*gokr quit (Remote host closed the connection)
10:57:49MaxdamantusI think it's probably easier to make a case that C's arrays are a form of dependent typing than nim's static[T] thing.
10:58:43MaxdamantusBecause dependent typing should let you reason statically about dynamic values.
10:58:56Maxdamantusbut I think it's only static values in nim.
10:59:36Araqyeah.
10:59:55Maxdamantusvar n = len(a); printArray[n](a)
11:00:38AraqI still prefer flow dependent typing over over dependent typing a la Idris btw
11:01:30Araqit's much simpler and still very useful
11:01:50Maxdamantusis that like flow typing?
11:02:05Maxdamantusmaybe flow-dependent typing
11:02:18Maxdamantusthough not much comes up with Google.
11:03:09Araqyes it's "flow typing"
11:03:20MaxdamantusHm. Flow typing isn't dependent.
11:03:34*epichero quit (Remote host closed the connection)
11:04:00Araqno, it's different and doesn't lead to ever more type annotations
11:04:57*Maxdamantus dislikes subtypes, so wouldn't have flow typing in his optimal language.
11:06:30Maxdamantusthough if subtypes are required, I quite like the idea of flow typing.
11:07:47*Maxdamantus suggested it to someone as a solution to his small-step reduction being broken by type inference as part of the reduction.
11:08:28Araqd3m1gd: there is only what you already know. 'repr' and its variants
11:08:57Araqd3m1gd: though there is still the .immediate vs non-immediate distinction
11:09:14Araqand usually .immediate macros are easier to debug
11:09:37d3m1gdAraq: i tried immediate, it just dumps non-expanded AST. But thanks for the info!
11:26:27kokozedmanhey guys, what's wrong with the current state of Aporia? http://paste2.org/dp27LyOE
11:27:12*tumult joined #nim
11:27:25Araqkokozedman: I still haven't fixed a codegen bug that causes this.
11:28:34kokozedmanhey Araq ... I see, unfortunately, I have no experience in codegen. By the way, when is 1.0 due?
11:29:03ekarlsois there any mode for nim in aceeditor ?
11:29:53Araqwith the number of people using Nim constantly increasing so does the number of reported bugs ... so version 1.0 is actually far away. :-(
11:29:55*davidhq joined #nim
11:30:15kokozedmanI might be wrong, but is codegen bug a serious thing?
11:30:52kokozedmanOh, ok. But I think that's a good thing thoug
11:31:00kokozedmans/thoug/though/
11:31:02Araqno, it's only triggered by GTK on some archs since GTK's API embaces varargs
11:31:10Araq*embraces
11:31:29Araqit's easy to fix
11:31:33kokozedmansome archs?
11:31:36kokozedmanlike which one?
11:31:43Araq64bit archs, I think
11:32:02kokozedmanhmm... well, I'm on Mint Linux (based on Ubuntu) 64-bit
11:32:10kokozedmanI get that exact crash
11:32:26kokozedmanso, which archs is working?
11:32:34Araq32 bits?
11:33:15kokozedmanhmm... ok. You mentioned it's easy to fix
11:33:48kokozedmandoes that concern 64-bit also?
11:34:34Araqhttp://forum.nim-lang.org/t/724/4
11:36:07Araqnote there is some confusing about how many bits GType actually does have
11:36:12Araq*confusion
11:40:10kokozedmanAraq: ok, thanks for that info. I'm not sure how the varargs works and how is the size of a type relevant to it. But I'll try the modification I see there.
11:40:45*kashyap_ joined #nim
11:41:57Araqkokozedman: I think I fixed it, let's see
11:43:59*a5i joined #nim
11:44:04kokozedmanAraq: cool... which repo do I have to update?
11:44:10tumulthey everyone, has there been any news on the GSoC?
11:44:29Araqtumult: we haven't been accepted
11:44:40tumult:(
11:45:10kokozedmanmay be we're too much in competition with Golang? :-P
11:45:29Araqtumult: you can still do the tasks. I can send you some German beer as a reward
11:47:39*akiradeveloper quit (Remote host closed the connection)
11:49:52tumultI think with all the good things happening with nim and the attention it is getting, it's only a matter of time - by next year things will look very different. The goals written for the application are well defined and layed out, so perhaps they'll become projects in of themselves anyway.
11:49:53Araqkokozedman: I have to go, edit compiler/ccgexprs.nim line 59
11:50:20Araqsimply remove the whole 'of' branch special casing tyInt
11:50:24kokozedmanAraq: ok, thanks for the tip
11:50:25tumultha! I love German beer :) Well I am actually attempting to do the game engine project to be fair :)
11:50:36Araqand bootstrap and try it please
11:50:39Araqbbl
11:59:50kashyap_ Looks like --listCmd does not print out the link command - how can I print the link command?
12:00:22ekarlsoso aceeditor sends me some funky stuff
12:00:26ekarlsoi'm trying to runInput.replace("\u000", "\n")
12:00:32ekarlsobut invalid character constabnt ?
12:04:03def-kashyap_: no idea, but isn't it just "gcc -o outfile all-o-files -ldl"
12:04:49def-ekarlso: strings don't handle null characters, they mean the string is over
12:05:17kashyap_def- what about with vcc though?
12:05:24kashyap_is it cl ?
12:05:51kokozedmanAraq: yes, that seems to make Aporia start without a crash, no modification required on the Aporia
12:05:59ekarlsodef-: .. how to fix that then :d
12:06:12def-you could try setting the linkerexe to cl and see if it still works
12:07:00*sepisoad joined #nim
12:07:11def-ekarlso: i don't know what exactly you're doing, you could have a seq[char] instead
12:07:22kashyap_where in source can I look for where the compiler/liker is invoked
12:07:25def-ekarlso: oh, and the error actually comes from writing "\u000" instead of "\0"
12:08:15def-kashyap_: compiler/extccomp.nim
12:08:23def- linkerExe: "cl",
12:08:23def- linkTmpl: "$options $builddll /Fe$exefile $objfiles $buildgui",
12:08:31def-for vcc
12:08:33kashyap_great...thanks def
12:08:41sepisoadHi, I'm looking for a library that handles sha25 and aes algorithms, if the library can cover other major encryption algorithms as well it's be awesome
12:13:33kashyap_sepisoad ... you could try the ssl impure library
12:14:48ekarlsodef-: http post http://localhost:8080/runs version="devel" input='for i in @[1,2,3]:\necho(i)'
12:14:54ekarlsoI dont think it likes the "\n"
12:15:27def-ah
12:15:36def-if you're parsing the \n as a single character, that won't work
12:15:45ekarlsodef-: what then ? :p
12:15:49def-use \r and \l instead
12:15:58def-http://nim-lang.org/manual.html#character-literals
12:17:12wbYeah, just ran into that with the SFML wrapper. Had to use cstrings to get it through the char/rune conversions.
12:17:26ekarlsoasdasdpdfo
12:17:30ekarlsostupid ass aceeditor
12:23:03*sillesta quit (Remote host closed the connection)
12:34:38kokozedmanhmm... the idetools are also seemingly broken. Nothing is being suggested at all.
12:34:42*gokr joined #nim
12:35:00def-kokozedman: idetools are being replaced with nimsuggest currently
12:35:28kokozedmandef-: oh, I see
12:35:42kokozedmanand how is the Aporia suggestion in relation to that?
12:37:17def-I think they were working on making Aporia support that in here yesterday
12:39:44kokozedmandef-: I take that's in the nim-suggest branch of Aporia
12:40:20*akiradeveloper joined #nim
12:42:12Araqstrings in general can hold \0 just fine
12:42:34Araqit's just that the stdlib sometimes takes advantage of the terminating \0
12:42:58*no_name quit (Remote host closed the connection)
12:43:39Araqin particular 'echo' doesn't like internal \0s and that's really hard to fix
12:44:17*no_name joined #nim
12:53:09Araqcan somebody review https://github.com/Araq/Nim/pull/2230 please?
13:01:27def-Araq: done
13:10:09*aleron joined #nim
13:12:19*kashyap_ quit (Ping timeout: 246 seconds)
13:12:59*akiradeveloper quit ()
13:13:58*BitPuffin joined #nim
13:14:17Maxdamantus23:33:01 < Araq> well when you construct the tuple type you need to skip tyTypeDesc
13:14:24MaxdamantusConstruct where?
13:14:55MaxdamantusIt doesn't seem to be constructed at the point of instantiating generics.
13:14:58*akiradeveloper joined #nim
13:15:05Maxdamantusunless that's what I'm missing.
13:16:09*akiradeveloper quit (Client Quit)
13:21:44*awesomo4000 joined #nim
13:21:50Araqwell semtypes should construct a tuple type, Maxdamantus
13:25:03Maxdamantusbut type matching doesn't use types (PType), does it?
13:26:24Araqsure it does
13:30:22aleronHow can I convert an enum value to a string?
13:30:41aleronnvm, $
13:30:50aleronI assumed that was only for ints
13:43:45*BlaXpirit joined #nim
13:47:12aleronSo, I think I am seeing incorrect behavior from terminal:setCursorPos() on OS X
13:47:31aleronsec, let me test in a different terminal app
13:48:48aleronWhat I'm seeing is this: setting the cursor to X = 0 results in nothing being printed. Only characters printed at x>1 are showing up, and x=1 is being printed in the first column
13:49:00aleronI tested with both the native terminal app and iTerm, same behavior
13:50:56Araqthat's not surprising to me at all. that escape sequence handling is barbaric
13:51:18aleronim going to set using SetCursorXPos() instead
13:51:34aleronsince a quick look at the source says SetCursorPos() doesn't delgate to the two other procs
13:51:35Araqwhen you're done, please create a PR
13:51:48aleronPR = pull request?
13:51:55Araqyes
13:54:56aleronSetCursorXPos() is subject to the same shenanigans
13:55:08aleronOkay I'll take a look at the escape strings I guess
13:55:32*mpthrapp_ joined #nim
13:56:56*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:10:21*Jehan_ joined #nim
14:12:29alerony=0 doesn't work either
14:13:50aleronhuh
14:13:52Araqaleron: replace it by using some macosx specific APIs or something, the more we can avoid unix's string munging bullshit, the better
14:13:55aleronThat's treally string
14:14:06aleronI am printing escape sequences manually and 0,0 is not working
14:14:17aleronbut I can get it to work from a C prog
14:14:25aleronprinting the same sequences with printf
14:14:45aleronI'm not really familiar with the os x apis, but osx supports the ansi sequences
14:14:56aleronThis is working from C
14:15:11aleronThe escape sequences appear to be correct
14:15:43Araqmaybe \e is different on Mac?
14:15:56aleronwell
14:16:12aleronis nim taking my "\e" and expanding it, or is it letting gcc do it?
14:16:16aleronThat's the first question
14:16:37aleronlet me look at the source
14:16:40aleronsorry, I'm slow
14:16:49aleroncompletely forgot I have the translated source in front of me
14:18:00Araqwe always map it to 0x1B
14:18:09Varriount_Meep
14:18:13*Varriount_ is now known as Varriount
14:18:25aleronso, the nim string with \e ends up as \0ee in the c file, so that looks correct
14:22:16Araqaleron: even if you can get it to "work" it's just stupid: changes to the terminal are permanent (after the process stopped!), redirecting stdout then produces weird escape stuff etc etc
14:23:36aleronI'm unsure of what you are getting at
14:24:31aleronIt seems really strange (and worth figuring out) why this particular escape sequence is not working, when it does from C
14:24:33VarriountGood morning Araq, aleron
14:24:37aleronGood morning
14:25:28aleronaraq: I'm just looking for a lightweight alternative to ncurses atm. the terminal module, or manual escape sequences, would provide that
14:26:10aleronI mean, I can work around this by just printing starting from 1,1 instead of 0,0, but man, thats really strange behavior
14:26:28Araqaleron: oh yes, it's definitely worth figuring out. But using escape sequences is fundamentally wrong.
14:26:40*jfchevrette joined #nim
14:27:16aleronI'm not sure there is really much of an alternative
14:27:31aleronI mean, doesn't curses/ncurses fundamentally use the escape sequences to provide all that it does?
14:28:13aleronI wish there was a better concept/standard for manipulating terminals, but all we have is what we have in the *nix world
14:29:18aleronAnd as per your original comment aobut using OS X specific APIs, I'm definitely not an Apple dev type I just use a MB, but I don't think those APIs exist
14:30:53ekarlsoBlaXpirit: u on
14:31:10AraqUnix is like PHP, everything is stringly typed. ;-)
14:31:20ekarlsohttps://bpaste.net/show/b3004f9bca37 < what's wrong with that ?
14:35:06*gokr quit (Ping timeout: 272 seconds)
14:36:24aleronhuh...its workring
14:36:30aleronwtf did i do/change
14:37:31aleronim losing my mind
14:37:49*gokr joined #nim
14:38:55Araqekarlso: maybe use when compiles(echo(eval()))
14:46:07BlaXpiritekarlso,
14:47:38*awesomo4000 quit (Quit: awesomo4000)
14:47:58*davidhq joined #nim
14:49:33VarriountAraq: Man, you have no pity for *Nix, do you?
14:53:26AraqVarriount: Tradition is not to preserve the ashes but to pass on the flame.
14:53:35aleronlol
14:57:55onionhammerAraq eta on the SPIR-V back end?
14:58:23*sillesta joined #nim
15:00:38VarriountThere's nothing like programming in assembly to make you value higher level languages (even C)
15:00:42*l04m33 quit (Remote host closed the connection)
15:01:40aleronor to value macro assemblers :P
15:02:41Varriountaleron: I'm taking an Assembly class which uses MASM (Microsoft Assembler)
15:02:56aleronI used to enjoy writing small programs/games with MASM
15:03:06VarriountToday I decided to look at NASM on my own. Man, things are different.
15:06:06Varriountaleron: How do you find Nim so far?
15:06:11aleroncool
15:06:17aleronI'm only like a day in
15:06:29aleronI really like the idea of Nim
15:06:56aleronI'm encountering issues, which are probably my fault, and its helping me learn faster
15:08:11gokraleron: Some articles may be of interest: http://goran.krampe.se/category/nim
15:08:35alerongokr: thanjks
15:10:00aleronoh man
15:10:19aleronjust figured out the root of all my issues, and as expected, has NOTHING to do with the terminal escape sequences
15:10:35aleronfor i in str:
15:10:39aleroni starts at 0
15:10:41aleroner, 1
15:11:27aleronso, can I tell for to start at 0? like maybe for i in 0..len(str)?
15:11:36Araqstrings start at 0
15:11:48aleronwhen I do this:
15:11:53aleronfor i, ch in "blah":
15:11:59aleronand echo($i)
15:12:05aleronI see it starting at
15:12:08aleron1
15:12:18aleronshit nvm
15:12:26aleronyou are right, it was at the end of the preceding line
15:14:30def-aleron: btw: echo automatically converts its arguments to strings with `$`, so "echo i" works too
15:14:42aleronoh cool
15:15:34*Mandar joined #nim
15:16:19Mandarexit
15:16:26*Trixar_za quit (Ping timeout: 256 seconds)
15:16:34*Mandar quit (Client Quit)
15:16:36*jasondotstar joined #nim
15:19:05OderWatSo if Nim is not in GSoC 2015 Rust aka Mozilla is neither: http://blog.queze.net/post/2015/03/03/Mozilla-not-accepted-for-Google-Summer-of-Code-2015
15:20:59OderWat@Araq Do I understand you correct to ditch the * implementation completely and just do repeat() for the repeatStr/Char() replacement?
15:21:18Araqyes
15:21:52aleronHow can I convert an int to a char literal?
15:22:05aleronThat is, go from 2 -> '2'
15:22:53Araqord(someChar) + ord('0')
15:22:53ekarlsoBlaXpirit: i tried copying the code u had done for Mimbus over to the playpen stuff
15:22:57ekarlsobut it's failing
15:23:04aleronaraq: thx
15:23:19Araqer no
15:23:31Araqchr(x + ord('0'))
15:23:37aleronaraq: acutally not quite....okay :)
15:23:56AraqI'm sure we also have something in the stdlib for that
15:24:24Araqbut if you know the low level you can forget about the high level ;-)
15:24:26ekarlsohttps://github.com/ekarlso/nim-playpen/blob/master/src/private/run.nim < is the culprit
15:24:39*awesomo4000 joined #nim
15:25:01*zahary1 quit (Ping timeout: 264 seconds)
15:26:09*zahary joined #nim
15:29:17*xet7 joined #nim
15:35:38fowlrepeatstr has bothered me for years
15:41:38Araqfowl: iirc it was ported from Pascal where 'repeat' is a reserved word :P
15:42:55OderWatArag but -1 is an int too :)
15:43:44ekarlsohmmms
15:43:49ekarlsohow do I split newline in nim ?
15:44:38*awesomo4000 quit (Quit: awesomo4000)
15:44:46def-ekarlso: splitLines from strutils?
15:45:12ekarlsoso not .split("\n") :D
15:45:20OderWatWell there was repeatStr and repeatChar .. which is ok if you do not have overloaded functions which match their parameters.
15:49:40*darkf quit (Quit: Leaving)
15:57:08*jholland joined #nim
15:59:04*Boscop quit (Read error: Connection reset by peer)
15:59:31*Boscop joined #nim
16:02:17*pafmaf_ joined #nim
16:03:31*ekarlso quit (Ping timeout: 250 seconds)
16:04:22*Sembei quit (Ping timeout: 240 seconds)
16:09:31*ekarlso joined #nim
16:10:47*jsudlow quit (Remote host closed the connection)
16:17:02*dapz joined #nim
16:19:53*dapz quit (Client Quit)
16:19:55*jsudlow joined #nim
16:22:14*brson joined #nim
16:23:03ekarlsodef-: hmmmms, so apparantly aceeditor only supports unix or windows as newlinemodes...
16:23:06ekarlsosuggiestions ?
16:24:11*OnwardEuler joined #nim
16:24:48ekarlsoor if anyone else has any it's for the playpen stuff for nim
16:26:56BlaXpiritekarlso, yeah, my code is poorly thought out :|
16:27:12BlaXpirityou shouldnt use that for playpen anyway
16:27:23BlaXpiritjust let people write code
16:27:37ekarlsook ^
16:31:14*pafmaf_ quit (Quit: This computer has gone to sleep)
16:35:01dom96Araq: You broke Aporia's config file.
16:36:44*pafmaf_ joined #nim
16:37:03dom96easy to fix though thankfully
16:38:10novist"Urho3D version 1.32 (exactly) compiled as a library for your platform."
16:38:15novistso its static or dynamic library?
16:39:33*pregress_ joined #nim
16:40:29*pregress_ quit (Client Quit)
16:41:52*askatasuna joined #nim
16:47:04*Matthias247 joined #nim
16:50:51novistlib/pure/osproc.nim(647, 4) Error: undeclared identifier: 'defer'
16:51:03gokrnovist: static library
16:51:05novistwhen compiling compiler
16:51:14novistok ty gokr
16:51:19gokrWhat platform?
16:51:27novistlinux x64
16:51:59gokrSame as me.
16:52:16ekarlsofor some reason when running nim inside a playpen stdout doesn't show :/
16:52:22*Matthias247 quit (Read error: Connection reset by peer)
16:54:23ekarlsodoes nim require anything special in a env to write ?
16:56:11novistekarlso: i have no idea what playpen is but maybe what you are doing does lousy redirection of standard streams?
17:00:13ekarlsonovist: weird then that rust uses the same thing and their stuff seems to work :/
17:01:03ekarlsonovist: is Hint: used config file '/usr/local/nim/versions/devel/config/nim.cfg' [Conf]
17:01:09ekarlsohints written to stderr or out ?
17:01:32novistno idea what hints are heh
17:03:07ekarlsonoone that wants playpen ? :p
17:07:49*sepisoad quit (Quit: Leaving)
17:10:47novistactually "playpen" gives me naughty ideas
17:11:07ekarlsonovist: hhaa
17:11:09ekarlso:p
17:13:55*perturbation joined #nim
17:15:25*perturbation quit (Client Quit)
17:15:36novistgokr: could you drop me current revision of nim you have installed? i suppose its devel.
17:15:40novistsince i cant find working revision heh
17:18:01*awesomo4000 joined #nim
17:18:09ekarlsoi give up this stuff
17:19:23gokrnovist: You need devel for Urhonimo. Really.
17:19:40gokrDoesn't the readme say so btw?
17:19:43gokrIt should
17:19:44novistgokr: right, i know. i just need revision that would compile heh
17:20:25gokrI have 8b05bf3e8660ded6dec29e044aa532a60d291cec
17:21:22fowlnovist, latest on the devel branch
17:21:24gokrBut now I did a git pull + koch release
17:21:28gokrAnd it compiled.
17:21:40ekarlsowhat does Error: execution of an external program failed
17:21:45ekarlsomean again when compiling ?
17:21:49ekarlsounder Linking
17:21:56*Tennis quit (Quit: Leaving)
17:21:58novisthmm the hell, ill rm -rf / reclone..
17:22:13*tumult quit (Ping timeout: 246 seconds)
17:23:52ekarlsoI wonder if nim hates being under playpen ..
17:26:00ekarlsoanyone wanna try ? :p
17:27:38*dapz joined #nim
17:27:51ekarlsonvm me then, someone else can do it :p
17:27:52novistoddly enough new clone compiles but doesnt install: gcc: error: tools/niminst/nimcache/libzip_all.o: No such file or directory
17:28:36novistekarlso: noone cares probably because they have no idea what playpen is.. or they think its pink dildo..
17:31:52*OnwardEuler quit (Ping timeout: 240 seconds)
17:33:01*TEttinger quit (Ping timeout: 264 seconds)
17:36:25ekarlsohttps://github.com/ekarlso/nim-playpen
17:44:10novistwrapper around running command. weird stuff ^_^
17:44:44*thilp left #nim (#nim)
17:45:56ekarlsonovist: uh, more like play.rust-lang.org
17:46:05ekarlsopeople said they wanted it but I dunno :p
17:46:48novistoh you are trying to make nim work w/ that? thats pretty neat
17:47:17novisti was thinking about something similar myself, but it was more like using emscripten to build nim test cases and run them as js on user's browser
17:47:19ekarlsoyeah...
17:47:25ekarlsobut it's not working
17:47:30novistcause you know.. running anyone's code aint exactly secure
17:49:08ekarlsoit's runned in playpen..
17:49:24novistis it kind of a sandbox thing?
17:49:28ekarlsoyeah
17:49:46novistinteresting
17:53:49*a5i quit ()
17:53:55*gsingh93 joined #nim
17:57:47novistekarlso: with what do you build playpen?
17:58:35novistactually.. it doesnt work w/o systemd?
18:02:58*dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:04:38awesomo4000where’s /usr/local/bin/eval.sh
18:07:31awesomo4000it’s in playpen but i don’t see the script in the source on github
18:10:01*nimnoob123 joined #nim
18:11:06*Jesin quit (Quit: Leaving)
18:12:58aleronheh
18:13:03aleronjust got this error: ???(???, ???) Error: type mismatch: got (float) but expected 'int'
18:13:49*Jesin joined #nim
18:16:04aleronI was doing const foo: int = 1000 / 30
18:16:23nimnoob123you could do int(1000/30)
18:16:25aleronso I had to force converstion with int(). weird that it wasnt able to determine line #
18:16:28aleronyeah thats what I did
18:16:45nimnoob123it outputted the question marks?
18:16:47aleronI just shared since the compiler couldn't figure out the line/column number
18:16:49aleronyeah
18:16:52nimnoob123weird lol
18:17:00nimnoob123gonna try it
18:17:02aleronand, interestingly, the error did not show up in vim via the vim-nim plugin
18:17:08aleronplease do!
18:17:09nimnoob123what version of nim?
18:17:27aleron0.10.2 (2014-12-29)
18:17:32aleronon OS X
18:17:39nimnoob123im using latest from github, gonna test (I'm on windows though)
18:18:09nimnoob123heh yeah same error :D
18:18:21nimnoob123looks like you found a bug
18:18:25aleronwell, consistent bug is better than inconsistent bug
18:18:32aleronWhere do I report it?
18:18:45nimnoob123on the git repo issues thing lemme link
18:18:51nimnoob123Nim Compiler Version 0.10.3 (2015-03-01) [Windows: i386] is the version i tested on
18:18:52aleronah, i know where then
18:18:54aleronnp
18:19:07nimnoob123https://github.com/Araq/Nim/issues
18:19:40nimnoob123tell them i had the same issue w/ that version I listed, weird bug
18:20:34aleronlist you as nimnoob123?
18:21:13nimnoob123um sure lol
18:21:33nimnoob123i'll make a comment saying i reproduced it
18:21:55nimnoob123easier that way
18:24:03*pafmaf_ quit (Quit: This computer has gone to sleep)
18:28:16Jehan_aleron: Use the div operator for integer division, e.g.: const foo = 1000 div 30
18:28:33kokozedmankoch seems to be doing a kind of 'make -j4' (or at least more than 1), how can I make it a kine of 'make -j1'?
18:29:10Jehan_And the missing line number information is probably a bug.
18:29:39kokozedmankind*
18:29:44nimnoob123that's what he's reporting, missing line information
18:29:53Jehan_kokozedman: That's actually the nim compiler that does that.
18:30:20aleronnimnoob123: https://github.com/Araq/Nim/issues/2252
18:30:35Jehan_--parallelbuild:1 should avoid it.
18:30:41nimnoob123responding
18:30:47aleronjehan_: yep, I know it was wrong, just filed the issue because of the missing line numbers in the error, thats all
18:31:20Jehan_Well, there's also a difference between a div b and int(a/b)
18:31:56aleronwhat is the difference
18:32:28Jehan_the latter actually does a (more expensive) fp division and casts that, the former does an integer division. Not important for const (other than that the semantics may be slightly different for negative values, I think), but it matters elsewhere.
18:32:46alerongotcha
18:32:54kokozedmanJehan_: doesn't seem to have an effect... trying to compile Nim on a 512MB DO VPS
18:33:21Jehan_kokozedman: Hmm, it may be that --parallelbuild:1 isn't passed on to the nim compiler when using it with koch
18:33:24nimnoob123aleron: responded
18:33:29aleronty
18:33:33kokozedmanyeah, probably
18:34:05kokozedmanAraq: any ways to pass --parallelbuild:1 to koch? trying to compile on 512MB RAM VPS with 1 Core
18:35:29Jehan_kokozedman: You can probably edit compiler/nim.nim.cfg
18:35:41Jehan_and add: parallelbuild:"1"
18:35:48Jehan_On a line of its own.
18:36:36*awesomo4000 left #nim (#nim)
18:36:56Jehan_Actually, if that's a general problem on that machine, you want to edit config/nim.cfg
18:37:22Jehan_That already has a value of 0 for parallelbuild (which means as many cores as it can find), so just change that to 1.
18:39:01reactormonkkokozedman, O.o?
18:42:37kokozedmanreactormonk: Jehan_: I'm not sure what I'm missing... but it seems to always run a bunch of gcc in one go
18:42:56reactormonkkokozedman, ok, go for parallelbuild:1
18:43:12Jehan_kokozedman: Hmm, did you change config/nim.cfg?
18:43:30Jehan_reactormonk: numbers don't work in config files without quotes.
18:43:39reactormonkJehan_, TIL
18:43:44Jehan_And it's parallelbuild:"0" in the standard config.
18:43:59Jehan_Afk, be back in a bit.
18:49:50*BlaXpirit quit (Quit: Quit Konversation)
18:50:51kokozedmanJehan_, reactormonk yeap, tried all possible combinations and it still runs a lot of GCC processes... but anywya, I solved the problem by running that part in a bigger VPS and simply rsync-ing to the smaller VPS
18:51:26reactormonkkokozedman, sounds like a solid approach to me, although parallelbuild:"1" shouldn't do that
18:51:45*BlaXpirit joined #nim
19:00:18Jehan_Yeah, it shouldn't.
19:03:11*a5i joined #nim
19:09:25*mtj quit (Ping timeout: 264 seconds)
19:11:44*sillesta left #nim ("undefined")
19:13:01VarriountWoah, we have a lot of PR's
19:13:40reactormonkVarriount, yup
19:16:26*davidterry joined #nim
19:16:32reactormonkMaxdamantus, aren't you simply looking for an "Unit" type with your PR?
19:19:11*davidter_ joined #nim
19:19:38Varriountreactormonk: How do you think https://github.com/Araq/Nim/pull/2230 looks?
19:21:02reactormonkVarriount, I don't like the buflen <= 0 part, imo should be an error instead of just dropping data
19:21:14*davidterry quit (Ping timeout: 256 seconds)
19:21:18reactormonkoh, it's a passed argument. nevermind.
19:23:04*mtj joined #nim
19:23:10*johnsoft quit (Ping timeout: 244 seconds)
19:23:28*johnsoft joined #nim
19:25:44*fizzbooze joined #nim
19:27:25*aleron quit (Quit: leaving)
19:30:25VarriountHm. Should a procedure to repeat a sequence X times assert that X > 0?
19:31:03Jehan_No, >= 0 at most.
19:31:29VarriountOh, hi Jehan.
19:37:59*gsingh93 quit (Ping timeout: 265 seconds)
19:38:54*rektide__ is now known as rektide
19:46:57*davidhq quit (Quit: Textual IRC Client: www.textualapp.com)
19:49:00*davidhq joined #nim
19:52:22*davidhq quit (Client Quit)
19:52:28*gsingh93 joined #nim
20:02:50Maxdamantusreactormonk: kind of.
20:03:00Maxdamantusreactormonk: the type already exists, you just can't express it.
20:03:24reactormonkMaxdamantus, so add Unit to system.nim and make your own magic up?
20:03:42Maxdamantusreactormonk: why not just make it possible to express types that already exist?
20:04:01reactormonkMaxdamantus, would work too.
20:04:04*fizzbooze quit (Ping timeout: 252 seconds)
20:04:30Maxdamantus.eval proc foo(a, b: tuple) = discard; foo((), (1, 2))
20:04:33MimbusMaxdamantus: eval.nim(4, 3) Error: type mismatch: got (tuple[], tuple[int, int])
20:05:40reactormonkI'd also sneak in Unit somwhere in system.nim, although I'm not sure the others would agree
20:06:05MaxdamantusWell, I'm trying to implement (), (int, int), etc now, so () would work.
20:06:09Maxdamantuswhich is only two characters.
20:08:11VarriountWhat's being expressed?
20:09:23Maxdamantusin my current PR, empty tuples.
20:09:39Maxdamantusempty tuple types, that is.
20:09:46Maxdamantuswell, there's only one empty tuple type.
20:10:03*fizzbooze joined #nim
20:11:14*askatasuna quit (Quit: WeeChat 1.1.1)
20:15:04*askatasuna joined #nim
20:18:14*Matthias247 joined #nim
20:28:34*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:33:42Araqkokozedman: I had the same problem and gave the machine a swap file to solve it
20:33:55Araqit doesn't slow things down that much
20:34:24AraqparallelBuild:1 should really work, not sure what's going on here
20:35:55*Maxdamantus still seems to be stuck on the typedesc thing.
20:36:47Maxdamantusother inputs still have typedesc around them, but they're in a different place.
20:37:00Maxdamantusand it only applies to generic types, not generic procs; they work.
20:37:01AraqMaxdamantus: typedesc transforms the type into a meta-type, kind of. So that high(int) etc. works.
20:37:31Araqso 4 has the type 'int', but 'int' has the type typedesc[int]
20:38:07MaxdamantusSo why does `Foo[tuple[a: int]]` seem to pass a `typedesc[tuple[a: int]]` node to `matches`?
20:38:07Araqand typedesc[int] has the type typedesc, I think, so these to not stack up
20:39:18Araqbecause it's a type and not a value?
20:39:57MaxdamantusHm. So this is something the parser decides?
20:40:19Araqno, semExpr returns a type or a meta-type
20:40:34Araqwell it annotates the AST with either a type or a meta-type
20:41:28Araqthis typedesc handling is still a bit inconsistent, this feature grew into existance ;-)
20:42:46MaxdamantusOkay, I think I might see it now.
20:45:28MaxdamantuscheckPar :)
20:46:35MaxdamantusHm. Actually, there are a couple of problems.
20:47:10Maxdamantus() can be either a type or value expression.
20:47:14Maxdamantusas can (int, int)
20:47:26Maxdamantushence the typedesc in each element.
20:49:00Araq() is indeed ambiguous :-/
20:49:53Araqbut (int, int) should be typedesc[tuple[int, int]] and not typedesc[tuple[typedesc[int], typedesc[int]]]
20:50:15Maxdamantuswhy wouldn't it be the latter?
20:50:29MaxdamantusCan you not have tuples of typedescs?
20:50:53MaxdamantusThat's what it's been passing all along.
20:51:02Maxdamantusthough only in generic types for some reason.
20:51:11Araqhrm, possible
20:51:25Araqbut typedesc shouldn't be recursive
20:51:36Araqthat's just absurd to work with otherwise
20:51:46Maxdamantusunless you're using generics.
20:53:23Araqtypedesc[seq[int]] is not typedesc[seq[typedesc[int]]], 1 typedesc is enough
20:54:33Araqzahary knows about about typedescs in generics
20:54:36MaxdamantusA lot of this is illogical :\
20:55:29AraqI'm open for suggestions
20:55:57MaxdamantusIt would probably make more sense to have a specific syntax for typedescs.
20:56:06Maxdamantuslike how Java has Class<T>
20:56:23Maxdamantusactually, the analogue there would be .getClass()
20:56:26Araqwell we have typedesc[T]
20:56:43MaxdamantusYeah, then you just write T instead of T.getClass()
20:57:04Araqyes that's what we do
20:57:42MaxdamantusWhy not make `typedesc` in expressions create the `typedesc[_]` values?
20:58:02Maxdamantusvar a: typedesc[int] = typedesc[int]
20:58:21Araqbecause we like to write high(int) and not high(typedesc[int])
20:58:40BlaXpirit:D
21:01:27MaxdamantusMaybe it could've been another sigil.
21:01:39MaxdamantusGHC has that as an extension iirc
21:03:03Araq"another" sigil? there are no sigils in the language
21:03:31fowlcould easily make ~(int,float) a macro for tuple[field0:int, field1:float] but ()? i dont think so
21:03:34*d3m1gd quit (Ping timeout: 245 seconds)
21:04:06Araqand from a user perspective it makes some sense: "what do you mean 'typedesc[int] required instead of 'int'?! what do you think 'int' is?"
21:05:49Maxdamantussilly user
21:08:07Maxdamantusfowl: presumably ~() would be just as easy, as long as you have my current PR.
21:08:31AraqMaxdamantus: but back to the real problem: if () is a value, what is its type?
21:08:46Araq'tuple[]' I guess
21:08:59Maxdamantusatm, yes.
21:09:16Araqso no nice sugar for the zero length tuple type. that's fine with me
21:09:44Maxdamantusbut it applies for other ones as well.
21:10:31reactormonkAraq, type unit = tuple[] ?
21:10:36def-Araq: is it intentional that when you copy a string the new one is allocated to the same capacity as the old one?
21:10:53Araqdef-: no, that's a bug we need to fix
21:10:54Maxdamantusproc foo[T: typedesc, U: typedesc](tds: (T, U))
21:11:11def-Araq: ok, can i just fix it in sysstr.nim? seems easy
21:11:22MaxdamantusYou would be able to call that function only by doing weird things.
21:11:29Araqdef-: yes please
21:11:54MaxdamantusSomething like: let a = int; foo((a, a))
21:12:48fowlT and U would have to be typedesc with that constraint
21:13:05Maxdamantusthey are, aren't they?
21:13:19fowlno a is an int
21:13:31Maxdamantuswhich int is it? 0, 1, 2, ..?
21:13:35fowloh nm my eyes
21:13:53Maxdamantusactually, I don't seem to be allowed to do that, so would need another proc.
21:14:06fowllet a = int isnt legal
21:14:21Maxdamantusproc bar(t: typedesc) = foo((t, t))
21:16:38def-Araq: damn, that makes such a huge difference on programs which copy strings
21:16:54def-the wiki one runes 11 times faster with this 2 line change
21:17:30*jfchevrette quit (Quit: Textual IRC Client: www.textualapp.com)
21:18:18fowldef-, you're doing gods work
21:19:21nimnoob123how do i grab a value from the command line again? can't seem to find it in the manual (most likely blind)
21:19:44def-nimnoob123: http://nim-lang.org/os.html#paramCount,
21:19:49def-(and the following procs)
21:20:11nimnoob123thanks
21:20:53nimnoob123I'm goning actually write something useful in nim today lol, well useful to me ;D
21:23:58Araqdef-: that means you don't need the slicing assignments in the parsexml module, right?
21:24:19def-Araq: I'm going to check that. First I want to see how seqs are copied
21:24:22*askatasuna quit (Ping timeout: 240 seconds)
21:26:40MaxdamantusSo Araq, do you want to disallow typedesc[typedesc[int]]?
21:27:18Araqnot disallow it can come up in generic code
21:27:21nimnoob123quick suggestion: I think procs that start with tilde should be listed first on the list of procs in the docs - for example http://nim-lang.org/tables.html that gets really confusing trying to find something quickly from the side menu
21:27:59AraqMaxdamantus: not disallow it, but flatten it.
21:28:11MaxdamantusHm.
21:28:12nimnoob123tbh the whole side menu is confusing in general for most of those pages
21:28:14Araqbut I didn't think too hard about that
21:29:28Araqin fact, if you can figure out what it *should* be and write that down somewhere, that would be really sweet
21:29:53MaxdamantusWhat what should be?
21:30:07Araqtypedesc of typedesc
21:30:25onionhammernimnoob123 i think it would be better if that sort of thing were handled in comments rather than sigils
21:30:34onionhammerwe dont want to start looking like rust
21:31:24Araqnimnoob123: I see not a single tilde in that page
21:31:37Araqso I have no idea what you're talking about
21:31:37onionhammeraraq he's saying it's confusing
21:32:06nimnoob123not a tilde, backtick or w/e
21:32:06onionhammerI somewhat agree that the generated documentation could be ordered better
21:32:20onionhammerrather than just order of declaration
21:32:44def-Araq: is it really necessary that we copy each element in a seq and array 1 by 1 instead of with a big memcpy?
21:32:52nimnoob123regardless, the side menu is really difficult at finding things at first glance, looks really unorganized
21:33:31Araqdef-: yes it is. though we could specialize it for what C++ calls "plain old datatypes"
21:34:12Araqnimnoob123: PRs are welcome, we know our docgen is quite bad
21:34:42nimnoob123speaking of PR's you ever get my one for the forum
21:35:10Araqthat's dom96's business
21:39:28def-Araq: definitely a worthy optimization. about 4 times faster for big seqs
21:40:36def-Araq: can only primitives like int, float be copied directly?
21:40:59Araqanything that doesn't contain GC'ed data
21:41:02def-objects or tuples containing those should work as well
21:41:13def-right
21:41:19Araqand only for gc:refc
21:41:31Araqfor the other GCs you can always memcpy
21:42:06Araqer ... no, you still need to obey to the general copying semantics
21:49:16VarriountMaxdamantus: Please document/comment any compiler code you touch.
21:50:40Araqas long as it doesn't hinder your productivity
21:52:38VarriountAraq: I like that Nim does nothing to prevent a user from memcpy'ing an sequence (even if the gc does crash)
21:53:02Araqflaviu: http://forum.nim-lang.org/t/960 thumbs up for you!
21:53:35AraqVarriount: last time I checked Nim requires you to use 'addr' for this stunt which screams "unsafe" to me
21:53:43flaviuThanks! I'd hate for someone to be using broken encryption and not know it.
21:54:17VarriountAraq: Well yes. But the compiler doesn't actually stop and say "No, you can't do that"
21:54:29Araqbut it does
21:55:25Araqit's just that Nim is smart and doesn't require 'unsafe' blocks. (Hi, Rust!)
21:58:59*johnsoft quit (Ping timeout: 245 seconds)
21:59:12*johnsoft joined #nim
21:59:43*davidter_ quit (Ping timeout: 244 seconds)
22:00:24def-Araq: How would I best discover whether there is gc-ed memory inside a data structure?
22:00:40Araqmissing typetrait
22:01:06Araqwe need a typetrait for that
22:03:02*mpthrapp_ quit (Remote host closed the connection)
22:04:46*reem joined #nim
22:07:42*gmpreussner|lapt joined #nim
22:08:13*gmpreussner|lapt is now known as gmpreussner|gdc
22:08:19*davidterry joined #nim
22:09:53*reem quit (Remote host closed the connection)
22:11:12*randomwalk joined #nim
22:12:47*davidterry quit (Ping timeout: 245 seconds)
22:13:08*reem joined #nim
22:13:13*davidterry joined #nim
22:13:46*Sembei joined #nim
22:16:30*reem quit (Remote host closed the connection)
22:19:43*BlaXpirit quit (Read error: Connection reset by peer)
22:21:19*BlaXpirit joined #nim
22:22:16*keldaris joined #nim
22:25:30*Matthias247 quit (Read error: Connection reset by peer)
22:26:59keldarisa newcomer question to Nim - having read through the manual and a fair amount of Nim code, I wanted to try my hand at writing a basic OpenBLAS wrapper for Nim - unfortunately, even a very simple test yields a SIGSEGV storage access error. have I misunderstood something when it interfacing with C code? here's a minimal example http://privatepaste.com/bbe921e285
22:27:10nimnoob123Am I using match incorrectly here? https://gist.github.com/G4MR/785c7ad4c8cd03f45771, find works fine (regex)
22:27:18keldariswhen it comes to*
22:27:50def-nimnoob123: i would suggest using nre and check if it works there. in my experience re is buggy and should be replaced with nre
22:28:15nimnoob123where can i find info on nre?
22:28:28def-https://github.com/flaviut/nre
22:28:58reactormonkkeldaris, taking a look...
22:29:00nimnoob123thanks
22:29:36Araqkeldaris: your byref array looks fishy, get rid of the .byref
22:29:37nimnoob123nice, nimble package ;D
22:29:59Araqdef-: you know, we could also fix re's bugs
22:30:24reactormonkdef-, mind waving through https://github.com/Araq/Nim/pull/2254 ?
22:30:28keldarisAraq: same error without byref, I thought I was supposed to pass the c array by reference, though
22:30:40flaviuAraq: nre has a nicer API anyway, IMO.
22:30:42nimnoob123or incorporate nre as the default (if it's that much better) and just repackage it as re?
22:30:43Araqarrays are currently always passed by reference
22:31:03keldarisah, ok
22:31:04def-Araq: i don't know enough about REs and when I tried to use it, re just hung forever. didn't get it fixed either
22:31:36reactormonkkeldaris, got the same code for lapack? I currently can't install openblas because it conficts with lapack and that one's a dependency for e.g. r
22:31:40Araqflaviu: yeah but IMO your API with exclusive upper bounds is just not idiomatic
22:32:10flaviuAraq: I have big plans ;)
22:32:39flaviuBut I suppose I can try fix that.
22:32:57keldarisreactormonk: since I'm testing on ddot, the syntax should be identical for any BLAS version, just change the library name to whatever you have
22:33:35reactormonkkeldaris, hm. actually, I do have the libopenblas lib
22:33:44reactormonkcould not import: ddot
22:34:02Araqkeldaris: Fortran passes *everything* by ref even ints and floats
22:34:11Araqso you need to use 'var cint' etc
22:34:39Araqwhich sucks ... pay me to implement a 'importFortran' pragma :P
22:35:04keldarisah, interesting. I'll try that.
22:35:06Araqor use a macro to patch over it
22:35:07reactormonkAraq, how much do you charge? ^^
22:35:59*johnsoft quit (Ping timeout: 246 seconds)
22:36:25*johnsoft joined #nim
22:38:22Araqreactormonk: I'm cheap. ;-)
22:38:47randomwalkWhat does it mean when an asterisk comes after a proc name?
22:38:54reactormonkrandomwalk, it's exported
22:39:44randomwalkreactormonk: oh thx. I was wondering why c2nim was putting that there.
22:41:23*randomwalk left #nim ("brb")
22:41:37*reem joined #nim
22:44:34*randomwalk joined #nim
22:55:14randomwalkWhy do I get a type error here: var t = initTable[string, OrderedTableRef](initialSize = 2)
22:55:47randomwalksystem.nim(538, 15) Error: invalid type: 'proc (var seq[KeyValuePair[string, OrderedTableRef]], int){.noSideEffect.}'
22:56:57def-randomwalk: are you sure you want a table to a table?
22:58:07def-randomwalk: try something like "var t = initOrderedTable[string, string]()"
22:58:14fowlorderedtable is missing two generic params
22:58:35fowlorderedtableref[a,b]
22:59:19randomwalkdef-: yes, I want to map string -> { string : float32, ... }
22:59:34reactormonkrandomwalk, so basically a sparse matrix?
23:00:25def-then initTable[string, OrderedTable[string, float32]]()
23:00:36randomwalkreactormonk: no
23:01:12randomwalkdef-: thx. I'm new to nim, so my understanding of type declarations is growing.
23:01:42def-You're welcome, randomwalk. Always good to see new people
23:02:22MaxdamantusAraq: https://github.com/Maxdamantus/Nim/commit/a743b468505f0357a7c15b4df3d52c5a9b8d91d5
23:02:32*Maxdamantus suspects he will've missed something.
23:02:43*Maxdamantus suspects that semexprs.nim thing might also be ugly.
23:04:04Maxdamantuseh, semtypes.nim:351 silly.
23:04:41Araq(int, int, ()) # value of type `(typedesc[int], typedesc[int], tuple[])` ... what? o.O
23:05:03MaxdamantusWell, it can't be a type, because () isn't one.
23:05:26Maxdamantusso it should either be invalid or revert to being a value expression.
23:05:38MaxdamantusMaybe it should do the former. Dunno.
23:06:00MaxdamantusBoth seem ugly, but you're already removing typedescs in types :\
23:06:07Araqwhat if I want (typedesc[int], typedesc[int]) without any () ?
23:07:26Maxdamantusproc tup2[A, B](a: A, b: B): (A, B) = (a, b); tup2(int, int)
23:07:37AraqI guess typedesc[int] as term should really have typedesc[typedesc[int]] as the type
23:08:03Araqand then I can simply write (typedesc[int], typedesc[int]) if I want that
23:08:37Araqflattening of typedesc looks more and more like a mistake
23:08:43MaxdamantusYou can't write the type for typedesc[int]
23:08:46Maxdamantusafaik
23:08:59nimnoob123is None a default keyword?
23:09:00Maxdamantusright, because of the flattening.
23:09:56Araqnimnoob123: no.
23:10:15nimnoob123trying to figure out something regarding nre, but I keep getting undeclared identifier because it uses None[RegexMatch] on invalid matches, yet I don't see it defined anywhere in this source
23:10:19AraqMaxdamantus: well but the flattening is a different problem that shouldn't affect your PR
23:10:22flaviunimnoob123: And it doesn't make sense since Nim doesn't require everything be a pointer.
23:10:42flaviunimnoob123: https://github.com/flaviut/nre/blob/master/nre.nimble#L11
23:10:43flaviuhttps://github.com/flaviut/optional_t
23:11:06nimnoob123i've included that too
23:11:21randomwalkIs cint a synonym for int?
23:11:29randomwalkalias I mean
23:11:31def-no
23:11:36def-it's the c int type
23:11:52MaxdamantusAraq: you mean the commit I just linked? I do the flattening there.
23:11:57flaviuC's size_t == Nim's int.
23:12:10Maxdamantus+ var typ = semTypeNode(c, n, nil).skipTypes({tyTypeDesc, tyIter})
23:13:22MaxdamantusBut that and the line after are copied directly from a different case, so they should probably be in a proc.
23:13:38Maxdamantusthen flattening will be that proc's fault.
23:14:48Maxdamantus of nkTypeOfExpr, nkTupleTy, nkTupleClassTy, nkRefTy..nkEnumTy, nkStaticTy:
23:15:01flaviunimnoob123: Yes, and that means that you have access to None[RegexMatch]. See https://github.com/flaviut/optional_t/blob/master/src/optional_t.nim#L23
23:15:23nimnoob123getting a new error
23:15:29Maxdamantuskind of difficult to handle the tuple types in the same place, since there isn't a special tuple type node.
23:15:59nimnoob123https://gist.github.com/G4MR/5c1a74a06ae49f741cfb
23:16:02Maxdamantus(having one would imply a proper distinction between parsing in the type world and in the term world)
23:18:06Maxdamantuser, semexprs.nim:2136 there has an erroneous `- 1`, should also probably use sonsLen .. /me isn't sure the rest of the code is consistent with that.
23:18:36nimnoob123these errors are tiring
23:23:32MaxdamantusAraq: "new better syntax"—the syntax that actually works.
23:23:58Maxdamantusit just wrote `tuple[int, int]` before, which you can't write.
23:24:17Araqyeah that was quite frustrating
23:25:00flaviunimnoob123: Looks like a stdlib bug, but I can work around it.
23:25:38Araqhow is that a stdlib bug?
23:25:57Araqthe stdlib doesn't know about prceMatchBounds
23:26:15nimnoob123flaviu: Nim Compiler Version 0.10.3 (2015-03-01) [Windows: i386] is the version im using btw if anyone was curious
23:26:42flaviuAraq: It's using the default `==`, and prceMatchBounds is not exposed.
23:27:26Araqthat's a feature
23:27:50Araqwhat's the alternative? the default == sneaking into your private stuff?
23:31:57flaviuI'm not sure. Memcmp is common in C. I'm not a fan of the error message, but I suppose that it says what it needs to say.
23:32:10*untitaker quit (Ping timeout: 272 seconds)
23:34:23*getoffmalawn joined #nim
23:34:52*zahary quit (Ping timeout: 245 seconds)
23:38:22*untitaker joined #nim
23:39:28getoffmalawnI've got a bit of work I'm planning on doing to openssl.nim - should I submit these changes as one large pull request, or group them by functionality?
23:41:41getoffmalawne.g. SNI support, dumping certificates/private keys, generating private keys, signing certificates
23:42:52Araqgetoffmalawn: I cannot speak for dom96 but I think grouping them by functionality is better in this case
23:43:13Araqlooks like it's complex
23:43:59Araqalso have a look at the 2 open stdlib bugs concerning SSL
23:46:24*OnwardEuler joined #nim
23:47:05*jsudlow quit (Remote host closed the connection)
23:50:08flaviunimnoob123: Ok, updated nre! Try 0.6.1
23:50:57getoffmalawnAraq: Great! Thanks. I'll submit them grouped by functionality then. I'll take a look at the stdlib bugs as well :)
23:55:10*OnwardEuler quit (Read error: Connection reset by peer)
23:55:50*davidterry quit (Remote host closed the connection)
23:57:30*gmpreussner|gdc quit (Ping timeout: 272 seconds)
23:59:53nimnoob123alright flaviu