<< 16-02-2015 >>

00:00:12filwitkoz_desktop: did you miss the Nim/Urho3D announcement? here: http://forum.nim-lang.org/t/870
00:00:28koz_desktopfilwit: I'm kinda new to Nim.
00:00:35koz_desktopI only discovered it like... two days ago?
00:00:41koz_desktopAnd am trying to get my head around its use.
00:01:12filwitkoz_desktop: ah, i see. Welcome to Nim
00:01:29koz_desktopThank you - from what I can see, Nim is everythign I've been looking for.
00:01:35koz_desktopI'm a C programmer mostly.
00:01:47*vendethiel quit (Ping timeout: 256 seconds)
00:03:01*Matthias247 quit (Read error: Connection reset by peer)
00:03:23*Jehan_ joined #nim
00:05:16*itsmeront quit (Quit: Page closed)
00:05:37Araqhey Jehan_ welcome back :-)
00:06:01Jehan_Araq: Hi, just responded to your email.
00:06:23Jehan_I'm afraid the flu laid me out pretty good the past few days.
00:07:43*reem joined #nim
00:08:38Araqjust say "it's ok, it makes sense, polyhedral model."
00:09:10Jehan_I'll have to read up on that first myself, I haven't dealt with vectorization stuff in ages.
00:09:26Jehan_Ironically, given that my MS thesis was about it. :)
00:09:37gokrfilwit: The emscripten work by Atomic has already been merged and improved in Urho3D itself.
00:10:33gokrfilwit: http://urho3d.prophpbb.com/topic831.html
00:11:31filwitgokr: well I mostly talking about their editor (it looks like they have JS highlighting/suggest only).
00:11:31AraqJehan_: it's fine either way, I can re-formulate it so that it's more of an open question with a plan B
00:12:04AraqJehan_: so if you don't find the time, we'll manage to survive
00:12:05filwitgokr: last time I tried Nim with emscripten the GC was screwing things up (raytrace benchmark)
00:12:38Jehan_Araq: I'll have the time, given that I'll probably have to stay home tomorrow anyway. It's more whether I'll be able to focus.
00:13:17filwitgokr: never got the raytracer to work with Nim's JS backend (due to timing functions missing I believe), though I didn't try hard. But I imagine the performance would be acceptable (considering they're encouraging raw JS as a scripting language to begin with)
00:13:42*BlaXpirit_ quit (Quit: Quit Konversation)
00:15:24filwitgokr: plus, it probably wouldn't take too much to fix Nim->emscripten (the raytracer works almost perfect, just some colors aren't correct): see it here: http://reign-studios.net/philipwitte/nimrod/emcc-raytracer/main.htm
00:16:56filwitthat was compiled with Nim 0.9.6 I believe, haven't tried with anything newer, though I should just to see if it's fixed in the newer version for some reason
00:17:59flaviufilwit: http://nim-lang.org/assets/images/bg.jpg is a bit blurry in spots, is that intentional?
00:18:19flaviuSince it's sharp all over in http://reign-studios.net/philipwitte/nimrod/new-design.png
00:19:01filwitflaviu: I'm not sure. Let me take a look at the source art.
00:19:12filwitflaviu: which i still owe you, btw... one sec
00:19:34filwitflaviu: my guess is that it's just more compressed (noticed one is jpg while the other is png)
00:20:16flaviuOk. If so, then we should get it replaced, it's significantly different.
00:22:08filwitah i remember now, and I disagree honestly. The background as a PNG is much larger than a compressed JPG, since 90% of the time it's covered up (honestly I can bare see the artifacts, and I'm trying) so the trade-off seemed to be worth it.
00:22:44filwiti remember trying the different compression levels and not being able to tell a difference.
00:22:58filwitbut let me give you source art so you can see yourself and let me know if you think it's an issue.
00:23:24fowlfilwit, i get resource errors when trying urhonimos character demo
00:24:05def-fowl: you have to copy them over from urho3d/Bin/*Data or something
00:24:39filwitfowl: why is that directed at me? I have yet to try the Urhonimos stuff.
00:25:12fowli scrolled up and saw you talking about it
00:25:15fowlmb
00:25:50fowlneat, it runs
00:37:53Varriountonionhammer: We now have nice 'running' bars like package control
00:38:06AraqVarriount: the builders are down :-(
00:40:28*pipeep_ joined #nim
00:40:39*pipeep joined #nim
00:40:47*pipeep_ quit (Client Quit)
00:41:39VarriountAraq: Uh, no they aren't? The last build reports as failed (because C++ bootstrapping isn't working), however tests should still have been run.
00:42:44pipeepSo I'm *really* new to nim (started playing around with it this morning)
00:43:02AraqVarriount: bottom of this page disagrees with you: https://github.com/Araq/Nim
00:43:17pipeepAnd I'm trying to implement memoization, but I'm running into an issue where it's claiming the memoized function isn't defined.
00:43:19Araqalso C++ bootstrapping should work again
00:43:26pipeepI think it's because my code expects late-binding.
00:43:35pipeepAny suggestions? http://pastie.org/private/cdbc9etghd7hqer1ws7ma
00:44:02VarriountAraq: Uh, the status icons report that the build has failed, which technically it has, b/c c++ bootstrapping didn't work.
00:44:31AraqVarriount: well the status icons are bad for us then.
00:44:31VarriountAraq: I'll look into it though.
00:44:49Araqthey should always be "green"
00:44:53VarriountAraq: And I should probably split C++ bootstrapping into it's own builds.
00:45:18Araqin fact, I'm not sure they actually need to reflect reality
00:45:26Varriount:3
00:45:36Araqit's just some marketing issue :P
00:46:25Araqbut yeah c++ bootstrapping is just another test for the testsuite
00:47:02Araqand it should work, but oh well
00:47:54Araqpipeep: var fib = fib doesn't work.
00:48:36pipeepAraq, so any suggestions of what to try? How to achieve late binding?
00:48:38Araqjust define 'fib' in the traditional way and then apply memoize
00:48:54pipeepBut then fib won't be called memoizedFib
00:49:15Araqah
00:49:52VarriountPerhaps this is a case for methods? Or possibly procedure references?
00:50:00Araqjust use the Y combinator then
00:50:29VarriountHuh? Whats a Y combinator?
00:50:37*Buttons840 quit (Quit: leaving)
00:51:00koz_desktopVarriount: It's a lambda calculus construct enabling finite recursion.
00:51:23pipeepVarriount, https://en.wikipedia.org/wiki/Fixed-point_combinator#Y_combinator
00:51:30pipeepVarriount, *it's complicated*
00:51:36koz_desktoppipeep: Fucking ninjas....
00:51:53koz_desktopIt's definitely not a pedestrian topic.
00:51:56Varriountpipeep: That's all I needed to hear.
00:52:11Varriountkoz_desktop: I don't see any ninjas
00:52:25Jehan_pipeep: The easier solution is to separate declaration and initialization of fib.
00:52:25koz_desktopVarriount: I was about to link that very same thing.
00:52:54koz_desktopAre let-declared variables transitively immutable?
00:53:08Araqkoz_desktop: no, they are not
00:53:13koz_desktopAh, ok.
00:53:25koz_desktopSo it behaves like C++'s const?
00:53:37Araqyeah
00:53:43koz_desktopOK, good to know.
00:53:50Araqbut it's not attached to the *type*
00:54:19AraqNim often tries to do that to keep type system complexity down.
00:54:32koz_desktopFair enough - C++ is hardly a model to emulate IMHO.
00:54:33VarriountAraq: Ok, this is odd...
00:54:38*pwernersbach left #nim (#nim)
00:54:53Varriount'-fpermissive' isn't being passed to gcc in c++ compilation mode.
00:55:35AraqVarriount: I fixed that, I think?
00:55:45*kjo left #nim (#nim)
00:56:12koz_desktopStrings in Nim are both zero-terminated and have a length field. <- this means 'null-terminated' right?
00:56:20flaviuyep
00:56:40koz_desktopOK, just making sure - it's an unusual way of wording it.
00:56:52VarriountAraq: When? I know the issue came up before, and an extra field had to be added in the config (gcc.cpp.*) to fix it.
00:58:12AraqVarriount: https://github.com/Araq/Nim/issues/1601
01:00:27VarriountAraq: That fixes --passc
01:00:39*smw_ joined #nim
01:00:46Araqyeah and your stuff fixes -fpermissive :P
01:00:52VarriountAraq: Yes, if I manually use --passc:"-fpermissive" things work,
01:01:07VarriountHowever I shouldn't have to manually pass that argument... hm...
01:01:32fowlkoz_desktop, they end with a 0 value character, not a null-pointer
01:01:49VarriountAraq: Actually, wait, no it doesn't.
01:02:11koz_desktopfowl: 'null-terminated' refers to the NUL byte.
01:02:19koz_desktopAt least, that's the way I intended it.
01:02:24*brson quit (Quit: leaving)
01:04:01VarriountAraq: Something funky is going on. >_>
01:07:39VarriountAraq: What is the 'proper' way to bootstrap the compiler using the c++ backend?
01:09:54pipeepJehan_, it works! Thanks! http://pastie.org/private/dxqhwzng3dqknuirc5tsw
01:10:26Araqpipeep: can I add that to the test suite?
01:10:39pipeepAraq, sure. Take it under whatever license you want.
01:10:55AraqMIT license so beware, I might base my product on this piece of core technology
01:11:05Araqthanks!
01:12:43pipeepAraq, it would be kinda cool to have a memoize type function in the standard library, like python does
01:13:01pipeephttps://docs.python.org/3/library/functools.html#functools.lru_cache
01:14:14Araqyeah but for Nim it should be a proc transformation macro
01:14:26Araqproc foo() {.memoize.} = ...
01:14:59pipeepAraq, I was looking at macros and stuff, but if you did that, where would you put the cache table?
01:15:13pipeepI did it as a proc because I could just stick it in the closure
01:16:08Araqgood point
01:16:23AraqI would stick it into a .threadvar, I guess
01:16:26VarriountAraq: Here's a gist of the output for two cpp commands: https://gist.github.com/Varriount/8feb87b161d899de1473
01:16:58filwitflaviu: was going to orginize this for you, but I'm just going to hand it off as-is: http://reign-studios.net/philipwitte/nim/artwork/NimArt.zip
01:17:24AraqVarriount: there is *no* correct way to bootstrap via cpp unless you hack koch to do just that
01:17:43filwitflaviu: has all the old artwork/html/css/etc for the original site, plus the new one (web & web2 respectively)
01:17:59Araqand so it's not surprising it doesn't work for you, Varriount
01:18:23filwitflaviu: make sure you have the latest Inkscape
01:18:42Araqand the error suggests you use some outdated devel version to compile
01:21:30*gmpreussner quit (Ping timeout: 244 seconds)
01:22:13VarriountAraq: Except that I just bootstrapped devel, after pulling from the main repo
01:27:08Araqpipeep: what is fib(50) ?
01:27:19pipeep20365011074
01:28:03pipeephttp://www.wolframalpha.com/input/?i=51st+fibbonacci+number
01:28:29pipeepWolfram alpha calls it the 51st though because they're 1-indexed apparently
01:29:37flaviufilwit: Thanks!
01:30:09filwitflaviu: np. make sure Dom gets that too when he wakes up (you'll probably be around before I am)
01:31:52VarriountAraq: Well, I'll remove C++ bootstrapping from the builders then, and split it off into dedicated builds later.
01:32:29AraqVarriount: ok, thanks. alternatively you could make it always show the nice green icons.
01:32:30flaviufilwit: Lots of new stuff in there
01:32:54filwitflaviu: eh? nothing's new.. just old stuff you're seeing probably
01:32:58VarriountAraq: Although, I can't even compile strutils.nim using cpp backend. :/
01:33:15flaviuI've never seen http://i.imgur.com/F7PJNKt.png before
01:33:17pipeepThe manual (http://nim-lang.org/manual.html#nosideeffect-pragma) says "Future directions: func may become a keyword and syntactic sugar for a proc with no side effects"
01:33:47pipeepBut http://nim-lang.org/news.html#Z2014-12-09-new-website-design says "func is a keyword now."
01:33:50filwitflaviu: ahh, yeah that was an old logo I made that dom didn't like :)
01:36:22filwitflaviu: btw, to export the background graphics is a bit tricky: you hide all the layers expect the background, export, open with gimp and remove the excess pixels (i usually duplicated the layer, fill a corner with pure red and 0% threshold, then crop to the red)
01:36:41filwitflaviu: hide all the layers in Inkscape I mean
01:38:38filwitflaviu: and by "crop to the red" i mean the red will fill all pixels that are the same color (the surround background color). So you fill it with red (or whatever) to see exactly where the change background graphics actually "end" (meet the background color which is described in the CSS)
01:39:09flaviuYep, got it. How would I edit the background layer?
01:39:10Araqpipeep: func is a keyword now, but it's not used for anything yet.
01:39:20pipeepAraq, so it just maps to proc?
01:39:33Araqno it's just reserved
01:39:36filwitflaviu: hope that makes sense... I should have made an HTML slice instead, but I usually change so much stuff around it's just easier that way
01:39:42filwitflaviu: erm... one sec..
01:39:48Araqlike Java's goto keyword
01:39:54pipeepThat's fair.
01:40:31*brson joined #nim
01:41:23Varriount(Will Java *ever* use the 'goto' keyword?)
01:41:44filwitflaviu: I'm not sure what you're asking, the BG layer is all there (the layer is locked so you don't accidentally move random stuff around)
01:42:00flaviufilwit: that's probably it, thanks. I'm not familiar with inkscape.
01:42:23flaviuVarriount: This is the wrong forum for that discussion, a openjdk mailing list would be better.
01:42:24VarriountAraq: What C/C++ compiler do you use with Nim?
01:42:59Varriountflaviu: But.. then I would have to get... /involved with Java/
01:43:01AraqVarriount: mingw or visual c++
01:43:21filwitflaviu: if you're new to Inkscape, you Alt+Click to select through objects. It's important to know what you're looking at (which Inkscape sux at cause it doesn't show you in the layers view).. look at the XML view to see all the objects in the layer (Ctrl+Shift+X i think, maybe Alt instead of Shift)
01:44:39*Jehan_ quit (Quit: Leaving)
01:45:01filwitI need to write some blogs on how to use Inkscape well I think... coming from Illustrator some things are wonky (some things are much better actually) and can be tricky to get the hang of, but Inkscape is very powerful once you're used to it.
01:45:19filwitbut that's probably not going to happen cause I don't like writing, so yeah
01:47:48*gokr quit (Quit: Leaving.)
01:50:38*Sharcho joined #nim
01:51:38*gokr_ quit (Quit: IRC for Sailfish 0.9)
01:53:54shevylol
01:55:33fowlsup shevy
01:55:47shevyhey fowl
01:55:50shevyI see you are still a nimster
01:56:49fowlha i read that as 'spinster'
01:58:42Araqdef-: I pushed compiler/forloops.nim, it's not tested, doesn't even compile and isn't used anywhere, but this is what the code would look like
01:59:25*gsingh93 joined #nim
02:01:10*darkf joined #nim
02:04:09SharchoIs there a way to have a compile hash table, something like: let details = {"key1": "value1", "key2": "value2"}.toTable
02:04:59Sharchos/compile/compile-time/
02:05:24AraqSharcho: .compileTime pragma for vars
02:05:26Araqgood night
02:05:36*rkj-b joined #nim
02:06:03flaviucan't you do `const foo = ...`?
02:06:18flaviuIt might fail to compile, but IIRC it was fixed
02:06:53Sharchoflaviu: I'm getting an error with const
02:09:05flaviuHow old is your compiler? If it's recent, I may have remembered incorrectly.
02:09:29Sharcho0.10.2 (2014-12-29)
02:09:48flaviuTry git devel.
02:12:13*chemist69 joined #nim
02:14:59Sharchoflaviu: it works with git devel.
02:15:19flaviugreat!
02:15:25*chemist69_ quit (Ping timeout: 264 seconds)
02:17:18flaviufilwit: btw, looks like there are artifacts from the downscaling from vector to a smaller size
02:17:37flaviujpeg introduces comparatively few artifacts.
02:18:07pipeepYay! I made a Nim blog post: http://benjam.info/blog/posts/2015-02-15-nim-euler/
02:18:28filwitflaviu: the background? It shouldn't be downscaled at all. What you see in Inkscape is a 1:1 of what's on the website (in my original design at least)
02:18:58flaviufilwit: If you look carefully at the background, some dots are bigger than others.
02:19:14filwitflaviu: yes, that is jpeg at a higher compression level
02:19:57filwitflaviu: jpeg can be virtually lossy, but I set it to lower to lower the size... can't remember what exactly. What image editor are you using?
02:20:28flaviufeh, but I'm not sure what algorithm it uses.
02:20:58filwitflaviu: actually i think i just used Gimp's default JPEG compression (~90% i think) and compared to it's default PNG output
02:21:18flaviubtw, the problem exists in inkscape too: http://i.imgur.com/Lsj0eEN.png
02:21:29flaviuthat's a screencap of inkscape
02:21:57filwitnah, that's just because the dots aren't pixel-perfect
02:22:35*Sharcho quit (Ping timeout: 246 seconds)
02:22:57filwitthat pattern is a vector-dot pattern I made in Inkscape and arbitrarily scaled (you can see it in the XML view, or you can select the object with the pattern on it an expand it)
02:23:44filwitif I had scaled it to and exact size and used pixel-snapping it would be a perfect dot
02:24:50filwitbut usually it's hard to get all the elements to come together right and worry about that sort of thing too, I could probably fix it, but honestly I don't think anyone's going to really notice
02:25:03filwitthat background is only really seen on the home page
02:25:35filwitbut i compliment your visual acuity :)
02:25:47filwitI can add it to my list of things to do
02:26:47flaviuI'll see if I can fix it.
02:26:55flaviuIt irritates me more than it should.
02:27:05filwitlol, i know that feeling
02:27:25filwitbut since it's so subtle, I almost like the irregularity TBH
02:29:06flaviubtw, I found out about ctrl-numpad5. Speeds up rendering tremendously.
02:30:08filwityes, (you can toggle that fro the view menu too), it helps when editing vectors up close.. edit without filters then zoom-out and enable them to check the final image
02:33:03filwitfalviu: what version of Inkscape are you using, btw?
02:33:34filwitmy system (Manjaro) just updated (today) to 0.91 and it's noticeably faster for me
02:35:14flaviuArch Linux, so I'm on the latest too.
02:35:27filwitgreat :)
02:36:04filwiti just switched to Manjaro (from Arch) a week or so ago after hosing my machine trying to switch from Catalyst to Radeon...
02:36:39filwitit's not bad, but I went with Xfce (cause it was default) and I'm starting to miss KDE in some ways..
02:37:42flaviulets bring the distro chat into #nim-offtopic. These people are here for nim discussion :)
02:38:19filwitno need to talk more about it :)
02:44:57*TEttinger joined #nim
02:49:40*qwr joined #nim
03:02:34*wb quit (Ping timeout: 252 seconds)
03:23:47*brson quit (Quit: leaving)
03:29:59*Etheco joined #nim
03:31:25*rkj-b quit (Quit: ChatZilla 0.9.91.1 [Firefox 35.0.1/20150122214805])
03:32:31*Etheco- quit (Ping timeout: 255 seconds)
03:40:23*lavender_ joined #nim
03:40:39*infinity0_ joined #nim
03:40:39*infinity0_ quit (Changing host)
03:40:39*infinity0_ joined #nim
03:40:39*infinity0 quit (Killed (cameron.freenode.net (Nickname regained by services)))
03:40:39*infinity0_ is now known as infinity0
03:42:13*filwit quit (Quit: Leaving)
03:43:14*lavender quit (Ping timeout: 265 seconds)
03:47:55*keyle joined #nim
04:09:51dtscodeim linking to some c code. what would i return ifthe c codes return value is void*?
04:12:26flaviudtscode: In general, you can answer this sort of question by running c2nim on that code.
04:12:33flaviuBut here, it's pointer iirc
04:12:45dtscodealright. thanks. i forgot about c2nim
04:16:29dtscodedoes c2nim not build on the latest compiler?
04:55:49*bmaxa joined #nim
05:02:28TEttingerdtscode: I built the compiler yesterday and it seems to work
05:02:46TEttingerI built the git head of c2nim
05:03:25TEttingerI'm having my own c2nim trouble; I'm trying to figure out how to get this odd C macro-in-macro-expansion to be usable by c2nim
05:03:26TEttinger#define TERMINAL_CAT(a, b) TERMINAL_PRIMITIVE_CAT(a, b)
05:03:26TEttinger#define TERMINAL_PRIMITIVE_CAT(a, b) a ## b
05:05:08TEttingerdtscode: I'm on windows 7, using cmd as my shell most of the time. this worked for me to get c2nim: nimble install "c2nim@#head"
05:13:34TEttingerthe file that I'm trying to convert is here; I've already removed all of the TERMINAL_API usages (since I think it would always define them as empty strings) https://github.com/tommyettinger/BearLibTerminal/blob/master/Terminal/Include/C/BearLibTerminal.h#L262-L263
05:21:32koz_Where can I find all the compiler options for nim?
05:23:01fowlTEttinger, what type are you using for wchar
05:26:27TEttingerI have no idea
05:27:25*fowl quit (Quit: Leaving)
05:49:19*Demos quit (Read error: Connection reset by peer)
06:10:22dtscodekoz_, on the site
06:10:50dtscodeTEttinger, yeah... i figured it out. its because the current release only builds with 10.3 and i had 10.2
06:11:10TEttingerah cool
06:11:22dtscodesorry, had some chores to do
06:18:27*bjz joined #nim
06:25:57*infinity0 quit (Ping timeout: 250 seconds)
06:28:59*infinity0 joined #nim
06:29:40*kapil__ joined #nim
06:29:51*bjz quit (Ping timeout: 250 seconds)
06:45:26*gsingh93 quit (Quit: Connection closed for inactivity)
06:47:04TEttingerseems like I got this one file to run through c2nim successfully. I still need to uh learn Nim, so that should be fun
06:48:06*leonlee joined #nim
06:51:48NhanHIs there a way to define array with fixed size at run time ? (Not sequences)
06:58:35*fowl joined #nim
07:01:46*vendethiel joined #nim
07:14:59*pafmaf joined #nim
07:16:44*pafmaf quit (Client Quit)
07:26:05*bjz joined #nim
07:26:25*brson joined #nim
07:26:51VarriountNhanH: Are you still there?
07:36:01NhanHyes
07:43:26VarriountNhanH: You might be able to do something with system.unsafeNew or system.create
07:44:49VarriountNhanH: Even if you cast the memory blocks to an array, I'm not sure how references taken from the array will behave.
07:45:33VarriountIf you're storing integers, or other data that is copied, then you're probably fine. Garbage collected memory is a bit of unknown territory though.
07:46:19VarriountNhanH: What exactly is your usecase?
07:47:00*gokr joined #nim
07:47:59VarriountHi gokr!
07:49:43gokrHey :)
07:50:02NhanHVarriount: I'm reading image files into byte array
07:51:23NhanHVarriount: what do you mean with "Garbage collected memory is a bit of unknown territory" ?
07:53:07VarriountNhanH: I mean that I don't have definite knowledge of what happens when you use those procedures to store memory handled by the garbage collector
07:54:09VarriountNhanH: Are you interfacing with some C code?
07:54:19NhanHno, it's all nim code for now
07:54:45*HakanD__ quit (Quit: Be back later ...)
07:55:02NhanHthe thing is, I have to do some dot product on vectors being represented by array, so I don't know if seq will have an effect on performance
07:55:21NhanHIs Seq linked list, or is it sequentially allocated block of memory like array?
07:55:24VarriountNhanH: Well, taking into account that you're storing bytes, and not references to other objects, the above code should work fine
07:55:31VarriountNhanH: The latter.
07:55:45VarriountI believe it's similar to a C++ vector.
07:56:00NhanHoh, so it just got re-allocated if the size got change to bigger than the current allocated size?
07:56:03*wb joined #nim
07:56:30VarriountNhanH: Yep. And you can use setLen() to resize the sequence to whatever size you want.
07:56:43NhanHI see, it seems like I can use seq in that case then
07:57:03Varriount(Dare I ask, is there any programming language out there that uses linked lists as it's main sequence type?)
07:57:05NhanHthanks
07:57:09NhanHpython
07:57:38NhanHPython has array, but I believe the majority of code use list as the main seq datatype
07:57:58VarriountNhanH: Uh, no.
07:58:00Varriounthttp://stackoverflow.com/questions/5932328/internals-of-python-list-access-and-resizing-runtimes
07:58:25NhanHright, I stand corrected
07:58:28NhanHlisp then ;)
07:59:09VarriountAh, well, I can't refute that, as I have only theoretical knowledge of lisp.
07:59:34Varriount*shrug*
08:00:07VarriountNhanH: Sorry if I sounded brisk.
08:00:20NhanHoh no, don't worry about that
08:01:28TEttingerNhanH, even lisp often uses a different implementation under the hood.
08:04:07TEttingerclojure I have a good deal of experience with and it has a kinda complex implementation of its immutable data structures, so different modifications to one, say, vector, preserve the parts of the original vector that are unchanged, and have the new modified versions only store what changed. it's a 32-nary trie internally
08:05:08NhanHyeah, that was just tongue-in-cheek on my part
08:05:29NhanHclojure don't even use cons cell that much
08:05:59VarriountTEttinger, NhanH: On that topic, note that Nim's strings and sequences are mutable (both are backed by dynamically resized arrays)
08:07:00TEttingerinteresting, I personally prefer mutable stuff even in clojure since the games I've been working on have trouble with the overhead from immutability
08:07:28VarriountSequences and strings are assign-by-copy too, and slice operations copy.
08:08:48VarriountIt's an interesting behavior that some people trip over. Whether or not it's the 'right' behavior is hard to say, but it can't really be changed without major, backwords incompatible changes.
08:10:59TEttingercan anyone recommend a 2d graphics library in Nim, by the way?
08:11:07TEttingerbinding to SDL2 would work
08:13:51VarriountTEttinger: We have that, actually
08:14:03Triplefoxyeah, try "sdl2"
08:14:15Varriounthttps://github.com/nim-lang/sdl2
08:16:49gokrTEttinger: Not sure if it helps, but I wrote some articles and one plays with c2nim: http://goran.krampe.se/category/nim
08:17:10gokr(the "Nim wrapping C" article)
08:20:20TEttingerah thanks gokr
08:20:29TEttingeralso thanks Varriount, Triplefox
08:21:34NhanHusing sequences mean that I lost a lot of compile time check :(
08:21:57NhanHis there any good way to define a function that takes an array/seq of n size, and return a seq of the same size
08:22:01NhanHsize not known at runtime
08:22:06NhanH*not known at compile time
08:23:01VarriountNhanH: Uh, huh?
08:24:27NhanHsomething like proc test(x: array[n, int]): array[n, int] = ....
08:24:27*brson quit (Quit: leaving)
08:24:44VarriountNhanH: newSeq[T](len(oldSeq))
08:25:32VarriountThat creates a new sequence with the same size as the old sequence, is that what you want?
08:25:40fowl@ is a funtion that turns openarray[t] into seq[t]
08:26:02fowl@[1,2,3]
08:26:35NhanHVarriount: no that's not what I wanted
08:26:39NhanHI mean to have something like
08:26:42NhanHproc test(x: array[n, int]): array[n, int]
08:27:01NhanH(a proc that return an array, but the size depends on the size of its variable)
08:27:19*lavender_ quit (Ping timeout: 245 seconds)
08:29:14gokrFirst - openarray is a special type only useful as a param type that matches both array and seq. Not sure exactly what you mean with the size thing.
08:29:21VarriountNhanH: Well, if you want an *array* (not a sequence), then you will need to use the procedures I mentioned above, create() and unsafeNew()
08:29:37VarriountWhat kinds of compile-time checks did you lose?
08:30:39NhanHgokr: I mean size as in length of the array
08:31:06*dumdum joined #nim
08:31:14NhanHVarriount: one moment, I definitely thought of something earlier
08:32:00VarriountNhanH: It might help if you posted some code (via gist or pastebin or similar)
08:32:33gokrdumdum: You may not be aware that your nick means "stupidstupid" in swedish. ;)
08:33:11Varriountgokr: Ooo, does my name mean anything in Swedish?
08:33:40gokrNah, where does it come from?
08:33:54*leonlee quit (Quit: Leaving)
08:34:46Varriountgokr: I made it up when I was 12. I think I got the idea from the word 'variable'
08:35:04gokrNhanH: Were you fishing for compile time checks for calling with literal arrays of the wrong sizes?
08:35:17NhanHgokr: yes!
08:35:19gokrBut what is an "ount"? :)
08:35:30NhanHbut the array size is not known during compile time
08:35:45gokrFor literals they are.
08:35:58gokrOr const or whatever
08:36:14NhanHI mean, similar to literal array. For example, I want to write a function that will take two arrays, but only if they're the same length
08:36:26VarriountHm, tricky.
08:36:53VarriountWe have 'static' types, but their entire values have to be known at compile time.
08:36:58gokrAnd note that when you say "array" (and not seq or openarray) it has a known compile time len.
08:37:32NhanHI know, that's why I was using *seq* earlier
08:37:40gokrBut how to express it, I am a damn Smalltalker - I have no idea. ;)
08:38:03fowlproc foo [r] (a,b: array[r, int]): array[r,int]
08:38:29fowlr is a range
08:38:31gokrNhanH: But you can of course have two procs - one for seq and one for array. The one for array could do more compile time checks I guess?
08:38:43gokrAh, generics. Duh.
08:39:03VarriountThat only works for arrays though, it won't work with sequences.
08:39:09NhanHah generics, that's cool! Thanks
08:39:21gokrNhanH: Also, if you are indeed implementing matrix stuff or something, then I presume there is lots of library code to find.
08:39:44VarriountNhanH: We don't have variadic generics yet, fyi
08:40:26NhanHthere definitely is C stuff that do matrix stuffs - I just wanted to implement as a mean to learn the language
08:40:39NhanHthank everyone for the help :-)
08:40:46gokrNo, I mean matrix code in Nim.
08:41:08gokrfowl here has surely hacked that already, right fowl?
08:41:59dumdumgokr: Well its loosely related to English: dummy: A stupid person who has no common sense and no brain at all
08:42:21gokryep
08:43:43gokrdumdum: So you use Nim for anything fun?
08:45:42gokrNhanH: Here is some similar stuff: https://github.com/fowlmouth/nimlibs/blob/master/fowltek/vector_math.nim
08:46:45*BlaXpirit joined #nim
08:50:04dumdumgokr: Parsers for some ugly languages/file formats at work
08:50:56VarriountSigh. I wish I could use Nim at work, however I have to design things that need to be easily modified by future employees.
08:51:22dumdumI write them for myself, I use the tools I write
08:51:38dumdumAnyway my work langauge is java :(
08:53:09gokrJava... yeah. sigh.
08:53:38dumdumNim's fun part for me is, writing english like phrases by using appropriate method names, nims prefix, postfix calling syntax and procs
08:53:43gokrdumdum: I started porting over PetitParser to Nim, got sidetracked. It's a beautiful library to compose parsers.
08:54:02gokrYeah, DSL style. PetitParser is exactly that.
08:54:05dumdumprocs = Operators i meant
08:55:47Varriountdumdum: I feel for you. My comp sci classes are all java
08:55:55gokrIn Smalltalk there have been the "regular" tools for constructing parsers, similar to what other langs have had. But then Lukas Renggli (now at Google btw) came around and combined a range of slick parsing technologies - and married that with the DSL capabilities of Smalltalk - and now everyone uses it.
08:56:19VarriountWell, except for my assembly class, which is a breath of fresh air
08:58:58dumdumI do not consider Java as a bad language. It is just not fun :)
08:59:16gokrdumdum: If interested, here is the original slides: http://www.slideshare.net/renggli/mastering-grammars-with-petitparser
08:59:29gokrExamples in Smalltalk, so of course a bit foreign if you don't know it.
09:00:02dumdumgokr: Thank you!, I dont know Smalltalk but enough about it to respect
09:00:22gokrdumdum: There is a Java port of it.
09:00:29gokrAnd Dart too.
09:00:43gokrThis is the original blog article: http://www.lukas-renggli.ch/blog/petitparser-1
09:00:50fowli have a parsing combinator(? is that what you call it?)
09:01:14dumdumAssembly I found tedious, then you start using the assemblers macro system , then you realise you might as well use C or similar
09:01:34gokrdumdum: That last link is actually best to get a grip.
09:01:56*wb quit (Ping timeout: 246 seconds)
09:02:22gokrdumdum: And if you are forced to use Java, check it out: https://github.com/petitparser/java-petitparser
09:02:59qwrdumdum: java is mediocre, but java coding culture is just terrible (to give one blatant example: writing useless one-line accessor methods)
09:03:07Varriountdumdum: You underestimate how much I dislike java
09:03:46dumdumgokr: links bookmarked, thanks!
09:05:14*kuzy000_ joined #nim
09:05:22dumdumI guess Java gives creative people who have not experienced other languages, a high by constructing complexes in Java
09:05:36gokrFirst Java was just plain silly (mid 1990s), then it got slightly better but quickly ruined by the "complexity worshipping culture". And to finish it off, they moved on turning it into C++ by stuffing more and more mechanisms into the language.
09:06:08Varriountgokr: 'more and more [inflexible] mechanisms into the language'
09:06:23gokrAs a Smalltalker - one can only cry.
09:06:54NhanHit's a combination of retarded strategy by Oracle (they want to have a component market back then, so everything has to be abstracted out), and the fact that the language is too weak. I think the complexity workship/design pattern is just a sign of missing language feature
09:06:56TEttingerthe only thing java has going for it is a large library ecosystem that can be used by other languages on the JVM that aren't java
09:07:40gokrNhanH: You mean Sun I guess.
09:08:49gokrOracle didn't buy Sun until... quite late in the game.
09:08:53TEttingerhttps://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
09:08:59dumdumRust is somewhat complexity worship too in a way, but maybe its worth it, I dont know enough about language safety etc to usefully comment though
09:09:38VarriountI've been spoiled by Python too much. :/
09:10:24TEttingerall I know is that the way Rust handles mutability can be very very complex, and the language is not mature (they still break the nightly's backwards compatibility at least every other week)
09:10:24NhanHgokr: I think it was Oracle somehow ... but yeah Sun would have made more sense
09:10:44NhanHRust's complexity might be justified though, memory safety without GC is a hard task
09:10:52gokrNhanH: I was around :)
09:10:55dumdumTEttinger: That link is exactly what I have to go through each day :(
09:11:06TEttingerdumdum, I'm sorry.
09:12:08dumdumFor a simple CRUD, I need to go trough spring xml configs, DAO, service layer, models, facade, models to DTO converters, the conveters use populators, then view, tags, jsp, tags, tlds :(
09:12:09def-Araq: i will give the for loop stuff a try, but i'm pretty busy this week, so it may take a bit
09:12:54gokrI always assumed Gosling didn't know about Smalltalk etc, and thus created Java simply out of ignorance. Then I attended a panel at OOPSLA - celebrating Simula (some anniversary)...
09:13:23gokr...and it turns out Gosling knew Simula all too well (and Smalltalk too I am fairly sure) - he even hacked the Simula compiler back in the days.
09:13:27dumdumI thought it was created as a small language for embedded use
09:13:38gokrSo now I simply attribute it to malice instead of ignorance. Pure evil :)
09:13:52gokrYes it was, it was intended for electronics.
09:14:06*HakanD__ joined #nim
09:14:21AraqGosling simply designed the language for the mediocre programmer.
09:14:25gokrIt was funny, they evidently made a prototype of a remote control - with a little youch display that adapted its "buttons".
09:14:26dumdumSo he might have left out features to keep the jvm small
09:14:32gokrtouch.
09:14:46NhanHJVM isn't the issue
09:14:51gokrThen they showed it to some executives from Japan, think like "Sony" etc
09:14:53NhanHit's actually a pretty amazing piece of tech
09:15:18gokrAnd they went... what? Nooo, customers don't want simple remotes. They want BUTTONS! As many as possible.
09:15:26gokrHehe
09:15:47gokrJVM isn't amazing IMHO. Its just TONS of man hours.
09:16:01dumdumgokr: yep
09:16:23gokrThe cool stuff, Hotspot, was bought from the outside.
09:16:31gokrAnd came from the Self project originally.
09:16:56NhanHbtw gokr, which Smalltalk are you using professionally right now?
09:17:08NhanHSqueak, Pharo or one of the commercial one?
09:17:13gokrGosling could have made a small Smalltalk-ish language instead - and it would have been smaller and more powerful at the same time.
09:17:32gokrOur system is based on Squeak 4.1. We also use Pharo for some peripheral stuff.
09:17:42NhanHjava was trying to replace C++, isn't it?
09:17:48NhanHso smalltalk wasn't in the picture at all
09:17:51gokrI haven't used commercial Smalltalks in a long time. But I do love GemStone.
09:17:53TEttingergokr: have you ever used a TV remote where you have to press a button to change the screen on the remote, look down at the remote to see the tiny screen, press the button on the remote, look up at the TV to see if it took the command, look down again after pointing the remote better... more buttons make sense for a remote
09:17:59dumdumhighly expressive languages do not make sense for the corporate though
09:18:41gokrNhanH: Java wasn't trying to replace any language really. It was aimed at embedded, didn't fly there - then was reaimed at applets.
09:19:07gokrAnd then eventually failed there too - but flourished on the server side, probably because Sun was pushing the SDK for free and IDEs etc too.
09:19:08qwrgokr: it reminds that, one guy once made small lispish language with C syntax... ;)
09:19:15gokrAt the time IDEs were not free.
09:20:03gokrMany missed that part - it was the Internet and the fact that Sun was pushing it out gratis - that was the big thing. And hey, they even plastered airports with ads for Java.
09:20:12TEttingerqwr: you mean JScript?
09:20:17qwrTEttinger: yes
09:20:23gokrI have never ever seen an ad for a programming language in an airport ever since or before.
09:20:25*Trustable joined #nim
09:21:11TEttingergokr: I have seen ads for lots of enterprise hardware and software at LA International airport
09:21:29gokrdumdum: You are wrong on the "highly expressive" part. Smalltalk was quite big back then, and its as expressive as it gets.
09:21:48gokrTEttinger: Ok, perhaps I simply don't visit the right airports ;)
09:22:20TEttingerit's totally weird though, you're right
09:22:25gokrBut my point still holds - Sun pushed it for free so hard, it drove Borland and lots of other companies out of business and crushed Smalltalk too.
09:22:34gokrSmalltalk was very expensive at the time.
09:22:44dumdumgokr: I meant, expressive languages, need expressive people who in turn are rare, so are more risky and costly for the corp
09:22:51keylenim off topic :)
09:22:51TEttingerthey certainly have the enterprise ads next to the strip club immediately next to airport parking in LA :)
09:22:59gokrkeyle: Yeah, sorry.
09:23:00TEttinger*certainly don't
09:23:15dumdumJava programmers like me are dime a dozen
09:23:34keyledon't get me wrong, I love Sun/java/smalltalk talks
09:23:45TEttingeris there a good starting point book or site for learning Nim?
09:24:08dumdumTEttinger: http://howistart.org/posts/nim/1
09:24:14gokrkeyle: But you are right :)
09:24:16TEttingerthanks
09:24:28gokrI just get carried away, I am too old.
09:25:40gokrTEttinger: AFAIK there is tut1, tut2 and the language manual (I like them all). And then "Nim by example", the hookrace blog, my blog, Rosetta code with Nim examples, and some more articles spread out.
09:25:50dumdumgokr: wasnt there drilling going on around your house? I wondered what for :)
09:26:16gokrdumdum: Join #nim-offtopic :)
09:26:42gokrBut yeah, they drilled a 240m hole.
09:27:14gokrWe are installing geo thermal heating.
09:28:03dumdumnice :)
09:29:16*fowl quit (Quit: Leaving)
09:46:03*pafmaf_ joined #nim
09:53:44*Sembei quit (Read error: No route to host)
09:58:59NhanHis it possible to do generics with ... 2 type parameters?
09:59:36BlaXpiritsure
10:00:59NhanHso just proc foo[x,y,z] () ... ?
10:01:42def-NhanH: exactly, see for example tables: http://nim-lang.org/tables.html#len,Table%5BA,B%5D
10:03:28NhanHoh I didn't know that page, thanks
10:03:51*fowl joined #nim
10:04:59gokrNhanH: Explore the documentation page.
10:21:54*bmaxa quit (Quit: Leaving)
10:22:05*sillesta joined #nim
10:26:00gokrnew Urhonimo demo coming soon, just need to clean it
10:26:17gokrNothing advanced though.
10:29:41*pafmaf_ quit (Quit: This computer has gone to sleep)
10:33:14*koz_ quit (Ping timeout: 250 seconds)
10:49:53*HakanD___ joined #nim
10:51:26gokrThere: particle.nim demo added to Urhonimo
10:52:22*HakanD__ quit (Ping timeout: 240 seconds)
10:52:26def-gokr: nice
10:52:49gokrWorks?
10:53:11def-Yes, perfectly
10:54:06gokrI wrote the port - then Araq fixed some issues in the wrapper (the 2D parts he hadn't used yet). :)
10:54:57gokrSo... that's wise to remember - if you decide to play - the wrapper is automatically generated, but its not perfect. So tweaks may be needed when we use more and more.
10:55:30gokrTime for lunch :)
11:01:58*HakanD___ quit (Quit: Be back later ...)
11:18:58*reem quit (Remote host closed the connection)
11:19:30*pr3d4t0r quit (Ping timeout: 246 seconds)
11:22:18*pr3d4t0r joined #nim
11:42:55*pafmaf joined #nim
11:54:46flaviukoz_desktop: http://nim-lang.org/nimc.html
12:04:35*pafmaf quit (Quit: This computer has gone to sleep)
12:05:36gokrDamn, slashdotters seem to be a whole bunch of C++ fans or something. That was depressing, I seem to recall when I actually read slashdot a few years back that the comments often had lots of value.
12:05:57def-gokr: yeah, looks like quite a different community than HN and r/programming
12:06:02gokrOk, C++ fans can be quite fine people too, but...
12:06:40gokr...skimming that Nim thread on Slashdot revealed almost NOTHING of insight or value.
12:07:35gokrJust blabla indenting, blabla, Python blabla.
12:08:53gokrBtw, interesting that pc-wa-lt-o-n commented with such vigor on HN.
12:15:27*rapind joined #nim
12:17:01*TEttinger quit (Ping timeout: 265 seconds)
12:17:37*jferg2010 joined #nim
12:17:55gokrThis was interesting: https://botbot.me/mozilla/rust/search/?q=Nim
12:18:00gokr:)
12:18:06*gokr coffee time...
12:18:08*rapind quit (Client Quit)
12:18:26*rapind joined #nim
12:18:26*rapind is now known as rapstar
12:19:28*reem joined #nim
12:20:36rapstarmorning
12:20:42jferg2010So I was messing around with the docgen functionality. What do you guys think of this (http://www.unraveltechnology.com/img/times.html) as a format? Similar to readthedocs.org with a change to sort each section (versus the order they appear in the source file).
12:24:03rapstarNim noob here. I'm trying to implement a simple nim example for websocketd and running into an issue creating an output stream properly. Tried a few things, but could use a bit of help if anyone has a free moment. It's probably something simple. https://github.com/rapind/websocketd/blob/master/examples/nim/count.nim
12:24:34def-jferg2010: that looks interesting, needs to work with other browser sizes still
12:24:52*reem quit (Ping timeout: 245 seconds)
12:25:12def-rapstar: what's the problem with that?
12:25:41def-minor notes: you can write "echo(i)" or even "echo i"
12:25:43rapstarit doesn't chunk out, it waits until the loop is complete then sends it all
12:25:58rapstaryes nice, i'll lose the parans
12:26:01jferg2010Def-: Lots to do to make it real, but wanted to get some early feedback to see if it was worth pursuing.
12:26:04def-rapstar: something is buffering then, need to flush
12:26:23def-flushFile stdout
12:26:43rapstarsec trying it
12:27:22def-jferg2010: I'm a bit conflicted whether it's better to have the page in the center or aligned left
12:27:50def-jferg2010: but i definitely love that the ToC on the left stays fixed
12:28:05rapstarwewt thanks!
12:28:25rapstarthat did the trick. thanks def-
12:28:55def-and sorting is a bit difficult because the order is usually not random, but makes some sense. But looking at the times module, it looks a lot tidier when sorted
12:28:59def-rapstar: you're welcome
12:29:18jferg2010def-: Readthedocs has a nice feature where the TOC scrolls if it doesn't fit in the browser window, which I haven't gotten to work yet. Does sorting the procs/types make sense? It's easier to read to me.
12:30:48rapstarIf interested, issued a PR to add nim to websocketd, which seems like a pretty sweet and simple way to support WS. https://github.com/joewalnes/websocketd/pull/104
12:31:14rapstarOnly been playing with Nim now for a few hours, so feel free to critique
12:31:36def-jferg2010: a search would be awesome too. Maybe you've seen the GSoC idea already: https://github.com/Araq/Nim/wiki/GSoC-2015-Ideas#enhance-and-expand-standard-library-documentation
12:33:23def-rapstar: echo "Hello", line, "!"
12:33:37rapstaron it
12:35:03jferg2010def-: Yeah, GSoC2015 was what got me looking into it. I'll work on search as well. What do you think about collapsing overloaded procs so you get one TOC entry per signature?
12:35:32*rapstar left #nim (#nim)
12:35:35*HakanD___ joined #nim
12:36:02def-jferg2010: either that, or add the proc signature to the TOC
12:36:31def-or combine both, collapse it, and show all signatures below?
12:38:34jferg2010def-: Probably best to try and see what works/looks best. Besides search, responsiveness and continued UI tweaks, any other priorities?
12:39:37jferg2010I see in the todo.txt a desire to decouple docgen from the compiler. Is there a desired set of requirements for that?
12:39:52def-I don't know, you'll have to ask Araq
12:40:24def-jferg2010: do you want to do web stuff? I'd love to have the documentation automatically installed by using nimble
12:41:26*dyu joined #nim
12:41:27def-jferg2010: And more examples, maybe even so you can run the examples in the browser (ekarlso was working on a nim-playpen)
12:41:32Trixar_zaNim is going to have a GSoC?
12:41:41def-Trixar_za: we'll try
12:42:56*rapind joined #nim
12:44:17*gokr quit (Quit: Leaving.)
12:46:14jferg2010def-: OK on the examples. For the nimble integration, were you thinking to generate the docs to a local folder during the package install?
12:48:05*rapind quit (Quit: leaving)
12:49:18*gokr joined #nim
12:50:50*rapind joined #nim
12:55:39*rapind quit (Client Quit)
12:56:22*rapind joined #nim
12:58:13*rapind quit (Client Quit)
13:00:12*rapind joined #nim
13:00:49*rapind quit (Client Quit)
13:00:53*mtj joined #nim
13:01:25*rapind joined #nim
13:06:43*rapind quit (Ping timeout: 255 seconds)
13:07:08def-jferg2010: exactly
13:09:31jferg2010def-: OK. Let me see what I can come up with. I'll check back in when I have more to share.
13:13:48*jferg2010 quit (Quit: Leaving)
13:17:14*pafmaf joined #nim
13:19:14*pafmaf__ joined #nim
13:23:13*pafmaf quit (Ping timeout: 264 seconds)
13:23:33*keyle quit (Quit: <Morbo> Chitchat achieved!)
13:44:40*gokr_ joined #nim
13:49:36*HakanD___ quit (Quit: Be back later ...)
14:02:04*BlaXpirit_ joined #nim
14:02:26*rapind joined #nim
14:05:13*BlaXpirit quit (Ping timeout: 255 seconds)
14:08:57*reem joined #nim
14:09:36*HakanD___ joined #nim
14:13:59*reem quit (Ping timeout: 265 seconds)
14:19:33qwrrapind: what's the problem, i compiled and runned the count.nim (on linux), seems to do what i'd expect
14:19:36*HakanD___ quit (Quit: Be back later ...)
14:20:45qwr(ahok, sry, damn irssi scroll buffer was left)
14:23:26Araqhi qwr. thank you for helping rapind
14:25:25qwrhi, tried to help, but it was already solved :)
14:27:49whitenoisei was researching how to enhance the javascript backend last night
14:27:55*HakanD___ joined #nim
14:28:03whitenoisekind of just browsing last couple days
14:28:40Araqwhitenoise: read our gsoc entry about it?
14:29:47whitenoisei'm not sure i'm qualified for any such endeavor :)
14:30:06whitenoisei have never written a compiler, and i don't know how code generation works
14:32:19rapindAraq: btw, def- helped me out. It's working great. Now I'm attempting to build a nim + redis + ws chat server
14:37:37*gokr_ quit (Ping timeout: 264 seconds)
14:37:45*gokr_ joined #nim
14:42:28*kapil__ quit (Quit: Connection closed for inactivity)
14:45:55rapindahh, it looks like pusub for redis hasn't been implemented yet. Maybe I'll do a poor man's version with polling instead.
14:57:21whitenoiseyou can do pubsub with channels and queues within Nim without using Redis.
14:58:16whitenoisein my opinion, there is no point in it being a websocket chat if you're polling
15:01:24whitenoiseAraq: where might one begin looking at the "javascript backend"
15:01:45def-whitenoise: compiler/jsgen.nim
15:02:03whitenoiselets see if i can learn how code generation works :P
15:06:46rapindwhitenoise: good point. I'll look int channels and queues. just getting started with nim.
15:28:29*davidhq joined #nim
15:29:44*davidhq quit (Client Quit)
15:36:34*UberLambda joined #nim
15:52:25rapindAdded a simple redis voting server as an example behind websocketd. Love how easy this was in nim. Comparable to ruby and far more performant. If interested, https://github.com/joewalnes/websocketd/pull/104
15:59:57dom96rapind: awesome!
16:02:38def-whitenoise: If you want to find bugs in JS, compiling these for JS should deliver some: https://github.com/def-/nim-unsorted
16:07:17rapindthanks dom96, i'm starting on a more feature rich poll / voting app using reactjs + websocketd + nim now :) hooked
16:09:36def-websocketd looks cool, but in the long run it would be nice to have a Nim websockets library I guess
16:10:51whitenoisedef-: I had actually just started working on my original idea of a "nacket" library or so. I'm wondering if I can wrap libnet and libpcap and get BPF to compile and everything...that could result in a lot of neat tools.
16:10:55Araqdon't we have that in Nimble already?
16:11:28AraqI told you guys to implement websockets *years* ago
16:11:34whitenoisedef-: I was also just a little scared away by unfamiliar territory, so I ran away to networking :) but I can visit that if you have examples.
16:11:44Araqnobody listens to me ...
16:11:51def-Araq: I know, I read the irc logs, but didn't find any finished implementations. someone started one somewhere iirc
16:12:31def-whitenoise: examples for what exactly?
16:12:41whitenoisedef-: JS compiles failing, the link you gave me.
16:13:06def-whitenoise: well, i haven't tried most yet. just run them with "nim -d:nodejs js FILE"
16:13:06*HakanD___ quit (Read error: Connection reset by peer)
16:13:21def-many will not work for whatever reason and some will show bugs in the js backend surely
16:13:36*HakanD___ joined #nim
16:13:47def-Here's the started websockets library: https://github.com/onionhammer/onion-nimrod/tree/master/websockets
16:14:25rapinddef-: yeah i would love to use nim for the ws part. i like the idea of a per process one like websocketd (written in go), but obviously not the most efficient
16:15:15rapindbut still if your backend is light enough, like < 500k like a simple redis backed server, you can handle a pretty high number of concurrents even when it's a process per
16:15:22*skroll3 quit (Ping timeout: 240 seconds)
16:16:00*HakanD___ quit (Client Quit)
16:19:33rapindwebsockets are generally long lived too, so you're not firing up new processes as often you would be with http
16:19:47*darkf quit (Quit: Leaving)
16:21:17whitenoiseapparently c2nim can't handle declarations like this:
16:21:23whitenoise unsigned char reserved:4; // 4-bits from the 6-bits of reserved space
16:21:23whitenoise unsigned char tcp_offset:4; // TCP data offset for little endian host
16:22:05Araqwhitenoise: well c2nim in general knows what Nim's FFI supports
16:22:37whitenoiseso that's not necessarily a bug, just an "unsupported" C syntax?
16:23:06*dyu quit (Quit: Leaving)
16:26:43def-https://pay.reddit.com/r/nim/comments/2w2e9y/higherkinded_type_in_nim/
16:32:10UberLambdayay, HKT
16:33:06infinity0covariant/contravarient generic types should probably come before that. or does nim already have them?
16:33:31infinity0as in, +/- in scala and In/Out in c#
16:42:17*perturbation joined #nim
16:42:42*Jehan_ joined #nim
16:44:12*dashed joined #nim
16:44:39Jehan_infinity0: Nim's parametric polymorphism isn't tied to subtyping, so covariance/contravariance is less of a concern (in this context).
16:54:33*kniteli joined #nim
16:54:58*cjbest joined #nim
17:02:27*superfunc|lab joined #nim
17:09:19*itsmeront joined #nim
17:14:00itsmerontlusers
17:15:31gokritsmeront: Hehe, that looked almost like an insult - but I guess some IRC cmd? :)
17:15:46itsmerontyeah was trying to get user count
17:15:55gokr118
17:16:08def-It's /names for me
17:16:11gokrNot a record, its evidently 120 :)
17:16:39itsmeronthmmm /lusers and /names doesn't work for me
17:17:03gokrrapind: Check my forking socket server article
17:17:29gokrrapind: http://goran.krampe.se/2014/10/25/nim-socketserver/
17:17:56gokrThe gist of it is that its very easy to make such a forking server in Nim using the threadpool in Nim, and its quite efficient too.
17:21:37*dumdum quit (Ping timeout: 256 seconds)
17:25:09*perturbation quit (*.net *.split)
17:25:10*chemist69 quit (*.net *.split)
17:25:10*ChrisMAN quit (*.net *.split)
17:25:10*Mimbus quit (*.net *.split)
17:25:11*milosn quit (*.net *.split)
17:25:11*comex quit (*.net *.split)
17:25:11*no_name quit (*.net *.split)
17:25:11*Triplefox quit (*.net *.split)
17:25:12*joebo quit (*.net *.split)
17:25:12*Varriount quit (*.net *.split)
17:25:12*dv- quit (*.net *.split)
17:25:13*Roin quit (*.net *.split)
17:25:13*MattAitchison quit (*.net *.split)
17:25:14*delian66 quit (*.net *.split)
17:26:17*lurky joined #nim
17:29:08*lurky left #nim (#nim)
17:29:24rapindgokr: taking a look, thanks
17:31:40*perturbation joined #nim
17:31:40*chemist69 joined #nim
17:31:40*ChrisMAN joined #nim
17:31:40*Mimbus joined #nim
17:31:40*milosn joined #nim
17:31:40*comex joined #nim
17:31:40*no_name joined #nim
17:31:40*Triplefox joined #nim
17:31:40*joebo joined #nim
17:31:40*Varriount joined #nim
17:31:40*dv- joined #nim
17:31:40*Roin joined #nim
17:31:40*MattAitchison joined #nim
17:31:40*delian66 joined #nim
17:32:22gokrrapind: The threadpool in Nim is quite smart - it adapts to number of avialable cores etc
17:32:51gokrAnd since its a pool - you aren't paying for starting/stopping threads.
17:33:23rapindgokr: nice, that looks pretty performant
17:34:12gokrYeah, it seemed to be quite performant - and still its pretty primitive - just throwing the whole socket via spawn which deep copies it. Although its not that "deep" to copy I guess.
17:34:25infinity0Jehan_: it's "tied to" by the fact that the language supports both
17:34:37infinity0so not having co/contravariance will lead to annoyances
17:34:39gokrPersonally I like forking servers - otherwise you need to make everything asynch.
17:35:10infinity0like the fact you would be able to cast List[int] to List[object] without a covariant definition of List[T]
17:35:16infinity0you wouldn't be able to*
17:35:33Jehan_infinity0: Yes, but is there a need to?
17:35:55infinity0is there a need for anything? what would you accept as a valid supportive argument?
17:36:00Jehan_The problem that Scala/Java/etc. have is that the only way they have to express constraints on the type parameter is through subtyping.
17:37:31infinity0and what does this have to do with "nim doesn't need covariant generics"
17:37:34rapindgokr: what I was playing with isn't async, it's actually per process. so far less efficient, and yetthe memory is low enough w/ simple servers that a cheap $20 can probably handle 90% of the use cases
17:37:42Jehan_infinity0: I didn't say that.
17:37:49Jehan_I said it's less of a concern.
17:38:16infinity0that's a very vague statement, i don't understand what it means concretely
17:39:25rapinds/cheap/cheap server
17:39:38Jehan_It means that the fact that constraints on Nim's type parameters are not restricted to subtyping eliminates a class of problems.
17:39:50gokrrapind: Personally I tend to feel the async craze is... slightly odd. I mean, we are in multicore country these days. And with a proper pool and decent inter-thread mechanisms - I am unsure why async would be so much better.
17:40:29*jholland joined #nim
17:40:32rapindgokr: i head ya
17:40:37rapinds/head/hear
17:41:15gokrAlso, if you do use the async stuff (which is nice by all means) then you better have async db library, async file io, async what-ever. All of it.
17:41:18infinity0Jehan_: what class of problems, and what do you mean "constraints"? not supporting co/contravariant parametric types is the more restrictive scenario
17:41:29rapindgokr: I think we may be at the point where for many use cases you don't need anync or threaded.
17:41:55Jehan_gokr: It's about the ability to express parallel algorithms in a natural way (obviously, "natural" is subjective, but a great many people seem to feel that way).
17:42:27gokrJehan_: Yeah, sure, but... I have mostly seen the "networking servers" use case.
17:42:31rapindi'm trying to imagine htop w/ 10k ws processes.
17:42:33gokrYou know, nodejs stuff.
17:42:42Jehan_infinity0: constraint = the condition a type parameter has to satisfy.
17:42:57gokrrapind: Why 10k threads?
17:42:58infinity0yes, and without co/contravariant definitions they have to match exactly
17:43:09Jehan_In Nim, or ML, that constraint is expressed through type signatures.
17:43:22Jehan_In Scala/Java, through subtyping.
17:43:25infinity0ML doesn't have subtypes, co/contravariance doesn't apply
17:43:26gokrrapind: With a pool you only need as many threads as you are concurrently serving.
17:43:41infinity0what do you mean by "type signatures"?
17:43:57rapindgokr: not threads, processes. take a look at http://websocketd.com/
17:44:14rapindgokr: just something I was toying with
17:44:27Jehan_infinity0: The signature of the type.
17:44:35infinity0how is that different in scala/java?
17:44:56gokrrapind: Nice website ;)
17:44:56infinity0also, java doesn't have real co/contravariance, you shouldn't put that together with scala during this discussion
17:44:58rapindgokr: obviously terribly inneficient compared to forking, but the idea is interesting
17:44:58Jehan_It means that in Scala/Java you have to inherit from a specific type for it to fit the correct constraint.
17:45:19Jehan_In Nim/ML, the type only has to support the functions without any need for inheritance.
17:45:33rapindgokr: oh it's not mine, this is just something I was messing with. It's a go service that basically proxies WS to your service as stdin / out
17:45:51gokrrapind: I know. I was just joking a bit, I do like the website.
17:45:58Jehan_gokr: We're using them in computer algebra, too, where they are very convenient.
17:46:00infinity0that's the same in java/scala. do you understand what co/contravariance means, and why without it, you can't say List[int] < List[object] ?
17:46:20*reem joined #nim
17:46:20Jehan_infinity0: I know exactly what co-/contravariance is, thank you.
17:46:21rapindgokr: yeah perty :) i just like the concept and how trivial it is to throw up a WS
17:46:32Jehan_And it's not the same in Scala/Java, sorry.
17:46:42gokrJehan_: Yes, I am aware of that - which is why I mentioned the fact that I personally mostly have been exposed to it in the networking area. And thus my comments. For other stuff, yeah, sure - banzai.
17:48:55infinity0Jehan_: so in nim how would you express that T[A] can be a subtype of T[B] if A is a subtype of B
17:49:03rapindgokr: any idea what the memory footprint was on your websocket forks?
17:49:22gokrIf its not in the article, I don't recall.
17:49:32*superfunc|lab quit (Quit: leaving)
17:49:39Araqinfinity0: that's not a sound typing relation by any means.
17:49:56infinity0it depends on your class definition, and it can be sound
17:50:07infinity0in the specific cases where it's sound, the programmer would like to express this to the compiler
17:50:27Araqit only happens to work when your subtype relation happens to imply "pointers under the hood"
17:50:53Araqand even then you have to care about mutability etc
17:51:03infinity0it's more general than that, scala and c# have precise correct definitions on when it's sound and how to verify that it's sound
17:51:08Araqit's not a coincidence it took version 4 of C# to suppor that
17:51:08Jehan_infinity0: The issue here is that Java and Scala overuse subtype polymorphism where parametric polymorphism would be superior.
17:51:10infinity0i forget the exact algorithm
17:51:20*reem quit (Ping timeout: 264 seconds)
17:51:25Jehan_Subtype polymorphism is really only necessary where you require dynamic dispatch.
17:51:28infinity0no, parametric and subtyping are two different things. i'm talking about if your language wants to support both
17:51:46infinity0perhaps, when you write a specific library, maybe it's incorrect to use subtyping when it's better to use parametric
17:51:54infinity0but that's not what i'm talking about
17:52:02infinity0there are valid cases where you could use both at the same time
17:52:10Jehan_They are different things, but they are related, and Java/Scala often unnecessarily use subtype polymorphism where parametric polymorphism would not only suffice, but be the more powerful construct.
17:52:12infinity0and in that case, co/contravariance helps your code be *less* restrictive
17:52:48Araqinfinity0: well this discussion is futile. we know what co/contravariance is. we disagree about how often it is useful/required.
17:53:19infinity0so then, i won't have a way to cast immutableList[int] to immutableList[object] ?
17:53:31Araqint is not a subtype of object anyway
17:53:31infinity0or to cast function[int,object] to function[object,int]?
17:53:42infinity0ok, well number or whatever it is
17:54:07Araqwell 'cast' is nearly always possible since it's unsafe to begin with
17:55:14Jehan_infinity0: I think an actual application would be needed to support the claim that it's necessary or beneficial.
17:56:05Jehan_And given that ML (including OCaml) and Haskell seem to do fine without, that seems difficult.
17:56:33infinity0ML and Haskell don't support subtypes, is why
17:56:51infinity0the point is when you want to have both subtypes and generics in the same language, it's best to have co/contravariance
17:56:58infinity0take for example Function[-T, +R]
17:57:03Jehan_OCaml has subtypes.
17:57:51*filwit joined #nim
17:57:53infinity0that means it's contravariant in the input and covariant in the output, so if your client requires a function(int)->number, you can pass it something that is actually a function(number)->int
17:58:02Jehan_Plus, algebraic datatypes are essentially a restricted form of subtyping.
17:58:07filwit118 eh?
17:58:09infinity0ok, i will look into ocaml
17:58:12Araqdo not lecture me.
17:58:29Jehan_infinity0: I understand this, the question is whether that's actually something that's necessary or beneficial in practice.
17:59:13*cjbest quit (Quit: My Mac has gone to sleep. ZZZzzz…)
17:59:19infinity0so what sort of arguments do you consider valid, when talking about "beneficial"?
17:59:32Jehan_Note also that you can actually do this in Nim, assuming that you don't need to actually dispatch dynamically on the function parameter.
18:00:53Araqinfinity0: by your logic C# before version 4.0 was unusable for software development. I disgree.
18:01:19infinity0what? no i'm saying C# and Scala are better than they would be if they didn't have co/contravariance
18:01:31infinity0if i think nim is "unusable" i wouldn't be packaging it for debian
18:01:35infinity0stop getting defensive
18:02:01Jehan_infinity0: An actual real-world example. Note also that you don't have to convince me; I don't have much influence (if any) on the design of the language. What I'm trying to explain to you is that your argument may not be as strong as you think it is.
18:02:18Jehan_If you disagree, that's okay, too.
18:02:37Araqwell even if it's beneficial "objectively", we have 400 bugs open and want to release version 1.0 in the near future.
18:02:53Araqso it's a totally futile discussion
18:03:00infinity0apparently OCaml has co/contravariance https://blogs.janestreet.com/a-and-a/
18:03:18infinity0well, fine
18:03:51infinity0but i was just defending the point that, disconsidering cost of implementation, that it's objectively not useful
18:04:10Jehan_But it is my experience that many people don't fully understand how much parametric polymorphism can substitute for subtype polymorphism (namely, whenever you do not need late binding).
18:04:23Araqno, it's objectively a poor complexity vs expressitivity tradeoff
18:04:37Araqwell not "objectively"
18:04:39Araqbut IMO
18:09:29*springbok joined #nim
18:10:49Jehan_Araq: I've read up on the polyhedral model. I think the proposal would make for a nice GSOC project, but I wonder how beneficial it would be for Nim. Like most approaches to vectorization, it necessarily has to make some pretty restrictive assumptions.
18:13:16*dumdum joined #nim
18:18:35*Matthias247 joined #nim
18:21:54*davidhq joined #nim
18:53:27*rapind quit (Ping timeout: 250 seconds)
19:00:57*lavender joined #nim
19:04:45AraqJehan_: well the idea is to use that model for semantic checking of the 'parallel' statement, not for optimization
19:05:19Araqso the idea is to apply it in a different but related context
19:05:28Jehan_Araq: That's understood, but that checking would be subject to the same assumptions.
19:06:22AraqI dunno if it makes for a nice GSOC project or rather a PHD thesis
19:06:37Jehan_Not saying that it's a bad idea, just that it seems to be for a fairly specialized set of cases, unless I'm missing something.
19:07:32*dhasenan joined #nim
19:08:21Araqwell right now we do an adhoc analysis that doesn't deal with more than one dimension and seems to have *more* restrictions
19:09:11*lavender quit (Ping timeout: 246 seconds)
19:09:29Jehan_Araq: *nod* It's a pretty difficult problem in the general case (that, incidentally, would be a Ph.D. thesis).
19:11:15Araqoh well I'll leave it in and add some notes like "should this turn out to be much too hard, plan B is to document in detail how the current analysis works"
19:12:48*rapind joined #nim
19:23:49*perturbation quit (Ping timeout: 255 seconds)
19:25:07*skroll3 joined #nim
19:26:54*davidhq quit (Ping timeout: 245 seconds)
19:28:36*cjbest joined #nim
19:31:14*davidhq joined #nim
19:31:17Araqdef-: can you make https://github.com/Araq/Nim/pull/1840 mergable again please
19:31:26def-Araq: sure
19:32:52*davidhq quit (Max SendQ exceeded)
19:33:20*davidhq joined #nim
19:33:37*Lady joined #nim
19:34:17Araqdef-: https://github.com/Araq/Nim/pull/2137 close or apply?
19:35:02def-Araq: that really looks wrong to me, but someone with Windows should check
19:35:31def-Nim in wine didn't work for me
19:36:00Araqwhy not? that's awful
19:36:28def-Error: unhandled exception: File not found.
19:36:45def-That's all I get, I guess it can't find mingw even though I selected to install it
19:37:18Araqdoes installation work?
19:37:21def-yes
19:38:01Araqadded it to your PATH via the installer?
19:38:24def-yes
19:38:44Araqhrm ok, will look into it. eventually.
19:39:04dom96gokr: How does your spawn server compare to asynchttpserver?
19:39:26gokrdom96: Not sure.
19:39:51gokrFeel free to test ;). Do note though that my code there didn't actually *do* much at all.
19:40:05gokrI mean, as in parse and respond.
19:40:25gokrdom96: The code in the article is quite trivial.
19:40:28dom96gokr: Yeah. I did test, but I found http benchmarks results odd on my laptop at least.
19:40:54gokrI haven't touched it any since I wrote that, I just wanted to see how easy it was for me to do it.
19:41:10gokrAnd kudos to you and Andreas, it was quite easy.
19:42:13dom96gokr: One potential issue I can see with your approach is a DOS attack where a lot of clients are connected but don't send any data to your server, so your server is blocking on recv().
19:42:29dom96At some point you will run out of threads.
19:43:25*Lady quit (Quit: Page closed)
19:43:58dom96New user record btw: 124!
19:45:09def-Araq: rebased, should be mergable
19:45:46BlaXpirit_def-, umm
19:45:46*rapind quit (Ping timeout: 252 seconds)
19:45:55BlaXpirit_I don't see any files written by installer in Wine
19:46:23def-BlaXpirit_: i get a fine installation and all seems to work except calling gcc in the end
19:46:57BlaXpirit_oh lol, I just tried to install it to my root drive
19:47:04BlaXpirit_and it didn't say any error
19:47:29def-Oh right, it tried to do that by default, don't know why
19:47:34*rapind joined #nim
19:50:19BlaXpirit_Error: unhandled exception: ╨д╨░╨╣╨╗ ╨╜╨╡ ╨╖╨╜╨░╨╣╨┤╨╡╨╜╨╛.
19:50:21BlaXpirit_righto
19:52:19*rapind quit (Ping timeout: 265 seconds)
19:55:03BlaXpirit_not looking good. tried different ways of providing the file path, but it's probably some other file that it can't find and we don't know which
20:03:13*cjbest quit (Quit: My Mac has gone to sleep. ZZZzzz…)
20:03:24*jfokkan left #nim (#nim)
20:05:33BlaXpirit_def-, Araq, i got it to work on Wine!
20:05:44BlaXpirit_the problem was just PATH
20:06:00def-BlaXpirit_: ok, what to do?
20:06:44BlaXpirit_wine cmd; SET NIMRODPATH=C:\Nim; SET PATH=%NIMRODPATH%\bin;%NIMRODPATH%\dist\mingw\bin;%PATH%; nim c -r Z:\tmp\blaxpirit\test.nim
20:07:21BlaXpirit_replace "; " with an "Enter" keypress :p
20:08:57def-BlaXpirit_: ok, works for me too. how comes this is necessary in wine and not on windows and any way to fix it automatically?
20:09:21BlaXpirit_def-, all I can guess is PATH is not set automatically? maybe you just did something wrong
20:09:50BlaXpirit_one can easily modify PATH permanently in Wine, I just didn't look for that specifically
20:10:07def-no, i mean how can the installer fix that
20:10:18def-i just ran the installer, don't think that's wrong
20:10:24BlaXpirit_def-, have you tried Nim on Windows at all?
20:10:43BlaXpirit_because I'm pretty sure I had problems with PATH on normal Windows too
20:11:52*BlaXpirit joined #nim
20:12:27def-BlaXpirit_: nope, i don't have windows
20:13:20BlaXpiritso maybe there aren't any additional problems with Wine
20:14:04*dashed quit (Quit: Connection closed for inactivity)
20:14:15def-I assume it just works on Windows without manually setting paths, especially because the installaer has the option to set paths
20:14:42BlaXpiritthere is that start.bat thing
20:18:58*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:24:58*koz_ joined #nim
20:26:56*BlaXpirit quit (Read error: Connection reset by peer)
20:27:39*BlaXpirit joined #nim
20:29:38*perturbation joined #nim
20:29:42*cjbest joined #nim
20:35:59*reem joined #nim
20:40:39*reem quit (Ping timeout: 265 seconds)
20:42:03*rapind joined #nim
20:42:04filwitAraq: there doesn't seem to be a 'cmake_gcc.sh' command in the Urho3D directory (like the Urhonimos readme suggests in the build instructions)
20:42:28filwitthat said, I built fine with the build_generic.sh
20:43:10filwitbut i'm still getting link errors trying to build character.nim: character.cpp:(.text+0x1279): undefined reference to `Urho3D::CollisionShape::SetTerrain()'
20:43:40filwithas anyone gone through these steps already and know to to fix it (I'm on Linux)
20:44:25def-filwit: yes, it doesn't work with Urho3D
20:44:28def-head*
20:44:34def-you need the latest release version
20:44:41filwitah, okay
20:45:01*perturbation quit (Ping timeout: 252 seconds)
20:46:32*springbok quit (Read error: Connection reset by peer)
20:48:01*vendethiel- joined #nim
20:48:24*Mat4 joined #nim
20:48:29Mat4hi all
20:48:34*vendethiel quit (Ping timeout: 250 seconds)
21:01:52VarriountMeep
21:02:38*perturbation joined #nim
21:04:40*brson joined #nim
21:05:12gokrfilwit: I think it was called cmake_gcc.sh in *1.32* :)
21:05:37gokrAh, right, sorry, didn't read all.
21:05:45filwitgokr: yeah i'm building it now
21:05:54gokrI just added instruction text to the particle demo ;)
21:06:22gokrI am on Linux too.
21:06:35filwitnice. the instructions are pretty clear, I just missed the part about needing 1.32 not head
21:07:01gokrYou mean you missed "Urho3D version 1.32 (exactly)" ;)
21:07:22filwityeah, i was being lazy :)
21:07:28gokrHehe
21:08:15gokrThere are some small "gotchas" porting samples from C++ - but not many.
21:08:28gokrI added some comments to particle.nim trying to mention a few of them
21:08:55*bjz joined #nim
21:10:01*rapind quit (Ping timeout: 255 seconds)
21:10:17*BlaXpirit quit (Quit: Quit Konversation)
21:10:39*bjz quit (Client Quit)
21:11:21*perturbation quit (Quit: Leaving)
21:12:58Mat4exist there a rule for advertisings (in the forum ore here) ?
21:13:26filwithmm... still having build errors (admittedly I haven't checked all my deps, but this doesn't seem related to missing deps): from nimcache/character.cpp:10:
21:13:26filwit../Urho3D-1.32/Source/Engine/Container/RefCounted.h: In copy constructor ‘Urho3D::Object::Object(const Urho3D::Object&)’:
21:13:26filwit../Urho3D-1.32/Source/Engine/Container/RefCounted.h:76:5: error: ‘Urho3D::RefCounted::RefCounted(const Urho3D::RefCounted&)’ is private
21:13:26filwit RefCounted(const RefCounted& rhs);
21:14:01*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:14:45*yibter joined #nim
21:15:35filwitdef-, gokr: you guys understand what's going on there? That's a error from --parallelBuild:1, so I'm thinking it's a linking issue.. but I copied the correct LibUrho3D.a to $URHONIMOS/lib and copied the 1.32 CoreData & Data folders to examples, so I'm not sure why the source isn't wiring up correctly
21:16:10gokrThe CoreData and Data is just for running.
21:16:24gokrlibUrho3D.a with lower case l, right?
21:16:40filwitgokr: right
21:17:04gokrhmmm
21:17:13filwitin the 'lib' folder (with a lower case) but that's not in the examples directory
21:17:27filwitshould it be? let me try
21:17:33gokrNo, no, its correct
21:17:36def-filwit: if you first built Urho3D from #head then there are 2 lib directories
21:17:39gokrIts directly in Urhonimo
21:17:56gokrDid you do "make install" at any time?
21:18:05filwitno
21:18:12gokrGood :)
21:18:22gokr2 lib directories?
21:18:23filwitnever ran make install, I never trust that
21:18:37filwitgokr: no.. but i'm not sure what you're asking?
21:18:46gokrdef- said it
21:18:52filwitthere's only one lib dir (in the Urhonimos dir)
21:18:55*yibter quit (Remote host closed the connection)
21:19:25filwiti first built Urho3D head with build_generic.sh, then make
21:19:39filwitthat built (outside of the Urhonimos dir) just fine
21:19:44gokrSure.
21:19:52filwitwait... i think i messed up, thinking back
21:20:28gokrThen you got 1.32 source ball?
21:20:42filwiti downloaded the Urhos 1.32 zip and extracted inside the Urhonimos dir, which seemed to add to the already existing Urho3D-1.32 dir...
21:20:45filwitthat's probably it
21:20:49gokrOuch.
21:20:51filwitcrap
21:21:01filwitoh well, let me restart
21:21:25gokrSo unpack source.
21:21:34def-filwit: yep, you overwrote the existing Urho3D-1.32 dir
21:22:10gokrThen do "./cmake_gcc.sh -DURHO3D_LUA=1 -DURHO3D_LUAJIT=1 -DURHO3D_EXTRAS=1 -DURHO3D_SAMPLES=1" (all those aren't needed, but the samples may be fun etc)
21:22:26gokrThen "cd Build && make"
21:22:46filwitokay. Thanks for the help, let me restart here and get back to you
21:23:07*itsmeront quit (Ping timeout: 246 seconds)
21:23:45gokrsure!
21:24:00gokrYou can join #urho3d too - they are curious about us ;)
21:25:42filwitsure, sounds like fun
21:26:07filwitbut I have to do other things pretty soon
21:27:29def-filwit: got the source files for nim graphics up somewhere already?
21:28:27filwitdef-: http://www.reign-studios.net/philipwitte/nim/Artwork/NimArt.zip
21:28:42def-Page not found
21:29:07def-http://www.reign-studios.net/philipwitte/nim/artwork/NimArt.zip works
21:29:42filwityeah whoops i just did that too... dunno how it capitalized the URL..
21:31:14*yibter joined #nim
21:31:24def-thanks
21:36:04flaviuNim includes the compilation date in the --version output. This might cause problems with efforts like https://lists.debian.org/debian-devel-announce/2015/02/msg00007.html where the wall clock time is changed.
21:38:38def-flaviu: is that really unusual? the linux kernel does so as well, for example
21:38:53*dumdum quit (Ping timeout: 256 seconds)
21:39:26flaviuApparently they're patching linux:
21:39:27flaviu> Several core (e.g. linux) and other packages have already received patches to make them build reproducibly
21:39:45def-flaviu: ah, so we just need a little switch to disable that optionally I guess
21:39:56flaviuI don't see why it's needed.
21:40:12flaviuUse the commit hash or the commit date instead.
21:43:50*NimBot joined #nim
21:44:14Araqyeah, commit date is fine
21:44:25*yibter quit (Quit: yibter)
21:44:47ekarlsoheya guys
21:45:02Mat4hi ekarlso
21:46:23ekarlsodef-: yeah ill do more stuff on the play stuff once I'm back home and settled
21:46:30ekarlsoit's more or the less ready
21:47:58filwitwoohoo! character demo runs great!
21:48:32gokrSuper :)
21:49:07*HakanD___ joined #nim
21:50:00Araqamazing how many people are playing with this
21:51:04filwityeah I want to play around more, but I need to stop now. Will get to messing around later.
21:51:15gokrfilwit: Port the driving car demo ;)
21:51:28*reem joined #nim
21:51:42filwitgokr: i was thinking of hammering out a spaceship in Blender and making my own demo ;)
21:51:52gokrYeah
21:52:07gokrThat's of course even cooler. A spaceship with the letters NIM on the side.
21:52:48filwitthere we go :)
21:53:00onionhammerVarriount running bars?
21:53:23filwitI originally designed the revamped Nim Logo in Blender (to get the perspective perfect), so maybe i'll make use of a 3D logo somewhere
21:58:54Mat4sadly I have not enough free time to take a deeper look at it. What interesting me is wheather Urho3D would be a good replacement for SDL (2D bitmap :- texture manipulation and such)
22:04:55AraqMat4: I think it's too heavy of a dependency for that
22:06:16Mat4hmm ok, thanks
22:07:47Araqbut it surely works for 2D, gokr just ported a nice 2D particle demo
22:11:56BlaXpirit_what's with the hype though
22:12:07BlaXpirit_have people interested in 2D seen SFML?
22:13:11BlaXpirit_Mat4
22:14:44Mat4I use 3D acceleration for emulating a classical video-display processor inclusive display characteristics
22:15:37BlaXpirit_huh
22:16:06*gokr_ quit (Ping timeout: 246 seconds)
22:17:16flaviuhttps://github.com/Swordfish90/cool-retro-term ?
22:17:16Mat4it helps me speed up development of dedicated hardware
22:17:28flaviuAh
22:18:46Mat4flaviu: Nice link, do you know: http://www.secretgeometry.com/apps/cathode/ ?
22:19:33*jfchevrette joined #nim
22:20:49flaviuNope, I don't have a personal interest in that sort of thing. I've just seen cool-retro-term posted on reddit a bit.
22:21:11flaviuLooks cool though
22:22:00Mat4let's starring on radioactive green displays again ;)
22:23:58*HakanD___ quit (Quit: Be back later ...)
22:24:46*kuzy000_ quit (Ping timeout: 250 seconds)
22:25:18gokrIdiotic question: Remove all elements of a seq?
22:25:28Araqx.setLen(0)
22:25:35gokrthanks.
22:25:53gokrThats... not easy to guess.
22:27:13def-"clear x" would be nice, but I guess the standard library is quite big already
22:27:33Araq*shrug* it may surprise you but I don't lose sleep over the question "how can others learn Nim effectively?" ;-)
22:28:03BlaXpirit_it's not the library that is big
22:28:09BlaXpirit_the documentation is "big"
22:28:21Mat4ehm, no
22:29:32gokrAraq: The issue is not that actually, the issue is that... I am not sure how to find out without asking here.
22:29:46gokrAny advice for that appreciated.
22:30:04BlaXpirit_that is indeed one of the biggest problems
22:30:15Araqwell I have no solution for this problem.
22:30:20BlaXpirit_and people often ask just this "how to find out things"
22:30:36def-so, how do you find out things in other languages?
22:30:49Araqwell working auto-complete goes a long way of solving this
22:30:54gokrIn Smalltalk it would be easy, I just look at the class and see all behaviors it supports.
22:31:03gokrNow, how do I see all I can do with a seq?
22:31:11BlaXpirit_ctrl+f -_-
22:31:11*jfchevrette quit (Ping timeout: 246 seconds)
22:31:14gokrAraq: Yeah, I know.
22:31:21def-so typing "x." and hitting <TAB> would show everything that works on seq?
22:31:21Araqthat's just IDE support
22:31:32*UberLambda quit (Ping timeout: 245 seconds)
22:31:34Araqdef-: it already does
22:31:46BlaXpirit_this does not help much
22:31:46Araqwith nimsuggest
22:34:34Araqwell we can add hints to 'del' like "if you want to remove the last element setLen(x, x.len-1) is usually more efficient
22:34:55Araqand if you want to remove every element, use x.setLen(0)"
22:36:02Mat4I think that is an IDE related issue because Smalltalk for example is a whole environment where the class browser act as integrate component of the whole language (at least in Smalltalk 80)
22:37:29BlaXpirit_all I can say is https://docs.python.org/dev/library/stdtypes.html
22:38:25Mat4ok, it's an documentation isue
22:38:30Mat4 issue
22:38:43gokrWell, I don't really want tons of documentation to wade through that rots.
22:38:55gokrI want browser and navigation tools.
22:39:21gokrNow... nimsuggest will be able to do it given a context.
22:39:37gokrCould it also ... help in creating a navigational browseable model?
22:39:47Jehan_What I would suggest is to have proc/method documentation indexed by type. Still tricky for types that are used a lot.
22:40:14AraqJehan_: yeah that is planned for the docgen
22:40:31gokrIts the lowest fruit for sure.
22:40:57flaviuhttp://reign-studios.net/philipwitte/nimrod/docs/docs.htm
22:40:58Araqno, making nimsuggest work well is less work than an overhaul of the docgen
22:41:26gokrOk, but... sure, most of the time I suppose I will be in a "suggest" situation.
22:41:30def-Someone was here before, working on the docgen and produced this: http://www.unraveltechnology.com/img/times.html
22:41:54gokrI looked at nimsuggest btw, but... I was lost. I couldn't see where the real action was.
22:42:21Araqcompiler/suggest.nim
22:42:50gokrI thought that was the code I looked at. Found def, sug etc
22:42:55gokrOh well, i will take another look
22:43:06Araqand that statement coming from a smalltalker is not without irony ;-)
22:43:18BlaXpirit_def-, what does that change?
22:43:20Jehan_The biggest problem I have with nimsuggest (or formerly idetools) is that it depends on having stuff in a file at a specific location.
22:43:29gokrWhich statement?
22:43:38Araq"smalltalk: everything happens elsewhere" wasn't that a common complaint?
22:43:47def-BlaXpirit_: looks nice, sidebar stays fixed when scrolling, sorted types/procs/...
22:43:48BlaXpirit_what is present at flaviu's link would of course be majestic
22:43:54shevysmalltalk syntax is awful!
22:43:54BlaXpirit_we've been waiting for it for ages
22:44:00Jehan_What I really want is something like "list all procs that take a Foo as their first argument" or "list all procs returning Foo" or "all constants of type Foo".
22:44:06gokrAraq: Ha! Well, yeah, some people felt like that.
22:44:16dhasenanAre there forward declarations for types?
22:44:16gokrshevy: No, its beautiful. ;)
22:44:46*Varriount quit (Read error: Connection reset by peer)
22:45:11def-dhasenan: trying to have 2 types that use each other? you can put them in the same type block
22:45:17Jehan_dhasenan: No, mutually recursive types need to be within the same type statement or you need to use parametric polymorphism to work around that.
22:45:23BlaXpirit_def-, I don't think sorting like that is an advantage
22:45:43AraqJehan_: or subtyping
22:45:46def-BlaXpirit_: yes, should be by type instead, like filwit did.
22:45:49dhasenandef-: thanks.
22:46:09Jehan_Araq: Yeah, but that adds overhead that you can avoid.
22:46:24BlaXpirit_filwit, please finish the documentation overhaul, it is very nice and very improtant
22:46:53flaviuBlaXpirit_: That's just a mockup.
22:47:06BlaXpirit_so you'd need to start it first, huh :|
22:48:54Mat4a mockup is a start, go on
22:49:22AraqJehan_: ok, I think I can add that feature
22:50:12Araqhrm tut1 is still so weak on 'sequence'
22:50:32AraqI thought it would also tell about the most common ops
22:50:36def-Araq, Jehan_: such a search would also be useful for the website
22:51:08Jehan_def-: Which search?
22:51:49def-Jehan_: > "list all procs that take a Foo as their first argument" ...
22:52:26Jehan_def-: Oh, yes. And now I understand the reference to subtyping, too. Sorry, was trying to follow multiple conversations at once.
22:52:28gokrAraq: I wrote an article on seq, but ... I missed several bits of course.
22:54:56gokrBtw, whats the official stance on sequtils? Can we add more things? Is there an idea on naming stuff?
22:59:29Araqyeah and we have some rather slim ideas about the naming conventions:
22:59:53Araqhttp://nim-lang.org/apis.html
23:00:23Araqoh .. and it also says "For coding guidelines see the Internals of the Nim Compiler documentation." which is completely outdated
23:00:44Araqthat's the problem with documentation, you need to maintain it.
23:01:00Araqbetter tooling doesn't have this problem
23:01:20gokrI'm with ya.
23:02:38shevythat's why no documentation is better, you don't need to maintain it
23:02:41BlaXpirit_another link i see for the first time
23:03:17shevyBlaXpirit_ there are many more world-wide, trust me :-)
23:03:41def-gokr: sequtils has bad performance, see for example here: http://hookrace.net/nim-iterutils/iterutils.html
23:04:07Araqdef-: does that work now? you said the compiler doesn't eat it
23:04:14def-Araq: nope, still doesn't compile
23:04:20Araqyay
23:06:58*pafmaf__ quit (Quit: This computer has gone to sleep)
23:07:27Jehan_So, "echo(repr 1)" results in a syntax error. Is that intended? Because "let x = repr(repr 33)" works.
23:07:35*TEttinger joined #nim
23:08:36def-Jehan_: i reported that already for name
23:08:59AraqJehan_: no there is something going on with () parsing
23:09:03BlaXpirit_this brackets skipping is so inconsistent and adds so little that I just gave up on it
23:09:06Jehan_Araq: Gotcha.
23:09:50AraqI think it's actually a regression introduced with the rather dubious (;;) construct
23:09:52Jehan_I stumbled upon it because I essentially wanted to do f(x .op y), which has the same underlying issue.
23:10:37Jehan_It's not particularly pressing, I was just wondering if it was a bug or a feature.
23:10:58AraqI'm quite sure this thing used to work much better
23:11:46dhasenanIs there a guide to nim project / config files somewhere?
23:12:43def-dhasenan: something like this?: http://howistart.org/posts/nim/1
23:13:21def-Should soon be linked from http://nim-lang.org/learn.html
23:13:29*fizzbooze joined #nim
23:15:11Araqwhich is remarkable since (;;) predates (foo 1) syntax ... hrm
23:16:05dhasenandef-: no, not really. I'm wondering if there is a way to access environment variables from foo.nim.cfg in particular.
23:16:53dhasenanA reference for the expected syntax would also be nice.
23:16:59Araqdhasenan: with devel you can do gcc.path %= "$PATH"
23:17:10Araqto access the PATH env var
23:17:51Araqand the syntax is obvious: It uses Nim's lexer and Nim's preprocessor coming from a time when Nim had a preprocessor
23:18:33gokrCan we have notNil? :)
23:18:40flaviuI don't think obvious means what you think it means ;)
23:18:44dhasenanAraq: "obvious" is a relative term :)
23:19:37AraqI rarely mean the term "obvious" seriously
23:20:07dhasenanHrm, perhaps divining the syntax is left as an exercise to the reader?
23:21:02Araqwell config/nim.cfg contains all there is to know about it
23:22:08Araqgokr: if you can promise me it's the last thing that will be added to system.nim
23:22:39gokrDoesn't have to be in system
23:22:49Araqwhere else should it be?
23:22:55AraqisNil is in system.nim
23:22:58dom96gokr: Can't 'not isNil' be used instead?
23:23:07flaviuor just `!= nil`?
23:23:16gokrSure, but I mean, you can answer anything with that answer
23:23:34*Matthias247 quit (Read error: Connection reset by peer)
23:23:39shevy42
23:24:06filwitBlaXpirit_: I'll making a PR for the forums, and after that I'll be talking with flaviu about how updating the docs.
23:24:07flaviu` != nil`: 7, `not .isNil`: 10, `.notNil`: 7
23:24:19filwitI'll be*
23:24:22*cjbest quit (Quit: My Mac has gone to sleep. ZZZzzz…)
23:24:23BlaXpirit_thanks
23:24:31BlaXpirit_what does all this stuff mean
23:24:42filwitgod that sentence (mine) is horrible, lol
23:25:04Araqfilwit: others have opinions about the docs too
23:25:11filwitBlaXpirit_: was the directed towards me? if so, I don't know what you mean.
23:25:13BlaXpirit_no
23:25:26BlaXpirit_!= nil doesn't always work, by the way
23:25:30flaviuhuh?
23:25:42*sillesta quit (Ping timeout: 245 seconds)
23:25:55gokrI presume you also think isEmpty is daft? Better to compare len with 0?
23:26:06BlaXpirit_I may have confused something
23:26:16BlaXpirit_but I remember having to use isNil instead of != nil
23:26:37Araqno you're right, == is lifted from the element type's == which might not exist
23:26:44Araqfor seqs
23:26:54Araqthat's why isNil was added in the first place
23:27:01Araqnot for convenience
23:27:07filwitAraq: of course. I just meant that because flaviu has obviously put in work on the docs I'll be talking with him about what's he's done, and how to move forward with the visual mockup I've done.
23:27:17flaviuI haven't put any work in the docs.
23:27:24filwitoh..
23:27:25flaviuboydgreenfield did the new doc layout.
23:27:39flaviuI don't remember who did that more recent mockup.
23:27:40filwiti thought the docs looked a lot like your Nim-by-example, so I assumed you did it
23:27:49filwitnevermind then
23:28:14*BlaXpirit_ quit (Quit: Quit Konversation)
23:28:32Araqgokr: personally I think yes, 'len' is 1 useful operation, isEmpty etc are bloating the APIs
23:28:41filwitwho did updated the docs then?
23:29:43Araqboydgreenfield
23:29:54filwitk
23:30:12Jehan_Is there actually a difference between == nil and .isNil? As far as I can tell, one compares to NIM_NIL, the other to 0, but NIM_NIL is defined to be 0.
23:30:12Araqgokr: but it's not worth fighting over
23:30:27Jehan_Oh, right, templates.
23:30:47AraqJehan_: == nil for seq[T] lifts the == from the element's type
23:31:00Araqwhich is suboptimal
23:31:09Jehan_Araq: Gotcha.
23:31:15Araqmaybe I'd better specialized this via AST based overloading
23:31:18gokrI am just... sensing the community. In Smalltalk we like to have intentful messages. Other communities think differently.
23:31:24Araqbut that had not been invented back then
23:32:39*yibter joined #nim
23:33:00flaviuYeah, AST based overloading is better IMO
23:33:43gokrintsets can evidently answer to "empty"
23:33:56*yibter quit (Client Quit)
23:34:14Araqgokr: sometimes things are not pulled by me
23:34:21gokrBut it doesn't have len ;)
23:34:43Araqthat's because it's expensive to support or something
23:34:51Araqbut good point
23:35:11Araqyeah, isEmpty can be faster than len == 0
23:35:27gokrSince it has a counter... ;)
23:35:56*flaviu quit (Remote host closed the connection)
23:36:01Jehan_It would be nice to have a minimum standard interface for containers, I guess.
23:36:14gokrBut I digress, I don't want to start a war. I just like intent.
23:36:17Araqgokr: the counter doesn't count what you think it does though
23:36:48gokrWell, the empty proc checks if the counter == 0 so... perhaps I don't get it.
23:37:09Araqthere is a correlation :P
23:37:16Araqwhen counter == 0 it's empty
23:37:25Araqbut the counter doesn't count the number of elements
23:37:52*yibter joined #nim
23:37:56gokrSo a very good example of having intentful behaviors then.
23:38:11Araqyup
23:38:15gokrIt can't answer len, but it can answer empty.
23:38:37*flaviu joined #nim
23:38:55gokrI recall a similar discussion with a Smalltalk oldtimer. I wanted to add a polymorphic removeAll to Collection (thus works for all containers).
23:39:25flaviu"<Araq> yeah, isEmpty can be faster than len == 0". What about TR macros? Isn't this the perfect place for one?
23:39:27gokrHe said, nah, we have always done "coll.removeAll(coll copy)". We don't need a removeAll that takes no argument.
23:39:34*yibter quit (Client Quit)
23:39:47gokrThis is exactly the same. Intent is key.
23:40:06*Hakaslak joined #nim
23:40:08Araqit's also wrong btw
23:41:00*yibter joined #nim
23:41:19Araqintsets.empty is completely wrong, lol
23:41:19Jehan_flaviu: My problem with TR macros for such purposes is that it's difficult for a human reader to do the disambiguation right.
23:41:43Araqflaviu: TR macros must not change semantics and can be disabled on a global level
23:41:52Araqso you cannot use them for these things
23:42:16flaviuI'm not sure I understand. Isn't the definition of empty "len == 0"?
23:42:48*onionhammer quit (Ping timeout: 276 seconds)
23:42:49Araqonly if 'len' exists
23:43:22flaviuSo you require that the parameter be of the collection type you're implementing it for.
23:43:25def-and even if len exists, it may be cheaper to look if there is at least 1 element, for example for a linked list
23:43:35flaviuI didn't even consider that it could be generic.
23:44:21flaviuYou can even optimize `coll.removeAll(coll)` with the alias specifier.
23:45:56gokrFor removeAll - its simple, my *intent* is to remove all, not remove all these. Same for isEmpty (Smalltalk use the isXXX for boolean tests like these).
23:47:01*Hakaslak quit (Quit: TODO: Generate 'Computer Sleep Quit Message')
23:47:02gokrBut hey, this is just simple OO ;)
23:47:15gokrCouldn't resist.
23:47:20Araqgokr: yeah but then 'clear' is a common alias
23:47:26Araqand then what do you do?
23:47:35Araqadd the alias so people can guess the name?
23:47:36gokrCome again?
23:47:45AraqremoveAll vs clear
23:48:05gokrOh, I didn't comment on that.
23:48:09Araqif you have both it's easier for some people to remember
23:48:29Araqbut other then think "wait a sec! are these somewhat different?"
23:48:40gokrNah, in that sense I like to stick to one.
23:49:05*yibter quit (Remote host closed the connection)
23:49:18gokrPerhaps I lost you somewhere.
23:49:51Araqwell I was asking about your opinion on that aliasing business and got an answer
23:49:54gokrIn the Smalltalk example of removeAll - then I could optimize in some classes, nuking a backing array in one swoop for example.
23:50:07gokrYeah, I don't like aliasing as "helping programmers".
23:50:26gokrIn that sense I am with you - keep the API as small as possible.
23:54:11gokrOne thing I have noticed is that Nim community (or Araq :)) likes short names. Not as short as C guys, but not as long as Smalltalkers. I find that interesting, what shapes that preference?
23:54:38gokrC++ers seem to be fairly verbose.
23:55:01Araqtyping annoys me
23:55:11Araqnah ;-)
23:55:35gokrI can appreciate both styles, unless when it turns into gibberish.
23:55:38Jehan_gokr: I like long names. :)
23:55:41*onionhammer joined #nim
23:55:51Jehan_But then I also like OOP. :)
23:55:57gokrHehe, yeah.
23:56:10Jehan_In the end, however, pragmatism is my middle name.
23:56:20gokrI am torturing Andreas with Smalltalk code now you know. Its fun ;)
23:56:38Jehan_I think he'll survive. :)
23:56:50gokrYep.
23:58:14Jehan_But let's just say that if Scala had a non-JVM backend, that would be another language that I'd be spending a lot of quality time with. (I also used to write a lot of Eiffel code.)
23:58:21gokrBtw, Araq, all this 0.2f32 all over in Urhonimo...
23:58:55Araqgokr: I don't think it's necessary
23:58:57flaviuack '(let|var) \w{1,2}\b' | wc -l
23:58:57flaviu1651
23:58:57flaviu:P
23:59:12Jehan_flaviu: :)