<< 17-02-2015 >>

00:00:13Jehan_I do agree that in the long term, the compiler would benefit from fewer one-letter symbols.
00:01:42gokrJehan_: Lots of Smalltalkers moved to Scala, but.. I am also allergic to the JVM eco system.
00:01:45TEttingergokr, what is Urhonimo?
00:02:05gokrTEttinger: http://forum.nim-lang.org/t/870
00:02:30Jehan_gokr: It's not so much the ecosystem (though I think the JVM tooling is a ridiculous jungle), but the design decisions that enforced upon Scala.
00:02:44*johnsoft quit (Ping timeout: 245 seconds)
00:02:47Jehan_99% of Scala's problems, in my opinion, exists because of Java interop.
00:03:00Jehan_It's still a darn nice language.
00:03:17*yibter joined #nim
00:03:27Araqyeah but only because they copied a decent amount of Nim :P
00:03:28gokrThe latest work on Cog (VM for Squeak/Pharo) may soonish propel it into the vicinity of Java performance.
00:03:30*johnsoft joined #nim
00:03:30Araq(just kidding)
00:04:27gokrJehan_: Cog just got a whole new object memory/gc and they are good on their way to add adaptive optimizations which Eliot thinks should put them in the same ballpark as Hotspot.
00:04:58gokrBut whatever ;)
00:05:16TEttingergokr: clojure uses hotspot too and idiomatic clojure is dog slow
00:05:25Jehan_gokr: That's very nice. It just doesn't fix my one problem with Smalltalk.
00:05:38gokrJehan_: Let me hear it! I can take it!
00:05:46*gokr grabs big fish...
00:05:50Jehan_Which is that image-based development is definitely a love-it or hate-it thing, and I'm pretty firmly in the hate-it camp.
00:05:56gokrHa!
00:06:23Jehan_Otherwise, I have little issue with the language itself.
00:06:26gokrWell, then you should look at Pharo these days. Sure, it has the image - but it also has very nice source code management with git integration yaddayadda.
00:06:58Jehan_In fact, the major reason why I used to program in Ruby so much was that it was the closest thing to "Smalltalk for the commandline" that I could find (other than gst).
00:07:04gokrSo the "dark side" of the image isn't really there anymore. People tend to rebuild them and throw them away quite often.
00:07:09Jehan_gokr: I have a copy of Pharo on my computer.
00:07:15gokrWhich version?
00:07:29gokrIts evolving very fast these days.
00:07:31Jehan_gokr: 3.0?
00:07:51gokrMmm, that's pretty new - although 4 is... around the corner I think.
00:08:03Jehan_What I want is basically the opposite of what Smalltalk is designed around.
00:08:19gokrWhat is that then?
00:08:22Jehan_I.e. a blank slate that I fill in.
00:08:49gokrI wonder if you would find pleasure reading about Ian Piumarta's COLA stuff.
00:09:18Jehan_The other thing is that I like to have my choice of editor.
00:09:23dhasenangokr: COLA? Cache-oblivious lookahead array?
00:09:56TEttingerpiumarta made a bunch of experimental languages, collectively the soda languages
00:10:10gokrTEttinger: Whoa! Impressed
00:10:40gokrJehan_: He has more papers there, but this one I saw him present: http://piumarta.com/papers/DLS-2006-slides.pdf
00:10:51TEttingerhe's been an inspiration to a lot of language writers, apparently
00:10:54Jehan_gokr: But yeah, oddly enough it's the Smalltalk environment that's my issue, not the language (and I do realize all the stuff that Smalltalk has done for IDEs).
00:10:54gokrI think it was one of the first presentations of those ideas.
00:11:07gokrJehan_: The COLA stuff is not Smalltalk.
00:11:26Jehan_gokr: Yes, I was continuing my earlier train of thought.
00:11:31gokrAh, ok.
00:11:58gokrIan wrote the first port of the Squeak VM to Unix etc.
00:12:13TEttingerMaru is a recursive implementation of lisp that performs at something like 30% the speed of optimized C, which is pretty neat
00:12:18gokrHe is ... a bit of a VM genius, but not a finisher ;)
00:12:37gokrYeah, Maru is the latest incarnation of COLA.
00:12:43gokrAFAIK.
00:13:05gokrHe wanted to get rid of the VM - make everything dynamic all the way down.
00:13:21gokrOh well, its pretty cool stuff.
00:14:08Jehan_gokr: As far as speed is concerned, I generally need considerably less than, umm, "C hand-coded by an omniscient deity", so I'm pretty flexible as far as implementations go, and don't really need a hugely optimized VM. I frequently run Nim code with all checks turned on during production, too.
00:14:26gokrThose slides included the 400 line js implementation that was faster than Firefox at the time.
00:15:38gokrthe fun part is that the language "creates itself" when you start it up. Almost like... you know Steele's legendary presentation?
00:15:53gokrgrowing a language I think it was called.
00:19:56gokrAraq: I pushed huge.nim to gitlab, it doesn't compile ;)
00:20:23gokrBut its "ported" AFAICT, modulo the usual slab of bugs
00:26:53*Trustable quit (Remote host closed the connection)
00:37:33*infinity0 quit (Remote host closed the connection)
00:39:58*gsingh93 joined #nim
00:41:39*Sharcho joined #nim
00:47:38Mat4ciao
00:47:44*Mat4 quit (Quit: Verlassend)
00:50:17*17WAA8EJD joined #nim
00:53:06*Varriount joined #nim
00:55:00*Jehan_ quit (Quit: Leaving)
01:00:12whitenoisedef-: so can Nim do bit fields?
01:01:31def-whitenoise: maybe someone wrote a module for them, i don't know
01:02:44Varriountwhitenoise: Not out of the box, unfortunately. There's the 'packed' pragma, but that doesn't give much granularity.
01:03:21fowltheres a workaround
01:04:14fowluse importc/header or importc with emit
01:05:37Araqbye
01:07:16*filwit quit (Quit: Leaving)
01:12:53*17WAA8EJD is now known as fungos
01:19:06*smw_ quit (Read error: Connection reset by peer)
01:25:35*pogoplug joined #nim
01:25:59*reem quit (Remote host closed the connection)
01:27:39pogoplugI'm having problems bootstraping nim on Ansible linux. I get the following error: "nimcache/stdlib_osproc.c:1628:57: error: use of undeclared identifier 'POSIX_SPAWN_USEVFORK' LOC33 = posix_spawnattr_setflags(&attr, (NI32)((NI32)(POSIX_SPAWN_US..."
01:28:07*OnwardEuler joined #nim
01:28:33def-pogoplug: with which C compiler?
01:28:44pogoplugclang
01:28:51pogoplugand musl-libc
01:29:07def-ok, that explains it
01:29:16pogoplugnot to me
01:30:42def-https://github.com/Araq/Nim/blob/devel/lib/posix/posix.nim#L1732-L1744
01:30:55def-I noticed the same issue with TCC and added this workaround
01:31:15def-I guess we need it in a more general way
01:34:32*reem joined #nim
01:35:42def-Made a PR to fix this, don't know if there's a better way: https://github.com/Araq/Nim/pull/2156
01:37:03pogoplugso its not a compiler issue, its a libc issue
01:37:03*koz_desktop quit (Remote host closed the connection)
01:37:58pogoplugdef-: probably want to add that musl-libc doesn't specify VFORK in spawn.h
01:38:13pogoplugdef-: I took your patch and add or defined(clang) and it built for me
01:38:24pogoplugof course that's not the right thing (its the libc not compiler)
01:38:28pogoplugbut it moves me forwards
01:38:50def-pogoplug: yeah, i'll wait to see what Araq thinks about how to fix this properly
01:39:45pogoplugdef-: pull in autotools of course!
01:39:57def-I doubt it
01:44:23pogoplugI need irc emoticons for sarcasm
01:50:09*dashed joined #nim
01:51:01*reem quit (Remote host closed the connection)
01:57:30*reem joined #nim
02:01:16*Sharcho left #nim ("Leaving")
02:05:04*JinShil joined #nim
02:06:56*pogoplug1 joined #nim
02:09:33*pogoplug quit (Quit: Page closed)
02:09:40*pogoplug1 quit (Client Quit)
02:11:27*chemist69_ joined #nim
02:11:35*pogoplug joined #nim
02:11:53*l04m33 joined #nim
02:14:40*chemist69 quit (Ping timeout: 255 seconds)
02:15:32Varriountpogoplug: We usually use ':3' or ';P' for sarcasm
02:17:14*JinShil quit (Quit: Konversation terminated!)
02:18:02*darkf joined #nim
02:18:44*JinShil joined #nim
02:23:30flaviuVarriount: I've never see ";P". Combining emoticons seems wrong :P
02:27:05*jholland quit (Quit: Connection closed for inactivity)
02:27:43Varriountflaviu: Ok, well at least ':3'
02:27:52VarriountI use that for when I'm joking.
02:30:07l04m33Hi folks, I'm tying out the asyncdispatch module, and my program here produced some `type mismatch` message: https://bpaste.net/show/19d03ec9303d
02:30:14l04m33Any ideas or pointers?
02:32:43Varriountl04m33: I don't think Asynccheck is a closure procedure.
02:32:43*pogoplug quit (Read error: Connection reset by peer)
02:33:08Varriountl04m33: You can wrap asynccheck in another procedure to get around the limitation
02:34:11*yibter quit (Quit: Textual IRC Client: www.textualapp.com)
02:34:23*johnsoft quit (Ping timeout: 246 seconds)
02:36:25l04m33Varriount: Thanks! Never read about `closure procedures`. Diving into that now....
02:36:48*johnsoft joined #nim
02:37:17Varriountl04m33: The rules about what can be implicitly converted to a closure and what can't are a bit complex, for reasons I can't recall at the moment.
02:37:24VarriountI do know that there are reasons though.
02:38:24Varriountl04m33: It's probably less of a headache to just for 'for f in y: asyncCheck(f)'
02:38:30TEttingerdef-: I think it's cool what people are using TCC for these days
02:38:31Varriount*just do
02:39:55l04m33Varriount: I see. Maybe it had something to do with the translated C code.... I'm just trying out different ways of doing something :)
02:41:19Varriountl04m33: Closures have two pointers - one to the actual procedure, and one to the procedure environment
02:41:38VarriountIt has to do with that, I think (though I'm not sure)
02:42:22def-you can use every proc as a closure inside its module. from another module they need the closure pragma for that, I think
02:43:08VarriountI think Araq said that it's like that because of 'default arguments', though I didn't quite understand why that was.
02:43:49def-"for f in fList: asyncCheck(f)" looks more nim-like to me anyway
02:44:05def-Varriount: right, there was something with that too, but I forgot as well. in this case I don't see any default arguments
02:45:16def-asyncCheck doesn't even return anything, so a map doesn't make sense
02:45:50l04m33def-: OK.... I came from the Python world you know :)
02:46:07Varriountl04m33: Ah, so you're like me.
02:46:38Varriountl04m33: If you use sublime text, onionhammer and I are the ones who develop the Nim extension plugin for it.
02:47:01l04m33So besides the manual, are there any other docs about closure usage?
02:47:28Varriountl04m33: Well, there are language-agnostic explanations of closures
02:50:02l04m33Varriount: I kinda understand what a `closure` is, but want to know more about how it works in Nim.
02:50:37Varriountl04m33: Well, in Nim, closures are usually inner functions
02:53:56Varriountl04m33: https://gist.github.com/anonymous/524404fe6fa42dc782ee
02:54:53Varriountl04m33: In that example, 'bar' is implicitly given 'closure' status
02:55:15*lavender joined #nim
02:55:55VarriountIt grabs the outer variables ('c') and can use them past the scope of 'foo'
02:57:28l04m33Varriount: hmm.... That looks pretty like closures in Python to me
02:57:45Varriountl04m33: Yes. Their fairly similar
02:57:50Varriount*They're
02:59:23Varriountl04m33: The thing is, behind the scenes they're represented as type containing two pointers. One pointer points to the function location, the other points to some allocated memory that holds the 'grabbed' variables.
02:59:26l04m33I'm reading the manual, and I think we should have a section for closures in the tutorials....
02:59:44Varriountl04m33: If you want to write one up, that would be great.
03:00:09Varriountl04m33: There's also http://nim-by-example.github.io/ , which could use some love.
03:00:41Varriount(Not all of the information there is 100% accurate)
03:02:32*johnsoft quit (Ping timeout: 250 seconds)
03:03:05onionhammerVarriount hows that mystery branch coming
03:03:22Varriountonionhammer: I'm halfway done with nimble.py
03:04:05Varriountonionhammer: While it's in my mind, I'll push what I have so far to a new branch, that way you can see what I'm up too.
03:04:39*johnsoft joined #nim
03:08:52*koz_ quit (Ping timeout: 240 seconds)
03:08:58Varriountonionhammer: https://github.com/Varriount/NimLime/tree/refactor
03:10:06Varriountonionhammer: Beware, that branch is likely broken in a few places. I'm testing commands as I makes changes.
03:10:55*flaviu quit (Ping timeout: 255 seconds)
03:10:55*Mimbus quit (Ping timeout: 255 seconds)
03:12:11DecoPersonStrange error with closures and tuples: https://gist.github.com/Deco/c9d9741a1f67d7d5ca94
03:13:22*johnsoft quit (Ping timeout: 240 seconds)
03:13:35VarriountDecoPerson: Try renaming the inner closure. 'inc' is a built-in function (increments an ordinal)
03:14:06DecoPersonno difference
03:14:06VarriountThough, that should probably be reported as a bug, or at least a warning.
03:14:29DecoPersonoh wait, it's a different error now
03:15:16DecoPersonhttps://gist.github.com/Deco/c9d9741a1f67d7d5ca94
03:15:48DecoPersonAh, annotating blah with {.closure.} solved it
03:15:49def-DecoPerson: proc blah {.closure.} =
03:16:22VarriountHm, probably because blah() doesn't actually capture any outer variables.
03:16:41def-Varriount: exactly, if you make it capture something, it's implicitly a closure
03:16:59VarriountDecoPerson: Could you look and see if those bugs have been reported, and if not, report them?
03:17:10Varriountonionhammer: No comments?
03:18:21DecoPersonVarriount: sure
03:18:36DecoPersonWorks perfectly, thanks! https://gist.github.com/Deco/c9d9741a1f67d7d5ca94
03:27:19DecoPersonWhy doesn't my redefinition of inc shadow system.inc?
03:28:06def-DecoPerson: good question, i think it should
03:28:21VarriountDecoPerson: Bug in the compiler.
03:28:31VarriountWhich is why it should be reported as a bug.
03:29:31DecoPersonI guess one is "proc inc() {.closure.}" and the other is "proc system.inc*(x: var T) {.stuff.}"
03:30:47VarriountDecoPerson: It's a magic proc
03:30:48DecoPersonGiven that procedures aren't first-class values, like in Lua or Python (because overloading would be impossibly difficult)... how does it decide which overload to resolve to when treating them as such?
03:31:05Varriount(Literally, one of the pragmas is 'magic'
03:31:08Varriount)
03:31:32VarriountDecoPerson: What do you mean, first class values?
03:31:38reactormonkDecoPerson, you can make them first-class just fine
03:31:49VarriountDecoPerson: You can pass around procedures and such just fine.
03:32:12reactormonkDecoPerson, you could consider them polymorphic functions.
03:32:12fowlDecoPerson, ret.inc should resolve to the field if thats what you named it, it probably works with an object type
03:32:36VarriountDecoPerson: Most of the 'overloading' is done at compile-time. The compiler does it's best to infer the best matching procedure.
03:33:45DecoPersonThis is not an issue with magic procs: https://gist.github.com/Deco/c9d9741a1f67d7d5ca94
03:35:34VarriountHm. So the compiler is matching against the outer procedure first, not the inner.
03:35:39VarriountDefinitely a bug.
03:35:42DecoPersonIf there's any conflict at all, there seems to be an issue: https://gist.github.com/Deco/c9d9741a1f67d7d5ca94
03:36:08DecoPersonoh, wait... what the
03:36:26fowlDecoPerson, try result.incval = incval
03:36:28DecoPersonThe IDE hints say there's an error, but it compiles fine with "nim c"
03:37:24VarriountDecoPerson: What IDE are you using?
03:37:40DecoPersonOh, nvm, I forgot to save
03:37:42DecoPersonhttps://gist.github.com/Deco/c9d9741a1f67d7d5ca94
03:38:00DecoPersonDefinately a bug
03:39:15VarriountDecoPerson: What IDE are you using?
03:39:33DecoPersonfowl: doing "result.incval = incval" worked
03:39:40DecoPersonand resolves to the inner proc
03:40:01DecoPersonVarriount: Sublime with NimLime, which runs "nim --verbosity:0 idetools --suggest" for hints
03:43:31gmpreussner|workquick question for wrapping a C library: i have a function that takes an array of SomeType, i.e. "SomeType* values". is it correct to convert this to "ref SomeTypeArray" with "SomeTypeArray* {.unchecked.} = array[1234, SomeType]" ?
03:45:41gmpreussner|worki thought i had read something about better C array support on the forums recently and recall this syntax, but i can't find it :/
03:46:22*JinShil quit (Quit: Konversation terminated!)
03:49:06Varriountgmpreussner|work: Huh?
03:49:41gmpreussner|workVarriount: C function looks like this: void Foo(SomeType* values)
03:49:51gmpreussner|workSomeType* means array of SomeType
03:50:01gmpreussner|worka pointer to a static array is expected
03:50:09Varriountgmpreussner|work: You can just pass it an array. It doesn't need to be unchecked.
03:50:50VarriountIsn't an array just a pointer to a block of memory? You don't need the extra ref/ptr, do you?
03:50:53*lavender_ joined #nim
03:50:53gmpreussner|workoh, ok. So it would be: proc Foo(values: array[123, SomeType]) ?
03:51:14gmpreussner|workin C and C++, the name of an array is a pointer to its first element
03:51:27VarriountAh, sorry, yes, you need an unchecked array if you want to write it that way.
03:51:34gmpreussner|worki thought so :)
03:52:01gmpreussner|workso is it this then: proc Foo(ref SomeTypeArray) ?
03:52:09VarriountYou should probably set the length as zero though. The unchecked pragma doesn't affect memory allocation for arrays, just bounds checking.
03:52:57gmpreussner|worki see. i saw a lot of examples that use 10_000 or 100_000_000 for unchecked arrays. 0 will work just as well then?
03:53:00DecoPersonVarriount, def-, fowl: https://github.com/Araq/Nim/issues/2157
03:53:34*lavender quit (Ping timeout: 245 seconds)
03:54:34gmpreussner|workVarriount: also, in general for non-array parameters, but pointers, is it safe to convert "SomeType* value" parameters to "value: ref SomeType" or should i use "value: ptr SomeType" ?
03:54:54Varriountgmpreussner|work: ptr
03:55:06gmpreussner|workok thanks
03:55:11Varriountgmpreussner|work: 'ref' implies that the value is under the control of the garbage collector
03:55:20gmpreussner|workah that's right
03:55:33gmpreussner|workso my array parameter should then be ptr as well, i suppose
03:55:55gmpreussner|workor is that a different situation?
03:56:38gmpreussner|worknevermind, i see that i have used ptr with arrays before, and it seems to work fine
03:58:10Varriountgmpreussner|work: Well, if my knowledge is correct, 'ptr array' is a pointer to a pointer to the first element of an array
04:00:40*johnsoft joined #nim
04:05:05*kapil___ joined #nim
04:09:45*zacts joined #nim
04:13:11dhasenanWhen I turned on the LineTooLong hint and compiled a hello world program, the compiler emitted some hints about the standard library (using a recent copy in the devel branch). Is there some way to constrain hints to only emit for my project rather than everything?
04:14:04*dashed quit (Quit: Connection closed for inactivity)
04:15:08onionhammerVarriount cool i'll check it out
04:18:42reactormonkdhasenan, uh-oh. File a bug.
04:19:38onionhammerVarriount you mind if i delete a couple of the old branches
04:22:26onionhammerVarriount it's all one commit :P
04:22:51*lavender_ is now known as lavender
04:24:47DecoPersongmpreussner|work: here you go: https://gist.github.com/Deco/208ac923ecc66f42caf2
04:25:50DecoPersonShould make it easier to work with raw C pointers
04:26:24*reem quit (Remote host closed the connection)
04:28:28gmpreussner|workthanks DecoPerson
04:29:38DecoPersonIt has mistakes... I should probably write some unit tests
04:32:13*koz_ joined #nim
04:32:28*zacts quit (Quit: ERC Version 5.3 (IRC client for Emacs))
04:35:37DecoPersonIsn't there a `..<` range operator?
04:36:09TEttingerholy crap, urho3d and urhonimo look awesome
04:36:41TEttingerI'm surprised it isn't mentioned on Urho3D's page
04:42:22dhasenanIs there a way to include an import trace when displaying errors? Like "Error: undeclared identifier: foo (in file imported at a.nim:12, imported by b.nim:47)"
04:42:26dhasenanGCC does this sort of thing, I think.
04:43:05DecoPersonI swear I saw someone do this in Nim: for i in 0..<len:
04:43:15DecoPersonWhere the < means it will go up to len-1
04:46:59whitenoiseis there a difference in memalloc and malloc
04:47:15*polde quit (Ping timeout: 272 seconds)
04:47:21whitenoiseoh, that was a template you made, nvm
04:48:06TriplefoxDecoPerson: yes, < is used there to mean "len-1"
04:48:26DecoPersonTriplefox: but whenever I try to use it, it says unrecognised operator
04:48:32Triplefoxadd a space
04:48:35Triplefoxafter ..
04:49:20*reem joined #nim
04:49:24Triplefoxit's a bit dangerous when you use it with a variable that will count into 0, since a negative index into a seq will give you the whole seq
04:49:39Triplefoxwe have an issue talking about that problem
04:51:57*lavender_ joined #nim
04:52:56whitenoisetypes.nim(10, 18) Error: type expected
04:53:00whitenoisewhat does this mean
04:53:21DecoPersonDepends on your code, paste to gist.github.com
04:53:32whitenoisehttps://www.irccloud.com/pastebin/SDAUtUvq
04:54:23DecoPersonLine 10, I think you mean "student = Student(...)"
04:54:50DecoPersonvar varName : TypeName says "varName is of type TypeName"
04:55:13whitenoiseI see. it's expecting a type but I'm giving it basically an object
04:55:23whitenoisemakes sense
04:55:28Triplefoxthe verbose student:Student = Student() also works i think
04:55:37*lavender quit (Ping timeout: 264 seconds)
04:55:39DecoPersonwhereas var varName = TypeName(something: "something") says "varName is of type TypeName and construct it with these values"
04:55:50whitenoiseTriplefox: that does work, i have done it with ints
04:55:53whitenoisex: int = 10
04:56:21whitenoisehttps://www.irccloud.com/pastebin/PbHvrlKR
04:56:21Triplefoxyeah...stylistically it probably doesn't matter which you use, unless type inference is breaking for some reason
04:56:24whitenoisethis works
04:56:52DecoPersonwow, just tried "var x: auto = 10" as a joke, and it broke the compiler
04:57:01whitenoiselol
04:58:47DecoPersonhttps://gist.github.com/Deco/53401151c669b944e554
04:59:06Triplefoxhmm
04:59:26DecoPersonNot exactly high-priority :)
04:59:38DecoPersonNot exactly high-priority :)
04:59:44DecoPersonopps, wrong window
05:03:37*lavender_ quit (Ping timeout: 244 seconds)
05:06:43Triplefoxaha, you can make it compile with "var x: auto int = 10"
05:06:56whitenoisewhat is the auto doing
05:07:05DecoPersonwhy would "auto int" even be a thing?
05:07:19whitenoise^
05:07:29Triplefoxi noticed that auto is defined as a type class
05:08:36Triplefoxi don't understand that in any detail but it would mean it's a kind of categorization, just not a useful one in that situation
05:08:59Triplefox> If a proc param doesn't have a type specified, Nim will use the "distinct auto" type class (also known as "any"):
05:10:00whitenoiseah, sort of like interface{} in Go
05:10:41Triplefoxit looks like every time we use "ref" or "ptr" we're actually working within the typeclass system
05:12:48Triplefoxthe part i really don't get is user-defined type classes...it's probably really powerful once i understand it
05:14:05DecoPersongmpreussner|work: Here's the fixed + unit-tested version: https://gist.github.com/Deco/208ac923ecc66f42caf2
05:16:47*polde joined #nim
05:19:14gmpreussner|workDecoPerson: looking nice. that will probably come in handy.
05:21:17Triplefoxalso i didn't notice that "unittest" existed so i guess i'll use that
05:26:17*reem quit (Remote host closed the connection)
05:26:59*reem joined #nim
05:39:01ekarlso∞is devel broken ?
05:43:13*lavender joined #nim
05:49:41DecoPersonekarlso: Latest devel on Win8.1 64 is working for me
05:49:54DecoPersonWhat's your issue?
05:51:46*kashyap_ joined #nim
05:51:51*polde quit (Ping timeout: 272 seconds)
05:52:31kashyap_Some folks discussed my moving from Rust to Nim :) http://www.reddit.com/r/rust/comments/2vqy81/author_of_unix_in_rust_abandons_rust_in_favor_of/
05:53:50TEttingerhi kashyap_, yeah I saw it mentioned on ##fsharp, I looked closer and popped in here :)
05:54:55kashyap_:) ... I think I should write a more detailed article about my path to Nim
05:55:11TEttingerhow did you get started with learning/writing Nim, kashyap_?
05:56:42kashyap_A lady called Maxime had tweeted about Nim a few weeks ago...That's when I looked at Nim ... when I saw Nim, I could see that it was wat I had been looking for!!!
05:57:07TEttingerneat
05:59:00Triplefoxthat makes it sound so serendipitous
06:01:02ekarlsoanyone wanna volunteer to help build the package indx ?
06:01:32Triplefoxbuild it how?
06:01:42ekarlsocode it ;)
06:02:46Triplefoxas in add more, or as in automate the indexing..?
06:03:16ekarlsoTriplefox: I've actually started doing a big deal of it ..
06:03:22ekarlsobut more help would be nice
06:04:33DecoPersonSomething like npmjs.com, ekarlso?
06:04:39ekarlsoDecoPerson: yeah
06:04:49ekarlsohttps://nim-pkg.svcs.io < initial stuffs
06:05:28DecoPersonOh boy, here come the growing pains
06:05:34Triplefoxfirefox doesn't like that certificate :D
06:05:43ekarlsoDecoPerson: what's wrong now ?
06:06:34*polde joined #nim
06:06:48Triplefoxoh, the tags browser is cool
06:07:03ekarlsoTriplefox: there's a branch for nimble also
06:07:34ekarlsoallows you to "nimble register" in the current dir of a new package and it does it for you
06:07:36DecoPersonekarlso: nothing wrong with your site. it's really well :)
06:07:49DecoPersonI was commenting on how Nim is building inertia, yet it is still immature
06:08:16DecoPersonWhat if heaps of people use the "do" notation in their packages, but the developers decide to change it completely...
06:08:27DecoPersongrowing pains, as faced by every other language :)
06:08:58Triplefoxi'm dodging the problem by building nim libraries that only use the subset least likely to change
06:09:41ekarlsonim libs needs more CI / Docs automation..
06:09:55ekarlsoand not a static index :/
06:10:33Triplefoxhere is an idea, docs that build on unit test code
06:10:47Triplefoxso the unit test can also be an example
06:11:31DecoPersonTriplefox: I don't agree with that idea. Take the unit tests I just wrote for my memory library: https://gist.github.com/Deco/208ac923ecc66f42caf2
06:11:58DecoPersonThey're not very good examples, in fact effective coverage (the goal of unit testing) can be painful and result in ugly code
06:12:11*brson quit (Quit: leaving)
06:14:25Triplefoxhide it because it is ugly? it still shows how code is used, and it doesn't have to be the central example
06:14:43Triplefoxthat goes for "this should fail" tests too
06:16:56DecoPersonHmm, interesting. I suppose docs and tests could be meshed together. They could lead with introduction, rationale and introductory examples, and then have the typical type/proc documentation with expandable unit tests for each
06:17:14DecoPersonBut you'd need a way to specify which unit test is for which proc(s)
06:19:06Triplefoxi like it mostly because it would help keep code/tests/docs in sync, although it would force the workflow to be a certain way
06:19:15*bjz joined #nim
06:19:20Triplefoxso there would certainly be a project at some point that couldn't handle it like that
06:28:48*bjz quit (Ping timeout: 250 seconds)
06:36:23Varriountonionhammer: You there?
06:42:49*TEttinger quit (Ping timeout: 244 seconds)
06:44:17*brson joined #nim
06:53:08*brson quit (Ping timeout: 264 seconds)
06:55:04*bjz joined #nim
07:04:07*kashyap_ quit (Ping timeout: 246 seconds)
07:12:08*kokozedman joined #nim
07:14:14kokozedmanHey guys, compared to other Hash map implementations (like STL, Judy, ulib, etc...), how good is Nim's Table?
07:18:41Varriountkokozedman: I don't think there have been any tests done. I know there has been talk about optimizing it though.
07:20:19*vendethiel- quit (Quit: q+)
07:26:39DecoPersondhasenan: Regarding LineTooLong, you could try not enabling it and then wrap your code in {.push hint[LineTooLong]: on.} and {.pop.}
07:44:32*fizzbooze quit (Ping timeout: 246 seconds)
08:00:16*ChrisMAN quit (Ping timeout: 255 seconds)
08:01:10*HakanD___ joined #nim
08:33:23*lavender quit (Ping timeout: 256 seconds)
08:34:33*lavender joined #nim
08:36:01*Trustable joined #nim
08:36:15*Trustable quit (Remote host closed the connection)
08:36:59*jaapz joined #nim
08:37:08*Trustable joined #nim
08:37:13jaapzlet's start a religious war, why would nim be better than rust?
08:37:42vegaihah
08:37:47jaapzother than that it's irc is on freenode like any other self respecting project
08:40:37bjznim's name is shorter!
08:41:21jaapzbjz: you've convinced me
08:41:25Triplefoxit comes first in the alphabet too
08:41:47jaapzanother great reason
08:42:31bjz<insert syntactic preferences here>
08:42:50jaapzbjz: rust syntax is a bit weird
08:43:00jaapzand there's a lot of it
08:43:16bjzI will be the first to admit that
08:43:23bjz:)
08:44:00bjznim has no annoying borrow checker
08:44:25bjzor ownership shenanigans
08:44:38jaapzsome would say that's a strength in rust
08:44:49bjzsome would (myself included)
08:44:57bjzbut for some that is a plus
08:45:53vegainim's syntax is also a bit weird when you're not used to it
08:45:56bjznim's metaprogamming seems more powerful, and prettier
08:45:57jaapzdoes nim run on raspberry pi and other arm-type thingies?
08:46:04bjzvegai: indeed
08:46:21jaapzvegai: fair enough
08:46:40vegaionly Forth's syntax isn't, really :P
08:46:49gokrIt seems to me that there are some fairly deep differences that overrule things like "syntax" etc. Philosophy is very different. Memory handling very different. Error handling. And compilation targets.
08:47:02bjzgokr: indeed
08:47:17bjzjaapz: nim has exceptions, rust does not
08:47:22gokrIts kinda odd staring at syntax when those differences I mentioned are in comparison HUGE differences.
08:47:53bjzrust compiles to llvm IR, where as nim has multiple backends to intermediate language targets
08:48:19jaapzgokr: still, syntax is what people see and what can be incredibly annoying
08:48:31bjzjaapz: you get used to it
08:48:45bjzjaapz: so long as its not COBOL
08:49:06jaapzbjz: fair enough
08:49:08gokrNim wants to be practical. Rust wants to satisfy a very specific use case (build a super multicore browser?) and sacrifices programmability to do it.
08:49:15gokrThat's my perception at least.
08:49:27jaapzgokr: the browser thing is it's main use case indeed
08:49:38vegaiI think it's trying generally to get into that place where C++ is
08:49:44VarriountWait, rust doesn't have exceptions?
08:49:53vegaino, not really
08:49:55Varriount._.
08:49:57gokrVarriount: Ha! You kiddin?
08:49:58Triplefoxjust this evening i mentioned nim in some other channel and got a kneejerk "not case sensitive?? reject" response
08:50:02vegaiVarriount: I like it, actually
08:50:13bjzVarriount: no, it has mondaic error handling, and task failure
08:50:17*dumdum joined #nim
08:50:48VarriountHm. I think 'mondaic' should be a real word
08:50:51bjzVarriount: monadic as in, Option or Result
08:51:05bjzlol woops
08:51:17gokrIt seems to me that serious use of error handling in Rust would simply blow the code into a mess.
08:51:36bjzgokr: I haven't found it to be a problem
08:51:43gokrBut I may of course be utterly mistaken. But every call site along the chain would need to be instrumented.
08:51:45Varriountbjz: No, I spotted your error. I'm just saying that 'mondaic' sounds like it should be a real word.
08:51:54bjzVarriount: heh, yup
08:52:10vegaithe Go folks seem to moderately succeed without exceptions too
08:52:22jaapzvegai: pls don't talk about Go error handling
08:52:24vegaibut Rust does it a bit better for the reasons mentioned above
08:52:34jaapzvegai: if statements everywhere
08:52:36*davidhq joined #nim
08:52:56vegaijaapz: mm, sure.
08:53:06vegaibut conceptually simple
08:53:13vegaiwhich is sometimes good
08:53:18jaapzvegai: true enough but it clutters the code like a bitch
08:53:22*vegai nods
08:53:29bjzjaapz: Nim has a single BDFL who calls the shots, where as Rust has a team people
08:53:32*chemist69_ is now known as chemist69
08:53:39jaapzf, err := OpenSomething()
08:53:46jaapzif (err) { handle the error }
08:53:58jaapznot my cuppa
08:54:00vegaiif you're crazy, you can inline that stuff inside the if clause, I think
08:54:06DecoPersonI'm of the school that if an exception has occured, the program should exit because it's an exceptional circumstance and the program could not possibly recover. If it's a situation the program has been designed to handle (disconnection, file not found, out of memory, etc), then it should be handle by traditional control flow... IMHO :)
08:54:08*davidhq quit (Max SendQ exceeded)
08:54:09gokrbjz: Do you use both btw?
08:54:31jaapzbjz: so kinda python-y
08:54:42vegai< bjz> Varriount: no, it has mondaic error handling, and task failure
08:54:45bjzgokr: mainly Rust - I follow nim though at a distance, and upvote all the posts on it :3
08:54:52vegaiI think they abandonded the erlang-style task failure thing
08:55:00vegaididn't they?
08:55:17*davidhq joined #nim
08:55:22bjzvegai: there is still failure to the task boundary, but no *linked* task failure
08:55:27vegaiah, ok
08:55:48jaapzif it's really bad you can panic!() your way out of the program
08:55:53bjzvegai: which is sad, and means no supervisors, but Rust's goals have shifted a tad
08:56:22bjzvegai: towards 'pay only for what you use'
08:57:32bjzgokr: what kind of stuff are you making in nim right now?
08:58:22gokrbjz: I work at 3DICC and our system is a 3D virtual worlds kinda thing. 100% in Smalltalk for the moment, but we just hired Araq and are moving towards Nim.
08:58:36gokrDid you miss the announcement the other day of Urhonimo?
09:00:14bjzthat's pretty neat
09:00:18bjzyeah, I did
09:00:44gokrThere were basically 3 important things in that announcement IMHO: 1) Araq works at 3DICC 100% Nimming 2) Nim can now wrap C++ very well automatically and 3) Urhonimo is a Nim wrapper of Urho3D
09:00:52bjzhow is smalltalk to use?
09:01:03bjzawesome!
09:01:06gokrOf those 3 I would say the first one is the most important part for Nim.
09:01:22bjzwill be good for nim to have commercial backing
09:01:32Varriountgokr: Hm. Wrapping C++ means Qt wrappers, right?
09:01:36bjzgutsy for the company, but hats off to them
09:01:44gokrAraq's work to produce Urhonimo produced a huge improvement in c2nim/nim to wrap C++ fully automatically.
09:02:11gokr3DICC is small. Me and Araq is 50% of it ;)
09:02:34bjzahh :D
09:02:35Triplefoxit has an impressive name though
09:03:47gokrBut yeah, having Araq be able to work 100% on/with Nim, from home, is quite a big deal for the Nim community IMHO.
09:03:52bjzgokr: it's also great that it is being used in production, especially by Araq
09:03:58gokrDefinitely.
09:04:08bjzthat is a big test for a language
09:04:22gokrYeah, we will be phasing Nim in gradually.
09:04:53bjzit's one thing to bootstrap a compiler, and another to actually use it in a large project (that is the experience of Rust, at least)
09:05:04gokrVarriount: Yes, Qt should be very doable now.
09:05:18bjzcompilers are different beasts to messy real world stuff
09:05:25gokrDefinitely.
09:05:35bjz(even though compilers are also messy)
09:05:47bjzwait - is nim bootstrapped?
09:05:58bjzsorry - made that assumption
09:06:02gokrIt is
09:06:07gokrIts all in Nim.
09:06:09bjznice
09:06:19gokrI wrote an article on that process btw.
09:06:31Triplefoxqt bindings will be nice, i know someone who might be interested in that
09:06:48gokrhttp://goran.krampe.se/category/nim/ - the "Bootstrapping" one at the far bottom
09:07:37gokrbjz: I also think this new C++ wrapping capability is a very strong feature of Nim.
09:07:50bjzyup, that is a big pluss
09:08:04gokrUrho3D is a beast, and we already have fairly advanced samples running quite fine.
09:08:45bjzI think nim would have an easier time wrapping C++ than Rust. It's overloading and template semantics would most likely match more closely
09:09:19bjzjaapz: there you go, it is easier to wrap C++ with nim than Rust
09:09:19gokrbjz: This is a small one I did yesterday: https://github.com/3dicc/Urhonimo/blob/master/examples/particle.nim
09:09:31gokrIts nice, because its fully clean - 100% Nim.
09:09:53gokrAraq's demo is much more advanced though: https://github.com/3dicc/Urhonimo/blob/master/examples/character.nim
09:10:13bjzgreat
09:10:21gokrIt has an emit in the beginning, he will fix that, but otherwise also fully in Nim.
09:10:35*davidhq quit (Ping timeout: 246 seconds)
09:10:52gokrThis is that demo: https://www.youtube.com/watch?v=-T0MrJkLB8Y
09:11:34Triplefoxthat sure does look like a 3d game
09:12:17gokrIts those 600 lines of Nim code I linked above.
09:13:25gokrDriving an animated avatar, Bullet physics etc etc. Tested on OSX, Windows and Linux (should run on iOS and Android too). :)
09:13:26*lavender quit (Ping timeout: 246 seconds)
09:15:17Triplefoxwhat is your ultimate goal for wrapping this engine? or is that up for disclosure
09:15:52gokrOur current system is already used in production etc, we are not a VC company.
09:16:27gokrSo we already have a 3D client with very advanced features. But we want to upgrade to the Urho3D engine.
09:17:41gokrSo we are injecting Nim into our current client written in Smalltalk as a start.
09:18:10Triplefoxsounds like a complex project, but also a good "real" test
09:18:27gokrIts a very complex project indeed.
09:18:36gokrAnd our system is HUGE.
09:18:59gokrSo... its going to be a step-by-step thing.
09:20:08Triplefoxwhen projects get bigger i always get frustrated that i can't really know it all very well anymore
09:21:29*davidhq joined #nim
09:21:44gokrOne of our promos, 3D comes 48 seconds into it: https://www.youtube.com/watch?v=oK3xjPaKuSg
09:22:27gokrYou can also search youtube for "Teleplace" and you will find lots more - since that was the name of the system earlier.
09:27:40Triplefoxthat pitch is getting me all fired up :3 like playing second life at the office
09:27:47gokrYes it is.
09:28:20gokrAnd oh, its all in Smalltalk ;)
09:28:31Triplefoxheh
09:28:48gokrBut in a 2 years, perhaps all in Nim.
09:29:01gokrWe will see.
09:30:06Triplefoxi know a lot of people who are or used to work at IMVU, sort of similar domain but more consumer focused.
09:30:44gokrYeah, we are mainly "big corp" focused at the moment - but future directions may include more consumer stuff.
09:31:09Triplefoxtheir stack is some mashup of haskell and c++ and i think one other language
09:31:10*BlaXpirit joined #nim
09:32:15gokrOn our server side we are basically all Smalltalk. On the client however we use several third party libraries in C and C++.
09:32:29gokrSo C/C++ interop is important for us in Nim.
09:32:29Triplefoxoh, it's actually way more than i thought, heh http://www.quora.com/What-is-IMVUs-technology-stack
09:33:24gokrYeah, well, our full stack is of course also much more.
09:33:59gokrBtw, Araq's wife's birthday today - so he has a day off ;)
09:39:02*rinukkusu_ joined #nim
09:39:42*rinukkusu_ is now known as rinukkusu
09:42:57*pafmaf__ joined #nim
09:47:25*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:48:09ekarlsoactually gokr u only have to run build.sh
09:48:11ekarlso-,,-
09:48:15dtscodehow is math.random seeded?
09:48:45*davidhq joined #nim
09:49:20*davidhq quit (Client Quit)
09:49:20gokrekarlso: Ehm?
09:49:51ekarlsogokr: instead of doing the whole snippet you have in your blogpost ;)
09:50:37gokrekarlso: I am not following.
09:57:45BlaXpiritdtscode, what do you mean "how"?
09:57:51BlaXpiritit's basically undefined
09:57:54BlaXpiritwhatever C does
10:03:05*teapot joined #nim
10:05:27*gsingh93 quit (Quit: Connection closed for inactivity)
10:06:50*sitaram joined #nim
10:09:37*kashyap_ joined #nim
10:18:21*reem quit (Remote host closed the connection)
10:20:02*reem joined #nim
10:21:07fowldid you guys know theres a wikipedia page now http://en.wikipedia.org/wiki/Nim_(programming_language)
10:21:24rinukkususick
10:21:45fowlit needs more references
10:25:29*Varriount|Mobile joined #nim
10:26:00*Var|Mobile joined #nim
10:26:01*Var|Mobile quit (Read error: Connection reset by peer)
10:26:18*Var|Mobile joined #nim
10:28:26*Var|Mobile quit (Read error: Connection reset by peer)
10:29:33federico3nice
10:30:07*Varriount|Mobile quit (Ping timeout: 255 seconds)
10:35:15*Var|Mobile joined #nim
10:35:31*kuzy000_ joined #nim
10:44:04*Var|Mobile quit (Ping timeout: 255 seconds)
10:51:15*Varriount|Mobile joined #nim
10:52:15*Var|Mobile joined #nim
10:52:17*reem quit (Remote host closed the connection)
10:53:45Var|MobileHrm
10:54:36Var|Mobile¤Var¤
10:54:55Var|MobileInteresting android keyboard
10:55:22BlaXpiritk
10:56:03*Varriount|Mobile quit (Ping timeout: 252 seconds)
11:04:53*HakanD____ joined #nim
11:05:58*TEttinger joined #nim
11:07:22*HakanD___ quit (Ping timeout: 245 seconds)
11:14:14*HakanD____ quit (Quit: Be back later ...)
11:17:13rinukkusuhow does that make you guys feel? http://developers.slashdot.org/comments.pl?sid=6971335&cid=49059393
11:17:46*flaviu joined #nim
11:27:19*flaviu quit (Remote host closed the connection)
11:27:43*HakanD____ joined #nim
11:28:14teapotpersonally i don't think it's representative, all irc channels get heated now and then and tbh it's nothing to do with the language, just people being people
11:29:34*flaviu joined #nim
11:31:13BlaXpiritas much as I complain about Nim's module system, it's so impressive
11:31:45BlaXpiritjust turned my library's structure inside out, but kept backwards compatibility
11:31:48qwrit's just different communication styles imho
11:32:52BlaXpirityou guys might wanna see how that conversation started
11:35:10rinukkusuthe comment on stackoverflow got me here
11:35:40rinukkusuI know that irc communication and generally conversation on the internet differs from reall life
11:37:36def-rinukkusu: Hi. Usually the communication here is quite nice. That day was an exception, where it got really heated.
11:38:58rinukkusuno problem at all
11:39:05def-fowl: nice, can we copy the old one into it? https://en.wikipedia.org/wiki/Draft:Nim_(programming_language)
11:39:11TEttingerrinukkusu, yeah I came in #nim initially to prove to someone that the IRC channel probably wasn't crazy, and I got help on getting started in a complex setup very quickly from friendly, polite people
11:39:14def-(need to fix many links and stuff first)
11:43:29teapotyep I've always found this channel quick to help with my new-to-the-language problems. Often Araq has helped directly.
11:43:36gokrrinukkusu: Welcome. Yeah, I have been here daily since... october? But my perception is that the community is very friendly.
11:44:28*sepisoad joined #nim
11:44:54sepisoadis there a function to generate unique id (UID) in nim lang libraries
11:45:44gokrsepisoad: At the far bottom perhaps: http://nim-lang.org/lib.html
11:45:46BlaXpiritsepisoad, what I'd do in that case is search for "UID" at http://nim-lang.org/lib.html
11:46:30gokrAnyone who knows cgen inside and out?
11:46:38BlaXpiritlooks like linux-only, that uuid thing
11:47:37sepisoadthanks @gokr & @BlaXpiri
11:47:54qwrsome "oids" library is also there
11:48:29qwrhttp://nim-lang.org/oids.html
11:48:44BlaXpiritthis looks more promising to me
11:49:33BlaXpiritit's based on C rand though :/
11:50:53gokrI just looked at the Cog VM and there is a UUID plugin there with specific code for mac, win, unix - using OS facilities. One could port that over.
11:51:32BlaXpiritI, as usual, turn to Python
11:51:45gokrYeah, Python probably has something very similar.
11:52:43gokrHa... the win code uses ole2. Talk about memory lane...
11:52:52*reem joined #nim
11:53:46BlaXpiritPython's implementation is extremely convoluted
11:54:20gokrIt doesn't use OS facilities or?
11:54:43BlaXpiritit uses a ton of things.
11:55:29BlaXpirithttps://github.com/python/cpython/blob/master/Lib/uuid.py if anyone is interested
11:55:37BlaXpiritI don't think it's worth copying
11:56:27gokrI could port over the one from Cog perhaps. Its very small.
11:57:11*reem quit (Ping timeout: 246 seconds)
11:57:41gokrI gather noone here except Araq (who is out having fun) knows cgen much? I stumbled onto a... bug.
11:58:42*untitaker joined #nim
12:00:03*jferg2010 joined #nim
12:02:00*reem joined #nim
12:02:29TriplefoxThere is a uuid generator in three.js, i didn't think i would have to port it but it's just a single function
12:02:53*reem quit (Remote host closed the connection)
12:06:08*HakanD____ quit (Quit: Be back later ...)
12:07:54TriplefoxAlso thinking this might be good to bind, or even port the minimal version http://www.pcg-random.org/
12:08:26BlaXpiritTriplefox, have you worked with that library?
12:08:34BlaXpiritis there any confirmation that it's good?
12:08:56*antrix joined #nim
12:09:24TriplefoxThere is more than one version of the library, and it's been around a little while. Maybe not good if you are leaning conservative
12:09:47TriplefoxI haven't tried it myself yet but I've kept getting pointed towards it
12:09:51BlaXpiritit could be backdoored, who knows
12:10:34TriplefoxIt's not for secure numbers
12:11:29BlaXpiritthen what's the problem with just using mersenne twister?
12:11:34*Gnist joined #nim
12:12:00TriplefoxThe minimal implementation is smaller than mersenne twister
12:12:27BlaXpiritthat's not even an argument
12:12:46*sillesta joined #nim
12:12:49*teapot quit (Ping timeout: 246 seconds)
12:13:00TriplefoxYou're acting like this is important to you what random numbers people generate
12:13:25BlaXpiritI have raised concerns over this topic more than once, yes
12:14:07TriplefoxYou could implement what you want then, i want this one for myself
12:14:18BlaXpiritI have implemented
12:16:12BlaXpiritand it looks like Apache license will not allow me to use PCG generator in my library https://github.com/BlaXpirit/nim-random
12:16:19*OnwardEuler quit (Quit: Leaving)
12:19:12*Gnist quit (Quit: Leaving)
12:20:24*antrix quit (Quit: Leaving)
12:21:22BlaXpiritI have no idea how that would affect it. Apache license may be undesired.
12:25:20*Gnist joined #nim
12:31:00TriplefoxLooks like it is only an issue with gpl1 and 2
12:31:47TriplefoxAlthough dual licenses would be annoying
12:32:14BlaXpiritI don't think there is a way to add this without changing the license of my project
12:32:28*kapil___ quit (Quit: Connection closed for inactivity)
12:32:43BlaXpiritflaviu, maybe you have something to say. You have pointed me at PCG generators before, and I was about to add it, but ^
12:33:25*jferg2010 quit (Quit: Leaving)
12:33:25*teapot joined #nim
12:33:51BlaXpiritXorshift, on the other hand, is in public domain, so just tell me which one(s) exactly should be added
12:34:03def-BlaXpirit: I think PCG would be nice to have
12:34:06*bjz quit (Ping timeout: 250 seconds)
12:34:13*teapot quit (Client Quit)
12:34:24BlaXpirit...
12:34:26TriplefoxAlso, derivative work may be relicensed so a native port will be fine
12:34:33*tapot joined #nim
12:34:49BlaXpiritwhere did you find that? -_-
12:34:57TriplefoxWiki
12:35:08*bjz joined #nim
12:35:30BlaXpirithm
12:35:53*antrix joined #nim
12:37:46*flaviu quit (Ping timeout: 252 seconds)
12:39:55*flaviu joined #nim
12:40:05flaviuSorry about that, my power went out.
12:40:31flaviuHow about sending an email to Prof O'Neill? It's worth a try at least.
12:40:46BlaXpiritwiki might be lying though
12:40:59BlaXpiritI don't see anything about "derivative work may be relicensed"
12:42:24flaviuBlaXpirit: Section 9.
12:42:55BlaXpiritoh and 4 after the abcd list
12:43:19BlaXpiritmm not really...
12:44:06BlaXpiritflaviu, section 9 says about money
12:47:34TriplefoxOh well, I'm going to sleep now... have fun, don't stress too much just cause I raised the issue
12:47:46*rapind joined #nim
12:49:45TEttingerBlaXpirit: check out the xorshift PRNG shootout http://xorshift.di.unimi.it/
12:49:51TEttingerall of these are public domain
12:50:02TEttingerwell all that he implemented
12:50:04BlaXpirit[:33:50] <BlaXpirit> Xorshift, on the other hand, is in public domain, so just tell me which one(s) exactly should be added
12:50:30TEttingera ha
12:50:34TEttingerI mussed that
12:50:35TEttingerhttp://xorshift.di.unimi.it/xorshift128plus.c
12:50:44TEttingerthat's probably the best right now
12:50:47flaviuPCG has some really cool ideas behind it btw, and the paper is easily accessible (if long)
12:52:14flaviuYes, Xorshift* is very near ideal: http://i.imgur.com/9pAZMKE.png
12:53:07BlaXpiritflaviu, you say Xorshift*, TEttinger sent a link to 128+
12:54:13flaviuAh, my bad.
12:54:17TEttingeryeah, on the shootout it talks about how xorshift+ combines properties of xorshift* with other things and it's a bit faster and has less flaws
12:55:21flaviuhttp://i.imgur.com/GdwPbHS.png
12:56:53TEttingernice, how fast is pcg?
12:57:56flaviuhttp://i.imgur.com/Krh1ZFA.png
12:59:03TEttingernice.
12:59:08flaviuI'm getting all this from the paper: http://www.pcg-random.org/pdf/toms-oneill-pcg-family-v1.02.pdf
12:59:21TEttingerah ok
12:59:40TEttingerI'm curious about that apache license now
12:59:48TEttingerI thought it was GPL-compatible\
13:00:05BlaXpiritwe're talking about MIT
13:00:10BlaXpiritGPL is completely irrelevant here
13:00:15TEttingeroh, ok
13:00:16*kapil___ joined #nim
13:00:23*Jehan_ joined #nim
13:00:34BlaXpiritthis might be off-topic, dunno
13:01:25flaviugood idea.
13:02:40BlaXpiritoh hi, Jehan_. I finally gave http://forum.nim-lang.org/t/533/1#2886 a serious look, and yes, this is definitely worth implementing. the problem is providing a generic API for different RNGs
13:04:23Jehan_BlaXpirit: Yeah, I can relate. :)
13:04:51BlaXpiritmay be worth changing the lowest common denominator from uint8 to uint32
13:05:40BlaXpiritbut then again, there is at least one RNG that just provides bytes
13:07:11flaviuBlaXpirit: Which one?
13:07:24BlaXpiritSystemRandom/urandom/CryptGenRandom
13:07:46flaviuConcatenate the bytes together.
13:08:41*JinShil joined #nim
13:08:58BlaXpiritthen it's gonna be a waste
13:09:28flaviuWho cares? If performance matters, people should use a fast PRNG
13:10:05flaviuThat's a bit harsh, sorry.
13:10:10BlaXpiritI'm talking more about a waste of system's entropy
13:10:45*HakanD____ joined #nim
13:12:23flaviuWell, if you're just throwing away the bytes, entropy isn't used. The system's counter will think it's been used, but there are lots of other sources of error in that counter.
13:12:34flaviuAnd /dev/urandom won't ever block, so it's not a problem.
13:13:24*rapind quit (Remote host closed the connection)
13:14:14BlaXpiritI wish there were some kind of conditionals on whether a function exists or not
13:14:33flaviuwhen compiles(...): ...
13:14:57BlaXpiritflaviu, wait a second... I just realized that this actually may work in generics
13:15:15BlaXpiritgotta check this out
13:16:10*TEttinger quit (Ping timeout: 255 seconds)
13:16:49BlaXpiritomg it totally does work
13:17:10BlaXpirithttps://bpaste.net/show/5f2866e08996
13:17:54BlaXpiritwelp, I will go and rework the library now :|
13:19:33*reem joined #nim
13:19:33*reem quit (Remote host closed the connection)
13:21:44*tapot quit (Quit: Page closed)
13:22:55*teapot joined #nim
13:23:01*teapot left #nim (#nim)
13:30:39*untitaker quit (Ping timeout: 245 seconds)
13:30:45*HakanD_____ joined #nim
13:31:06*banister joined #nim
13:31:55*HakanD____ quit (Ping timeout: 255 seconds)
13:35:05gokrBlaXpirit: That's pretty slick :)
13:35:36gokrLots of non Nimmers' eyes would roll back into the head though ;)
13:35:52BlaXpiritbut this is exactly what I need
13:36:17BlaXpiritRNGs may provide any or all of randomByte, randomUint32, randomUint64
13:37:23gokrJust got another Urhonim example going - after hacking cgen.nim ;)
13:37:50*untitaker joined #nim
13:39:12*HakanD______ joined #nim
13:40:52*antrix quit (Quit: Leaving)
13:42:52*HakanD_____ quit (Ping timeout: 240 seconds)
13:44:24*HakanD______ quit (Ping timeout: 245 seconds)
13:45:12*teapot1 joined #nim
13:49:41*Gnist left #nim ("Leaving")
13:50:53*sepisoad2 joined #nim
13:52:01teapot1does anyone know if there are any plans to have features for safe sharing of memory between threads in nim?
13:53:03*kuzy000_ quit (Ping timeout: 265 seconds)
13:53:15*kuzy000 joined #nim
13:53:28*sepisoad quit (Quit: Leaving)
13:53:33*HakanD______ joined #nim
13:53:48sepisoad2sepisoad
13:58:23*sepisoad2 quit (Read error: Connection reset by peer)
14:01:33*BlaXpirit_ joined #nim
14:03:59*BlaXpirit quit (Ping timeout: 245 seconds)
14:05:41*rapind joined #nim
14:10:43*gsingh93 joined #nim
14:16:12*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:20:23*reem joined #nim
14:21:53*jfchevrette joined #nim
14:24:09*Jehan_ quit (Quit: Leaving)
14:25:02*reem quit (Ping timeout: 250 seconds)
14:32:56*banister joined #nim
14:40:33*HakanD______ quit (Quit: Be back later ...)
14:45:21*wb joined #nim
14:49:45ekarlsoif anyone is interested I got a vagrantfile that brings up fedora 21 with nim-vm and latest nim + nimble
14:49:52ekarlsofun for dev stuffs
14:51:41jfchevretteinteresting. why not put it up on github and share the link?
14:51:51jfchevrettei'm interested :)
15:01:32*HakanD______ joined #nim
15:09:19*saml joined #nim
15:11:30*rapind quit (Remote host closed the connection)
15:20:52*JinShil quit (Quit: Konversation terminated!)
15:26:01*jholland joined #nim
15:32:31*saml quit (Quit: Leaving)
15:38:46*saml joined #nim
15:39:26*banister is now known as banisterfiend
15:40:11shevyekarlso up with the link!
15:41:13*dumdum quit (Ping timeout: 256 seconds)
15:45:40*HakanD______ quit (Quit: Be back later ...)
15:48:36*rapind joined #nim
15:55:46*jfchevre_ joined #nim
15:56:10*jfchevrette quit (Ping timeout: 244 seconds)
15:57:44*kjo1 joined #nim
15:58:19BlaXpirit_flaviu, I'm pretty sure this is wrong https://github.com/flaviut/furry-happiness/blob/master/rand.nim#L25
15:58:56BlaXpirit_first of all, the conversion won't work if the number has a sign. second, it just truncates one bit regardless of sign
16:00:22*skroll3 quit (Ping timeout: 240 seconds)
16:02:10*skroll3 joined #nim
16:04:11*jfchevrette joined #nim
16:05:06*ChrisMAN joined #nim
16:06:07*nickles joined #nim
16:07:32*jfchevre_ quit (Ping timeout: 264 seconds)
16:07:52*nickles quit (Client Quit)
16:10:42flaviuBlaXpirit_: Well, it does work :P
16:10:43*Ven joined #nim
16:10:54Ven!kirbyrape
16:11:05VenI'm sorry, I had to try.
16:11:31*kuzy000 quit (Read error: Connection reset by peer)
16:12:50*kuzy000 joined #nim
16:13:25federico3ekarlso: nim-vm?
16:13:32flaviuOr maybe it doesn't, investigating further.
16:15:53reactormonkHow do I properly benchmark stuff? as in, circumvent dead code elimiation etc.?
16:16:48flaviureactormonk: Typically, you set up an accumulator and do something non-optimizable with it like write it to stdout.
16:17:17reactormonkflaviu, yeah, but the problem with that it spends a non-trivial amount of time accumulating the results
16:17:34reactormonke.g. converting to string.
16:18:36flaviutry grabbing the nth character of the string and adding it then.
16:18:54reactormonknice idea
16:20:14*panzone joined #nim
16:24:19*panzone_ joined #nim
16:25:19*lavender joined #nim
16:26:17*banisterfiend quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:27:43*panzone quit (Ping timeout: 265 seconds)
16:29:26reactormonkflaviu, meh, can't reproduce the differences :-/
16:30:58*TEttinger joined #nim
16:33:28*panzone joined #nim
16:35:17*panzone quit (Client Quit)
16:35:20*Woflox joined #nim
16:35:31*gsingh93 quit (Quit: Connection closed for inactivity)
16:35:44*panzone_ quit (Ping timeout: 252 seconds)
16:44:31*irrequietus joined #nim
16:45:08reactormonkAraq, btw, any plans to move nim from Araq to nim-lang?
16:47:35*irrequietus quit (Client Quit)
16:47:51*HakanD______ joined #nim
16:48:33ekarlsofederico3: nim version manager
16:50:03TEttingerbut I like having a benevolent dictator for life
16:53:30*darkf quit (Quit: Leaving)
16:54:25*Jehan_ joined #nim
16:55:15*dumdum joined #nim
16:57:01*banister joined #nim
17:06:38*vbtt joined #nim
17:07:44*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:09:37*dhasenan_ joined #nim
17:11:45vbtthello
17:12:48*davidhq joined #nim
17:13:20def-hi vbtt
17:15:09vbttpretty nice to see nim get good publicity in the last few months
17:15:34vbttofficial support for araq is awesome
17:16:08vbttalthough I don't care for c++, hopefully nim compiler issues will get fixed soonish now.
17:17:27reactormonkvbtt, been coding anything in nim?
17:17:32Jehan_vbtt: The importance of C++ support is to achieve a critical mass for external library support. Which is important for a lot of people.
17:17:54Jehan_It doesn't matter much to me, but that's because my work doesn't depend much on external libraries.
17:18:09vbttJehan_:I understand, I'm not against c++ support. doesn't excite me, that's all.
17:18:37vbttreactormonk:not much really
17:18:38*Matthias247 joined #nim
17:19:07vbtti wrote a blog about generics last year.
17:19:09Jehan_vbtt: As I said, it's not terribly important for me, but it makes Nim more viable for a number of people, which increases its userbase, which ultimately is good for Nim development.
17:19:15vbtttime to write another one about nim i think.
17:19:23vbttJehan_:agree
17:19:28*rapind quit (Remote host closed the connection)
17:19:59reactormonkvbtt, I can help, toss me something
17:20:22vbttreactormonk:help with what?
17:21:02reactormonkvbtt, read-check etc. What do you want to write about?
17:21:28vbttreactormonk:ah thanks.
17:21:36vbtthaven't decided yet. kinda short on time.
17:22:05vbtti like server type code.
17:22:23vbttmaybe something about the concurrency models and async stuff.
17:24:17vbtthave to write more code in it first
17:25:21*rapind joined #nim
17:26:21vbttbtw, is there an stm library for nim?
17:28:27reactormonkWhat's stm?
17:28:41Jehan_software transactional memory.
17:28:43vbttsoftware transactional memory.
17:28:47Jehan_And not that I know of.
17:29:00vbttso since heaps are isolated in nim, stm may be one good way to share data.
17:29:13*teapot1 quit (Ping timeout: 246 seconds)
17:29:26Jehan_Yeah, but … really hard to do without a GC for shared heaps.
17:29:48Jehan_There are also easier ways to do shared memory that don't involve STM.
17:30:22vbttsuch as?
17:30:35Jehan_Also, transactional memory is still at the point where its performance is essentially too poor for practical purposes without hardware support.
17:30:47vbttdepends on what you use it for
17:30:48Jehan_Simple shared heaps that can be read-/write-locked.
17:32:03Jehan_vbtt: Well, pretty much anything? The problem is that the constant overhead for transactional reads/writes is so big that it tends to kill a lot of the gains you get from parallelization.
17:32:35Jehan_Furthermore, outside of specific data structures, there are easier approaches to get fine-grained parallelism working.
17:32:49vbttJehan_:depends on the implementation no? you could have read optimized stm, based on mvcc for e.g.
17:33:09vbttit's mostly the writes that would be the problem
17:33:23vbttanyway, does nim have shared heaps that can read/write locked?
17:33:38Jehan_vbtt: Of course it depends on the implementation, but I don't know of any that's both reasonably general and fixes the performance issues.
17:34:43Jehan_vbtt: No, but I've been advocating for it.
17:35:12Jehan_It's low-hanging fruit that would fit in nicely with the existing thread-local heaps.
17:35:41vbttso these shared heaps would also be isolated? i.e. could objects in the shared heap point to other heaps?
17:37:38Jehan_vbtt: They'd be isolated. The point would be to have shared access to large data structures that you wouldn't have to move between threads.
17:38:14vbttright, that would work too
17:38:14Jehan_Simple example: A large shared hashtable.
17:38:38Jehan_You'd still have to copy keys and values from the thread-local heap to the shared heap, but wouldn't have to move the entire table.
17:38:53vbtti was thinking an stm that is isolated too.
17:39:04Jehan_Ah, gotcha.
17:39:13vbttso,e g, use a cow btree for a hashtable
17:39:34vbttthen you have multiple parallel reads but single writer
17:39:44Jehan_But yeah, that would be tricky with GC again.
17:39:48vbttvery useful for caching type data that is common
17:39:53vbttthere would be no gc
17:39:59vbttyou'd have to remove the values yourself.
17:40:00Jehan_If you have one read/writelock per shared heap, GC works fine.
17:40:17Jehan_Since read access can't mutate the heap and with write access you have exclusive access and can GC at will.
17:40:38vbttso all readers are locked out while the gc runs?
17:41:03Jehan_vbtt: Yup. Remember, though, that Nim's GC is soft RT.
17:41:33Jehan_And you actually have a lot of control over pause times.
17:41:44vbtti see
17:42:19Jehan_This is why I said that it's low-hanging fruit that fits the existing GC model pretty well.
17:42:33vbttyeah that would be pretty useful
17:42:43Jehan_It's not perfect, but it doesn't require a huge time investment, either.
17:44:27vbttJehan_:is it on the gsoc list?
17:45:30vbttbtw, is there is a way to deep copy an object in nim?
17:45:32Jehan_vbtt: The GSOC proposal is more ambitious. What I've been suggesting would be a bit too simple for GSOC.
17:46:02Jehan_vbtt: Yes, but I don't recall how you use it explicitly. It's used under the hood by spawn, I know that.
17:47:04vbttalso, is trunk stable enough mostly or should i use a published release?
17:48:00*rapind quit (Remote host closed the connection)
17:48:55*Ven quit (Remote host closed the connection)
17:50:49reactormonkvbtt, trunk is good
17:52:11*gsingh93 joined #nim
17:54:55*rapind joined #nim
18:04:20*banister joined #nim
18:13:33*lavender quit (Ping timeout: 250 seconds)
18:17:00*kjo1 left #nim (#nim)
18:38:10*UberLambda joined #nim
18:40:32gokrAraq: Here? Or still drinking champagne?
18:43:33*HakanD______ quit (Ping timeout: 264 seconds)
18:44:10*HakanD______ joined #nim
18:57:34gmpreussner|workis anyone using nim @ head on Windows today?
18:57:56gmpreussner|worki'm getting some odd segfaults at run-time in compiled programs. not sure what's going on.
18:58:12gmpreussner|worklike local variable declarations can crash :/
18:58:20*singularity joined #nim
18:58:35*singularity is now known as singul42
18:58:43singul42hi there
19:00:01singul42I have just installed nimble and trying to install jester, but I get the following error:
19:00:06singul42Error: unhandled exception: Unable to query remote tags for git://github.com/dom96/jester/. Git returned: fatal: write error: Invalid argument [OSError]
19:00:25def-singul42: hi. do you have git installed?
19:00:46singul42yes, used a windows installer for it and it is also in the path
19:01:28def-On Linux it works for me
19:01:43singul42using "git" on the command line just gives me the git help
19:03:07def-as a workaround you can "git clone git://github.com/dom96/jester/" and run "nimble install" in the jester directory
19:03:14def-i don't know what causes the error
19:06:55BlaXpirit_Nim in Wine was such a great idea
19:07:21BlaXpirit_it allows me to test for: Windows, Nim 0.10.2, sizeof(int)==4 all at once
19:07:37dom96singul42: report this as a bug on Nimble's repo please
19:09:38dom96singul42: What happens when you execute: `git ls-remote --tags git://github.com/dom96/jester/` ?
19:09:47*dhasenan_ left #nim (#nim)
19:10:29singul42will try it in a second. just tried to clone it and also got an error. looks like git has problems on my machine with the git:// protocol
19:10:50singul42when using http:// I am able to clone jester
19:11:37def-that's an issue we've had a few times. sometimes we use git://, sometimes https://. should always be the same (probably https?)
19:12:00singul42using git ls-remote.... I get the error "fatal: write error: Invalid argument"
19:12:23singul42that's the same error I also get when trying to clone with git://
19:13:03BlaXpirit_looks like it's time to search for this particular problem
19:13:13BlaXpirit_this is not necessarily related to nimble
19:13:49flaviuMaybe it's related to corporate proxies?
19:14:22singul42at least I have no proxies running
19:14:29dom96Perhaps the ports which the git protocol uses is blocked?
19:14:32singul42also swicthed my firewall off for testing
19:15:40singul42well, I didn't restart windows after installing git .... hope that's not the problem
19:17:39*alexruf joined #nim
19:22:36BlaXpirit_made some changes to random library, if someone is interested https://github.com/BlaXpirit/nim-random/compare/602467577653aa5770208f49c98119903316bc96...master
19:24:06BlaXpirit_im away for now though
19:24:48*dom96 restored the draft of the Nim wikipedia article on https://en.wikipedia.org/wiki/Nim_%28programming_language%29
19:27:17flaviuBlaXpirit_: Added some comments on the commits
19:30:46*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:31:10BlaXpirit_mostly unimportant things
19:32:03ldleworkdom96: +1
19:33:03flaviuBlaXpirit_: Only the gitignore thing is unimportant IMO
19:33:50ldleworkdom96: "Nim however differs greatly when it comes to semantics: for a start Nimr is statically typed."
19:34:19dom96ldlework: please fix it, I need to head out now.
19:35:15*koz_ quit (Quit: Leaving)
19:35:42def-ldlework: I'm also fixing many references and renames from nimrod to nim
19:35:53ldleworkWell I just submitted the fix.
19:38:35*brson joined #nim
19:38:39*dumdum quit (Ping timeout: 256 seconds)
19:40:43BlaXpirit_flaviu, what's wrong with that cast?
19:41:07flaviuThe cast is fine, the idea in general isn't.
19:41:26BlaXpirit_which idea
19:41:43flaviuOf falling back to seeding with the time if urandom is unusuable.
19:42:17*fizzbooze joined #nim
19:42:27*UberLambda quit (Quit: Leaving the Matrix)
19:43:17*alexruf quit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:43:45BlaXpirit_what then
19:44:25*alexruf joined #nim
19:45:25flaviuIf an attacker can cause that fallback to occur, you're pwned.
19:46:01BlaXpirit_people dont need to rely on that seed
19:47:17*singul42 quit (Quit: Page closed)
19:48:42flaviuBut they will. It's the easiest way after all, and most people won't process the possible implications (or even be able to think of them!).
19:49:15BlaXpirit_I don't see how urandom can be unusable
19:49:51flaviuFile descriptor exhaustion is one thing that comes off the top of my head.
19:50:50flaviuOr what about a chroot where no one has bothered to add /dev/urandom.
19:54:49*johnsoft quit (Ping timeout: 245 seconds)
19:55:30*johnsoft joined #nim
19:55:40*kuzy000 quit (Ping timeout: 250 seconds)
19:56:20*kuzy000 joined #nim
20:03:45*vendethiel joined #nim
20:06:32*dhasenan_ joined #nim
20:06:47*singul42 joined #nim
20:06:55singul42re
20:07:49singul42still having the problem with git:// protocol under windows, but as a workaround git config --global url."https://".insteadOf git:// helps
20:08:19singul42thanks for the help, hints and tips
20:11:22TEttingersingul42: woah that should help me too
20:11:25TEttingerthanks singul42
20:13:50singul42oh, I thought I am the only one on earth with the "fatal: write error: invalid argument" error when using nimble :-)
20:15:37*Mat4 joined #nim
20:15:41Mat4hello
20:18:10singul42hi Mat4
20:18:26Mat4hi singul42
20:21:29*Hakaslak joined #nim
20:26:48*Hakaslak quit (Ping timeout: 246 seconds)
20:30:48*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:32:37ekarlsohttps://github.com/ekarlso/nim-vm < cd vagrant; vagrant up < voila wokring rust devel
20:32:56def-rust devel?
20:33:04ekarlsoehm, nim devel
20:33:06ekarlsohaha
20:33:08ekarlso:P
20:33:10ekarlsodunno where rust came into it
20:35:30Mat4from rust to dust
20:36:10shevyto lust
20:36:44ekarlsoshould it install nimble as well ?
20:41:51vbttyes
20:47:47*UberLambda joined #nim
20:51:36ekarlso:p
20:56:42*HakanD______ quit (Quit: Be back later ...)
21:02:03singul42is there a nim library that offers high level procs to show a notification icon in windows' notification area? maybe also with some popup-menu functionality?
21:02:31*Jehan_ quit (Quit: Leaving)
21:03:56BlaXpirit_gtk?
21:04:04BlaXpirit_no idea
21:04:20BlaXpirit_Qt is my answer to everything, but it is not available for nim
21:04:52flaviuthis is weird. If I replace one bit of code with another, it's 10x slower than the initial code. If I mark everything as inline, it's 2x faster than the initial code.
21:07:11def-flaviu: code pleae
21:07:22singul42well, looks like I have to dig into win32 api
21:07:28def-if it's short enough
21:08:37*TEttinger quit (Ping timeout: 250 seconds)
21:09:09*filwit joined #nim
21:09:15flaviudef-: I'm not really asking for help, but ok: https://github.com/flaviut/nim-random/compare/BlaXpirit:master...master
21:09:31def-flaviu: i'm just curious
21:11:34*nimthusiast joined #nim
21:14:54*alexruf quit (Quit: Textual IRC Client: www.textualapp.com)
21:16:12filwitBlaXpirit_: was reading logs, and noticed your pastbin, just wanted to point out a couple of alternatives in case you weren't aware of them: https://gist.github.com/PhilipWitte/a9ecf4d36b109ee179b7
21:17:51BlaXpirit_that's no good
21:18:31filwitI'm not sure of your use case. I just wanted to put it out there in-case you didn't know you could do those things.
21:19:37filwitwhy do I add a hyphen in the word "in-case"... silly brain...
21:20:51filwitBlaXpirit_: that said, the second example is basically exactly what your code is doing, but I find it a bit cleaner (I always find `compiles()` a bit too "hacky")
21:21:05BlaXpirit_but make it 4 classes
21:21:11BlaXpirit_across different modules
21:21:15BlaXpirit_it's oversimmplified
21:22:05filwiti'm not sure what you mean by "it makes 4 classes", sorry. Maybe I missed something in your original post.
21:22:35BlaXpirit_i mean do the same thing with 4 classes across different modules
21:24:07filwitthat shouldn't be a problem. type classes apply to any other type (they're basically a way of wrapping up the `compiles()` statement into a clean package which only gets invoked once per unique-type)
21:24:27filwitbut again, i don't know your use case
21:24:49filwitso i'm only showing you in case you didn't know about them
21:25:44filwit(ah, i think you're referring to the top example... yes that wouldn't work with 4 classes across modules, but the bottom example would)
21:28:13*Mat4 quit (Remote host closed the connection)
21:30:30filwitvery cool to see the Nim wikipage back up!
21:30:55filwitguess the recent traction Nim has been getting did the trick :)
21:31:03BlaXpirit_ah i understand how your stuff works... yes, it'spretty much the same except you need to bother with typeclasses
21:31:03gokr131 users? yowza
21:31:36VarriountThis comment might be interesting to those who wonder why Nim can't seem to get a Wikipedia article: https://news.ycombinator.com/item?id=9063800
21:31:54Varriount(or wasn't able to)
21:32:13flaviufilwit: I think it's up because they haven't noticed yet ;)
21:32:14filwitBlaXpirit_: yes, for a simple example the type-class might be overkill.. but type-classes can package a ton more than just checking for a single procedure (they can test anything), so it's very useful for this sort of thing.
21:33:31flaviuAnd don't typeclasses get lowered down to a series of when compiles(foo)?
21:36:23*singul42 quit (Quit: Page closed)
21:36:47filwitflaviu: that's my understanding, yes. But they clean up the code when you need to check multiple interfaces in multiple areas around your code. If you have an `Visual` type-class witch a few proc requirements (predraw, postdraw, draw, etc) and you need to work with "Visuals" in multiple places throughout your rendering pipeline, type-classes obviously make much more sense than doing `compiles(predraw(x)) and ...` all over the place
21:37:05filwitwith** a few...
21:37:33*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:37:53flaviuYep, 20 lines once is better than 20 lines 20 times, especially for more complicated type classes
21:38:28filwityep
21:39:24filwithttps://www.youtube.com/watch?v=22-HSjMS3Ks
21:39:42filwitwhoops... wrong video, sorry (nevermind that)
21:40:25flaviuhaha
21:45:03gokrTidbit: Just got a new demo running in Urhonimo (but it takes a hack in nim compiler) that is a stress test. It indicates that the Nim version is basically same speed as the C++ version.
21:45:04*nimthusiast quit (Ping timeout: 246 seconds)
21:46:29*reem joined #nim
21:46:38filwitI remember Araq (or someone) talking about using the Ref-Count GC as a leak-detector for non-GC'd Nim code before, but I forgot exactly how to do it (or what was possible).. Reading the recent discussion on the forums makes me think this would be a good thing to know (in order to help those who want to use Nim without a GC). Does anyone know more about this?
21:47:28*Jehan_ joined #nim
21:48:18filwithey Jehan_, was just wanting to ask you about something (hopefully you know).. let me quote what I just said..
21:48:24filwitI remember Araq (or someone) talking about using the Ref-Count GC as a leak-detector for non-GC'd Nim code before, but I forgot exactly how to do it (or what was possible).. Reading the recent discussion on the forums makes me think this would be a good thing to know (in order to help those who want to use Nim without a GC). Does anyone know more about this?
21:48:47filwitJehan_: Do you have any idea on how to use the GC in this way?
21:49:02*Boscop__ quit (Ping timeout: 245 seconds)
21:49:03*Woflox quit (Ping timeout: 244 seconds)
21:49:51Jehan_filwit: Not in the sense that I know how to actually implement it as part of the current codebase, but the idea is that a GC will detect unreachable objects. If that happens during manual memory management, that object is a leak.
21:50:02Jehan_The Boehm GC has explicit support for that, too.
21:50:33Jehan_That said, I'm not sure if the people who want a GC-less version of Nim know what they're in for.
21:51:04filwitI agree, but it would be a nice thing to point them towards.
21:51:22Jehan_Eh, that would only solve a fraction of their problems.
21:51:43*Boscop__ joined #nim
21:52:17Jehan_And let's not even get into the hard real-time stuff.
21:52:21filwitwell didlybom had a good point in that he did not know what parts of the stdlib he could use without the GC.. I remember hearing that you could use the GC to detect this, but didn't know exactly how to direct him to it (which is why I ask)
21:52:41Jehan_At this point it may be easier to create a hard real-time GC or not do dynamic memory management at all.
21:53:03Jehan_Very little, really.
21:53:59Jehan_I mean, strings and seqs are the easy part, since they have copy semantics by default (like C++).
21:54:51Jehan_Basically, if I tried, I'd simply not use any ref types at all and do it like ParaSail.
21:55:08*jsudlow quit (Quit: Leaving)
21:55:30Jehan_Note that arguments and results are passed by reference by default even if not declared as var (unless they're very small).
21:55:31*reem quit (Remote host closed the connection)
21:55:36Varriountfilwit: When the compiler has the GC switched off, it will warn when memory is being used that is ussually under GC control.
21:55:51filwitI imagine that would be best for embeded devices coding (areas you probably don't want the small overhead of the GC)
21:56:01filwit^ (directed at Jehan)
21:56:25filwitVarriount: Okay awesome. So Nim basically does this out of the box.
21:56:26filwitnice
21:56:56Jehan_Basically, what I'm saying is that you need to make do without GC, you probably want to make do without heap storage at all (or only under controlled circumstances).
21:57:05filwithmm... I've tried with --gc:none before and didn't notice any messages though, maybe I wasn't looking hard enough..
21:57:39Varriountfilwit: Odd. They should be there.
21:57:39Jehan_Nim is capable of working out of the box without ref types, which is the easiest way to get started.
21:57:46*davidhq joined #nim
21:57:50filwitJehan_: yes i understood you, and I agree that's probably the best solution.
21:57:51Jehan_You'd still have to deal with string/seq-resizing.
21:58:33ekarlsonimvm now handles multiple versions and allows you to "nim-vm use v0.10.2"
21:58:44def-filwit: definitely there: xy.nim(4, 3) Warning: 'add(s, i)' uses GC'ed memory [GcMem]
21:58:46Jehan_I'd suggest to look at ParaSail and set Nim up to do it similarly.
21:59:24filwitJehan_: that's an interesting idea actually... basically if you only used stack-allocation plus ptr types for referencing, you basically end up with something similar to Rust's memory management...
21:59:35filwitJehan_: I feel like I'm really mistaken about that though...
21:59:37Jehan_Does nim-vm work like rvm? I haven't looked at that.
21:59:59ekarlsoJehan_: kinda yeah ;)
22:00:10filwitdef-, Varriount: Yes thanks. I wasn't really looking for the messages when I tried awhile ago (was benchmarking something).. so it was just me.
22:00:19filwitdef-, Varriount: thanks for the heads up.
22:00:21Jehan_filwit: ParaSail is sort of stack allocation + tree structures.
22:00:42*reem joined #nim
22:00:43Jehan_ekarlso: Hmm, not so exciting, unless it manages to not pollute shell profile files as much as rvm does?
22:00:52Jehan_I'm generally more of a fan of virtualenv.
22:01:23Jehan_filwit: Which works mostly like unique_ptr, minus the need to actually have pointers in a lot of cases.
22:02:35filwitI've never really taken a look at Parasail, but I remember watching a talk about it's memory-safety with a GC awhile back (didn't understand most of it at the time)
22:03:12filwitbut now that I think about it, basically stack-allocating everything (except for seq/strings) would mostly be memory-safe in Nim with a GC
22:03:36filwitI don't know what virtualenv is, and my understanding of unique_ptr is limited too
22:03:55filwitit's been awhile since I've worked with C++ code heavily
22:04:08filwitand I never really used those smart pointer types when I did
22:04:13*pafmaf__ quit (Quit: This computer has gone to sleep)
22:04:26BlaXpirit_btw, when I did try to use typeclasses, the compiler failed big time
22:04:39*polde quit (Ping timeout: 272 seconds)
22:04:51Jehan_filwit: virtualenv was "as opposed to rvm". :)
22:04:52filwitBlaXpirit_: do you have an example?
22:04:56ldleworktypeclasses compile for me fine, but the compiler doesn't enforce them when used as generic constraints
22:05:00Jehan_Two conversations at once, sorry.
22:05:17*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:05:38BlaXpirit_filwit, quite likely that I don't
22:05:55BlaXpirit_not anymore
22:06:14filwitBlaXpirit_: i mean can you post a simple example online (of what is failing for you) so that we can help fix the issue?
22:06:44BlaXpirit_found it in logs, yay
22:06:45filwitthe type-classes work fine in master and devel
22:06:58ldlework'work fine'
22:07:18BlaXpirit_https://bpaste.net/show/fddec6c851f2 on line 13 there are 2 generic arguments. if I make one of them normal, it works, just not with both
22:07:24ldleworkfilwit: they still don't work as constraints do they?
22:07:34filwitldlework: yes my brain always types the wrong words that I'm thinking :S
22:07:54ldleworkfilwit: hehe
22:08:13filwitldlework: if you mean `proc foo[T:MyTypeClass](x: T)` then yes, that works
22:08:40filwitBlaXpirit_: one sec, let me take a look
22:09:25ekarlsoJehan_: it just adds a single addition to PATH
22:09:27ekarlsonothing more
22:10:03ldleworkfilwit: as in it will only let me parameterize foo with a MyTypeClass? That's news to me.
22:10:21ldleworkI'm pretty sure last time I checked user type-classes compiled but did not enforce against generics.
22:10:23Jehan_ekarlso: Yeah, still not keen on that, I'm afraid.
22:11:03ekarlsoJehan_: how else would you solve it ?
22:11:10Jehan_I mean, it's not as bad as rvm where I basically had to spend an hour ripping out everything it had put in there, but I still prefer it if my dot files are being left alone.
22:11:20filwitBlaXpirit_: to my knowledge you cannot use user-defined-TypeClasses like you're trying to (as regular type contstraints). Try: `proc draw*[D:Drawable](renderTarget: RenderTarget, obj: D)`
22:11:22Jehan_ekarlso: As I said, I'd prefer a virtualenv-like approach.
22:11:33BlaXpirit_filwit, maybe, maybe
22:11:40ekarlsoJehan_: hmmmms
22:11:43BlaXpirit_but that... is not very useful
22:12:00filwitBlaXpirit_: I may be wrong about that, let me check.
22:12:09Jehan_ekarlso: I mean, I'm not saying that it should be done this way. Just trying to explain my personal preferences. :)
22:12:23BlaXpirit_filwit, Drawable works just fine if the RenderTarget argument is not there
22:12:34BlaXpirit_RenderTarget works just fine if the Drawable is not there
22:12:44BlaXpirit_the combination of them breaks things
22:13:09Jehan_There used to be a problem with multiple generic arguments, that may be the same thing.
22:13:21filwitBlaXpirit_: your problem is with RenderTarget... define like this: type RenderTarget* = RenderTexture | RenderWindow
22:13:22BlaXpirit_your line of code doesn't work either
22:13:30filwitnotice i removed the 'or'
22:13:39filwiti think that's the problem at least, (didn't test)
22:13:41BlaXpirit_doesn't help, filwit
22:13:44filwitcrap
22:13:55BlaXpirit_no change at all
22:14:15filwitone sec, let me try to compile this...
22:17:03*BlaXpirit joined #nim
22:17:34*BlaXpirit_ quit (Quit: Quit Konversation)
22:18:05*kernasi joined #nim
22:18:07kernasihola
22:18:22filwitBlaXpirit_: it looks like line 11 is causing the issue, but it's odd and I think it might be a bug
22:19:20BlaXpiritthat's what everybody thought
22:20:31filwitBlaXpirit: actually I think it's because the semantics are wrong on that line (you can't pass 'RenderTarget' as a value to 'draw' cause it's a type not an instance) and just the error message is odd... one sec
22:21:24ekarlsoJehan_: how you think a venv approach could be done then ?
22:21:36*Cykacykacyka joined #nim
22:22:00gokrkernasi: welcome
22:22:05Jehan_ekarlso: Umm, I haven't looked at it, but I think it may require changes to nimble at least.
22:22:29ekarlsoJehan_: what about nim compiler versions then ?
22:22:30*rapind quit (Remote host closed the connection)
22:22:37Cykacykacykahello, I came across this language and it seems really great from what I've seen
22:22:39*rapind joined #nim
22:22:40*rapind quit (Remote host closed the connection)
22:22:52Cykacykacykadoes the YCM plugin for vim support this language ?
22:22:52ldleworkCykacykacyka: welcome
22:23:07Cykacykacykaand what could be a good non trivial project to try the language out ?
22:23:29Cykacykacykaand will you ever try and write a llvm frontend compiler for it ? :D
22:23:49def-Cykacykacyka: All I know for vim is this: https://github.com/zah/nimrod.vim/ (a bit out of date i think)
22:23:51Jehan_Different Nim versions can co-exist in different directories, the only issue there is the global config file.
22:24:41def-Cykacykacyka: someone was working on an llvm frontend, but it's been abandoned. you can compile through clang though, and that often gets nice speedups at compile and runtime
22:26:12Cykacykacykayeah, but doesn't transpiling to c before bytecode mean that there are certain optimisations you simply can't do ?
22:26:47def-Cykacykacyka: a gameboy or nes emulator in Nim would be cool
22:27:51CykacykacykaI haven't done any emulators yet, in fact, the only real life project I've made is an automisation framework for android in python, but hey, gameboy shouldn't be too hard, should it ?
22:28:40BlaXpiritnes emulator huh
22:28:57BlaXpiritisn't that too complicated
22:29:01Cykacykacykaand regarding the similarities to python, do you also do list comprehensions and the godly or operator in assignments ?
22:29:07def-at least those are fun projects i've been thinking about.
22:29:10def-BlaXpirit: he said non-trivial
22:29:26BlaXpiritCykacykacyka, no
22:30:01CykacykacykaBlaXpirit, although this is just speculation, I think that the cpu in the early gameboys are relatively well documented and are not brainwack craizy
22:30:20def-There seem to be quite good references on writing a gameboy emulator: https://github.com/mattrubin/Gambit
22:30:53Cykacykacykaand being a naive student with no understanding of anything, writing an emulator would give me good practical experience and force me to understand lower levels of hardware, shouldn't it ?
22:31:08*pregressive joined #nim
22:31:31AraqCykacykacyka: the word "transpile" is verboten in this channel ... ;-)
22:31:43def-Welcome back, Araq
22:31:48CykacykacykaAraq, noted.
22:32:17Araq(omg, seriously! if you don't know what you are talking about, stop acting like you do!)
22:32:33def-Araq: any plan to reupload the website soon? I like filwit's changes
22:32:54Araqthat depends on dom96
22:32:57def-ok
22:33:00AraqI have it ready
22:33:06Araqfor upload
22:33:45Cykacykacykawell, then elaborate, are you not compiling nim code to c code to binary ?
22:35:13def-Cykacykacyka: YCM looks similar to the nimsuggest we have
22:35:30def-should see how to get it integrated into vim
22:35:40filwitAraq: could you help me figure out why this type-class code isn't working: https://gist.github.com/PhilipWitte/8935a52bcf945e7a878b ?
22:36:07Jehan_Cykacykacyka: Transpiling generally means that the target language offers about the same level of abstraction as the source language and the translation process tries to preserve that; using C as a portable assembly language is not really the same thing.
22:36:18Araqfilwit: no idea, sorry, I'm still busy getting static[T] into shape
22:36:27filwitAraq: np
22:36:43filwitI'm thinking it may be a bug in Type-classes anyways
22:37:19Araqbut hey, at least I got their tests cleaned up
22:38:36filwitBlaXpirit: take a look at my gist: https://gist.github.com/PhilipWitte/8935a52bcf945e7a878b
22:38:53filwitBlaXpirit: it's not working, but the line i have commented out is along the lines of what you want to do
22:38:54BlaXpiritwhat am i supposed to see there
22:38:56kernasihow I can tell "nim" to use a different CC? in the output I see "CC" but setting CC doesn't have any effect; I'm used to this in C
22:39:03kernasican I*
22:39:04BlaXpiritoh ok
22:39:06kernasitoo much beer
22:39:13filwitBlaXpirit: i have `d is Sprite` just to make things compile
22:39:26BlaXpiritkernasi, --advanced shows some stuff
22:39:31kernasiI'm there :)
22:39:38kernasibut it still uses "gcc"
22:39:52BlaXpirit --gc:refc|v2|markAndSweep|boehm|none
22:39:59*UberLambda quit (Ping timeout: 256 seconds)
22:40:04Jehan_kernasi: --cc:clang
22:40:04BlaXpiritoh damn
22:40:07kernasioh
22:40:15BlaXpiritCC sorry, I confused with GC
22:40:26filwitdom96: 127, new record :)
22:40:35Jehan_If you want to actually use a different version of gcc, that's slightly more complicated.
22:40:49Jehan_Since you then will have to specify the path.
22:40:51BlaXpiritwasn't it just 128 cuz UberLambda left
22:40:52kernasino, just a wrapper :)
22:41:11*Demos joined #nim
22:41:12filwitBlaXpirit: oh i missed that, you're right
22:41:18filwitnevermind... 128 again!
22:41:22BlaXpirit:>
22:43:27*grumbly joined #nim
22:43:52BlaXpirit:>
22:44:45grumblyDoes anyone have experience making nim use tinycc?
22:44:45kernasiI was actually looking for --passL:"-static" as I already replaced my libc :) thanks guys
22:44:59gokrkernasi: Bottom: http://nim-lang.org/question.html
22:45:09kernasiI wanted to replace $CC because I have a wrapper I use in C ("musl-gcc")
22:45:12kernasibut that it works as well
22:45:26*JinShil joined #nim
22:45:33gokrfilwit: We were at 130 earlier
22:45:36gokr;)
22:45:46def-grumbly: yep, works perfectly, just need --cc:tcc
22:45:54kernasigokr, nice, I change it in the config, perfect :)
22:46:06kernasiya, sorry, I just downloaded nim and wanted to play around with it :)
22:46:47def-kernasi: --gcc.exe:musl-gcc should work
22:46:56filwitgokr: we're at that now too! quick, invite your friends!
22:47:04grumblySo I thought (--cc:tcc) however I get an error 'crt1.o not found' and 'crti.o not found'
22:47:13filwit:P
22:47:17def-filwit: https://gist.github.com/dom96/da2d4dead6fb00b71312
22:47:23grumblyI get farther if I force --cpu:i386
22:47:42filwitdef-: er, okay then
22:47:50grumblyBoth nim and tinycc work alone on hello world, but can't get them to work together.
22:47:59filwitthis record goes up too fast these days I can't keep up!
22:48:39kernasidef-, yep :)
22:48:48kernasiseems flexible enough
22:49:00def-grumbly: maybe your tcc version is too old? i only tried with 0.9.26-r2
22:49:14kernasitcc is not developed anymore, I wouldn't invest in that
22:49:19kernasithough it's nice
22:49:24*jfchevrette quit (Ping timeout: 245 seconds)
22:51:16grumblydef-, I'm using tcc v. 0.9.26 from here [http://download.savannah.gnu.org/releases/tinycc/]
22:51:43grumblykernasi, Sounds like the right idea
22:52:05Jehan_kernasi: Set gcc.exe = "musl-gcc" in your config file.
22:52:13def-kernasi: grumbly if you google for it, there are some solutions: http://stackoverflow.com/questions/6329887/compiling-problems-cannot-find-crt1-o
22:52:25Jehan_The --cc argument can only be one of a number of predefined values.
22:52:29kernasimy god, the help in here is overwhelming
22:52:37*kuzy000 quit (Ping timeout: 264 seconds)
22:52:50kernasiJehan_, ya, noticed that :)
22:53:08grumblykernasi, Thank you; I hadn't found that one yet.
22:53:29kernasiredirecting your thanks to def-
22:53:30Jehan_For example, I have the following in ~/.config/nim.cfg
22:53:32Jehan_@if gcc48:
22:53:32Jehan_ cc:gcc
22:53:32Jehan_ gcc.exe = "gcc-4.8"
22:53:32Jehan_ gcc.options.always = "-w -fpermissive"
22:53:32Jehan_@end
22:56:14*pregress_ joined #nim
22:56:54grumblydef-, Thank you. I'm sure if I spent a few more hours I could port that solution to my mac, but it's a headache. I'll just stick with Clang. Thanks for the help - this is a great IRC community!
22:56:59*pregressive quit (Ping timeout: 256 seconds)
22:57:33def-grumbly: oh right, i only tried on linux. clang is pretty fast at compiling already
22:58:34*grumbly quit (Quit: Page closed)
23:06:50filwitBlaXpirix: got it working: https://gist.github.com/PhilipWitte/8935a52bcf945e7a878b
23:08:10filwitBlaXpirit: ^; So basically you just need to prove that both the RenderTexture and RenderWindow can be called with `draw`
23:08:31BlaXpirito.o
23:08:47filwitBlaXpirit: unfortunately that's not idea.. I'm still trying to figure out how to make that cleaner (using RenderTarget instead)
23:08:52filwitideal*
23:09:10BlaXpiritok thanks
23:09:26fowli used generics like that in sfmls cpp wrapper
23:10:45*pregressive joined #nim
23:12:45*pregress_ quit (Ping timeout: 244 seconds)
23:17:25*BlaXpirit quit (Quit: Quit Konversation)
23:17:52Jehan_dom96: Where does nimble look for nim?
23:19:31Cykacykacykahas anyone used nim to produce binaries that run on android ? Not talking about using any of the android API's, basicall just using the c compilers provided by the android ndk ?
23:21:00*dom96_ joined #nim
23:21:36dom96_Jehan_: It looks in your PATH.
23:21:55Jehan_dom96_: Yeah, it wasn't finding it, but reinstalling from Git fixed that.
23:21:57*Var|Mobile quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com ))
23:23:26def-Cykacykacyka: some old code here: https://github.com/gradha/nimrod-on-android
23:24:41*sillesta quit (Ping timeout: 250 seconds)
23:24:59*polde joined #nim
23:25:19*pregress_ joined #nim
23:27:28kernasiJehan_, I had to add gcc.linkerexe = "/usr/local/musl/bin/musl-gcc as well; now it's perfect :)
23:27:37kernasithanks for all your help
23:27:42kernasigreat channel so far :P
23:28:02Cykacykacykadef-, this is not exactly what I need. I don't intend to app apps in nim, but rather 'traditional/linux-like' daemon that would do things with a socket and stuff.
23:28:09*pregressive quit (Ping timeout: 256 seconds)
23:28:22*jsudlow joined #nim
23:31:01def-Cykacykacyka: sorry, i misread. sounds like a case for cross compilation: http://nim-lang.org/nimc.html#cross-compilation
23:35:14filwitBlaXpirit: I found a different (probably better) way which uses RenderTarget inside the Drawable type-class: https://gist.github.com/PhilipWitte/8935a52bcf945e7a878b
23:36:42filwitBlaXpirit: however, that way is slightly different. It uses the type-classes slightly differently (in a way i'm not as familiar with) and avoids one of the procs completely.
23:37:16filwitBlaXpirit: not sure it will really be applicable to your real code
23:41:28*lavender joined #nim
23:42:45*pregress_ quit (Ping timeout: 252 seconds)
23:45:04*pregressive joined #nim
23:45:37filwitoh damn he left awhile ago...
23:47:38*rapind joined #nim
23:57:34*brson quit (Quit: Lost terminal)
23:57:44*brson joined #nim
23:59:46Cykacykacykadef-, actually, I shouldn't have jumped to conclusions, I don't have to use jni, but everything up to it is very well documented and fits my use case, thank you very much.