<< 02-01-2015 >>

00:02:04*aaaa quit (Ping timeout: 246 seconds)
00:05:34*MrBlaise quit (Remote host closed the connection)
00:06:45def-https://www.quora.com/Which-organisations-are-using-the-Nim-programming-language
00:09:29Varriount|Remotedef-: :/
00:10:04Varriount|Remotedef-: That's the wrong sort of question.
00:10:39*kumul joined #nim
00:11:25*kumul left #nim (#nim)
00:11:38def-I didn't ask it, I just found it!
00:18:36Varriount|Remotedef-: Unfortunately, getting Nim used in an organization is something of a chicken-and-egg problem.
00:22:45*gmt joined #nim
00:25:04Varriount|RemoteHello gmt
00:26:25*NimBot joined #nim
00:33:31*tinAndi quit (Quit: ChatZilla 0.9.91.1 [Firefox 34.0/20141125180439])
00:33:37dom96I like the answer to this https://www.quora.com/Is-the-Nimrod-language-a-joke-or-for-something
00:36:22gmpreussner_i had mixed feelings about 'nimrod'. i think 'nim' is awesome.
00:37:35gmpreussner_one syllable, and unlike any other language :)
00:39:25*gmt quit (Quit: Page closed)
00:39:34Triplefoxworking on a nim version of this gl example...i have it to where it compiles and runs and the render loop shows a black screen https://github.com/jckarter/hello-gl/blob/master/hello-gl.c
00:39:44Triplefoxhopefully this won't be horrible to figure out
00:40:17*jefus__ is now known as jefus
00:40:25dom96gmpreussner_: Yeah, I think it was a good call to rename it.
00:44:38*no_name quit (Quit: leaving)
00:48:44MyMindexist any lunar phase algorithm for nim?
00:52:29flaviuMyMind: Write it and make a Nimble package!
00:52:36flaviuhttp://www.ben-daglish.net/moon.shtml looks like a useful resource
00:52:42MyMindhahahaha
00:53:08MyMindman I tried to figure out how to calculate the chinese new year
00:53:31MyMindhttp://www.math.nus.edu.sg/aslaksen/calendar/cal.pdf
00:55:47EXetoC:o
00:56:47Forty-3how do I explicitly call the proc I'm overriding?
00:57:22Forty-3for example, I want to implement a $ proc for an enum which returns the 3rd letter of the normal $
00:58:05EXetoCa more specialized proc should take priority
00:58:12EXetoCoh
00:58:19EXetoCsystem.`$`(...)?
00:58:21Forty-3which is my problem, since I need the less specialized one
00:59:04*jefus_ joined #nim
00:59:35Forty-3EXetoC: thanks, that works
00:59:49*jefus quit (Ping timeout: 245 seconds)
01:00:03EXetoCgreat
01:01:49Varriount|RemoteTriplefox: The only hard thing about opengl and nimrod is getting the types rights. Other than that, things should be ok.
01:01:56Varriount|Remote*nim
01:03:01EXetoCI always manage to screw up buffers
01:03:05TriplefoxVarriount|Remote: yeah, earlier I had an simple immediate mode demo going, it's just there's a lot more to screw up once I switch to the programmable pipeline stuff
01:03:38Varriount|RemoteTriplefox: Yeah.
01:03:59Triplefox1,000,001 colored cubes https://vine.co/v/OwFDpVb1itp
01:04:36EXetoCremember that int for example is not a fixed size. use OpenGL types (some of which don't really need to be used)
01:04:45EXetoC1.GLfoo for example
01:05:04EXetoCTriplefox: realtime? :p
01:05:32Triplefoxyeah, 60hz...they're in a display list
01:05:39EXetoCthat's probably possible these days
01:05:42EXetoCyeah, batching
01:06:32TriplefoxI'm pretty sure at least one or two of these api bindings are mixing up a GLuint with a GLint and making me cast things, but I'm not gonna try sorting it out right now
01:07:12Triplefoxafter all maybe that's what's getting me the black screen :p
01:07:44EXetoCnot the bindings for nim I hope
01:08:55Triplefoxi'm still reorganizing things in the code, I'll be able to make some conclusions later
01:09:56EXetoCmaybe glut or something, but the opengl module was automatically generated
01:11:25Triplefoxokay...i'm working with sdl and sdl_image and i did have to add some windows dll boilerplate to the sdl_image binding
01:12:22Triplefoxthe gl stuff hasn't really given me trouble yet other than the GLtypes pollution
01:13:19EXetoCthose might be examples of unnecessary aliases
01:13:39Varriount|RemoteForty-3: Use a module qualifier for the proc
01:14:07EXetoCVarriount|Remote: too late! c(:)|<
01:14:24Varriount|Remote:<
01:19:26MyMinddoes nim support variable-- ?
01:20:32Varriount|Remote.eval var x = 7;x--;echo(x)
01:20:36MimbusVarriount|Remote: eval.nim(5, 4) Error: invalid indentation
01:20:55*yglukhov__ joined #nim
01:21:27Varriount|Remote.eval var x = 7;echo(x)
01:21:31MimbusVarriount|Remote: 7
01:21:41Varriount|Remote.eval var x = 7;x--;echo(x)
01:21:44MimbusVarriount|Remote: eval.nim(5, 4) Error: invalid indentation
01:21:51def-.eval var x = 7;dec x;echo x
01:21:53EXetoCit's confusing
01:21:54Mimbusdef-: 6
01:22:14Varriount|RemoteMyMind: So, no, however there's 'inc' and 'dec'
01:22:21EXetoC.eval var x = 1;dec x; dec x, 3; x -= 3
01:22:23MimbusEXetoC: eval.nim(5, 4) Error: invalid indentation
01:22:32EXetoCright
01:22:44EXetoC.eval var x = 1;dec x;dec x, 3;x -= 3;echo(x)
01:22:45MyMindok
01:22:47MimbusEXetoC: -6
01:22:51Varriount|RemoteMyMind: It has to do with operators and precedence, if I recall correctly.
01:25:28*yglukhov__ quit (Ping timeout: 265 seconds)
01:33:49Araqcan we stop this Mimbus spamming? you don't get the indentation right, live with it.
01:34:14fowlmouthMyMind, there is no postfix operators
01:35:58Varriount|Remoteflaviu: Next suggestion for Mimbus: have it try to auto-correct the common indentation errors.
01:36:15EXetoClet's have a separate channel or allow code to be evaluated via private messages
01:36:30Varriount|RemotePerhaps, round down the number of spaces preceding a colon to an even number (or zero)
01:37:38EXetoCat least one succeeding space perhaps. seems more natural
01:38:21flaviu#nim-offtopic
01:39:30*sjiitr quit (Quit: Page closed)
01:40:05flaviuugg, fine. I'll make indentation easier
01:44:18MyMindis possible to use anonymous functions on var assignment like xtra > 0.0 ? math.floor(xtra) : math.ceil(xtra - 1.0) ?
01:44:18*Mimbus quit (Read error: Connection reset by peer)
01:44:25*Mimbus joined #nim
01:45:01EXetoCalternative chars for ' ' for more visually distinct indents?
01:45:03Varriount|RemoteMyMind: Huh?
01:45:20EXetoCanonymous?
01:45:37EXetoClet x = if true: 1 else: 0
01:45:41Varriount|RemoteMyMind: What do you mean by anonymous functions?
01:45:44MyMindyes
01:45:58MyMindlambdas?
01:46:22MyMinda conditional on var assignment in c are inline
01:46:24MyMindi think
01:46:53AraqMyMind: EXetoC just showed you the syntax
01:49:21*Mimbus quit (Remote host closed the connection)
01:49:27*Mimbus joined #nim
01:49:34EXetoCthink of it like this: "let x = (if true: 1 else: 0)". the block is used as an expression in this case, so it returns a value (unlike a statement). it's syntactic sugar that does not introduce another proc (function). the same goes for C
01:50:57flaviuOk guys, one space indentation is no longer enough, two spaces are needed
01:51:12flaviu.eval while false:; discard 1
01:51:15Mimbusflaviu: eval.nim(4, 7) Error: invalid indentation
01:51:17flaviu.eval while false:; discard 1
01:51:20Mimbusflaviu: <no output>
01:51:22flaviusee?
01:51:50EXetoCyeah
01:52:27*Etheco joined #nim
01:53:55Triplefoxhow do comments work with that...or do they
01:54:25flaviuit's just a dumb s/;/\n/
01:54:42Triplefoxah, i guess that works
01:54:44flaviu.eval echo "this doesn't work; see?"
01:54:47Mimbusflaviu: eval.nim(3, 5) Error: closing " expected
01:55:31flaviuAlthough I could tokenize it if I really cared
01:56:15Triplefoxi like having wide declaration lines where i declare several short symbolic names with a descriptive comment inlined adjacent it, but nim syntax forces me to write it tall
01:56:33Triplefoxi guess i can adjust
01:56:33flaviuTriplefox: Can you post it in a gist? I'm curious.
01:56:52Forty-3I get "fish.nim(11, 14) Error: illegal capture 'result'" when compiling http://ur1.ca/jap71
01:57:26Triplefoxan example from what i'm doing now https://gist.github.com/triplefox/fed309e16382dcfe5257
01:57:38flaviuForty-3: That's incredibly fishy.
01:57:46Forty-3>.>
01:57:48Triplefoxi'm testing out this hyper restricted naming style
01:58:20AraqForty-3: the compiler for now doesn't allow capturing of 'result' use temporary variable as a workaround
01:58:37Forty-3huh?
01:58:57EXetoCthere's a capture there?
01:59:03Forty-3so I should do "h.sort((x, y: deck.Card) => var tmp = cmp(ord(x.value), ord(y.value)))" ?
01:59:58EXetoCok it's not explicit. preferably include the error message inline
02:00:49Forty-3that... compiles but doesn't work
02:01:05Forty-3I get back some unsorted hands
02:01:14EXetoCForty-3: what he said, so introduce a temporary var, and then assign result to the value of it, or return the newly introduced var
02:01:27EXetoCok
02:01:28AraqForty-3: report it, it's weird either way
02:01:39*Demon_Fox joined #nim
02:02:06Forty-3the sort proc does nothing, it seems http://ur1.ca/jap9f
02:02:41Forty-3that's with "echo($player) player.sort() echo($player)"
02:03:17Varriount|RemoteForty-3: What happens when you use an actul procedure, rather than a macro?
02:03:52EXetoComit the return type rather than specifying void
02:04:10MyMindto perform a modulo operation is mod(x,y) right?
02:04:22Araqx mod y
02:04:35Araqit's a binary operator (keyword)
02:04:49Araqor `mod`(x, y) if you want to
02:05:00Forty-3Varriount: it works with http://ur1.ca/japac
02:05:37Forty-3http://ur1.ca/japal is deck.nim, if you want to compile it
02:07:24MyMindAraq: ty that was driving me crazy
02:07:44MyMindsomehow only accepted x mod y way
02:09:40Varriount|RemoteForty-3: What is the expected output?
02:09:42EXetoCor `mod`(x, y), if you really want to. the same goes for other operators
02:10:10Forty-3Varriount: the two outputs should be different, as one is sorte and the other isn't
02:10:38Forty-3if you comment line 15 and uncomment line 14, you will get the same output
02:10:50Forty-3also: the ord()s don't do anything
02:16:02*jefus_ is now known as jefus
02:17:18*gmpreussner_ is now known as gmpreussner
02:17:39*Mimbus quit (Excess Flood)
02:17:47*Mimbus joined #nim
02:18:25*fabiok joined #nim
02:18:42*Mimbus quit (Excess Flood)
02:18:49*Mimbus joined #nim
02:19:27*Mimbus quit (Excess Flood)
02:19:34*Mimbus joined #nim
02:20:46Forty-3Varriount: having problems compiling this bare-bones case http://ur1.ca/japgg
02:20:56Forty-3test.nim(14, 3) Error: type mismatch: got (Container, proc (Container, Container): int{.gcsafe.} | proc (T, T): int | proc (string, string): int{.noSideEffect, gcsafe.})
02:20:57Forty-3but expected one of:
02:20:57Forty-3test.sort(c: var Container)
02:20:57Forty-3algorithm.sort(a: var openarray[T], cmp: proc (T, T): int{.closure.}, order: TSortOrder)
02:22:57Varriount|RemoteForty-3: It's a problem with the lambda macro, I think
02:25:09*Forty-3 goes back to wishing there were lambdas
02:26:05EXetoCForty-3: see the future module
02:26:18Varriount|RemoteEXetoC: That's what he was using.
02:26:20Forty-3EXetoC: the past 15 minutes has been me breaking that
02:26:37Varriount|RemoteForty-3: You killed it! T_T
02:26:55Forty-3mission success!
02:27:13Varriount|RemoteForty-3: Anyway, the current problem is that you are calling the base sort() procedure with incorrect parameters.
02:27:15EXetoCwell, there basically are, but ok maybe there are some issues
02:28:39Forty-3well, that's what the compiler says...
02:33:31gmpreussnerVarriount|Remote: do you know if generic procs can be parameterized based on the params of the return type (i.e. the value being assigned to)?
02:34:21gmpreussnersomething like: proc Foo[T1, T2](foo: Foo[T1]): Bar[T2] = ...
02:34:53Varriount|RemoteForty-3: https://gist.github.com/Varriount/c9eaf4038e62b04171ac
02:35:13Varriount|Remotegmpreussner: What?
02:35:14gmpreussneri guess it would be undecidable for assignments of the form: var f = Foo(..)
02:35:30gmpreussnersorry, that should be foo()
02:36:10Varriount|Remotegmpreussner: I don't understand...
02:37:15gmpreussneri was wondering whether generic procs of this form are possible in cases where the assigned to type of the return value is known: proc foo[T1, T2](foo: Foo[T1]): Bar[T2] = ...
02:37:26gmpreussnerbut i guess even if it was it would be bad style
02:37:59*cyraxjoe joined #nim
02:38:18gmpreussnerthe proc is parameterized based on a param of the return type. see what i mean?
02:38:22Varriount|Remotegmpreussner: Uh, what do you think we do for procs returning generic sequences?
02:38:23*MightyJoe quit (Ping timeout: 272 seconds)
02:38:59*kapil__ joined #nim
02:39:53gmpreussnerVarriount|Remote: i have not seen the code for those procs.
02:40:39fowlmouthgmpreussner, you mean like `var x: Bar[int] = foo(someFoo)` ?
02:40:52gmpreussneryeah
02:41:32Varriount|Remotegmpreussner: https://gist.github.com/Varriount/a31567ce91da8a9206c4
02:41:58gmpreussneri guess the only limitation with that is that the type of 'x' could obviously not be determined automatically, i.e. the following would not work with these procs: var x = foo(...), but it could be called like this to resolve the params: var x = foo[T1, T2](...)
02:42:11fowlmouthsee if let i: seq[float] = foo(15,3) there
02:42:14Forty-3Varriount: ah
02:42:20Varriount|Remotegmpreussner: If the second generic type is only in the return type, you have to pass the generic types explicitly
02:42:40gmpreussnerright, that's what i meant
02:42:45gmpreussnerthanks Varriount|Remote
02:43:02fowlmouthgmpreussner, you should test it anyways, see if `let i: seq[float] = foo(15,3)` works there
02:43:18gmpreussnerok
02:47:16Forty-3hm, so my test case is successful http://ur1.ca/japrs
02:47:28Forty-3so this isn't as simple as it looks
02:48:10fowlmouthForty-3, use arr.sort(cmp[Container])
02:48:23Forty-3fowlmouth: huh?
02:48:35*Mimbus quit (Remote host closed the connection)
02:48:35*flaviu quit (Remote host closed the connection)
02:48:37fowlmouthfor line 20
02:50:03Forty-3fowlmouth: try compiling http://ur1.ca/japac and http://ur1.ca/japal
02:50:46Forty-3then uncomment line 14 and comment line 15 and run the first one again
02:50:59fowlmouthwhy dont you paste on gist so there is syntax highlighting and im too busy to run it
02:51:19Forty-3fowlmouth: because gist doesn't have a command line tool which is built into my distro
02:51:36Forty-3anyway, it doesn't do what you think it would
02:51:52Forty-3the pasted version works fine, with the hand coming out sorted
02:52:04Forty-3but the macro version does absolutely nothing
02:52:20fowlmouththere are no macros here
02:52:24Forty-3=>
02:56:12MyMindon proc parameters are inmutable ?
02:56:43fowlmouthForty-3, https://gist.github.com/fowlmouth/d8d8310ad37a1e76271f
02:56:46fowlmouthMyMind, yes
02:56:47EXetoCs/n/m
02:57:06EXetoCMyMind: parameters that aren't annotated with 'var' are
02:57:24Forty-3fowlmouth: your point?
02:57:34fowlmouthnvm
02:58:14fowlmouththats how you use algorithm.sort with your custom type
02:58:31*fowlmouth left #nim ("Leaving")
02:59:44MyMindEXetoC: why is not possible then
02:59:46MyMindproc mysum(a,b:var int): int =
02:59:48MyMind return a+b
03:00:45MyMindmysum(1,2)
03:01:17EXetoCyes well those are not var's. you need to introduce variables in that case
03:01:24EXetoCbut you'd want to omit var in this case
03:02:04*darkf joined #nim
03:02:06MyMindwell a +=1 before return
03:02:42MyMindI need to create new variables inside my function ?
03:03:21EXetoCyes but literals can't be treated as var's, so you need to do something like var x = 1; var y = 2; mysum(1, 2)
03:03:49EXetoCand then you should get another error message
03:04:08MyMindthat's kinda weird
03:04:44EXetoCI requested syntactic sugar for it IIRC, but it's probably of low priority
03:05:11EXetoCbut I don't know if our BDFL approves
03:05:28*Varriount|Remote quit (Ping timeout: 246 seconds)
03:05:43MyMindiirc you can do it in C right?
03:06:15willwillson_Forty-3: could you use h.sort(proc(x, y: deck.Card): int = (cmp(ord(x.value), ord(y.value)))) instead of the sugared version?
03:06:17EXetoCnot that I recall
03:06:34Forty-3willwillson_: the point is that the sugared version does not work, although it should
03:07:15willwillson_ok
03:09:49*yglukhov__ joined #nim
03:14:31*yglukhov__ quit (Ping timeout: 255 seconds)
03:14:36MyMindEXetoC: this http://pastebin.com/6MneQnZk
03:15:23*Trustable quit (Quit: Leaving)
03:15:24EXetoCyes, but that's not the equivalent of specifying 'var'
03:15:39MyMindexist an equivalent?
03:15:52EXetoCT*
03:18:02*yenic joined #nim
03:18:17EXetoCand then you need to introduce something that you can take the address of, unless you pass in 0 (NULL); the latter of which doesn't apply to Nim because 'var' is more restricted. there's also ptr and ref though
03:19:00MyMindpff so complicated
03:20:04yenicHello Nimmers. It appears to me that Nim may be the right language, at the right place, at the right time. It's mature enough at this point, many Python2 users may choose Nim over porting to Python3.
03:20:09yenicquestion on Nim, is it possible that a shim layer could be added to Nim to run Python2 libraries? Say with Nuitka's method or Pyinstaller (including the whole runtime if 2.x code is used)? I think this would give Nim serious mindshare
03:21:31willwillson_yenic: embed python: https://github.com/nim-lang/python ?
03:22:11yenicwillwillson_: nice, and directly from Andreas. So he already had this idea.
03:22:27yenicwillwillson_: be good to put this officially into the Nim compilation process before 1.0
03:23:31yenicand advertise Nim as being Python2 compatible. I imagine many businesses in that case, will choose Nim as they look for ways off of Python2's EOL.
03:24:34willwillson_how do the do it in julia? They have good python integration right?
03:25:33yenicwillwillson_: I'm not sure, I don't know much about Julia. But I think this is the killer-feature that would lead everyone to moving to Nim.
03:25:56yenicif it could be compiled to C/C++ like Nuitka does, and increase speed as a result.. even better
03:26:21Triplefoxsounds like a big agenda
03:26:32EXetoCMyMind: yes but I'd say the complexity is justified. you should get the hang of it after a little trial-and-error
03:28:14Demos_it is not a lot of fun to call into a dynamically typed language from a static one, not impossible but not fun
03:28:29EXetoCyenic: directly from andreas? several people contribute to that organization, and this time it was fowlmouth
03:28:47yenicEXetoC: it had his name in the source as the author
03:28:50Triplefoxi guess having python at hand would help with onboarding, but integrating it well...
03:29:29*yglukhov__ joined #nim
03:30:19EXetoCyenic: right, sorry. need some sleep
03:33:53*yglukhov__ quit (Ping timeout: 240 seconds)
03:34:19*willwillson_ quit (Ping timeout: 255 seconds)
03:39:19*dain joined #nim
03:40:37*dain left #nim (#nim)
03:50:14*AMorpork is now known as CSGOMorpork
03:51:57*BitPuffin quit (Ping timeout: 245 seconds)
03:52:19*Hakaslak joined #nim
03:53:12*VinceAddons quit (Read error: Connection reset by peer)
03:59:04*MrOrdinaire joined #nim
03:59:20*FreezerburnV joined #nim
04:01:48*Hakaslak quit (Quit: TODO: Generate 'Computer Sleep Quit Message')
04:02:18*Hakaslak joined #nim
04:02:43yenicthe other points that came to mind about Nim other than supporting CPython2.7 code, is if the standard library will ever work with the GC disabled? I think longterm that may be possible?
04:03:07yenicand 3rd thought was while there is no IDE for Nim, would an extension for SublimeText or VIM fill that gap well enough?
04:03:35Triplefoxoh, no wonder i'm having trouble...i need to get GLEW in this project
04:04:04*Hakaslak quit (Client Quit)
04:04:21EXetoCTriplefox: why is that?
04:04:38EXetoCyenic: I think it's on the horizon
04:05:08yenicI'm becoming excited about Nim, I wish I were a better programmer and I'd try to put some of these ideas into place
04:05:29Triplefoxto access GL2+ things
04:05:35*Hakaslak joined #nim
04:06:38EXetoCthe opengl module is compatible with all versions
04:06:42yenicCurious to see if Andreas thinks Python2 code could be supported in Nim's compiled binaries.. this language would soar if companies knew about Nim and chose Nim over porting to Python3. I know I would.
04:07:18EXetoCit's just that it might get hairy if one wants to do selective loading. the compiler currently checks which GL functions are referenced
04:08:09yenicso just interfacing with CPython2.7 libraries would get hairy? I'm not suggesting support Python2.7 code within Nim itself, just its extensive 3rd party library system somehow.
04:08:43EXetoCno, that was intended for Triplefox
04:09:53*MrOrdinaire quit ()
04:10:02*dyu joined #nim
04:10:51Triplefoxwell, every sample i find depends on having GLEW do the work...a strong suggestion that i should follow along
04:12:03EXetoC1. create the context 2. call opengl.loadExtensions(). that's it
04:14:46*CSGOMorpork is now known as AMorpork
04:15:06dyunim seems to be on a streak on hn
04:15:54Triplefoxokay, maybe it's not the extensions. but then i'm back to the beginning with making this sample draw things
04:18:40Triplefoxoh, i see how i got confused about that. this person's tutorial is talking about adding glew to clear up a bunch of compiler warnings
04:21:35*FreezerburnV quit (Quit: FreezerburnV)
04:23:01Triplefoxi'll just start over with this other sample which looks marginally simpler than the one i was trying before
04:39:02*Varriount joined #nim
04:39:21*Varriount is now known as Varriount|Remote
04:41:52*noobatNim joined #nim
04:46:51*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:53:58*Varriount|Remote quit (Ping timeout: 246 seconds)
04:56:44*abcv joined #nim
05:03:25*abcv quit (Quit: Page closed)
05:03:39*brson quit (Ping timeout: 244 seconds)
05:04:07*noobatNim quit (Quit: Page closed)
05:13:22fabiok\quit
05:13:24*fabiok quit (Quit: leaving)
05:14:24Triplefoxwith this sample it crashes at glCreateShader() \o/ <o>
05:16:25Triplefoxah, that one didn't include an extension loader, of course
05:16:30Triplefoxit draws a thing! \o/
05:18:19gmpreussnerdraw all the things!
05:18:39gmpreussner\o_
05:21:21*V01D joined #nim
05:22:00*no_name joined #nim
05:22:27no_nameI think I found a pretty big bug in httpclient - where do I report it?
05:22:42V01Dhttps://github.com/Araq/Nim/issues?page=9&q=is%3Aissue+is%3Aopen
05:22:55V01Dcreate an issue on github
05:23:10V01Dthis is the main repo - https://github.com/Araq/Nim
05:25:31*vbtt joined #nim
05:26:07no_namethanks
05:26:26V01Dwelcome ,.,.,., BTW .,., does anyone know why the repo contains tinyC compiler. what is it used for.
05:27:40*vbtt quit (Client Quit)
05:27:52*vbtt joined #nim
05:27:57gmpreussnerV01D: to bootstrap the nim compiler
05:28:21EXetoCit's considered unsuitable for that task now
05:28:27gmpreussnerand nim also generates C code, so i guess it uses that to compile as well
05:28:51gmpreussnerEXetoC: oh really? is it using gcc now?
05:28:57V01Dthe readme in the repo states that `To build from source you will need: gcc 3.x or later recommended. Other alternatives which may work are: clang, Visual C++, Intel's C++ compiler` so what's the need for TCC
05:29:20Triplefoxsomewhere in the compiler docs it mentions a use for tcc although i forget what
05:30:02Triplefoxthere is plenty of leftover cruft in nim already, that might be one
05:30:04EXetoCgmpreussner: yep
05:31:10*goobles joined #nim
05:31:14Triplefoxunder advanced commands: "run run the project (with Tiny C backend; buggy!)"
05:32:53V01Dok.,.,
05:33:05*brson joined #nim
05:38:25*V01D quit (Ping timeout: 246 seconds)
05:48:30*adam_s joined #nim
06:04:12*brson quit (Quit: leaving)
06:04:19goobleswhats this parallel: thing?
06:07:51vbttgoobles:it autmatically runs your code in parallel across multiple threads
06:08:35*ARCADIVS joined #nim
06:08:57vbttso you write code that looks serial, but nim will figure out how to run it in parallel over multiple threads. that's my understanding anyway.
06:10:00vbtthopefully someone with more knowledge an also answer
06:26:24no_namehrms.. where do I put zlib1.dll for import zlib to work properly? I put one in system32, but no love
06:27:48*vbtt quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
06:31:32*kapil__ quit (Quit: Connection closed for inactivity)
06:31:49*vbtt joined #nim
06:38:38Triplefoxtwice now i've tried to end a block by writing "end" .-.
06:39:18Triplefoxi think it's probably the lua i've written, it's been too long to be the pascal
06:45:11*vbtt quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
06:45:28*tgkokk joined #nim
06:48:04*BitPuffin joined #nim
06:48:08gooblesis nim better than lua
06:48:57goobleswhere typeclasses?
06:52:17*BitPuffin quit (Ping timeout: 240 seconds)
06:58:34*chrisheller joined #nim
06:58:46*goobles quit (Quit: Page closed)
07:05:36*SplinterOfChaos joined #nim
07:05:44Triplefoxand now i used "def" - i'm writing all the languages tonight
07:11:06*vbtt joined #nim
07:18:15*vbtt quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
07:19:05*chrisheller playing with python integration
07:20:05chrishellerPR created for python.nim to work with 0.10.2 https://github.com/nim-lang/python/pull/1
07:22:14chrishellerThat lets the pythonex.nim code work properly, but having some more examples beyond PyRun_SimpleString would be good.
07:24:00chrishellerI may work on some more examples/tests later since I have some interest in using some existing Python code with Nim.
07:24:40dv-i'd be interested in using python's matplotlib from nim
07:25:36*kapil__ joined #nim
07:27:40chrishellerBe sure to look at https://github.com/micklat/python/commit/b66f48e7ce096fbdac74e03df8961676dcbe8198 for using Python's FFI .
07:29:15chrishellerI haven't used matplotlib, but I believe that it is a wrapper over a C library, so you'll want global_symbols=true
07:31:52dv-hmm. maybe i can just call c then
07:41:07*chrisheller quit (Remote host closed the connection)
07:46:15*decaf joined #nim
07:47:10*decaf quit (Client Quit)
07:50:35*gokr joined #nim
07:52:10*tgkokk quit (Ping timeout: 255 seconds)
08:19:15*vbtt joined #nim
08:21:25*vbtt quit (Client Quit)
08:24:26*adam_s quit (Quit: Leaving)
08:24:37*chrisheller joined #nim
08:32:36*yglukhov__ joined #nim
08:35:55*BlaXpirit joined #nim
08:37:02*yglukhov__ quit (Ping timeout: 244 seconds)
08:41:42*gokr quit (Quit: Leaving.)
08:42:52*gour joined #nim
08:47:10*alexruf joined #nim
08:48:52alexrufHi
08:49:17dts|pokeballsomeone said my name?
08:51:47alexrufjust a noob question: does the nim compiler directly created bytecode or does it translate nim to C and compile the C code with a normal C compiler (like gcc, clang, ...)? I didn't understand.
08:52:10BlaXpiritalexruf, it creates C code
08:52:18BlaXpirityou can maybe even see it in nimcache folder
08:52:35dts|pokeball^
08:52:46alexrufso this means than nim is very much like pypy for example?
08:53:01alexrufthat
08:53:10dts|pokeballiirc, nim -> AST -> (obj)c/++/js
08:53:23BlaXpiritalexruf, whaaaat, pypy is nothing like that
08:53:41alexrufwhat does AST mean?
08:53:49dts|pokeballabstract syntax tree
08:53:55alexrufah ok
08:54:21dts|pokeballast's are super cool shit, which explains why ms doesnt use it
08:54:48BlaXpirit. . .
08:55:05alexrufpypy also has backends to generate python, C, java whatever
08:55:17BlaXpiriti... really don't think so
08:55:23dts|pokeballto which?
08:55:46alexrufi really think pypy works the same way
08:56:04BlaXpiritdefinitely not
08:56:06alexrufhttps://en.wikipedia.org/wiki/PyPy
08:56:23alexrufCurrent PyPy versions are translated from RPython to C code and compiled.
08:56:23dts|pokeballuh nim is not jit
08:56:26dts|pokeballafaik
08:57:13BlaXpiritPyPy itself is translated to C, whatever
08:57:29*coffee` joined #nim
08:57:36*Hakaslak quit (Quit: TODO: Generate 'Computer Sleep Quit Message')
08:57:55BlaXpiritPyPy definitely does not translate Python to C
08:58:04dts|pokeball> PyPy focuses on speed, efficiency and compatibility with the original CPython interpreter
08:58:14dts|pokeballnim just focuses on being cool
08:58:15dv-how do i tell nim to load a function from an object file?
08:59:24dts|pokeballdv-, there might be something in os/osproc
08:59:50dv-i mean for ffi. i have a library that generates an .o
09:00:00dts|pokeballah
09:00:08dts|pokeballuhh... hold on. ive got a link
09:00:27alexrufBlaXpirit: I think pypy definitly does: http://rpython.readthedocs.org/en/latest/translation.html
09:00:42alexrufBlaXpirit: thats the whole point with pypyp
09:00:45BlaXpiritwill you stop please
09:00:45dts|pokeballhttp://rosettacode.org/wiki/Call_a_foreign-language_function#Nimrod
09:01:02dts|pokeballdv-, ^
09:01:23BlaXpiritalexruf, you gave me a link to RPython, and somehow think this is about PyPy
09:01:59*EastByte_ joined #nim
09:02:03*EastByte quit (Read error: Connection reset by peer)
09:03:21alexrufBlaXpirit: you should read how pypy works first :) if you write in RPython, pypy is able to translate your syntax into other syntax like C for example. The Python interpreter from pypy is also written in RPython itself
09:03:43*dts|pokeball googles rpython
09:03:53BlaXpiritalexruf, you should read how pypy works first :) if you write in RPython, RPython is able to translate your syntax into other syntax like C for example. The Python interpreter from pypy is also written in RPython itself
09:04:19BlaXpiritbut does not translate Python to C
09:04:28alexrufpypy isn't an python interpreter, it's an compiler toolchain
09:04:35BlaXpiritno
09:04:36BlaXpiritpls stop
09:04:52dts|pokeballuh BlaXpirit you are wrong
09:05:10alexrufsure he's wrong. Nim is very much like pypy
09:05:28BlaXpiritfacepalm
09:05:31dts|pokeballidk about that, but about translating Python to c
09:05:35dts|pokeballit literally says:
09:05:40dts|pokeball> Current PyPy versions are translated from RPython to C code and compiled
09:05:48dts|pokeball<BlaXpirit> but does not translate Python to C
09:05:55alexruf^^thats the point with pypy
09:05:58BlaXpirit[:57:13] <BlaXpirit> PyPy itself is translated to C, whatever
09:06:12alexrufOk it translates RPython to C...
09:06:23dts|pokeballRPython is python though apparently
09:06:27BlaXpiritno
09:06:34dts|pokeballrestricted python
09:06:36BlaXpiritPython is RPython though
09:06:47BlaXpirit[:03:52] <BlaXpirit> if you write in RPython, RPython is able to translate your syntax into other syntax like C for example. The Python interpreter from pypy is also written in RPython itself
09:06:58alexrufRestricted Python is a small subset of Python
09:07:00dts|pokeball^
09:07:10alexrufit's not Python
09:07:15dts|pokeballwhich makes <BlaXpirit> Python is RPython though have zereo sense
09:07:30dts|pokeballif its a subset of python it is python
09:07:30jpoirierpypy is written in rpython. pypy implements python 2.7.8 and jits user's python code when appropriate.
09:07:30BlaXpiritwell yeah
09:08:00Triplefoxpypy is complicated to talk about because it's a bunch of different technologies
09:08:18BlaXpiritbut it is easy to assert that PyPy does not translate Python to C
09:08:27Triplefoxnim is "just" a compiler, i guess
09:08:54jpoirierpypy doesn't transpile python code to c src
09:09:02BlaXpirityay, another sane guy
09:09:11dts|pokeballan apparently buggy compiler, but a compiler nonetheless Triplefox
09:09:27jpoirierthe rpython toolchain does transpile to c
09:10:28alexrufok, but my point was that nim doesn't have it's own bytecode compiler... it works sort of like pypy which translates it's code to another language (like C in case of Nim). Correct?
09:10:39BlaXpiritno
09:10:51BlaXpiritPyPy actually does directly work with bytecode
09:11:27BlaXpiritPyPy never translates Python to another language, unless you call bytecode or machine code a language
09:11:46alexrufok i understand
09:12:43dts|pokeballwell it *is* a language
09:12:56dts|pokeballjust an awkward one
09:12:59jpoirieragreed: pypy -> bytecode and/or machine, which are not source code
09:13:16jpoiriers/machine/machine code
09:13:18BlaXpiritCython, on the other hand...
09:13:25BlaXpiritAnd Niutka, which seems weird
09:13:41dts|pokeballcython is some weird shit man
09:13:53jpoirierNiutka is kinda cool and works well
09:14:31BlaXpiritpretty sure Cython does everything Niutka does, and better, and also much more
09:15:14Triplefoxpeople seemed hyped about niutka as another way to package builds for distribution...i haven't looked at it
09:15:51Demon_FoxTriplefox, Jeez, I see you in a lot of channels
09:15:53jpoiriercython is nice as well
09:15:59TriplefoxDemon_Fox: ikr
09:16:49Demon_FoxThen again, nim has taken off recently
09:17:01Demon_FoxI got rolled up in the snow ball
09:17:09Demon_FoxHow about you?
09:17:23*yglukhov__ joined #nim
09:17:26Triplefoxi've followed it for a while and finally found the time to sit down and work on a project with it
09:18:22Demon_FoxSoon, I'm starting a C project
09:18:48Triplefoxi see nim as complementary to haxe...where haxe lets me write code for potentially anywhere, nim allows deeper optimization
09:18:48Demon_FoxA really small wrapper for some posix functions
09:20:32jpoirierthe short time i've played with nim i've enjoyed it but it needs some polish, imho. but that'll happen in time
09:20:53BlaXpiritall i'm missing now is documentation search
09:21:02BlaXpiritgoogle could as well not exist
09:21:10BlaXpiritnot a single search leads to success
09:21:12*gokr_ joined #nim
09:21:20Demon_FoxTriplefox, Well, not sure about that
09:21:27*alexruf quit (Quit: Textual IRC Client: www.textualapp.com)
09:21:57BlaXpiritand that rename... put a nail in the coffin of searchability
09:22:09jpoirieryeah, a nimdoc would be nice
09:22:20jpoiriersimilar to godoc
09:25:27BlaXpiritwe need to seriously think... is there any way to search docs at all
09:25:30Demon_FoxNight Triplefox
09:25:39Triplefoxnight Demon_Fox
09:26:16dts|pokeballBlaXpirit, ctrl + f, grep
09:26:25BlaXpiritdts|pokeball, on ONE page
09:26:33BlaXpiritbut if i look at some code and see some function,
09:26:38BlaXpiriti have no frickin clue where it comes from
09:26:49Triplefoxright now what i do is bring up three tabs and ctrl+f in the most relevant one
09:27:10Triplefoxit's about the same as what i did with python way back when
09:27:23BlaXpiritthis is not so bad https://google.com/search?q=nim+newseq+site:nim-lang.org
09:27:49BlaXpirityeah, it's actually pretty good
09:29:26*Demon_Fox quit (Quit: Leaving)
09:31:16dts|pokeballfml i forgot to write a build script
09:32:41BlaXpiritdts|pokeball, you mean you kept just repeating a long command in terminal?
09:33:09BlaXpiritotherwise i don't get it
09:34:45dts|pokeballno. i just need to write nim c nimbus.nim
09:35:14dts|pokeballbut there are other things involved in nimbus that i dont need to mess with after i primarily install them
09:35:23Triplefoxwriting the tiny build script is worth it
09:35:43dts|pokeballyep. right now nimbus is extremely static
09:37:16*loz joined #nim
09:37:35Triplefoxi was watching the Handmade Hero streams and in one of the early videos he's setting up the project environment...and his build script is a little windows .bat file that just rebuilds everything directly
09:37:45Triplefoxand he says, "i will ship the game with this"
09:38:43dts|pokeballmine is shipping with a bash script :}
09:42:33dv-he also doesn't use version control :(
09:43:21dv-still fun to watch though
09:43:31vegaihmm... is & the string concat operator?
09:43:37dts|pokeballyes
09:53:45Demos_who is doing homemade hero?
09:55:16dv-https://www.youtube.com/user/handmadeheroarchive
10:01:35*gokr_ quit (Remote host closed the connection)
10:01:51*gokr_ joined #nim
10:02:03*VinceAddons joined #nim
10:04:56BlaXpirit.eval (-1)`mod`5
10:05:06BlaXpiritheloooo
10:05:18BlaXpiritMimbus, where are you? :(
10:05:36dv-nim isn't haskell
10:05:39dv-you don't need ``
10:05:46BlaXpiriti'm pretty sure you do
10:05:52BlaXpiritah no nvm
10:06:02BlaXpiriti just thought mod is an ordinary function and blah
10:06:33BlaXpiritwell whatever. how do i eval now? make a new file and COMPILE it? barbaric
10:06:38dv-nim i
10:06:42dv-gives you a repl
10:07:06BlaXpiritok
10:07:07BlaXpiritthaks
10:07:09BlaXpiritn
10:07:10dv-i suggest rebuilding nim with readline though
10:07:20BlaXpiritpretty sure it is with readline
10:07:44BlaXpirit*arch master race
10:07:54dv-oh
10:08:03dv-heh, i thought arch used defaults everywhere
10:08:10BlaXpirit(-1) mod 5 == -1, not good
10:08:27BlaXpiritdv-, it's probably because i use non-official package for nim
10:08:47BlaXpiritis there any operation where (-1) ? 5 == 4
10:08:51dv-i think so
10:09:28dv-http://nim-lang.org/system.html#%%,IntMax32,IntMax32
10:09:59BlaXpiritno, that's not it
10:10:08BlaXpiritthe stuff that ends with % is unsigned hacky stuff
10:10:19BlaXpiritin any case, (-1) % 5 == 0
10:10:40*gokr joined #nim
10:11:30*ARCADIVS quit (Quit: ARCADIVS)
10:12:57*gokr_ quit (Ping timeout: 240 seconds)
10:13:51BlaXpirit.eval import math;echo (-1.0 mod 5.0)
10:13:59BlaXpirit<Mimbus> BlaXpirit: 4.0
10:15:06BlaXpiritso int mod and float mod works differently. okay
10:17:15*gour_ joined #nim
10:17:26*irrequietus joined #nim
10:21:06*gour quit (Ping timeout: 250 seconds)
10:25:13*gour_ is now known as gour
10:33:45*Demos_ quit (Ping timeout: 264 seconds)
10:38:46*jefus_ joined #nim
10:40:51*chrisheller quit (Ping timeout: 252 seconds)
10:41:21BlaXpiritI want to remove items from seq while iterating through it
10:41:41dv-so a filter?
10:41:44BlaXpirityes
10:42:00dv-http://nim-lang.org/sequtils.html#filter,seq[T],proc%28T%29
10:42:14BlaXpiritoh ok. thanks
10:42:30BlaXpiritagain... there is no tutorial on this kind of stuff
10:42:43*jefus quit (Ping timeout: 255 seconds)
10:42:50dv-yeah
10:43:01dv-you could write one...
10:43:53BlaXpirithow can i write a tutorial if i don't know anything
10:44:11BlaXpiritI know FFI more than the rest of the language xD
10:45:09dv-dunno, you learn it same as any other language, by browsing the docs
10:45:18BlaXpiritno
10:45:39BlaXpiritwhen i learned python, there was actually a tutorial that shows: you can do this kind of stuff, and that kind of stuff
10:45:57BlaXpiritand there is actually readable documentation! not randomly shuffled functions
10:46:21dv-well if go to http://nim-lang.org/lib.html
10:46:26dv-it says
10:46:28dv-sequtils This module implements operations for the built-in seq type which were inspired by functional programming languages.
10:46:44*gokr quit (Read error: Connection reset by peer)
10:46:57*gokr joined #nim
10:50:43*chrisheller joined #nim
10:51:54dv-hm... how do i pass an array to C?
10:55:27dv-oh
10:55:47dv-addr(arr[0]) i guess
10:59:02BlaXpirityes
11:03:25BlaXpirithow to find out if 2 references point to the same object?
11:03:38BlaXpirit(again, I wish I didn't have to bother people with this)
11:04:03dv-== ?
11:04:20BlaXpiritwouldn't it delegate to the actual objects... eh i don't know
11:05:40BlaXpiritthen how do i compare actual objects?
11:06:55dv-hm not sure. i think [] is the dereference operator?
11:08:08BlaXpirityeah.......
11:20:02*Nimbus quit (Ping timeout: 250 seconds)
11:20:14*dts|pokeball quit (Ping timeout: 245 seconds)
11:28:45chrishellerI just added a more detailed example of using Python from within Nim. https://github.com/chrisheller/python/blob/master/examples/pythonex_ctypes.nim
11:30:17chrishellerThat has examples of setting/getting variables in Python from the Nim code, as well using the ctypes module to exercise Python's FFI
11:31:51chrishellerIt still needs more work (better error checking), and I would like to add an example of calling Nim procs from Python, but sleep is beckoning, so that will have to wait
11:32:00dv-cool
11:35:05chrishellerI need to figure out how ctypes would access a Nim function if Nim is compiled as an executable though. The ctypes documentation just focuses on calling functions in dynamic libraries.
11:37:27*flaviu joined #nim
11:37:30chrishellerSo .exportc. progma should work properly if the Nim side is compiled as a dynamic library, but I don't know if I can trick ctypes into getting a reference to the executable that it is loaded from and use that
11:39:21chrishellerBy the way, the Python C API that python.nim uses is fairly well documented in case anyone wants more info on how all that works. https://docs.python.org/2/c-api/index.html
11:42:15BlaXpiritwhaaaaaat. have I just managed the compiler to go into an infinite loop?
11:43:48*Matthias247 joined #nim
11:50:53*gsingh93 quit (Quit: Connection closed for inactivity)
11:51:01BlaXpiritI don't understand how to pass variables like by reference in C++
11:51:23BlaXpiritvar is not it, no var has a risk of passing by copy.......
11:52:43*ErikBjare__ joined #nim
11:52:56ErikBjare__Hi guys, anyone mind helping me out with the wiki article?
11:53:03*tgkokk joined #nim
11:53:04dv-var is by reference i'm pretty sure
11:53:12ErikBjare__https://en.wikipedia.org/wiki/User:Erik.Bjareholt/Nim_(programming_language)
11:53:15BlaXpiritwell it is by reference
11:53:27BlaXpiritbut it also enforces it to be an lvalue
11:53:35BlaXpiritand with C++ references that's not the case
11:54:11dv-ErikBjare__: it's been done and it's been deleted
11:54:20*ErikBjare__ is now known as ErikBjare_
11:56:06ErikBjare_dv-: There hasn't been one since June, I thought given the recent publicity now might be a good time.
11:56:14ErikBjare_At least to make a decent draft
11:56:38BlaXpiritpeople talked about it yesterday
11:56:41ErikBjare_This is vastly superior though: https://en.wikipedia.org/wiki/Draft:Nimrod_(programming_language)
11:56:47BlaXpiritrecent publicity self-referencial
11:57:09ErikBjare_BlaXpirit: Yeah I know
11:58:57*loz quit (Ping timeout: 240 seconds)
12:03:57*lodyb joined #nim
12:03:57*BitPuffin joined #nim
12:08:47*gour_ joined #nim
12:10:04MyMindit's possible to shadow a variable?
12:10:41dv-yes
12:11:07*tgkokk quit (Ping timeout: 245 seconds)
12:11:54*gour quit (Ping timeout: 245 seconds)
12:12:58BlaXpiritoh man, i've done so much shadowing today
12:13:10*loz joined #nim
12:13:14BlaXpiritfunction vs variable shadowing too
12:13:15BlaXpirit:|
12:13:41*chrishel_ joined #nim
12:14:24lodybmy gf refuses to try nim as it has 'let' haha
12:14:53chrishel_Looks like getting the address of the proc from within Nim might work for getting ctypes to call back into Nim.
12:15:05*chrisheller quit (Ping timeout: 252 seconds)
12:15:37BlaXpiritlodyb, what exactly is the problem?
12:16:00lodybits my girlfriend, some ruby ptsd or something
12:16:20BlaXpiritchrishel_, don't forget about specifying calling convention and extern
12:16:29BlaXpiriti don't know what i'm talking about though
12:17:53chrishel_Yes, it would need cdecl calling convention. I don't think that extern is needed though; exportc can take a parameter which specifies the exported name
12:18:49*tgkokk joined #nim
12:21:30*gokr1 joined #nim
12:23:09*chrishel_ quit (Ping timeout: 252 seconds)
12:23:17*gokr_ joined #nim
12:23:55*gokr2 joined #nim
12:24:12*gokr2 quit (Client Quit)
12:24:39*gokr quit (Ping timeout: 256 seconds)
12:25:39*gokr1 quit (Ping timeout: 245 seconds)
12:27:15*chrisheller joined #nim
12:31:35*chrisheller quit (Ping timeout: 252 seconds)
12:31:48*chrisheller joined #nim
12:35:01*chrishel_ joined #nim
12:35:01*chrisheller quit (Read error: Connection reset by peer)
12:36:00chrishel_Hmmm. Looks like I'm not getting the proc exported when compiling as an executable. It does export properly when I compile as a dynamic library. Maybe Nim does not support exported symbols in executables?
12:36:15chrishel_Will have to play around with that more tomorrow
12:40:20*flaviu quit (Read error: Connection reset by peer)
12:40:33*flaviu joined #nim
12:47:46Araqchrishel_: dynlib + exportc does the trick for DLLs
12:48:59EXetoClodyb: she is free to discuss that aspect on the forum or on github :-p
12:49:01chrishel_Araq: Yes, that works perfectly. I was just trying to figure out if I can export the proc when I compile an executable.
12:49:25BlaXpiritthat sounds crazy to me :o
12:49:41BlaXpiritsomeone, please check this out: https://bpaste.net/show/af5222c01c29
12:49:55BlaXpiritseemingly the same code involving seq behaves differently
12:50:11chrishel_This is just for the Python/Nim example code, so if it's not possible, that is fine. I can add a note to the code that it only works when the Nim side is a dynamic library
12:51:46def-Araq: the code for items and mitems is mostly the same. should I make a template for the common code or just write it twice?
12:52:31Araqdef-: usually the stdlib uses a template then
12:52:50Araqwe can also consider to have a single 'items' that calls 'mitems'
12:53:19def-can you still pass non-vars to items?
12:53:30Araqah yeah, you cannot
12:53:35Araqgood point
12:54:02Araqchrishel_: did you checkout "nimborg"?
12:54:28Araqit's a high level bridge between Python and Nim, but afaict not maintained anymore
12:54:48Araqbut hey, we can always revive it
12:56:33chrishel_Araq: I was playing around with your earlier version of python.nim. I will take a look at the nimborg stuff though. I see that micklat did that after he was also working on python.nim.
12:57:08Araqdef-: wanna fix the GC bug? I can give you some hints. the bug itself escapes me though
12:57:25BlaXpiritThis is an extremely minimal example now. Araq, please check it out: https://bpaste.net/show/340aa8eae1ae
12:57:40Araqfirst the code was "obviously" wrong and then it was "obviously" correct and now I'm confused :p
12:58:17chrishel_I had updated the earlier version of python.nim to work with 0.10.2 and then added some more example code (which is what got me on this kick of being able to call Nim procs from within Python).
12:59:11def-Araq: busy with another bug that escapes me, maybe later
12:59:24Araqmeh ok
12:59:45dv-can i include an object file somehow in the compilation?
13:00:08Araqdv-: {.link: "foo.o".}
13:00:40BlaXpirit:(
13:00:58def-Araq: I'm not sure why, but something is working wrong with epoll sometimes
13:01:03dv-Araq: oh cool
13:01:31gokr_sidenote: We have a python plugin in Terf today so we will need a python bridge later. similar to what we have now
13:02:31AraqBlaXpirit: report it, it's a codegen bug
13:02:46BlaXpiritAraq, I don't know how to describe this
13:02:54BlaXpiriti can put the code in, sure
13:03:19BlaXpiritthis is a really sad one :(
13:03:37Araq"s.high refers to the current seq instead of the old one"
13:03:44BlaXpiritthank you
13:04:17*tgkokk quit (Ping timeout: 240 seconds)
13:06:08chrishel_Looks like nimborg needs to be updated for 0.10.2 as well. I will do that tomorrow and send micklat a PR.
13:06:46Araqchrishel_: ask him if he wants you to take over the project perhaps
13:07:50chrishel_Yeah, I can probably help with the Python stuff. I don't know Lua (although I suppose it can't be that hard)
13:08:52*chrishel_ left #nim (#nim)
13:09:08*jefus_ is now known as jefus
13:11:25*fiatjaf joined #nim
13:12:51Araqhi fiatjaf welcome
13:15:34fiatjafhi , Araq
13:16:02*BitPuffin quit (Ping timeout: 244 seconds)
13:20:36fiatjafI'm looking onto the Nim powers to use C libraries somehow
13:20:50*chrisheller joined #nim
13:26:14fiatjafI can't make myself really graps C (I've written some C code, and it has worked, but it was bugged, bery bugged, the C way doesn't enter in my brain), and I need to use a C library for reading fingerprints, so maybe I could write Nimrod code instead and just call that library or something like that. am I right? Nimrod seems much easier to understand and write.
13:26:33fiatjafoops, Nim, not Nimrod.
13:27:05BlaXpiritfiatjaf, it is extremely easy to use C libraries
13:27:22BlaXpiritread some general documentation, then ask focused questions
13:27:35fiatjafright, I'll do that.
13:27:35def-http://nim-lang.org/manual.html#foreign-function-interface
13:27:57fiatjaf(I was going to, but since I was welcomed to the channel I thought I could just ask a general question :P)
13:28:01def-fiatjaf: but what you want should work well
13:29:07EXetoCyou still have to do some low level things when interfacing with C libs, if that's what you were getting at
13:35:22*irrequietus quit (Ping timeout: 240 seconds)
13:38:59*gokr_ quit (Ping timeout: 245 seconds)
13:39:21*FreezerburnV joined #nim
13:44:14*gokr_ joined #nim
13:45:39*BitPuffin joined #nim
13:50:47*BitPuffin quit (Ping timeout: 256 seconds)
13:51:24ekarlso-so mysql does't work with libmariadbclient-dev ?
13:51:48ekarlso-could not load: libmysqlclient.so.15
13:52:39*gour_ is now known as gour
13:52:49*Etheco quit (Read error: Connection reset by peer)
13:54:30*darkf_ joined #nim
13:56:20*darkf quit (Ping timeout: 244 seconds)
13:56:38*MrBlaise joined #nim
13:58:13*gour quit (Remote host closed the connection)
13:58:54def-ekarlso-: if it's compatible with mysql you could try allowing libmariadbclient in lib/wrappers/mysql.nim
13:59:10ekarlso-packages.nim(26, 11) Error: type mismatch: got (typedesc[seq[Package]]) but expected 'seq[Package]' < hmm
13:59:30ekarlso-how do you declare a seq with a type of object Package ?
13:59:45*gour joined #nim
14:00:15def-var mySeq = newSeq[Package]() ?
14:00:30ekarlso-ahhh
14:00:53def-ah, you probably wrote "var mySeq = seq[Package]"
14:01:04def-you could also do "var mySeq: seq[Package] = @[]"
14:03:57ekarlso-var c = db_mysql.open("localhost:3306", "nim_pkg", "nim_pkg", "nim_pkg") < doesn't that look correct ?
14:05:02*tane joined #nim
14:07:48*basaah joined #nim
14:08:07basaahhi
14:08:55*darkf_ is now known as darkf
14:09:57def-ah, libmysqlclient.so.16 it is by now
14:10:49def-or 18
14:10:52def-hi basaah
14:10:55basaahI was just toying with nim. Is it true that to 'convert int to string' I have to implement it myself? just want to check before I code something unnecessary
14:11:19def-basaah: $x converts x to a string
14:11:57basaahoh nice that works
14:12:11tanehello
14:12:18basaahI did string(789)
14:12:23taneis there any REPL for nim, where i can type small expressions and the like?
14:12:38flaviutane: `nim i`
14:12:41def-tane: there is "nim i" but it's not really usable imo
14:12:42tanethanks
14:12:43flaviubut it's fairly buggy
14:12:54BlaXpiritcan't import math in it. nuff said.
14:13:09taneok
14:13:11*Mimbus joined #nim
14:14:59def-ekarlso-: for me it works like this, with correct user, pass and database of course
14:16:12dom96ErikBjare_: why not base the wiki article on the old draft?
14:16:27dom96BlaXpirit: use this for searching docs http://nim-lang.org/theindex.html
14:16:42BlaXpiritnot bad :o
14:17:15BlaXpiritSo, my Nim SFML bindings are ready. https://github.com/blaxpirit/nim-csfml (yes, I made another one)
14:17:41def-BlaXpirit: what's wrong with the other one?
14:17:48BlaXpiritNIH
14:18:20BlaXpiritseriously though, i don't like that it has T and P everywhere... and the fact that it seems to be hand-made makes it error-prone and tedious to update
14:18:55BlaXpiritand converting types of variables seemed tedious
14:19:04BlaXpiritthere were a few places where that was needed
14:20:46def-looks like nice work, BlaXpirit
14:20:51BlaXpiritthanks
14:21:15BlaXpiritoh yeah, and I changed getter/setter functions to assignment
14:23:06ekarlso-http://pastebin.com/ZYLeS2xq < hmmm
14:23:09EXetoCideally you'd update. many libs were written when the prefixes were encouraged
14:23:10ekarlso-what's wrong with that ?
14:24:53def-EXetoC: hm yeah, it's not ideal to have 2 wrappers for the same lib now
14:25:18BlaXpiritwell I'm sure we'll figure something out with fowl
14:26:31BlaXpiritespecially since he doesn't seem to have time....
14:28:43BlaXpiritdocumentation is the main thing that is lacking
14:30:26BlaXpiritfowl's bindings do have nim generated documentation, but it wasn't very helpful to me when i tried to use it
14:30:54ekarlso-anyone ? :p
14:31:24BlaXpiritwell, ekarlso-, you tell us what is wrong
14:31:25BlaXpiritany eror message?
14:31:27def-ekarlso-: no idea what that even should do
14:32:04*joebo joined #nim
14:32:07def-ah
14:33:16def-something like this: https://github.com/def-/nim-unsorted/blob/master/parametrizedsql.nim
14:33:48BlaXpiritoh, and old sfml bindings can only pass ascii strings to sfml
14:34:13def-ekarlso-: but this didn't quite work, now there's dbj_*: https://github.com/Araq/Nim/issues/1359
14:35:04dom96ekarlso-: Are the '?' not supposed to be inside the parenthesis?
14:35:32BlaXpiritit's supposed to be VALUES(?, ?, ?, ?, ?)
14:35:40BlaXpirithow didnt i notice
14:35:48ekarlso-+1 dom96
14:36:07*gokr_ quit (Ping timeout: 256 seconds)
14:39:08ekarlso-can't u change the value of a field on a already instantiated object ?
14:40:25EXetoCyou can, if the instance is mutable
14:40:42BlaXpiritvar vs let
14:40:53EXetoCand there's no per-field mutability
14:41:15ekarlso-ah, so when it's passed into a proc it's immut
14:41:57ekarlso-is there a way to copy a object ?
14:42:06EXetoCif 'var' is not present, yes
14:42:29EXetoC(to the first question)
14:42:51EXetoCekarlso-: if it's not a pointer type, then it will copy on assignment
14:43:24ErikBjare_dom96: Didn't know it existed, made a few changes to it.
14:43:37EXetoCand pointer types can be dereferenced like so: foo[]. so "var x = foo[]" would make a copy of the object pointed to by 'foo'
14:43:59dom96ErikBjare_: sure, are you going to submit it as a new article?
14:45:09EXetoCgood to see a nice increase in popularity, and participation to some degree. later
14:45:17EXetoCdom96: wanna add the example site to the topic?
14:45:17ekarlso-EXetoC: so when you are passing a obje down to a proc how u make it immut within a proc ?
14:45:57EXetoCekarlso-: by not making it a var, in which case it's sort of like an implicit 'let'
14:46:32ekarlso-EXetoC: not following -,,-
14:46:59dom96EXetoC: Nobody reads the topic anyway :P
14:47:14EXetoCoh well
14:47:15dom96EXetoC: Why the example site specifically?
14:48:04EXetoCekarlso-: "proc p(x: T)" rather than "proc p(x: var T)"
14:48:08*bitstopper joined #nim
14:48:14*basaah quit (Quit: Page closed)
14:48:32*FreezerburnV quit (Quit: FreezerburnV)
14:48:36BlaXpirit.eval var s = @[5];let x = s[s.high];s.add x;s.add s[s.high];echo s
14:48:39MimbusBlaXpirit: @[5, 5, 0]
14:49:00ekarlso-EXetoC: I already have proc p(x: T): ..
14:49:03*Dispatch joined #nim
14:49:08EXetoCekarlso-: then you're all set
14:49:32ekarlso-packages.nim(24, 7) Error: 'pkg.id' cannot be assigned to
14:49:35ekarlso-EXetoC: hence ^
14:50:05ekarlso-needs to be var p I guess
14:50:15EXetoCI thought you said you wanted it to be immutable rather than mutable
14:50:17EXetoCI think so
14:50:21ekarlso-;)
14:50:33ekarlso-i'm not making alot of sense always :(
14:50:40EXetoCdom96: I don't know, but maybe you want to extend it, and then you can just say "see the topic"
14:51:23dom96EXetoC: There is too much stuff in the topic already
14:51:53joeboI am interfacing with a C function that returns a struct and that struct contains an offset to another memory location, which would be an an array of numbers... how can I access that array?
14:51:54EXetoCyes I think it should be delegated to a bot instead
14:53:19BlaXpirit"Build farm: Down until further notice" is not useful :|
14:53:39joeboI have the type definition as type JTA ... offset: int... size: int...
14:53:44BlaXpiritand what the heck is that git.io link
14:53:48ekarlso-why is the build farm down ? :p
14:54:22joeboso it would be something like (aptr+aptr.offset)[0...aptr.size]
14:54:48*Varriount|Busy joined #nim
14:55:15*phao joined #nim
14:55:21*phao left #nim ("Leaving")
14:55:34*ethycol_ joined #nim
14:55:41Varriount|BusyHello ethycol
14:57:27*bitstopper quit (Quit: Page closed)
14:57:49*ethycol quit (Ping timeout: 244 seconds)
14:59:11*Ven joined #nim
15:00:34*ethycol_ quit (Ping timeout: 255 seconds)
15:02:28ekarlso-grrr
15:02:37ekarlso-when a program crashes is there no way to see why?
15:03:36Varriount|Busyekarlso-: Depends on the OS, and the language the program was written in, and how the program is run/compiled.
15:03:41BlaXpiritwe talked yesterday
15:03:49Varriount|BusyIs the program in question a Nim program?
15:04:02BlaXpiritthe only time a program crashed that was not because of my error with C FFI,
15:04:08BlaXpiritwas uninitialized pointer
15:04:21BlaXpiritref type, you must call new on it
15:04:23BlaXpiritand i didn't
15:04:29ekarlso-ahhh, Varriount|Busy nim program.
15:04:39ekarlso-ubuntu
15:05:45BlaXpirithttp://irclogs.nim-lang.org/01-01-2015.html 19:17:36
15:05:47Varriount|Busyekarlso-: Compiling in debug mode doesn't give you a stack trace?
15:06:27BlaXpiritalso 18:12:18
15:06:31ekarlso-BlaXpirit: ?
15:06:41BlaXpiritekarlso-, we talked about debugging yesterday
15:07:19ekarlso-nim -d:useSysAssert -d:useGcAssert c src/packages.nim
15:07:21ekarlso-I tried that :)
15:07:40BlaXpirit--embedSrc --linedir:on --debugInfo was slightly helpful for me
15:07:59BlaXpiritbut in the end, i was unable to debug my program, and found the error on my own
15:08:09ekarlso-whaaa
15:08:15Varriount|BusyBlaXpirit: You know that you can use GDB, right?
15:08:17no_namelets say I wanted to import zlib, how do I indicate that I want to statically link zlib1.dll into the binary?
15:08:19*Y0Gi_ joined #nim
15:08:21dom96ekarlso-: what's the problem?
15:08:28dom96you should get a stack trace
15:08:30BlaXpiritVarriount|Busy, that's exactly the flags that made GDB slightly useful
15:08:37ekarlso-so the program crashes due to a NULL value in a mariadb row
15:08:38BlaXpiritonly very slightly
15:08:48BlaXpiritekarlso-, D:
15:08:54Varriount|Busyno_name: I believe you need to pass a compiler option. Let me see if I can find it...
15:09:04ekarlso-but why, doesn't nim handle that ? :/
15:09:15Y0Gi_hi there. is there an easy way to turn a slice (1..4) into an actual sequence? or another approach to generate a sequence of successive numbers?
15:09:15ekarlso-i'm just doing SELECT * FROM packages; :/
15:09:49BlaXpiritY0Gi_, hmmmm
15:10:12Araqno_name: --dynlibOverride and then have fun with --passL
15:10:18BlaXpirit.eval import sequtils;toseq(1..4)
15:10:21MimbusBlaXpirit: lib/pure/collections/sequtils.nim(311, 2) Error: value of type 'seq[int]' has to be discarded
15:10:23Y0Gi_a list comprehension might work, but seems ... wrong
15:10:26BlaXpirit.eval import sequtils;echo toseq(1..4)
15:10:29MimbusBlaXpirit: @[1, 2, 3, 4]
15:10:32BlaXpirityay
15:10:42BlaXpiritY0Gi_, ^
15:11:34ekarlso-a bit sad if a program blows up due to that
15:12:28Araqekarlso-: not sure if the mysql wrapper was updated to handle NULL "properly"
15:13:11ekarlso-Araq: uh, so how to fix that then ? :/
15:13:28*ARM9 joined #nim
15:13:46Y0Gi_BlaXpirit: thanks, I must have been doing something wrong there.
15:13:57no_namehrms.. that's not working so well... so I'm on a windows machine with msys/mingw installed, and trying to use zlib, when I run my program it complains it can't find zlib1.dll. my system actually has like 8 zlib1.dll's already. I've taken several (including the one shipped with Aporia) and put them in the current dir, with no effect
15:14:05BlaXpiritY0Gi_, toSeq is not trivial to find
15:14:19ARM9Hi, does nim have any support for inline assembly?
15:14:40Y0Gi_BlaXpirit: then again, sequtils seems to only contain toSeq (a template), not toseq (as far as http://nim-lang.org/sequtils.html tells me)
15:14:52AraqARM9: yes check out the asm keyword
15:14:56BlaXpiritY0Gi_, case insensitive language
15:15:08BlaXpiritonly 1st letter is case sensitive
15:15:22Y0Gi_BlaXpirit: urgs
15:15:45ekarlso-Araq: u want a bug boss ?
15:15:46*MrBlaise quit (Remote host closed the connection)
15:16:23Y0Gi_the type of 1..4 is Slice[int], is that right?
15:16:40Araqekarlso-: afaict db_mysql has been updated
15:16:58ekarlso-https://github.com/Araq/Nim/issues/1837 < Araq
15:17:49Araqekarlso-: collectionToString doesn't deal with 'nil' strings. nothing does.
15:18:03Araqthe wrapper returns a nil string though for NULL.
15:18:23*loz quit (Ping timeout: 240 seconds)
15:18:27Araqthis is just the old nil string gotcha, has nothing to do with the mysql wrapper
15:18:44ekarlso-Araq: eh, so what am I doing wrong then?
15:19:05Araqand according to your bug report you do get a stack trace
15:19:41Araqekarlso-: write your own outputRow proc
15:19:47ekarlso-did you ask if i got one ?
15:19:51ekarlso-sorry if that
15:20:04ekarlso-really ?
15:20:09Araqor wait until $ works for 'nil'
15:20:16ekarlso-sigh
15:20:45BlaXpirit.eval echo nil
15:20:48MimbusBlaXpirit: eval.nim(3, 5) Info: instantiation from here
15:20:59Varriount|Busyno_name: Um, you do know that dll's can't be statically linked to?
15:21:03BlaXpiritmmmmmkay
15:21:10Varriount|Busyno_name: You need a lib file for that.
15:21:11BlaXpiritalmost anything can be echod, why not nil?
15:21:19Araq.eval echo string(nil)
15:21:23MimbusAraq: Error: execution of an external program failed; rerun with --parallelBuild:1 to see the error message
15:21:31Araqyay
15:21:33BlaXpirit.eval echo($nil)
15:21:36MimbusBlaXpirit: eval.nim(3, 5) Info: instantiation from here
15:21:52flaviuBlaXpirit: It only prints the first line
15:21:53ekarlso-a bit funky that there's no support for a standard db thing..
15:22:20Araqekarlso-: the db libs changed the rest of the language wasn't
15:22:28Araqprepared for this change
15:22:36AraqI was against this change btw
15:22:49ekarlso-against it how ?
15:22:50Y0Gi_BlaXpirit: may you can give me a hint why toSeq doesn't work in that context? http://hastebin.com/asovajuxus.pl
15:22:57Y0Gi_s/may/maybe/
15:22:58Araqso *shrug*, it will get better and there is a limit to what I can do
15:23:09*gmpreussner quit (Ping timeout: 245 seconds)
15:23:14BlaXpiritekarlso-, i like http://bpaste.net/ btw
15:23:15*gmpreussner_ joined #nim
15:23:22BlaXpiritthat link u sent is just unreadable
15:23:35ekarlso-BlaXpirit: ok..
15:23:47DispatchHi everyone
15:23:51BlaXpiritwait
15:23:52BlaXpiritsorry
15:23:52BlaXpiriti mean Y0Gi_
15:24:04ekarlso-I dont wanna start doing stuff that should be done there for me already :/
15:24:37Varriount|BusyAraq: What change were you against?
15:24:39Y0Gi_BlaXpirit: this should provide enough contrast if that's your point: http://hastebin.com/raw/asovajuxus
15:24:43BlaXpiritY0Gi_, ok, this is strange
15:24:46Araqekarlso-: maybe your production app doesn't just 'echo' rows though
15:25:21Y0Gi_BlaXpirit: I'm on nim 0.10.2 here btw
15:25:21AraqVarriount|Busy: that we map NULL to 'nil' strings. I wanted the db* libs to use JSON instead
15:25:46Varriount|BusyAraq: *shrug*
15:25:59ekarlso-Araq: true enough !
15:26:00BlaXpiritso Y0Gi_, there is some magic happening
15:26:08*gokr joined #nim
15:26:10BlaXpirittoSeq accepts openarray (among other things)
15:26:25BlaXpiritand if used as toSeq(1..5), it can treat any iterable as openarray
15:26:27BlaXpiriti'm pretty sure
15:26:28AraqY0Gi_: toSeq calls items, there is no items for Slice
15:26:40Araqsince nobody does:
15:26:40BlaXpiritbut there is not toSeq defined for Slice[int]
15:26:44DispatchI have a ptr int16 and would like to write int16 values to that pointer, I can do ptrvar[] = 12345, but how do I increase the pointer to the next value?
15:26:45Araqvar r = 1..3
15:26:49Araqfor x in r:
15:26:57Araqbut everybody does: for x in 1..3
15:27:01Y0Gi_.eval echo NimVersion
15:27:04MimbusY0Gi_: 0.10.1
15:27:26BlaXpiritAraq, ...
15:27:46BlaXpirit.eval import sequtils;echo toSeq(1..5)
15:27:49MimbusBlaXpirit: @[1, 2, 3, 4, 5]
15:27:51BlaXpirit.eval import sequtils;let r = 1..5;echo toSeq(r)
15:27:54MimbusBlaXpirit: eval.nim(5, 11) Error: type mismatch: got (Slice[int])
15:27:56BlaXpiritthe confusion is natural
15:28:11Y0Gi_Araq: I see. but I'd like to avoid creating a sequence in a for loop.
15:28:37AraqY0Gi_: for i in 0..8 doesn't create a seq
15:28:59Araqthere are 2 '..'. One contructs a Slice for the [] access
15:29:06Araqthe other is an iterator
15:29:12BlaXpiritAraq, the guy wants to convert a Slice to seq
15:29:12BlaXpiritwhat are you talking about?
15:29:12Y0Gi_Araq: exactly that's my point. but I could create an array, fill it via numeric index etc.
15:29:52AraqY0Gi_: toSeq(r.a .. r.b) should work
15:30:08Araq(adding to the confusion, I know I know)
15:30:21Y0Gi_Araq: indeed, it does.
15:30:24BlaXpiritAraq, why the inconsistency?
15:30:24BlaXpiritit makes me sad
15:30:43AraqBlaXpirit: there is no inconsistency, just a missing 'items' for Slice[T]
15:30:52BlaXpiritooooohh
15:30:55Y0Gi_so, as probably the first person to try that, may I request an overload of `items` for a slice? :)
15:31:05Araqmake a PR
15:31:09BlaXpiritit sure would be useful as heck
15:31:12Y0Gi_will do
15:31:21BlaXpiritwhy does for of a slice work then???????
15:31:33Y0Gi_second one today. productive new year so far ;)
15:31:40gokrBlaXpirit: because its not a slice
15:31:51BlaXpirit[:30:08] <BlaXpirit> Araq, why the inconsistency?
15:32:00gokrAraq just said there are two '..'
15:32:23gokrBut I agree - it is a bit confusing.
15:33:21gokrI added for fun, a map that operates on Slice[T] - and that works fine. But... Araq felt we really should create an Interval type instead.
15:33:24gokrIIRC
15:34:18*loz joined #nim
15:34:45*BitPuffin joined #nim
15:37:04ekarlso-https://bpaste.net/show/a5e820382fc9 < what exactly actually failed there :/
15:38:24Varriount|BusyHello loz
15:38:27dom96soemthing is nil
15:38:31dom96*something
15:38:39ekarlso-yeah, I see it now
15:38:58ekarlso-would be nice if it said more then sigserv..
15:39:52dom96it used to... Araq messed it up :P
15:40:00*BitPuffin quit (Ping timeout: 265 seconds)
15:40:03ekarlso-pfffffffft
15:40:06ekarlso-bad Araq :p
15:40:22flaviuUse gdb, it gives a stack trace
15:40:27ekarlso-ok
15:41:08flaviubut make sure to compile with --linedir:on --debugInfo
15:41:47ekarlso-does Nim like to use camelcase or ?
15:43:09ARM9I wonder, would it be possible to change the asm block quotation with macros or something
15:43:33gokrekarlso-: Are you on Linux?
15:43:53gokrI tried a few debugger frontends earlier and IMHO KDevelop was smoothest.
15:44:10ekarlso-gokr: ya
15:44:39flaviuyou don't really need a frontend. l33t h@x0rs don't use them ;)
15:44:43gokrDebugging with stepping in/out etc + breakpoints and so on worked great in KDevelop, as long as you compile with those flags flaviu mentioned.
15:44:48flaviubut really, just do `run`, and then `bt`
15:44:57gokrflaviu: Its still quite nice.
15:45:33gokrAnd personally I laugh at people who claims IDEs and debuggers are "for wimps".
15:45:38Varriount|Busyekarlso-: S-s-s-style guide!
15:45:44Varriount|Busyekarlso-: https://github.com/Araq/Nim/wiki/NEP-1-:-Style-Guide-for-Nimrod-Code
15:46:10gokrI worked at a die hard Vim/Perl company a year back - introduced Komodo and remote debugging for them - they gasped in awe. For god's sake... and I am not even a Perler.
15:46:34ekarlso-I love ipdb..
15:46:54Varriount|Busygokr: Well, a good debugger and IDE are nice things. I just dislike when you have to *rely* on them to be productive in a language. *cough*java*cough*
15:47:10flaviugokr: You can do remote debugging with text-mode gdb
15:47:24gokrOf course you can. That was not my point.
15:47:54gokrMy point was those guys never thought debugging was "needed" so they riddled code with prints instead and spent hours on end to track down crap.
15:48:04ARM9that's just silly
15:48:13gokrYep,
15:48:36gokrSo all that "real cool dudes don't need debuggers" etc - ha.
15:48:48*BlaXpirit_ joined #nim
15:49:35gokrThe other day there were some Nimmers here trying to figure out what was happening in some web code... some macro or what was it? I didn't say anything at the time but it sure felt that a true "hey, did you try a debugger?"-moment.
15:49:48gokr"like a true"
15:49:58Y0Gi_Araq, BlaXpirit_: while I seem to have managed to implement `items` for a slice, I ran into a problem with the `toSeq` implementation at https://github.com/Araq/Nim/blob/master/lib/pure/collections/sequtils.nim#L310
15:50:19*chrisheller quit (Ping timeout: 252 seconds)
15:50:19Varriount|BusyY0Gi_: What exactly is the problem?
15:50:21Y0Gi_Error: type mismatch: got (seq[Slice[int]], int)
15:51:05flaviugokr: You can honestly turn vim into a pretty decent IDE with ctags. I'm surprised you were able to convert a bunch of vimmers to Komodo
15:51:07Y0Gi_so the template tries to create a seq of type seq[Slice[int]] and then tries to pass it to `add`. and I'm pretty sure having that sequence in the first place is not right.
15:51:51Y0Gi_or, `type(iter)` should result in `T` when given `Slice[T]`.
15:52:00gokrflaviu: I didn't convert them. I just showed them in a few hours that its easy to set up remote Perl debugging.
15:52:09Varriount|BusyY0Gi_: Ouch.
15:52:27Varriount|BusyY0Gi_: I wonder why that's a template, and not a procedure...
15:53:08Y0Gi_Varriount|Busy: well, I'm just a new guy in Nim land.
15:54:11Y0Gi_I'm somewhat reluctant to add a special case there. feels a bit like the slice type itself needs adjustment.
15:55:24Varriount|BusyY0Gi_: Yeah, I understand your hesitation. Araq, what's your verdict?
15:56:13*chrisheller joined #nim
15:56:36Y0Gi_oh damn, slice can be high-to-low as well, I guess?
15:57:03Varriount|BusyY0Gi_: I think?
15:57:37Varriount|BusyY0Gi_: In the end, it's just a generic type with two fields
15:59:17Araqhigh-to-low is not supported via '..'
15:59:29Araqnor are strides
15:59:37def-oh, the behaviour of object inheritance recently changed?
15:59:44Varriount|BusyAraq: Why isn't high-to-low supported?
15:59:53def-I need "ref object" now to get methods working?
16:00:32Varriount|Busydef-: You shouldn't, unless the object is being implicitly downcasted, and the data cut off.
16:00:34Araqdef-: no, but I fixed bugs which result in a change of behaviour
16:00:58Araqand yeah, we should forbid data cutting off from happening at runtime
16:01:01*willwillson joined #nim
16:01:06def-Varriount|Busy: yeah, implicit downcast is exactly what I'm doing
16:01:14Y0Gi_hm. I think a saw a github issue with [1.. -1] as an example.
16:01:36Varriount|Busydef-: Well, if data is being cut off, then the method should dispatch to the new data type
16:01:40lozVarriount|Busy: hi?
16:02:03def-Varriount|Busy: I guess this is fine then: https://gist.github.com/def-/c0be89b6b88ebb1159ba
16:02:11AraqY0Gi_: I think type(items(a..b)) should yield 'int', not Slice[int]
16:02:25Araqare you sure you wrote the items correctly?
16:02:35*saml_ joined #nim
16:02:56flaviu.eval echo type(items(a..b))
16:02:59Mimbusflaviu: eval.nim(3, 16) Error: undeclared identifier: 'a'
16:03:05flaviu.eval echo type(items(1..2))
16:03:08Mimbusflaviu: eval.nim(3, 15) Error: type mismatch: got (Slice[int])
16:03:45BlaXpirit_Nim seems like such a good language, but the standard library.......
16:04:51Varriount|Busydef-: Yeah. And that makes sense too. I'm actually surprised that the previous behavior didn't cause a memory corruption
16:05:26def-Varriount|Busy: yeah, makes sense. maybe it did and that just went unnoticed
16:05:29Y0Gi_Araq: no, I'm not sure. my implementation is this: https://bpaste.net/show/dc17b749dc58
16:06:06ErikBjare_dom96: Not yet
16:06:17Y0Gi_what I have discovered so far: as long as I don't overload `items` for Slice, the openarray variant seems to be called.
16:07:19Y0Gi_but isn't `items` what is called for a `for ... in` loop? the toSeq template uses that, too, so I'd guess it should've worked out of the box.
16:07:52flaviuBlaXpirit_: I agree, you should try writing another stdlib. It worked for D!
16:08:10BlaXpirit_Y0Gi_, actually I bet toSeq uses openarray
16:08:23BlaXpirit_naaah
16:08:24Varriount|BusyBlaXpirit_: Feel free to give the stdlib an overhaul
16:08:44BlaXpirit_Varriount|Busy, nobody's gonna accept that
16:09:01*chrisheller quit (Ping timeout: 252 seconds)
16:09:16Y0Gi_is there a proc or expression that tells the type of a variable?
16:09:29Varriount|BusyY0Gi_: type(variable)
16:09:31def-Y0Gi_: type(x)
16:09:39Y0Gi_well, I thought so.
16:10:02Y0Gi_.eval type(1..4)
16:10:05MimbusY0Gi_: eval.nim(3, 8) Error: ')' expected
16:10:27flaviuI might have an old copy of the compiler
16:10:42def-.eval import typetraits;echo name(type(1))
16:10:46Mimbusdef-: int
16:10:59dv-http://pastebin.com/bJymk9Ye why does the plot window open after the sleep?
16:11:09Y0Gi_.eval let r = 1..4; echo type(r)
16:11:12MimbusY0Gi_: eval.nim(4, 5) Error: type mismatch: got (typedesc[Slice[int]])
16:11:20Y0Gi_gna
16:11:24def-dv-: p.inputStream.fflush
16:11:32*kapil__ quit (Quit: Connection closed for inactivity)
16:11:39def-dv-: oops, flushFile*
16:12:18dv-but it's a Stream
16:12:41dv-oh there's a flush for streams
16:12:50AraqY0Gi_: report it please, looks correct to me
16:12:51*darkf quit (Quit: Leaving)
16:12:53dv-it doesn't work though
16:12:54def-p.inputStream.flush
16:13:20Y0Gi_Araq: which part exactly should I report?
16:13:30*MrBlaise joined #nim
16:13:40Araq"items for Slice makes toSeq fail"
16:13:52Y0Gi_ok
16:14:24def-dv-: works with writeln
16:14:35*MrOrdinaire joined #nim
16:14:54dv-def-: oh doh!
16:14:56dv-thanks
16:15:56Y0Gi_what is `..` called anyway? isn't that a "range"?
16:16:30dv-it's a Slice
16:16:34Y0Gi_oh wait, it's a slice
16:16:39Y0Gi_yeah thanks
16:17:01*petantik quit (Changing host)
16:17:01*petantik joined #nim
16:19:02skyfexAraq: I looked a bit at unsigned related issues like https://github.com/Araq/Nim/issues/936
16:19:21skyfexAraq: But I need to know what you're thinking about how to solve them
16:19:40skyfexSo I got some questions (coming up.. :)
16:20:55Araqwell?
16:22:06skyfex1: Do you want implicit conversions from uint to int when it's safe?
16:22:06skyfex a: Do you want it built into the compiler or
16:22:07skyfex b: Added to the unsigned module as "converter's?
16:22:40Araquh oh... I dunno.
16:22:55AraqI want people to stop using unsigned... ;-)
16:22:59gokrY0Gi_: So... I added your items - and ran "toSeq(1..4)" and that worked for me.
16:23:25Araqgokr: toSeq(1..4) always worked though
16:23:40Araqvar r = 1..4; toSeq(r) # is the test case
16:23:46ekarlso-meh, how can I cast to a diff type ?
16:23:57skyfexK, I can go the easy route then, and implement whatever I can in lib/core/unsigned.nim
16:24:02ekarlso-as in string to int64
16:24:27ekarlso-since obviously it doesn't fixup the value of a "id" which is int in mysql when doing a SELECT
16:24:31*fungos_ joined #nim
16:24:41gokrAraq: Ok. toSeq(items(r)) works though.
16:24:50gokrBut yes, toSeq(r) failed.
16:25:18skyfexAraq: I get the point of avoiding unsigned, but it's nice to have a working unsigned module when interfacing with C sometimes.. libusb uses lots of unsigned types :/
16:25:31Araqskyfex: ok, integer literal parsing need to be fixed though
16:25:42Araqyou cannot avoid that via unsigned
16:25:48Araq*the unsigned module
16:25:49skyfexTrue
16:26:12ekarlso-anyone ?
16:26:20Araqskyfex: I wrap these as signed integers usually
16:26:30Y0Gi_here's the issue I created: https://github.com/Araq/Nim/issues/1839
16:26:31ekarlso-.eval int64("1")
16:26:34Mimbusekarlso-: eval.nim(3, 5) Error: conversion from string to int64 is invalid
16:26:39def-ekarlso-: 1 moment
16:26:40Araqekarlso-: parseInt
16:26:41ekarlso-meh, how does that work
16:26:46skyfexAraq: Should literals for uint64 work for numbers that can't fit in int64?
16:26:59def-.eval import strutils; parseBiggestInt("1")
16:27:02Mimbusdef-: eval.nim(4, 15) Error: value of type 'BiggestInt' has to be discarded
16:27:26BlaXpirit_.eval import strutils; echo parseBiggestInt("1")
16:27:28Araqskyfex: no these should always require an u64 suffix
16:27:30MimbusBlaXpirit_: 1
16:27:41Araqskyfex: otherwise int128 will cause lots of trouble
16:28:07BlaXpirit_.eval echo 18446744073709551615u64
16:28:10MimbusBlaXpirit_: eval.nim(3, 5) Error: number 18446744073709551615 out of valid range
16:28:26AraqBlaXpirit_: that is the bug we're talking about
16:28:29BlaXpirit_ok
16:28:43*lodyb quit (Quit: Lost terminal)
16:29:23*kh4z joined #nim
16:29:32skyfexAraq: Right, but now numbers in the range 2 shl 63 .. 2 shl 64 doesn't work even with the 'u64 suffix.. I suppose that's a bug?
16:29:57skyfexRight, you just answered that :P
16:32:04*kh4z quit (Client Quit)
16:36:39*kh4z joined #nim
16:37:06*Robert___ joined #nim
16:37:33skyfexAraq: Hm, why are big numbers int64 and not still 'int literal'?
16:38:23*Robert___ quit (Client Quit)
16:41:42BlaXpirit_Mimbus, you should just write out a value if it "has to be discarded"
16:41:55skyfexOh, and how do I run the compiler tests again?
16:43:40taneIs there any way to have anonymous tuples, not requiring member naming?
16:43:58*Dispatch quit (Quit: Page closed)
16:44:05dv-well you can say (1, 2, 3)
16:44:38tanesay i want to return a tuple if int * string, i use proc .... : tuple[int,string] =
16:47:55*MrOrdinaire quit (Remote host closed the connection)
16:48:23*BitPuffin joined #nim
16:49:26BlaXpirit_name tham "a" and "b"
16:49:28dv-you can deconstruct tuples in a let
16:49:35dv-let (num, str) = func()
16:50:03tanealright, thanks
16:50:28*Puffin joined #nim
16:52:06*gokr quit (Quit: Leaving.)
16:52:43*BlaXpirit_ quit (Quit: Quit Konversation)
16:52:58*tgkokk joined #nim
16:55:18*Puffin quit (Ping timeout: 244 seconds)
16:56:31*MrOrdinaire joined #nim
16:57:43*gokr_ joined #nim
16:58:42*Sphax joined #nim
17:01:41*yglukhov__ quit (Ping timeout: 265 seconds)
17:05:34*chrisheller joined #nim
17:09:53*chrisheller quit (Ping timeout: 252 seconds)
17:10:08*kh4z quit (Remote host closed the connection)
17:10:39*gokr_ quit (Ping timeout: 245 seconds)
17:28:48*gmpreussner__ joined #nim
17:28:53*gmpreussner_ quit (Ping timeout: 244 seconds)
17:31:21*kniteli joined #nim
17:31:32*atticusalien joined #nim
17:35:34*MrBlaise quit (Remote host closed the connection)
17:35:36*gokr_ joined #nim
17:38:37*atticusalien quit (Ping timeout: 240 seconds)
17:38:52*atticusalien joined #nim
17:41:34*MrBlaise joined #nim
17:45:31jh32I'm playing with wrapping some fltk. It works basically: http://flpsed.org/tmp/fltk.nim
17:47:08jh32I'm facing two issues: I need a C++ lib to add constructors without parameters, and I can't replicate the class hierarchy of fltk in nim, so I need the cast (line 35)
17:47:36jh32is there better ways to deal with that?
17:48:13*atticusalien quit (Ping timeout: 256 seconds)
17:52:54*MrOrdinaire quit (Remote host closed the connection)
17:53:10*MrOrdinaire joined #nim
17:53:39*MrOrdinaire quit (Remote host closed the connection)
17:54:26Varriount|Busyjh32: Could you explain the 'lib to add constructors without parameters' bit?
17:56:23jh32it's http://flpsed.org/tmp/fltkwrap.hh
17:57:05jh32many classes in fltk don't have default constructors (without parameters) and I didn't manage to use them directly from nim
17:57:53Varriount|Busyjh32: I think the cast is fine.
17:59:06*dts|pokeball joined #nim
18:01:58*gokr joined #nim
18:02:24*Trustable joined #nim
18:03:21jh32ok, thanks. I would have hoped that I could define e.g. TNim_Toggle_Button as object of TFl_Widget, but that didn't work
18:04:34Varriount|Busyjh32: Unfortunately, C++ is hard to interface with.
18:05:13*loz quit (Ping timeout: 256 seconds)
18:05:13*gokr_ quit (Ping timeout: 250 seconds)
18:08:49jh32anyway, I think I have everything working to get started
18:13:57*gmpreussner__ quit (Ping timeout: 240 seconds)
18:14:15*gmpreussner__ joined #nim
18:17:46*gokr quit (Ping timeout: 250 seconds)
18:19:54*shevy joined #nim
18:20:00shevyhappy new year to nim! \o~
18:21:49*loz joined #nim
18:26:18*Sphax quit (Quit: ZZZZZzzzzz)
18:27:16*yglukhov__ joined #nim
18:28:19joeboI have a seq[seq[int]] that I need to pass to a C function as a ptr int. What would be the right way to do that? Should I convert it to a flat array somehow?
18:29:11dts|pokeballhold on. ive got a rosetta code link for this
18:29:43joeboI see one for flattening a list
18:30:10joebobut that results in a sequence
18:30:13BlaXpiritjoebo, flattening is definitely recommended
18:30:13BlaXpiritotherwise you don't have any guarantees
18:30:17dts|pokeballhttp://rosettacode.org/wiki/Use_another_language_to_call_a_function#Nimrod
18:31:03dts|pokeballBlaXpirit, whats flattening a list?
18:31:04BlaXpiritthis seems irrelevant
18:31:23BlaXpiritwell seq[seq -> seq
18:31:28dts|pokeballah
18:31:35joebook, so if I had a flat sequence, how would I convert that to an array?
18:31:49BlaXpiritaddr that[0]
18:31:50def-joebo: addr mySeq[0]
18:32:22joebooh, perfect. I didn't want to assume a sequence stored the data contiguously
18:32:37joebothanks, I'll give it a shot
18:35:15Varriount|BusyBlaXpirit, def-, joebo: No, don't do that unless the sequence is guaranteed to stay alive and not be modified
18:36:30def-Varriount|Busy: I assumed that the sequence is passed, the C code calculates something and then returns some result
18:36:36BlaXpirityeah..
18:36:59*gokr joined #nim
18:37:16*dyu quit (Quit: Leaving)
18:37:49Varriount|Busy.eval var g = @[1,2,3,4,5];var x = cast[array[len(g), int](unsafeNew(sizeof(int)))
18:37:52MimbusVarriount|Busy: eval.nim(5, 0) Error: ']' expected
18:38:03Varriount|Busy.eval var g = @[1,2,3,4,5];var x = cast[array[len(g), int]](unsafeNew(sizeof(int)))
18:38:06MimbusVarriount|Busy: eval.nim(4, 23) Error: cannot evaluate at compile time: g
18:38:30Varriount|BusyOh, I need to use an unchecked array
18:40:46Varriount|Busyjoebo: For future reference, be very carefull passing the address of a sequence's first element to a C function expecting an array pointer. A Nim sequence is a dynamic array, so if it's modified while the C code has hold of it, bad things could happen.
18:41:36joeboVarriount|Busy: thanks, that makes sense
18:42:08ldleworkHas anyone here spoken to yenic about Python interop?
18:42:22joeboI'm getting a SIGSEV illegal storage access so I don't think it's working quite right
18:42:52ldleworkAlso, are types values in Nim?
18:43:01Varriount|Busyldlework: Depends on the type
18:43:31ldleworkVarriount|Busy: I'm thinking about like an entity component system where you have a map that maps from type to an array of values or something
18:43:35ldleworkLike in Python you could easily use the class as a key in a dictionary
18:43:56Varriount|Busyldlework: I don't follow
18:43:58def-ldlework: types are values of type typedesc
18:44:02*dts|pokeball quit (Read error: Connection reset by peer)
18:44:24ldleworkdef-: are they distinct? Could use use types as a mapping key?
18:44:38*ErikBjare_ quit (Ping timeout: 244 seconds)
18:44:42def-not sure
18:44:53ldleworkdef-: thanks a lot for your artcle on Nim btw
18:44:55def-try it out with a hash set?
18:44:57ldleworkVery well written, very useful
18:45:03Varriount|Busyldlework: Not yet... values of typedesc only exist at compile time.
18:45:03def-thanks
18:45:15Varriount|Busyldlework: You can use the typeinfo module though...
18:45:22*dts|pokeball joined #nim
18:45:26ldleworkVarriount|Busy: doh
18:45:29ldleworkSo you'd have to have like a superflous enum for each type you want to use
18:45:49ldleworkBasically the same situation in Rust and Golang
18:46:04ldlework(in Go you can use empty interface{} but now you're not type safe)
18:46:36Varriount|Busyldlework: It might be better to use an enum, and manually map each type
18:46:56ldleworkVarriount|Busy: yeah its just.. now you have two tokens for what is essentially one thing
18:47:02ldleworkBut its fine-ish
18:47:11Varriount|Busyldlework: *shrug*
18:47:23ldleworkI have to really try to eventually look up the C# implementation
18:47:24ldleworkSee how it is done there
18:48:27Varriount|Busyldlework: What about typetraits.name?
18:49:12Varriount|Busyldlework: The only problem you have then is to make sure that there aren't two modules with types that share the same name
18:49:13*Mimbus quit (Read error: Connection reset by peer)
18:49:13*flaviu quit (Read error: Connection reset by peer)
18:49:31ldleworkIts not a huge deal to use an enum
18:49:51*chrisheller joined #nim
18:49:58ldleworkBut I will say that Nim will have some slight advantage over other languages if you can use type names themselves as values somehow
18:49:58ldleworkat runtime
18:50:00ldleworkbut its probably not useful for many things
18:50:32ldleworklike even if each type was assigned some integer value globally
18:50:49ldleworklike the type names in a value context are evaluated as enum's that the compiler establishes over all the types in the program
18:52:35*flaviu joined #nim
18:53:01*superfunc joined #nim
18:54:33superfuncdom96: I cold-called the guy from wired, we'll see what happens
18:56:14*loz quit (Ping timeout: 265 seconds)
18:57:05def-superfunc: cool
19:07:25*rpag joined #nim
19:07:37*quasinoxen quit (Ping timeout: 255 seconds)
19:12:04superfuncWhoever did the rework on the manual's css, great work. Haven't been able to be online much lately and missed quite a bit
19:14:00Varriount|BusyHm... what would the attributes of 'relative' and 'absolute' be described as, with regards to file system paths?
19:16:02*brson joined #nim
19:16:20ldleworkVarriount|Busy: I don't really understand the question
19:16:26*quasinoxen joined #nim
19:17:13Varriount|Busyldlework: I'm trying to think of a name for an enum that contains 'relative' and 'absolute'
19:17:14flaviusuperfunc: it was boydgreenfield
19:18:08ldleworkVarriount|Busy: orientation is the best that's coming to mind
19:18:11ldleworkVarriount|Busy: relativity?
19:18:45no_nameI'm having a hell of a time figuring out how to compile a binary on windows 64-bit that uses zlib. I've tried a bunch of things. Help!
19:18:47ldleworkVarriount|Busy: Basing?
19:19:02*ldlework throws no_name a lifesafer
19:19:23ldleworkOh no its a sentimental lifesafer without substance!
19:19:31*ldlework watches no_name drown.
19:19:31ldlework:(
19:20:01jsudlow:'(
19:21:35Varriount|Busyno_name: First off, are you using a lib file, and not a dll?
19:21:48no_nameVarriount|Busy: I've tried both
19:21:59no_namecan't get any zlib1.dll I can either get or compile to be recognized
19:22:10no_namehaven't been able to make a lib file that it's happy with yet
19:22:32Varriount|Busyno_name: Well, you can't statically link a dll.
19:22:36no_nameI know
19:22:46no_namethe default is for it to dynamically import it
19:22:47dts|pokeballheh
19:23:02Varriount|Busyno_name: What C compiler are you using? And what options have you passed to the compiler?
19:23:03no_nameget "could not load: zlib1.dll" at program run
19:23:27no_namethe mingw that's distributed with nim
19:23:35dts|pokeballdoes it know where zlib1.dll is?
19:24:35no_nameI've tried putting it in the same dir and in system32
19:24:39Varriount|Busydts|pokeball: He doesn't want to load the dll, he wants a static lib included in the binary
19:24:57no_nameI'd prefer a static lib, but I'm almost at the point where I'll take it where I can get it
19:25:43Varriount|Busyno_name: Have you checked that the dll's that are in your path/the executable directory match the architecture the executable is compiled for?
19:26:23Varriount|Busyno_name: A 64-bit program won't load or link 32-bit dlls, or vice-versa
19:26:25no_namenot sure how to do that - I didn't see anything obvious in the properties for them
19:26:28no_nameyeah, I know
19:26:40*chrisheller quit (Remote host closed the connection)
19:27:01Varriount|Busyno_name: http://blog.ringerc.id.au/2012/12/how-to-tell-if-dll-is-32-bit-x86-or-64.html
19:27:23BlaXpiritis there any way to introduce namespaces?
19:27:46*dain joined #nim
19:27:54Varriount|BusyBlaXpirit: You mean, besides module namespaces? No.
19:28:14BlaXpiritI've just realized that I can make an object......
19:28:33*dts|pokeball quit (Ping timeout: 244 seconds)
19:28:35BlaXpiritwith fields......
19:28:57ldleworkBlaXpirit: ...that's pretty typical for objects..
19:28:59ldlework:P
19:29:36*ehaliewicz joined #nim
19:29:37*dts|pokeball joined #nim
19:29:53BlaXpiritI can't just turn this https://github.com/LaurentGomila/CSFML/blob/master/include/SFML/Window/Window.h#L43 into this https://github.com/BlaXpirit/nim-csfml/blob/master/src/csfml_window_gen.nim#L162
19:30:44ldleworkwhy not
19:30:53BlaXpirithorrible name pollution
19:31:19*ldlework clears his throat and puts on his best Golang cult member voice
19:31:30def-BlaXpirit: from outside you can access them as csfml.Titlebar and so on
19:31:36ldleworkAhem, if name pollution isn't your bag, then Nim might not be the best language for you
19:31:40BlaXpiritbut nobody's gonna do that
19:31:53BlaXpiritno, but these are very generic names
19:32:12ldleworkBlaXpirit: why do you think it has sf prefexes in the C?
19:32:13Varriount|BusyBlaXpirit: Don't forget 'import Foo as FooBar'
19:32:27BlaXpiritVarriount|Busy, I know, but still, nobody's gonna do that
19:32:38Varriount|BusyBlaXpirit: If you're writing a wrapper, don't forget about c2nim.
19:32:39BlaXpiritbecause procs don't get imported
19:32:54BlaXpiritand you can't just call them
19:32:56ekarlso-.eval foo
19:32:56BlaXpiritcan you
19:33:06ldleworkBlaXpirit: you can import multiple things
19:33:07BlaXpirita.b(c,d) becomes sf.b(a, c, d)
19:33:38EXetoCso encourage it, and bring it up in code reviews
19:34:03BlaXpiritif i can have window.draw sprite i'm not gonna go for sf.draw(window, sprite)
19:34:17BlaXpiritand this is still not so bad as other things
19:34:20ldleworkBlaXpirit: "Nim: Fix it with tooling. Fix it with culture."
19:34:31BlaXpiritsetters
19:34:52BlaXpiritsprite.rotation = 45 becomes...... sf.`rotation=`(sprite, 45)
19:34:54BlaXpiritreally
19:34:54Varriount|BusyBlaXpirit: Remember that name pollution doesn't matter so much - the compiler's type resolution mechanism helps.
19:34:56BlaXpiritit's not viable
19:35:14ldleworkVarriount|Busy: it hurts humans
19:35:27Varriount|Busyldlework: Howso?
19:35:37ldleworkI'm not going to warrant that with a response.
19:35:42EXetoCI don't want to be forced to qualify the symbols, but I will do it myself if in doubt
19:36:46Araqskyfex: because the compiler knows 'int' is of platform specific size
19:36:54EXetoCbut the author of a certain module can of course force me to do it by importing a certain way
19:36:55Araqso only int32 literals are 'int literal'
19:37:30skyfexHmm, I see, thanks :)
19:37:30EXetoCBlaXpirit: but those kinds of collisions should be very rare
19:37:51Varriount|BusyAraq: Could you explain your reasoning for implicit importation of entire module namespace?
19:38:35AraqVarriount|Busy: I used Delphi which uses that with no problem. I used Ada which doesn't use that and was annoyed. Something like that.
19:38:35EXetoCor do you think that field assignment procs will commonly be defined outside of the module that defines said object?
19:38:49BlaXpiritimport nil is basically never viable
19:39:04no_nameVarriount|Busy: ok.. so I checked all 9 zlib1.dll's on my system (2 of which came in the C:\Nim\ installation directory, and the only one that was 64-bit was in my wireshark directory. I copied that one over and it crashed
19:39:04AraqIMHO this whole discussion resolves about the term "pollution"
19:39:19Araqsomebody called it "pollution" and now it's "obviously bad"
19:39:31Varriount|Busyno_name: Any stack trace?
19:39:38BlaXpiritAraq, it would all be great, but seriously, I'm taking away the name "Default"
19:39:47no_nameSIGSEGV: Illegal storage access. (Try to compile with -d:useSysAssert -d:useGcAssert for details.)
19:39:48BlaXpiritso I'm desperate for namespaces
19:40:07AraqBlaXpirit: a module provides a namespace, dude
19:40:16skyfexAraq: Have you thought about adding some support for abitrary-precision arithmetic in Nim?
19:40:22no_nameVarriount|Busy: yeah, gc.nim:growObj -> alloc.nim:rawAlloc
19:40:29BlaXpiritAraq, but I'm not gonna make a module for every enum
19:40:44Varriount|Busyno_name: Ouch, that looks like a memory corruption error.
19:40:48AraqBlaXpirit: so use a .pure enum
19:40:49EXetoCBlaXpirit: he did acknowledge it, but some people think that collisions will be very common for large projects
19:40:54no_nameVarriount|Busy: more specifically: test.nim:gunzip->gc.nim:growObj -> alloc.nim:rawAlloc
19:40:56BlaXpiritAraq, I can't because it's a bitmask
19:40:57Varriount|BusyBlaXpirit: If you're worried about enums, use the pure pragma
19:41:07Araq?
19:41:09BlaXpiritit can't be an enum, it can only be constants
19:41:09no_nameVarriount|Busy: yes it does.
19:41:14EXetoCI don't think it'll be *that* common, if the interfaces are properly designed, but if it then so be it
19:41:20BlaXpiritbecause it needs support for `or` (bitmask)
19:41:22ldleworkAraq: "you don't need generics. they are not required. You can get by without them"
19:41:26no_namedo you use any of the windows impure libraries?
19:41:37ldleworkAraq: "one language has generics and they're useful and so now they're "obviously good""
19:41:41no_nameI've tried compiling zlib from source with mingw, it's kind of painful
19:41:46EXetoCthen you resolve the collision by qualifying
19:41:48ldleworketc
19:41:49Varriount|Busyno_name: Yes, quite often.
19:41:57EXetoCvoid* ftw
19:42:03Varriount|Busyno_name: I'm about to get off work, I can help you when I get home.
19:42:08no_nameyeah sure
19:42:12*dain quit (Quit: dain)
19:42:14Araqldlework: I don't think you can apply my argument in this way
19:42:31AraqI'm talking about a term, you about a feature.
19:42:45EXetoCVarriount|Busy: and you can qualify enums even without it, but then chances are you'll use a prefix
19:42:45ldleworkAraq: namespaces are the feature that are coupled to name pollution
19:42:57Araqwe have namespaces
19:43:04EXetoCwhich is basically a convention, and that's another way of avoiding collision
19:43:10ldleworkThat by default import everything in the namespace into the module that's importing them
19:43:13AraqI know you all like to pretend that we don't, but we do.
19:43:19ldleworknamespaces trying to avoid being namespaces
19:43:35EXetoCecOhNo (error code: oh no)
19:43:39Araqso use 'from foo import nil'. nobody stops you
19:43:46Araqit's in the language.
19:43:48ldleworkAraq: then I'm importing iterally everything manually
19:43:55BlaXpiritAraq, no, import nil is useless
19:43:56ldleworkAraq: how about "import foo" imports the name 'foo'
19:44:07ldleworknot foo.bar, and foo.*
19:44:15ldleworknow we have Namespaces
19:44:16EXetoCso did you make a feature request?
19:44:18*Puffin joined #nim
19:44:22BlaXpirit[:34:51] <BlaXpirit> sprite.rotation = 45 becomes...... sf.`rotation=`(sprite, 45)
19:44:27EXetoCafter the last discussion
19:44:40*Varriount|Busy quit (Quit: Page closed)
19:45:13ldleworkEXetoC: I'll just write a feature for my IDE to solve this problem.
19:45:17ldleworkOKAY I swear I'm done trolling
19:45:27*ldlework huggles everyone.
19:45:28EXetoCBlaXpirit: so that's a yes: you do think it'll be common. well I don't
19:45:36EXetoCI would support such a feature
19:45:36BlaXpiritwhat
19:45:44EXetoCBlaXpirit: nevermind
19:45:45BlaXpiritI don't understand what you're talking about
19:45:54EXetoCso you too want foo.*
19:45:55Araq"boohoo I want to import things explicitly. But boohoo then I have to import things explicitly."
19:46:02EXetoCthere's a lot to keep track of, but I'm done now
19:46:17BlaXpiritAraq, it's just not viable as it is right now
19:46:31BlaXpiritbecause there is too much dependency on the procs being there with dot notation
19:46:37ldleworkAraq: I don't want to import things explicitly. I want to access them from a namespace explicitly.
19:46:52ldleworkAraq: "import foo" allowing me to do "foo.bar" but requirng the prefix, is what a namespace is
19:46:56Araqldlework: 'from foo import nil'
19:46:59BlaXpiritif dot notation was something a bit more advanced, then sure
19:47:01Araqfoo.bar() # works
19:47:04ldleworknow I have to import everything I want to
19:47:11BlaXpiritAraq, are you sure it works?
19:47:15ldleworkwhere'as "import foo" gives me foo.bar()
19:47:18ldleworkand foo.baz()
19:47:26AraqI don't think you know how 'from foo import nil' works
19:47:26ldleworkbut I *can't* access "baz" without going through "foo"
19:47:32ldleworkUh yes I do
19:47:33BlaXpiritAraq, maybe.
19:48:05ldleworkIts amazing that in disucssion about a simple feature, where you can sort of enumerate the different potential ways of the feature working
19:48:16ldleworkand the result is like maybe 9 possible different ways the import mechanism works
19:48:25ldleworkwe can't just objectively talk about how they each would work differently
19:48:34ldleworkand not wave our hands and say X is EQUIVALENT to Y
19:48:41ldleworkwhen they're obviously, non-emotionally not equivalent
19:48:45EXetoCthe important will end up not being as documenting, but it still serves a purpose imo. please start a discussion that's more official
19:48:50BlaXpiritAraq, so does import nil actually do what I dreamed it does and i'm full of s**t?
19:48:54EXetoC*import
19:48:55*Puffin quit (Ping timeout: 256 seconds)
19:49:07AraqBlaXpirit: I don't know. try it.
19:49:29BlaXpiritno, it doesn't
19:49:33ldleworkEXetoC: its a waste of breath at this point
19:49:38BlaXpiritError: undeclared identifier: 'vertical_sync_enabled='
19:49:42BlaXpiritwindow.vertical_sync_enabled = true
19:49:55*BitPuffin quit (Ping timeout: 255 seconds)
19:49:58Araqldlework: write some document about how you want the feature to work.
19:49:58*superfunc quit (Ping timeout: 246 seconds)
19:50:03EXetoCirc discussions can only be so productive
19:50:12ldleworkokay okay
19:50:21Araqldlework: post it on the forum. everybody agrees with you, I give up and implement it.
19:50:28AraqThis is how it works.
19:50:39ldleworkhehe
19:50:56Araqbut I die a little inside :P
19:51:02BlaXpiritAraq, so my point remains that import nil is useless
19:51:14ldleworkAraq: haha
19:51:21Araqand think my language of dreams is now gone and I'm reinventing C#
19:51:25BlaXpiritbecause it doesn't carry the procs necessary to do dot calls
19:51:43ldleworkAraq: oh come on
19:51:56ldleworkNow you're just trying to make me feel bad :(
19:52:12Araqlol, no, no, it's fine
19:52:31Araqeverybody complains about it, so let's add yet another import feature
19:52:51EXetoCactually I don't care either way. collisions should be rare unless the module authors implement things like "proc doStuff[T](x: T)"
19:52:52ldleworkWell, to be fair, I think in the way I've mentioned, that the current system is a subset
19:53:02ldleworkSo its not like you lose anything
19:53:03Araqit's not like we already have more features delegated to that than anybody else
19:53:09ldleworkall "import foo" becomes "from foo import *"
19:53:13ldleworkits not that big of a change
19:53:15EXetoCfrequently that is
19:53:19ldleworkAnd we allow people who want actual namespaces to have them
19:53:25*tani joined #nim
19:53:43ldleworkI don't think "I don't imagine it being a problem" should be our baseline
19:53:59ldleworkThis *is* the same argument to Golangs "Well I get by just fine without X"
19:54:01ldleworkWell great.
19:54:19Araqit's more like "it's not a problem for me, never was, never will be and if you care too much you have too much time"
19:54:29*tane is now known as Guest45758
19:54:29*Guest45758 quit (Killed (asimov.freenode.net (Nickname regained by services)))
19:54:29*tani is now known as tane
19:54:31Araqbut ok, I'll stop now.
19:54:36ldleworkAraq: now apply that to generics
19:54:50EXetoCI think it's mostly a problem for operators, so one could support it for that only, but that incurs additional complexity
19:55:05ldleworkEXetoC: generics in golang? or imports in nim?
19:55:48ekarlso-so how does parseInt work ?
19:56:32*gour quit (Remote host closed the connection)
19:56:33EXetoCldlework: nim
19:58:20EXetoCan alternative could be to add support for actual member functions. the question is once again whether it's something that has been officially requested :p
19:58:29Araqif a peg operation has the Peg type as its 2nd parameter, does your "obvious" type based import mechanism account for that?
19:59:18Araqand how exactly is escapeForPeg(s: string): string "polluting" your namespace when you import pegs?
19:59:39Araqand what IS the obvious type that os.nim deals with?
20:00:09*milosn quit (Remote host closed the connection)
20:00:23EXetoCwould you not approve of this: "from x import foo.*, doPegStuff"?
20:00:57Araqjust some questions to consider in your proposal.
20:01:09Araqnot meant as a rant.
20:01:34flaviuI'm not against the specific idea, but I don't like the idea of making things more complex than they already are.
20:02:08EXetoCok
20:02:38flaviuIf a module contains procs not for a specific type, that seems like an issue with the organization of the library, not an issue that the language needs to solve.
20:02:40*milosn joined #nim
20:02:46*BlaXpirit_ joined #nim
20:03:59ldleworkAraq: obviously not all names are equally collidable
20:04:16BlaXpirit_guys, this is all great but you seem to be forgetting that this will remain a problem:
20:04:19ldleworkAnd collision isn't the only benefit of namespaces
20:04:20BlaXpirit_[:34:51] <BlaXpirit> sprite.rotation = 45 becomes...... sf.`rotation=`(sprite, 45)
20:04:52*BlaXpirit quit (Ping timeout: 250 seconds)
20:04:52ldleworkBlaXpirit_: that's not really a problem
20:04:55BlaXpirit_why/
20:05:02ldleworkBlaXpirit_: because there is no such thing as sprite.rotation
20:05:08ldleworkthere is only sf.rotation=
20:05:08*jpoirier quit (Quit: Leaving)
20:05:17ldleworkwell
20:05:22ldleworkattribute was a bad example
20:05:42ldleworkbut what I mean is, "yeah, you need to import the method that you're calling"
20:05:49ldleworkno matter what syntax sugar you use to call it
20:05:53BlaXpirit_import them all one by one?
20:06:06BlaXpirit_(if that even works)
20:06:09EXetoCthat issue is indeed very similar
20:07:20skyfexHow do I run the compiler tests?
20:07:33ldleworkBlaXpirit_: its true, I see what you mean
20:07:56BlaXpirit_so can we all agree now that from x import nil is useless in the current state?
20:07:57ldleworkBlaXpirit_: if you have a nimport like "import foo" which imports a namespace foo, you can't implicitly get foo.rotation= by doing a sugar assignment with "sprite.rotation"
20:08:00ldleworkI get the problem now
20:08:04EXetoCskyfex: see the output of ./koch
20:08:51skyfexEXetoC: thanks :)
20:12:19*Sphax_ joined #nim
20:12:21ekarlso-.eval parseInt("16")
20:12:47EXetoCthe bot is not here atm
20:13:09BlaXpirit_:<
20:13:13flaviu1 sec
20:13:23ekarlso-...
20:13:43*Mimbus joined #nim
20:13:44*Mimbus quit (Remote host closed the connection)
20:13:53*Mimbus joined #nim
20:13:56ekarlso-.eval parseInt("16")
20:14:01ekarlso-still dead huh
20:14:07*Sphax_ quit (Client Quit)
20:14:09*Mimbus quit (Read error: Connection reset by peer)
20:14:17flaviuit should be in soon
20:14:40AraqBlaXpirit_: tbh I still think you're all complaining that the language is more consistent in its handling of these things than you are.
20:14:46dts|pokeballim giving up on Moe flaviu
20:15:00BlaXpirit_Araq, no, I'm complaining that from x import nil is useless
20:15:06BlaXpirit_[:34:51] <BlaXpirit> sprite.rotation = 45 becomes...... sf.`rotation=`(sprite, 45)
20:15:15Araqyes, just what you asked for.
20:15:21dts|pokeballBlaXpirit_, how is it useless?
20:15:35ldleworkdts|pokeball: by useless he means "doesn't cover this case"
20:15:35Araqyou want explicit, the language teaches you what explicit truely means.
20:15:41ekarlso-how does parseInt work then ?
20:15:44*Mimbus joined #nim
20:15:51BlaXpirit_no, I asked to access stuff directly, but if I use dot notation, lookup relevant procs
20:16:01flaviuekarlso-: there it is
20:16:24def-.give ekarlso- import strutils; var x = parseInt("16"); echo x
20:16:24ekarlso-.eval parseInt("16")
20:16:27Mimbusekarlso-: 16
20:16:30Mimbusekarlso-: eval.nim(3, 8) Error: value of type 'int' has to be discarded
20:16:49dts|pokeballldlework, ah
20:17:00ldleworkekarlso-: https://github.com/Araq/Nim/blob/devel/lib/pure/strutils.nim#L416
20:17:07BlaXpirit_[:41:41] <BlaXpirit_> Mimbus, you should just write out a value if it "has to be discarded"
20:17:16ARM9is there some way to tell nim what compiler to use without messing with system configs?
20:17:21flaviuBlaXpirit_: It's not that easy.
20:17:21BlaXpirit_wait, it does now? cooool
20:17:26ARM9like with a makefile
20:17:36def-ARM9: nim --cc:clang c file
20:17:37BlaXpirit_no, that was 2 overlapping requests to it
20:17:51ARM9def- so I can do --cc:arm-none-eabi-gcc for example
20:17:57BlaXpirit_flaviu, what about... wrapping the stuff in a function
20:18:00ARM9I'll check it out, cheers
20:18:00ldleworkflaviu: interpret the error, if it has "has to be discarded", rerun the last compilation slightly modified
20:18:12BlaXpirit_yeah.. or that
20:18:33Araqflaviu: disable Mimbus or make it work in a way that's not embarrassing to all of us
20:18:43def-ARM9: nim --gcc.exe:arm-none-eabi-gcc
20:18:55ldleworklol
20:18:57def-ARM9: or in $NIM/config/nim.cfg
20:18:57EXetoCldlework: or.. write a macro \o/
20:19:07ARM9the latter is what I didn't want
20:19:09ARM9but thanks
20:19:09ldleworkoh yeah!
20:19:12AraqARM9: just use a project specific nim.cfg file
20:19:31ARM9nah
20:19:35ARM9I'd prefer using a proper build system
20:19:44dts|pokeballits not a build system...
20:19:48ldleworkwat
20:19:54Araqand by that you mean "make"? you're a funny guy.
20:20:03dts|pokeballmake is terrible
20:20:10ARM9there there lads, no need to be so passive aggressive
20:20:12dts|pokeballi thought i liked it, then i read the make manual
20:20:19ARM9too bad
20:20:43ldleworkmake is nice when you need some simple thing
20:20:48dts|pokeballsays the guy that doesnt know the difference between a build system and a config file ;)
20:20:52flaviuIt would be nice if nim respected $CC
20:20:59ARM9there you go being passive aggressive again dts
20:21:08def-ARM9: you'll also need --gcc.linkerexe:arm-none-eabi-gcc
20:21:17dts|pokeballyeah ldlework i agree, but I still like cmake
20:21:33dts|pokeballi dont think that word means what you think it means ARM9
20:21:33ldleworkdts|pokeball: I don't know the various different ones
20:21:35flaviudts|pokeball: Get to work on the bot!
20:21:42dts|pokeballD: OK OK
20:21:50dts|pokeballsomeone find me a fucking sandbox!
20:21:50ARM9it means exactly what I think it means
20:21:50EXetoCI would at least try using only a cfg at first, but there's also "nake", which is a little minimalistic, but it does provide some additional functionality
20:21:56Araqguys, ARM9 is right. let's calm down please.
20:22:15*Mimbus quit (Remote host closed the connection)
20:22:31EXetoCAraq: if indeed it does compile. either search for it using nimble, or clone this repo: https://github.com/fowlmouth/nake.git
20:23:01AraqEXetoC: you don't mean me.
20:23:28EXetoCARM9*
20:24:14ekarlso-packages.nim(49, 24) Error: type mismatch: got (string)
20:24:17ekarlso-parseutils.parseInt(s: string, number: var int, start: int): int
20:24:19ekarlso-hmmms
20:24:28ekarlso-aint I giving it a string dammit ?
20:24:48ldleworkekarlso-: parseutils != strutils
20:24:59ekarlso-ohhhh
20:25:40dts|pokeballalthough strutils does import parseutils doesnt it?
20:25:57EXetoCit would also have to export it
20:26:13dts|pokeballoh right
20:26:15EXetoCdts|pokeball: it does actually
20:26:18EXetoChm
20:27:59AraqEXetoC: it doesn't
20:28:18ldleworkAraq: he means it imports it, not that it exports it
20:30:17EXetoCnimble must be importing it
20:30:24EXetoCnimbus
20:30:26EXetoCbah
20:31:57dts|pokeballi believe nimbus imports strutils yes
20:32:01dts|pokeballto find ;'s
20:32:16*goobles joined #nim
20:33:27EXetoChe didn't even eval it this time :p
20:33:38dts|pokeballeval what?
20:34:39*MrBlaise left #nim (#nim)
20:36:38no_nameVarriount_: I figured out the cause of the crash - my code was causing zlib to barf because I asked for too much memory
20:36:52flaviuWho was having trouble with segfaults?
20:37:11flaviuYou have to use -fsanitize=... for linking too, that's the reason it failed
20:38:53*shevy left #nim ("I'll be back ... maybe")
20:38:56*Grauwolf joined #nim
20:44:22*BlaXpirit_ quit (Quit: Quit Konversation)
20:44:39*BlaXpirit joined #nim
20:50:32*superfunc joined #nim
20:51:32*phira joined #nim
21:06:53*grumio2 joined #nim
21:07:36ekarlso-yay
21:07:40ekarlso-working package index !
21:10:56*Mat4 joined #nim
21:11:02Mat4hello
21:11:16dv-hi
21:12:01Mat4hi dv-
21:12:21dts|pokeballhi
21:13:31*Demos joined #nim
21:16:17*yglukhov__ quit (Ping timeout: 240 seconds)
21:16:54*yglukhov__ joined #nim
21:18:57Mat4happy new year to all (ok, it's a bit late)
21:19:36superfuncyou too dude
21:19:43BlaXpirityear is still quite new...
21:21:20ldleworksuperfunc: are we getting a wired article?
21:21:42superfuncwaiting to see them email me back
21:21:52superfuncI'll ping the irc if/when it happens
21:22:42dv-I noticed that the online docs don't have the export * in them but mine do. how I do that?
21:23:27EXetoCdv-: you mean, none of the listed symbols are annotated with *?
21:23:44dv-yes
21:24:07EXetoConly exported symbols will appear, so it's omitted
21:24:36dv-well if it's on the docs then it's exported
21:24:44ldleworkdv-: that's what EXetoC is saying
21:25:16dv-i have stars in my docs
21:25:42ldleworkdv-: using the latest versions of everything?
21:26:29dv-dunno. how do i update? i did git pull; ./koch clean; ./koch ./koch boot -d:release -d:useGnuReadline
21:26:31dv-is that enough?
21:26:32EXetoCdv-: did you use doc2 rather than doc?
21:27:03BlaXpiritguys, what ever happened to that new amazing searchable documentation someone has been working on?
21:27:24ldleworkits calle ctrl-f
21:27:24dv-EXetoC: oh i see
21:27:26ldlework:)
21:27:27EXetoCI never did run 'clean'
21:28:03dv-now it's not wrapping the proc lines any more though
21:28:21dv-instead i get an ugly horizontal scrollbar
21:28:50*coffee` quit (Read error: Connection reset by peer)
21:29:19AraqBlaXpirit: the guy who worked on it is very busy, and instead we only got a CSS update and content improvements, no search, no "type based" view
21:29:24BlaXpiritok
21:29:42*gokr1 joined #nim
21:29:56Araqbut hey, at least we improved it. though dv- seems to disagree. :-)
21:30:24EXetoCevery community has its scrollbar haters
21:30:52dv-i'm viewing it on a 1280x1024 screen :p
21:31:01BlaXpiritEXetoC, nim doc2 doesn't work D:
21:31:17BlaXpiritplease try to use it on your machine with nim-git
21:31:46*nimnoob123 joined #nim
21:33:20BlaXpiritmaybe i'm just doing something very wrong
21:33:32*superfunc_ joined #nim
21:33:41BlaXpiritnim doc works
21:33:43nimnoob123dumb question is nim still called nimrod or is it just nim or nimlang? I ask because projects on github are listed on Nimrod and I just realized when trying to find existing projects to see real usage of the language
21:33:59def-nimnoob123: just Nim
21:34:21ekarlso-is there a datetime type in nim ?
21:34:22EXetoCBlaXpirit: I'll look into it. it looks for ../doc/....
21:34:40def-ekarlso-: http://nim-lang.org/times.html
21:35:37*chrisheller joined #nim
21:35:46ekarlso-hmm, which one to match the DATETIME in mysql ?
21:35:47nimnoob123def-: thanks
21:36:07*superfunc_ is now known as superfunc[mobile
21:36:41nimnoob123def-: i remember you now, from /r/programming posted the update there about the new version
21:36:42*chrisheller quit (Remote host closed the connection)
21:38:02gokr1More than 100 people here, a first or?
21:38:39Araqif yesterday doesn't count, yes
21:38:46BlaXpiritthis is a stat that should be tracked :o
21:38:46def-ekarlso-: you'll have to format the time to a string I guess, but not sure what you're doing
21:39:07AraqBlaXpirit: we do.
21:39:10BlaXpiritcool
21:39:13BlaXpiritit seems increasingly likely to me that I'll have to roll with something other than nim doc
21:39:22nimnoob123having fun learning the lang
21:39:25EXetoCsee the subtle link in the topic
21:39:34*chrisheller joined #nim
21:39:41*Trustable quit (Remote host closed the connection)
21:39:43BlaXpiritahhhhhhhhh I was just wondering today xD
21:40:07BlaXpirit:53:44 BlaXpirit and what the heck is that git.io link
21:40:56nimnoob123irc's more active than the subreddit on reddit, guess i'll post simple questions here for now or the forums
21:41:11*Demos_ joined #nim
21:41:50Araqwell that's likely my fault. I'm on irc and on the forum and nowhere else.
21:42:35Araqbut it's distracting enough already
21:42:48dom96superfunc: awesome
21:42:48nimnoob123;p
21:44:13*Demos quit (Ping timeout: 255 seconds)
21:46:34nimnoob123last noob question for now are the optional parenthesis used as (soft) blocks only available for procedures (and I'm assuming methods) ex.: http://pastie.org/9810065 ? I only came across the topic of it's usage once on the by-example tutorials
21:47:14nimnoob123which was maybe a sentence talking about them, couldn't find any information anywhere else
21:47:41flaviunimnoob123: Those aren't really blocking
21:47:43flaviuit's more a hack
21:47:58ekarlso-https://bpaste.net/show/e061a319454f < that format ok ?
21:48:02flaviuparentheses allow you to create an expression that spans multiple lines.
21:48:23nimnoob123right
21:48:48flaviuHmm, I shouldn't have mentioned that in nim-by-example.
21:49:54*grumio2 quit (Quit: Lost terminal)
21:50:31EXetoCekarlso-: yes
21:50:42nimnoob123flaviu: will there ever be some form of optional blocking in a similar manner? just so used to using brackets and what not when writing c++/c#
21:50:47EXetoCI'd personally cram more things into individual lines, that's all
21:50:55ekarlso-EXetoC: like ?
21:51:44jsudlowwhat is the proper way in nim to stop execution of a program with a normal exit code?
21:52:41flaviunimnoob123: In the early days, block syntax was on the todo list, but it got dropped. I don't think it's likely it'll be added any time soon.
21:53:09*ARM9 left #nim ("swi 0x00")
21:53:12nimnoob123flaviu: alright, thanks for the help.
21:53:40def-jsudlow: just let it run to the end of the file? or quit()
21:53:56*Demos_ quit (Ping timeout: 244 seconds)
21:54:16jsudlowdef: I'm contributing a little bit of code in making a nim game and I need to quit the program when the user hits the quit button
21:54:22*jpoirier joined #nim
21:54:41def-jsudlow: ok, quit() is fine then
21:54:46jsudlowdef: cool thx
21:54:47*Demos_ joined #nim
21:55:14*Varriount|Mobile joined #nim
21:55:22*Puffin joined #nim
21:56:04EXetoCekarlso-: "'foo': [..." and "}, { <newline> ..."
21:56:16*fabiok joined #nim
21:56:33ekarlso-EXetoC: sorry ?
21:56:49ekarlso-EXetoC: I meant the format of the json a'la the keys needed etc to get smth like nimble working
21:57:09ehaliewiczi'm gonna pretend nim is still called nimrod
21:57:16ehaliewiczas long as #nimrod redirects :)
21:57:27EXetoCok I was just engaging in some bikeshedding again
21:57:51Araqehaliewicz: the URL should be valid for another year
21:58:23ekarlso-Araq: what u think?
21:58:41Araqekarlso-: what's the question again?
21:58:50ekarlso-https://bpaste.net/show/e061a319454f < that format ok for smth like nimble ?
21:59:10*fabiok quit (Client Quit)
21:59:25Araqshould be. nimble uses a real parser
21:59:29ehaliewiczAraq: great :)
21:59:40ekarlso-Araq: real parser ?
21:59:59*viralata joined #nim
22:00:07Araqa parser that parses JSON and ignores whitespace
22:00:21AraqI guess I don't understand your question
22:00:26ekarlso-Araq: I meant the releases part of it sorry
22:00:57Araqdom96: help ekarlso- please
22:01:25ekarlso-Araq: he who wrote the tool ?
22:02:25dom96hrm? what's the problem?
22:02:41ekarlso-dom96: trying to make tghe package app json usable for something like nimble
22:02:45ekarlso-https://bpaste.net/show/e061a319454f < that format ok for smth like nimble ?
22:02:51ekarlso-as in if the data is "ok"
22:03:28dom96sure i guess
22:03:58dom96releases won't be read by nimble though
22:04:09ekarlso-possible to make it do that ?
22:04:48dom96sure
22:05:17Araqisn't that re-implementing git tags though?
22:06:10ekarlso-Araq: well, pypi works also by being able to publish tarballs..
22:06:18dom96i'm assumming ekarlso-'s will track them
22:06:27dom96*ekarlso's website
22:06:30*tgkokk quit (Quit: Textual IRC Client: www.textualapp.com)
22:06:43ekarlso-can't you have a proc without a return ?
22:06:55*tgkokk joined #nim
22:07:04*tgkokk quit (Client Quit)
22:07:32EXetoCekarlso-: yes, and you need at least one statement
22:07:44EXetoCuse 'discard' as a placeholder
22:07:58*tgkokk joined #nim
22:10:08dom96ekarlso-: don't worry about the format, we can always adjust it easily
22:10:59ekarlso-;p
22:11:42wtwhi, I'm just reading about the quirks of Java's checked exceptions. I'm not yet familiar with nim's exception system, but how is Java's "mess" avoided here?
22:12:12wtwI understand checked exceptions don't _have_ to be caught?
22:13:08wtwotoh, there is no Option<T> type or default tuple return values or is there?
22:14:29*Dispatch joined #nim
22:18:08ekarlso-hmmm
22:18:11ekarlso- pkg["tags"].elems
22:18:21ekarlso-is that how u access the elements in a js array ?
22:18:42Araqwtw: it's avoided by having a better default and smarter inference
22:19:09Araqthe default being "oh shut up, I don't care"
22:19:38Araqand then when you opt-in for the additional checking it's there for you
22:20:47wtwah, thx
22:20:50AraqJava's mistake is that when I write no "throws" that it means "throws nothing".
22:21:01AraqIn Nim it means "I don't care".
22:21:07ldleworknice
22:22:01*chrisheller quit ()
22:25:30nimnoob123Araq: how many people are actively working on Nim? main contributors
22:25:42ldlework~4
22:25:57ldleworkis my count
22:26:00nimnoob123dang, just 4
22:26:06nimnoob123that's cool
22:26:55ekarlso-hat does it mean when it says named expression expected ?
22:27:18flaviunimnoob123: https://github.com/Araq/Nim/graphs/contributors
22:27:32ldleworkflaviu: nice
22:27:36nimnoob123flaviu: thanks
22:27:44ekarlso-var release = Release( < on a line like that
22:28:24EXetoCare you doing this Release(x=y) rather than this Release(x:y)?
22:28:43ekarlso-ah, I had a sneaked in =?
22:28:57EXetoCyep, common mistake
22:29:31ekarlso-ok, time to go to work on the angular app...
22:30:32*tane quit (Quit: Verlassend)
22:31:27*tgkokk quit (Ping timeout: 244 seconds)
22:32:26*gokr1 quit (Quit: Leaving.)
22:33:14Araqwtw: Option[T] is pretty simple to write too and we also have tuples and in fact
22:33:43Araqwe improve upon "return value based error handling" with the requirement of having to use 'discard'
22:34:33Y0Gi_Araq: I don't think 'discard' solves the same problems as Option does.
22:35:07AraqY0Gi_: no, but it is related.
22:35:15Y0Gi_I'd second a request for an Option type as libraries could pick it up as a standard way of doing such things
22:35:36BlaXpiritguys, what's the status on documentation comments?
22:35:46BlaXpiritdo they work already and where should I put them?
22:36:01BlaXpirit(manual only says "they're allowed only in certain places")
22:36:03AraqBlaXpirit: they work and it's documented somewhere where to put them
22:36:34BlaXpiritnot in manual, it looks like :|
22:36:39skyfexAraq: https://github.com/Araq/Nim/issues/936 -- If you pass int16 to `$` it selects proc `$`(x: int) rather than proc `$`(x: int64) even though int64 is convertible to both.. do you remember where in the compiler this special selection is implemented?
22:36:56Araqskyfex: sigmatch.nim
22:37:20Araqand this is the way it should work
22:37:32Araqthat's not a bug what you describe here
22:38:51*jefus_ joined #nim
22:40:35ldleworkhttps://github.com/rust-lang/rust/blob/master/src/test/run-pass/html-literals.rs
22:41:41skyfexAraq: well shouldn't uint8 be implicitly convertible to int16 and up? If so I need to implement a similar logic there
22:42:49*jefus quit (Ping timeout: 244 seconds)
22:43:56Araqskyfex: yeah, try that
22:45:05skyfexThink I found it out.. :)
22:45:48AraqI still wonder how I will be able to turn that thing into a spec
22:46:25nimnoob123is it normal that if you name a file after a keyword that it won't compile? for example I was testing the varargs example from the tutorial and named the file in my examples folder "varargs.nim" and it spit out a ambitious identifier error use a qualifier
22:46:53ldleworknimnoob123: :/
22:47:30Araqnimnoob123: the module name is useful for module.foo access
22:47:37BlaXpiritdocumentation comments for enums don't work?
22:48:08AraqBlaXpirit: just look at os.nim of how to do it
22:48:16wtwThe problem I see with Java checked exceptions is that they are a workaround for the lack of two return values (be they implemented via Option[T] or via something else)
22:48:20*gokr1 joined #nim
22:48:32nimnoob123I see. was just curious
22:48:51wtwand if something on a very low level throws something and I want to catch this something e.g. three levels higher every layer inbetween has to write "catch (something)"
22:48:52BlaXpiritAraq, I want multiline doc comment for enum
22:49:02wtwi.e. clutter :)
22:49:38wtwusing an Option[T], Result[T] or something else alleviates this
22:50:17Araqhow do you get a stacktrace with your precious Option[T]? ;-)
22:50:37wtwthat's right :) I don't want to argue too much in favor of Option
22:50:44Araqhow come Haskell - the king of monads - has exceptions?
22:51:21wtwthere is also another problem: you get another kind of clutter, namely a cascade of Option[] checks
22:51:31wtwwhich has to be dealt with monad stuff :/
22:51:46Araqyeah, but the performance implications remain
22:51:53wtwsure I concur
22:52:30wtwI don't want to come across as a proponent of Option[T] (probably already too late :D) but just wanted to know your stance on it
22:53:11AraqI usually prefer the hasKey/getKey pair where getKey returns a reasonable default
22:53:54Araqand I usually don't have to call hasKey at all
22:54:13wtwI find this also the most straightforward and useful approach
22:54:23ldleworkin python: v = d.get('name'); if v is not None: do_something()
22:54:49wtwah btw: do you plan to include higher-kinded types/generics of generics/monads? or is this already included?
22:56:07ldleworkgenerics of generics
22:56:10*ldlework 's head spins.
22:57:28dom96ldlework: we need to go deeper :P
22:57:36wtwldlework: it's not that dizziness-inducing actually: https://stackoverflow.com/questions/2565097/higher-kinded-types-with-c
22:57:38Araqha, I don't know! I remember zahary worked on it.
22:58:12*Dispatch quit (Quit: Page closed)
22:58:13wtwnot that I need/want it, just for information :D
22:58:26Araqplan is definitely to have them one day. unlikely for version 1 though. but maybe I should be more optimistic.
22:58:51wtwok :) rust hast the same plan, iirc
22:59:16wtwI find it quite difficult to maintain a balance between genericity and simplicity
22:59:25*Mat4 left #nim (#nim)
22:59:51wtwscala is a bad example for simplicity imho ;)
23:00:16ldleworkwtw: I find that genericity leads to the most simple code, in a sense
23:00:35Araqwtw: currently the stdlib repeats the proc headers for SingleLinkedList[T] and DoublyLinkedList[T] but the implementation delegates to a common template
23:00:48Araqthis is not too nice, but not too bad either
23:01:30wtwldlework: i guess this is true for one layer at a time, but additional genericity increases the 'intellectual' load, i.e. I don't exactly know what/how my functions are doing something anymore
23:01:52wtwAraq: ah, I see, interesting
23:02:56ldleworksure but that's true for normal functions too
23:04:27wtwI've followed the development of scala a little and in the beginning I found the abstractions quite useful. however, if your language is powerful like Scala, you tend to have people in the community who are able to generalize over everything
23:04:49wtwwhich is reasonable from their point of view, but too complicated for me ;)
23:05:02wtwsee e.g. tony morris's blog (https://tonymorris.github.io/blog/)
23:05:37*renesac joined #nim
23:05:52wtwhowever, I also prefer to write foo.map( * 2) instead of writing a for loop myself
23:05:59ldleworkwtw, without referring to an external authority do you agree with my reasonning that the same is true for normal functions?
23:06:12ldleworkwtw, you have to know what a function does in order to know what it does
23:06:17ldleworkthe same goes with generics and macros
23:06:19wtwI guess so
23:06:33ldleworkanyone can write confusing and dense generics, macros, or functions
23:07:40wtwsure, however certain languages seem to foster complexity somehow, haskell and scala being examples
23:08:22ldleworkwtw, I was waiting for you to make the point that macros and generics can do things that normal functions can't do
23:08:32ldleworkso when you are looking at a function, you can guess at least to the range of things it might do
23:08:43ldleworkwhen you're looking at a macro invocation it could literally be doing anything
23:09:05ldleworkBut then I was going to say that merely knowing the range of things your non-macro language can do doesn't really give you insight as to what a function is doing
23:09:11ldleworksince the things the core language can do is still a lot
23:09:44ldleworkso you still have to look at the definition
23:11:20wtware you referring to nim specifically now?
23:13:42BlaXpiritthis looks totally awesome! http://blaxpirit.com/t/csfml_graphics_gen.html#=,CircleShape,cfloat
23:13:45ldleworkNo I'm speaking generally about the alleged obsfucation that meta-programming is purported to inherently have
23:14:02ldleworkBlaXpirit: nice
23:14:07def-BlaXpirit: wow, with documentation!
23:14:08BlaXpiritand I didn't write a single word of these docs :p
23:14:19BlaXpiritall parsed from c headers
23:14:21ldleworkBlaXpirit: woah it stole them from the c lib
23:14:23ldleworknice!
23:14:24BlaXpiritbut omg is the code kludgy
23:14:44BlaXpiritit's kludges upon kludges
23:15:09BlaXpiritbut users won't have to deal with the kludgy code, they'll just see the nice pregenerated things :p
23:16:13ldleworkBlaXpirit: what has kludges?
23:16:23BlaXpiritthe Python code that I used to generate all this
23:16:43dom96BlaXpirit: awesome! Now rewrite the generator in Nim ;)
23:16:53BlaXpiritno.
23:16:56BlaXpiritit's not needed
23:16:59def-and in a way so it can be used for all wrappers!
23:17:14BlaXpiritnah, it's all hardcorely hardcoded
23:17:20BlaXpiriti rely on nice format that sfml gives
23:17:20Araqc2nim could do it.
23:17:27BlaXpiritit would horribly break on anything else
23:17:38def-would be nice to have though, most wrappers don't have documentation unfortunately
23:17:50Araqit already adds C comments into the AST
23:18:03BlaXpirituh cool
23:18:03Araqbut it needs to be able to handly doxygen
23:18:14Araqand of course general polish
23:18:16dts|pokeballso can someone show me an example of how to call this c function in nim: unsigned int alarm(unsigned int seconds); its in unistd.h
23:18:20BlaXpiritbut i'd most likely run into some problem and not be able to modify c2nim to my needs
23:19:25def-dts|pokeball: proc alarm(seconds: cuint): cuint {.header: "<unistd.h>".}
23:19:25flaviudts|pokeball: run that through c2nim, see what comes out
23:19:40AraqI'm working on a general pre and post processing step for c2nim
23:20:13Araqwell ... I'm playing with some ideas in my head
23:20:15def-Araq: sounds useful, i always did pre- and post-processing by hand with c2nim
23:20:27Araqdef-: everybody does. :-)
23:21:18def-hm, can't install c2nim with nimble
23:21:25def-"nim not found in local packages.json"
23:21:47Araqnimble does not know about 'nim'?
23:21:52def-apparently not
23:21:56AraqI changed it today
23:22:26Araqadded simply stuff like c2nim config.c2nim fileA.c fileB.h fileC.c
23:22:38Araq*simple stuff
23:22:52def-hm, same error when i try to use nimble to update itself
23:23:09def-after a manual update it works
23:23:13dts|pokeballthanks def, flaviu
23:23:34wtwldlework: sorry, quite busy currently, please excuse the delay - I was thinking of additional layers of abstraction usually induced by metaprogramming. these tend to increase my 'cognitive load' or at least I had the impression when programming Haskell or Scala. I don't think there is an inherent difference in legibility of meta-languages or the programming language itself. however, by generalizing over larger structures (which meta-programming facilitates) it's po
23:23:41wtwarg
23:23:42wtwi should really split my messages, sr
23:24:15def-dts|pokeball: alarm already exists in the posix module btw, but I think its type is wrong
23:24:17wtwof course everyone is free to obfuscate using just functions ;)
23:24:27dts|pokeballdef-, good to know
23:24:36wtwbut I feel obfuscation gets easier as soon as you have access to monads an the likes
23:25:28BlaXpiritI think nim doc should handle `include`...
23:25:38AraqBlaXpirit: doc2 does
23:26:03BlaXpiritit doesn't seem to work on my system :|
23:26:13def-i'll try to fix a few includes in posix.nim
23:26:22def-a few procs*
23:26:46EXetoCAraq: it does look for some txt files in a relative directory
23:27:11ldleworkwtw, sure my general point was that functions create additional layers of abstraction in the exact same way
23:27:33EXetoCwait
23:27:56ldleworkwtw: and further, in the same way that macros creating abstractions can make somethings really high-level and nice to use, or make things complicated and hard to understand - the same is true for functions
23:28:05dts|pokeballhow would i do signal handling in nim?
23:28:30ldleworkSo I think the long-term implication that metaprogramming has this inherent problem is overblown by people suffering from having to work with other people's badly-written utilization of meta programming facilities
23:28:53Araqldlework: no, not in the exact same way. ;-) functions create abstractions that have a runtime representation
23:29:11EXetoCAraq: right, my package does not put those files there, cus unix hierarchies and all that
23:29:30AraqEXetoC: what is 'it'?
23:29:43EXetoCdoc2
23:29:55EXetoCmaybe I should put everything in /opt
23:30:30renesachi, I've never been in this channel before
23:30:33renesac:)
23:30:52BlaXpiritEXetoC, that's scary
23:31:09BlaXpiritask for a fix
23:31:20BlaXpirit(and thanks for your work)
23:31:27BlaXpiriti wonder what the official maintainer is doing
23:31:31def-dts|pokeball: I've only done this, for more advanced ones you have to go down the posix hole i think: https://github.com/def-/nim-unsorted/blob/master/signals.nim
23:31:37EXetoCyeah
23:32:02ldleworkAraq: what's the consequence of that observation?
23:32:05def-welcome renesac
23:32:37dts|pokeballhandler, so your code tells the time whenever someone hits ctrl + c?
23:32:40renesacok, it seems I will need nimfix
23:32:50ldleworkhi renesac
23:32:52*chrisheller joined #nim
23:32:56renesacbut first, download the new compiler
23:33:02EXetoCAraq, BlaXpirit: I found a related bug report
23:33:11dts|pokeballthe new compiler fixes all the bugs ive found :(
23:33:26renesacwill nimfix work on 0.9.4 code?
23:33:29Araqldlework: with a macro system you strive for function like behaviour when it comes to local variables at least.
23:33:51EXetoCdts|pokeball: oh :\
23:33:53Araqrenesac: it should work even better than with 0.9.6 code
23:33:58ldleworkAraq: you mean so that macros cannot inject local variables into the callsite?
23:34:19dts|pokeballEXetoC, yeah :/ i thought i was smart, and it turns out im just behind
23:34:51Araqldlework: no I mean that every macro instantiation gets a fresh set of locals. "Hygiene" is the keyword.
23:34:57ldleworkah
23:35:08Araqor 'gensym'
23:35:52renesacAraq, your greetings bot is not working anymore?
23:35:59EXetoC:p
23:36:27def-Araq: I'm wondering why in the posix module all kinds of int types are wrong
23:36:44renesacthe forum seems very active now
23:37:10Araqrenesac: it collapsed under 100 users
23:37:25renesacI don't remember the record number of users on the old channel, but I think it was about 60
23:37:25renesacheh
23:37:37ldleworkAraq: huh I wondered how you so consistently greeted new people
23:37:57flaviurenesac: 80 actually
23:38:00ldleworkI thought you were just a very caring and friendly BDFL
23:38:02flaviuhttps://gist.github.com/dom96/da2d4dead6fb00b71312/revisions
23:38:04ldlework:)
23:38:05Araqdef-: I wrap unsigned types as signed
23:38:42Araqbecause I know it doesn't matter and unsigned is viral
23:39:16def-oh, so that's intentional. what about using "int" in Nim when it's a "long int" in C, is that guaranteed to work?
23:39:23renesacheh, the last record I was around was 71
23:39:55Araqdef-: no.
23:40:41wanrenesac: let's party like it's 99
23:40:53def-Araq: can't fix this in all 3000 lines by hand
23:41:31Araqdef-: then it's fine. it only breaks for Win64
23:41:40renesacand I'm back because of unsigneds by the way
23:41:40Araqwhich is not a posix target anyway
23:41:42renesachttps://github.com/Araq/Nim/issues/936#issuecomment-68565981
23:41:46renesac^^'
23:42:00def-Araq: ok, not going to change anything then. thanks for the infos
23:43:24dom96argh
23:44:13Araqskyfex: uint64 literals are not hard to handle at all, just look at the nodes' type field to see how to interpret the bit pattern
23:45:47renesacnimrod is still lacking a bigint library?
23:46:06def-renesac: https://github.com/def-/nim-bigints
23:46:49jpoirierAraq: can you elaborate on your "unsigned is viral" comment?
23:47:21*superfunc[mobile quit (Quit: Connection closed for inactivity)
23:48:22renesacdef-, nice
23:49:07def-and I just discovered converters, should make bigints nicer with them
23:50:16Araqjpoirier: no, I need to sleep. But consider this: C#'s length returns int, not uint for a reason.
23:51:15skyfexjpoirier: There's been some discussions on the forum
23:52:28*foo123 joined #nim
23:52:44*xAndy joined #nim
23:53:33*foo123 quit (Client Quit)
23:53:55*Demon_Fox joined #nim
23:54:11jpoirierAraq: I've never used C# but as an embedded developer doing CRCs, viterbi/convolutional/turbo en/de-coders, and general bit banging I've always used unsigned types
23:54:50jpoirieri'll check out the forum
23:56:07Araqjpoirier: that's a fair point, but I prefer my 'for i in 0..L-3' to work when L == 0.
23:56:42EXetoCit's a very convenient default
23:58:05xAndyhi, i was looking at some nim tutorials and wrote some own code but i'm getting undeclared identifier: 'parseInt'. i use 0.10.2 (2014-12-31) [Linux: amd64]
23:58:59BlaXpirit.eval import strutils; echo parseInt("5")
23:59:13BlaXpiritMimbus, oh, Mimbus...
23:59:29flaviuBlaXpirit: too spammy, you'll have to wait for dts
23:59:31BlaXpiritin any case, xAndy. import strutils
23:59:34xAndyoh strutils. thanks
23:59:40BlaXpiritflaviu, ?
23:59:45BlaXpirit"dts"?
23:59:48skyfexjpoirier: I also find it natural to use unsigned types in those cases.. but thinking about it.. if the value you're working with has no arithmetic interpretation (like in CRC or bitbanging), is it really more natural to use unsigned rather than signed?
23:59:59flaviuBlaXpirit: dts|pokeball