00:00:12 | filwit | koz_desktop: did you miss the Nim/Urho3D announcement? here: http://forum.nim-lang.org/t/870 |
00:00:28 | koz_desktop | filwit: I'm kinda new to Nim. |
00:00:35 | koz_desktop | I only discovered it like... two days ago? |
00:00:41 | koz_desktop | And am trying to get my head around its use. |
00:01:12 | filwit | koz_desktop: ah, i see. Welcome to Nim |
00:01:29 | koz_desktop | Thank you - from what I can see, Nim is everythign I've been looking for. |
00:01:35 | koz_desktop | I'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:37 | Araq | hey Jehan_ welcome back :-) |
00:06:01 | Jehan_ | Araq: Hi, just responded to your email. |
00:06:23 | Jehan_ | I'm afraid the flu laid me out pretty good the past few days. |
00:07:43 | * | reem joined #nim |
00:08:38 | Araq | just say "it's ok, it makes sense, polyhedral model." |
00:09:10 | Jehan_ | I'll have to read up on that first myself, I haven't dealt with vectorization stuff in ages. |
00:09:26 | Jehan_ | Ironically, given that my MS thesis was about it. :) |
00:09:37 | gokr | filwit: The emscripten work by Atomic has already been merged and improved in Urho3D itself. |
00:10:33 | gokr | filwit: http://urho3d.prophpbb.com/topic831.html |
00:11:31 | filwit | gokr: well I mostly talking about their editor (it looks like they have JS highlighting/suggest only). |
00:11:31 | Araq | Jehan_: 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:04 | Araq | Jehan_: so if you don't find the time, we'll manage to survive |
00:12:05 | filwit | gokr: last time I tried Nim with emscripten the GC was screwing things up (raytrace benchmark) |
00:12:38 | Jehan_ | 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:17 | filwit | gokr: 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:24 | filwit | gokr: 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:56 | filwit | that 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:59 | flaviu | filwit: http://nim-lang.org/assets/images/bg.jpg is a bit blurry in spots, is that intentional? |
00:18:19 | flaviu | Since it's sharp all over in http://reign-studios.net/philipwitte/nimrod/new-design.png |
00:19:01 | filwit | flaviu: I'm not sure. Let me take a look at the source art. |
00:19:12 | filwit | flaviu: which i still owe you, btw... one sec |
00:19:34 | filwit | flaviu: my guess is that it's just more compressed (noticed one is jpg while the other is png) |
00:20:16 | flaviu | Ok. If so, then we should get it replaced, it's significantly different. |
00:22:08 | filwit | ah 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:44 | filwit | i remember trying the different compression levels and not being able to tell a difference. |
00:22:58 | filwit | but let me give you source art so you can see yourself and let me know if you think it's an issue. |
00:23:24 | fowl | filwit, i get resource errors when trying urhonimos character demo |
00:24:05 | def- | fowl: you have to copy them over from urho3d/Bin/*Data or something |
00:24:39 | filwit | fowl: why is that directed at me? I have yet to try the Urhonimos stuff. |
00:25:12 | fowl | i scrolled up and saw you talking about it |
00:25:15 | fowl | mb |
00:25:50 | fowl | neat, it runs |
00:37:53 | Varriount | onionhammer: We now have nice 'running' bars like package control |
00:38:06 | Araq | Varriount: 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:39 | Varriount | Araq: 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:44 | pipeep | So I'm *really* new to nim (started playing around with it this morning) |
00:43:02 | Araq | Varriount: bottom of this page disagrees with you: https://github.com/Araq/Nim |
00:43:17 | pipeep | And 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:19 | Araq | also C++ bootstrapping should work again |
00:43:26 | pipeep | I think it's because my code expects late-binding. |
00:43:35 | pipeep | Any suggestions? http://pastie.org/private/cdbc9etghd7hqer1ws7ma |
00:44:02 | Varriount | Araq: Uh, the status icons report that the build has failed, which technically it has, b/c c++ bootstrapping didn't work. |
00:44:31 | Araq | Varriount: well the status icons are bad for us then. |
00:44:31 | Varriount | Araq: I'll look into it though. |
00:44:49 | Araq | they should always be "green" |
00:44:53 | Varriount | Araq: And I should probably split C++ bootstrapping into it's own builds. |
00:45:18 | Araq | in fact, I'm not sure they actually need to reflect reality |
00:45:26 | Varriount | :3 |
00:45:36 | Araq | it's just some marketing issue :P |
00:46:25 | Araq | but yeah c++ bootstrapping is just another test for the testsuite |
00:47:02 | Araq | and it should work, but oh well |
00:47:54 | Araq | pipeep: var fib = fib doesn't work. |
00:48:36 | pipeep | Araq, so any suggestions of what to try? How to achieve late binding? |
00:48:38 | Araq | just define 'fib' in the traditional way and then apply memoize |
00:48:54 | pipeep | But then fib won't be called memoizedFib |
00:49:15 | Araq | ah |
00:49:52 | Varriount | Perhaps this is a case for methods? Or possibly procedure references? |
00:50:00 | Araq | just use the Y combinator then |
00:50:29 | Varriount | Huh? Whats a Y combinator? |
00:50:37 | * | Buttons840 quit (Quit: leaving) |
00:51:00 | koz_desktop | Varriount: It's a lambda calculus construct enabling finite recursion. |
00:51:23 | pipeep | Varriount, https://en.wikipedia.org/wiki/Fixed-point_combinator#Y_combinator |
00:51:30 | pipeep | Varriount, *it's complicated* |
00:51:36 | koz_desktop | pipeep: Fucking ninjas.... |
00:51:53 | koz_desktop | It's definitely not a pedestrian topic. |
00:51:56 | Varriount | pipeep: That's all I needed to hear. |
00:52:11 | Varriount | koz_desktop: I don't see any ninjas |
00:52:25 | Jehan_ | pipeep: The easier solution is to separate declaration and initialization of fib. |
00:52:25 | koz_desktop | Varriount: I was about to link that very same thing. |
00:52:54 | koz_desktop | Are let-declared variables transitively immutable? |
00:53:08 | Araq | koz_desktop: no, they are not |
00:53:13 | koz_desktop | Ah, ok. |
00:53:25 | koz_desktop | So it behaves like C++'s const? |
00:53:37 | Araq | yeah |
00:53:43 | koz_desktop | OK, good to know. |
00:53:50 | Araq | but it's not attached to the *type* |
00:54:19 | Araq | Nim often tries to do that to keep type system complexity down. |
00:54:32 | koz_desktop | Fair enough - C++ is hardly a model to emulate IMHO. |
00:54:33 | Varriount | Araq: Ok, this is odd... |
00:54:38 | * | pwernersbach left #nim (#nim) |
00:54:53 | Varriount | '-fpermissive' isn't being passed to gcc in c++ compilation mode. |
00:55:35 | Araq | Varriount: I fixed that, I think? |
00:55:45 | * | kjo left #nim (#nim) |
00:56:12 | koz_desktop | Strings in Nim are both zero-terminated and have a length field. <- this means 'null-terminated' right? |
00:56:20 | flaviu | yep |
00:56:40 | koz_desktop | OK, just making sure - it's an unusual way of wording it. |
00:56:52 | Varriount | Araq: 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:12 | Araq | Varriount: https://github.com/Araq/Nim/issues/1601 |
01:00:27 | Varriount | Araq: That fixes --passc |
01:00:39 | * | smw_ joined #nim |
01:00:46 | Araq | yeah and your stuff fixes -fpermissive :P |
01:00:52 | Varriount | Araq: Yes, if I manually use --passc:"-fpermissive" things work, |
01:01:07 | Varriount | However I shouldn't have to manually pass that argument... hm... |
01:01:32 | fowl | koz_desktop, they end with a 0 value character, not a null-pointer |
01:01:49 | Varriount | Araq: Actually, wait, no it doesn't. |
01:02:11 | koz_desktop | fowl: 'null-terminated' refers to the NUL byte. |
01:02:19 | koz_desktop | At least, that's the way I intended it. |
01:02:24 | * | brson quit (Quit: leaving) |
01:04:01 | Varriount | Araq: Something funky is going on. >_> |
01:07:39 | Varriount | Araq: What is the 'proper' way to bootstrap the compiler using the c++ backend? |
01:09:54 | pipeep | Jehan_, it works! Thanks! http://pastie.org/private/dxqhwzng3dqknuirc5tsw |
01:10:26 | Araq | pipeep: can I add that to the test suite? |
01:10:39 | pipeep | Araq, sure. Take it under whatever license you want. |
01:10:55 | Araq | MIT license so beware, I might base my product on this piece of core technology |
01:11:05 | Araq | thanks! |
01:12:43 | pipeep | Araq, it would be kinda cool to have a memoize type function in the standard library, like python does |
01:13:01 | pipeep | https://docs.python.org/3/library/functools.html#functools.lru_cache |
01:14:14 | Araq | yeah but for Nim it should be a proc transformation macro |
01:14:26 | Araq | proc foo() {.memoize.} = ... |
01:14:59 | pipeep | Araq, I was looking at macros and stuff, but if you did that, where would you put the cache table? |
01:15:13 | pipeep | I did it as a proc because I could just stick it in the closure |
01:16:08 | Araq | good point |
01:16:23 | Araq | I would stick it into a .threadvar, I guess |
01:16:26 | Varriount | Araq: Here's a gist of the output for two cpp commands: https://gist.github.com/Varriount/8feb87b161d899de1473 |
01:16:58 | filwit | flaviu: 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:24 | Araq | Varriount: there is *no* correct way to bootstrap via cpp unless you hack koch to do just that |
01:17:43 | filwit | flaviu: has all the old artwork/html/css/etc for the original site, plus the new one (web & web2 respectively) |
01:17:59 | Araq | and so it's not surprising it doesn't work for you, Varriount |
01:18:23 | filwit | flaviu: make sure you have the latest Inkscape |
01:18:42 | Araq | and the error suggests you use some outdated devel version to compile |
01:21:30 | * | gmpreussner quit (Ping timeout: 244 seconds) |
01:22:13 | Varriount | Araq: Except that I just bootstrapped devel, after pulling from the main repo |
01:27:08 | Araq | pipeep: what is fib(50) ? |
01:27:19 | pipeep | 20365011074 |
01:28:03 | pipeep | http://www.wolframalpha.com/input/?i=51st+fibbonacci+number |
01:28:29 | pipeep | Wolfram alpha calls it the 51st though because they're 1-indexed apparently |
01:29:37 | flaviu | filwit: Thanks! |
01:30:09 | filwit | flaviu: np. make sure Dom gets that too when he wakes up (you'll probably be around before I am) |
01:31:52 | Varriount | Araq: Well, I'll remove C++ bootstrapping from the builders then, and split it off into dedicated builds later. |
01:32:29 | Araq | Varriount: ok, thanks. alternatively you could make it always show the nice green icons. |
01:32:30 | flaviu | filwit: Lots of new stuff in there |
01:32:54 | filwit | flaviu: eh? nothing's new.. just old stuff you're seeing probably |
01:32:58 | Varriount | Araq: Although, I can't even compile strutils.nim using cpp backend. :/ |
01:33:15 | flaviu | I've never seen http://i.imgur.com/F7PJNKt.png before |
01:33:17 | pipeep | The 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:47 | pipeep | But http://nim-lang.org/news.html#Z2014-12-09-new-website-design says "func is a keyword now." |
01:33:50 | filwit | flaviu: ahh, yeah that was an old logo I made that dom didn't like :) |
01:36:22 | filwit | flaviu: 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:41 | filwit | flaviu: hide all the layers in Inkscape I mean |
01:38:38 | filwit | flaviu: 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:09 | flaviu | Yep, got it. How would I edit the background layer? |
01:39:10 | Araq | pipeep: func is a keyword now, but it's not used for anything yet. |
01:39:20 | pipeep | Araq, so it just maps to proc? |
01:39:33 | Araq | no it's just reserved |
01:39:36 | filwit | flaviu: 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:42 | filwit | flaviu: erm... one sec.. |
01:39:48 | Araq | like Java's goto keyword |
01:39:54 | pipeep | That's fair. |
01:40:31 | * | brson joined #nim |
01:41:23 | Varriount | (Will Java *ever* use the 'goto' keyword?) |
01:41:44 | filwit | flaviu: 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:00 | flaviu | filwit: that's probably it, thanks. I'm not familiar with inkscape. |
01:42:23 | flaviu | Varriount: This is the wrong forum for that discussion, a openjdk mailing list would be better. |
01:42:24 | Varriount | Araq: What C/C++ compiler do you use with Nim? |
01:42:59 | Varriount | flaviu: But.. then I would have to get... /involved with Java/ |
01:43:01 | Araq | Varriount: mingw or visual c++ |
01:43:21 | filwit | flaviu: 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:01 | filwit | I 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:19 | filwit | but 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:54 | shevy | lol |
01:55:33 | fowl | sup shevy |
01:55:47 | shevy | hey fowl |
01:55:50 | shevy | I see you are still a nimster |
01:56:49 | fowl | ha i read that as 'spinster' |
01:58:42 | Araq | def-: 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:09 | Sharcho | Is there a way to have a compile hash table, something like: let details = {"key1": "value1", "key2": "value2"}.toTable |
02:04:59 | Sharcho | s/compile/compile-time/ |
02:05:24 | Araq | Sharcho: .compileTime pragma for vars |
02:05:26 | Araq | good night |
02:05:36 | * | rkj-b joined #nim |
02:06:03 | flaviu | can't you do `const foo = ...`? |
02:06:18 | flaviu | It might fail to compile, but IIRC it was fixed |
02:06:53 | Sharcho | flaviu: I'm getting an error with const |
02:09:05 | flaviu | How old is your compiler? If it's recent, I may have remembered incorrectly. |
02:09:29 | Sharcho | 0.10.2 (2014-12-29) |
02:09:48 | flaviu | Try git devel. |
02:12:13 | * | chemist69 joined #nim |
02:14:59 | Sharcho | flaviu: it works with git devel. |
02:15:19 | flaviu | great! |
02:15:25 | * | chemist69_ quit (Ping timeout: 264 seconds) |
02:17:18 | flaviu | filwit: btw, looks like there are artifacts from the downscaling from vector to a smaller size |
02:17:37 | flaviu | jpeg introduces comparatively few artifacts. |
02:18:07 | pipeep | Yay! I made a Nim blog post: http://benjam.info/blog/posts/2015-02-15-nim-euler/ |
02:18:28 | filwit | flaviu: 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:58 | flaviu | filwit: If you look carefully at the background, some dots are bigger than others. |
02:19:14 | filwit | flaviu: yes, that is jpeg at a higher compression level |
02:19:57 | filwit | flaviu: 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:28 | flaviu | feh, but I'm not sure what algorithm it uses. |
02:20:58 | filwit | flaviu: actually i think i just used Gimp's default JPEG compression (~90% i think) and compared to it's default PNG output |
02:21:18 | flaviu | btw, the problem exists in inkscape too: http://i.imgur.com/Lsj0eEN.png |
02:21:29 | flaviu | that's a screencap of inkscape |
02:21:57 | filwit | nah, that's just because the dots aren't pixel-perfect |
02:22:35 | * | Sharcho quit (Ping timeout: 246 seconds) |
02:22:57 | filwit | that 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:44 | filwit | if I had scaled it to and exact size and used pixel-snapping it would be a perfect dot |
02:24:50 | filwit | but 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:03 | filwit | that background is only really seen on the home page |
02:25:35 | filwit | but i compliment your visual acuity :) |
02:25:47 | filwit | I can add it to my list of things to do |
02:26:47 | flaviu | I'll see if I can fix it. |
02:26:55 | flaviu | It irritates me more than it should. |
02:27:05 | filwit | lol, i know that feeling |
02:27:25 | filwit | but since it's so subtle, I almost like the irregularity TBH |
02:29:06 | flaviu | btw, I found out about ctrl-numpad5. Speeds up rendering tremendously. |
02:30:08 | filwit | yes, (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:03 | filwit | falviu: what version of Inkscape are you using, btw? |
02:33:34 | filwit | my system (Manjaro) just updated (today) to 0.91 and it's noticeably faster for me |
02:35:14 | flaviu | Arch Linux, so I'm on the latest too. |
02:35:27 | filwit | great :) |
02:36:04 | filwit | i just switched to Manjaro (from Arch) a week or so ago after hosing my machine trying to switch from Catalyst to Radeon... |
02:36:39 | filwit | it's not bad, but I went with Xfce (cause it was default) and I'm starting to miss KDE in some ways.. |
02:37:42 | flaviu | lets bring the distro chat into #nim-offtopic. These people are here for nim discussion :) |
02:38:19 | filwit | no 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:51 | dtscode | im linking to some c code. what would i return ifthe c codes return value is void*? |
04:12:26 | flaviu | dtscode: In general, you can answer this sort of question by running c2nim on that code. |
04:12:33 | flaviu | But here, it's pointer iirc |
04:12:45 | dtscode | alright. thanks. i forgot about c2nim |
04:16:29 | dtscode | does c2nim not build on the latest compiler? |
04:55:49 | * | bmaxa joined #nim |
05:02:28 | TEttinger | dtscode: I built the compiler yesterday and it seems to work |
05:02:46 | TEttinger | I built the git head of c2nim |
05:03:25 | TEttinger | I'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:26 | TEttinger | #define TERMINAL_CAT(a, b) TERMINAL_PRIMITIVE_CAT(a, b) |
05:03:26 | TEttinger | #define TERMINAL_PRIMITIVE_CAT(a, b) a ## b |
05:05:08 | TEttinger | dtscode: 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:34 | TEttinger | the 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:32 | koz_ | Where can I find all the compiler options for nim? |
05:23:01 | fowl | TEttinger, what type are you using for wchar |
05:26:27 | TEttinger | I have no idea |
05:27:25 | * | fowl quit (Quit: Leaving) |
05:49:19 | * | Demos quit (Read error: Connection reset by peer) |
06:10:22 | dtscode | koz_, on the site |
06:10:50 | dtscode | TEttinger, yeah... i figured it out. its because the current release only builds with 10.3 and i had 10.2 |
06:11:10 | TEttinger | ah cool |
06:11:22 | dtscode | sorry, 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:04 | TEttinger | seems 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:48 | NhanH | Is 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:51 | Varriount | NhanH: Are you still there? |
07:36:01 | NhanH | yes |
07:43:26 | Varriount | NhanH: You might be able to do something with system.unsafeNew or system.create |
07:44:49 | Varriount | NhanH: Even if you cast the memory blocks to an array, I'm not sure how references taken from the array will behave. |
07:45:33 | Varriount | If 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:19 | Varriount | NhanH: What exactly is your usecase? |
07:47:00 | * | gokr joined #nim |
07:47:59 | Varriount | Hi gokr! |
07:49:43 | gokr | Hey :) |
07:50:02 | NhanH | Varriount: I'm reading image files into byte array |
07:51:23 | NhanH | Varriount: what do you mean with "Garbage collected memory is a bit of unknown territory" ? |
07:53:07 | Varriount | NhanH: 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:09 | Varriount | NhanH: Are you interfacing with some C code? |
07:54:19 | NhanH | no, it's all nim code for now |
07:54:45 | * | HakanD__ quit (Quit: Be back later ...) |
07:55:02 | NhanH | the 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:21 | NhanH | Is Seq linked list, or is it sequentially allocated block of memory like array? |
07:55:24 | Varriount | NhanH: Well, taking into account that you're storing bytes, and not references to other objects, the above code should work fine |
07:55:31 | Varriount | NhanH: The latter. |
07:55:45 | Varriount | I believe it's similar to a C++ vector. |
07:56:00 | NhanH | oh, 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:30 | Varriount | NhanH: Yep. And you can use setLen() to resize the sequence to whatever size you want. |
07:56:43 | NhanH | I see, it seems like I can use seq in that case then |
07:57:03 | Varriount | (Dare I ask, is there any programming language out there that uses linked lists as it's main sequence type?) |
07:57:05 | NhanH | thanks |
07:57:09 | NhanH | python |
07:57:38 | NhanH | Python has array, but I believe the majority of code use list as the main seq datatype |
07:57:58 | Varriount | NhanH: Uh, no. |
07:58:00 | Varriount | http://stackoverflow.com/questions/5932328/internals-of-python-list-access-and-resizing-runtimes |
07:58:25 | NhanH | right, I stand corrected |
07:58:28 | NhanH | lisp then ;) |
07:59:09 | Varriount | Ah, well, I can't refute that, as I have only theoretical knowledge of lisp. |
07:59:34 | Varriount | *shrug* |
08:00:07 | Varriount | NhanH: Sorry if I sounded brisk. |
08:00:20 | NhanH | oh no, don't worry about that |
08:01:28 | TEttinger | NhanH, even lisp often uses a different implementation under the hood. |
08:04:07 | TEttinger | clojure 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:08 | NhanH | yeah, that was just tongue-in-cheek on my part |
08:05:29 | NhanH | clojure don't even use cons cell that much |
08:05:59 | Varriount | TEttinger, NhanH: On that topic, note that Nim's strings and sequences are mutable (both are backed by dynamically resized arrays) |
08:07:00 | TEttinger | interesting, 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:28 | Varriount | Sequences and strings are assign-by-copy too, and slice operations copy. |
08:08:48 | Varriount | It'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:59 | TEttinger | can anyone recommend a 2d graphics library in Nim, by the way? |
08:11:07 | TEttinger | binding to SDL2 would work |
08:13:51 | Varriount | TEttinger: We have that, actually |
08:14:03 | Triplefox | yeah, try "sdl2" |
08:14:15 | Varriount | https://github.com/nim-lang/sdl2 |
08:16:49 | gokr | TEttinger: Not sure if it helps, but I wrote some articles and one plays with c2nim: http://goran.krampe.se/category/nim |
08:17:10 | gokr | (the "Nim wrapping C" article) |
08:20:20 | TEttinger | ah thanks gokr |
08:20:29 | TEttinger | also thanks Varriount, Triplefox |
08:21:34 | NhanH | using sequences mean that I lost a lot of compile time check :( |
08:21:57 | NhanH | is 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:01 | NhanH | size not known at runtime |
08:22:06 | NhanH | *not known at compile time |
08:23:01 | Varriount | NhanH: Uh, huh? |
08:24:27 | NhanH | something like proc test(x: array[n, int]): array[n, int] = .... |
08:24:27 | * | brson quit (Quit: leaving) |
08:24:44 | Varriount | NhanH: newSeq[T](len(oldSeq)) |
08:25:32 | Varriount | That creates a new sequence with the same size as the old sequence, is that what you want? |
08:25:40 | fowl | @ is a funtion that turns openarray[t] into seq[t] |
08:26:02 | fowl | @[1,2,3] |
08:26:35 | NhanH | Varriount: no that's not what I wanted |
08:26:39 | NhanH | I mean to have something like |
08:26:42 | NhanH | proc test(x: array[n, int]): array[n, int] |
08:27:01 | NhanH | (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:14 | gokr | First - 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:21 | Varriount | NhanH: 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:37 | Varriount | What kinds of compile-time checks did you lose? |
08:30:39 | NhanH | gokr: I mean size as in length of the array |
08:31:06 | * | dumdum joined #nim |
08:31:14 | NhanH | Varriount: one moment, I definitely thought of something earlier |
08:32:00 | Varriount | NhanH: It might help if you posted some code (via gist or pastebin or similar) |
08:32:33 | gokr | dumdum: You may not be aware that your nick means "stupidstupid" in swedish. ;) |
08:33:11 | Varriount | gokr: Ooo, does my name mean anything in Swedish? |
08:33:40 | gokr | Nah, where does it come from? |
08:33:54 | * | leonlee quit (Quit: Leaving) |
08:34:46 | Varriount | gokr: I made it up when I was 12. I think I got the idea from the word 'variable' |
08:35:04 | gokr | NhanH: Were you fishing for compile time checks for calling with literal arrays of the wrong sizes? |
08:35:17 | NhanH | gokr: yes! |
08:35:19 | gokr | But what is an "ount"? :) |
08:35:30 | NhanH | but the array size is not known during compile time |
08:35:45 | gokr | For literals they are. |
08:35:58 | gokr | Or const or whatever |
08:36:14 | NhanH | I 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:26 | Varriount | Hm, tricky. |
08:36:53 | Varriount | We have 'static' types, but their entire values have to be known at compile time. |
08:36:58 | gokr | And note that when you say "array" (and not seq or openarray) it has a known compile time len. |
08:37:32 | NhanH | I know, that's why I was using *seq* earlier |
08:37:40 | gokr | But how to express it, I am a damn Smalltalker - I have no idea. ;) |
08:38:03 | fowl | proc foo [r] (a,b: array[r, int]): array[r,int] |
08:38:29 | fowl | r is a range |
08:38:31 | gokr | NhanH: 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:43 | gokr | Ah, generics. Duh. |
08:39:03 | Varriount | That only works for arrays though, it won't work with sequences. |
08:39:09 | NhanH | ah generics, that's cool! Thanks |
08:39:21 | gokr | NhanH: Also, if you are indeed implementing matrix stuff or something, then I presume there is lots of library code to find. |
08:39:44 | Varriount | NhanH: We don't have variadic generics yet, fyi |
08:40:26 | NhanH | there definitely is C stuff that do matrix stuffs - I just wanted to implement as a mean to learn the language |
08:40:39 | NhanH | thank everyone for the help :-) |
08:40:46 | gokr | No, I mean matrix code in Nim. |
08:41:08 | gokr | fowl here has surely hacked that already, right fowl? |
08:41:59 | dumdum | gokr: Well its loosely related to English: dummy: A stupid person who has no common sense and no brain at all |
08:42:21 | gokr | yep |
08:43:43 | gokr | dumdum: So you use Nim for anything fun? |
08:45:42 | gokr | NhanH: Here is some similar stuff: https://github.com/fowlmouth/nimlibs/blob/master/fowltek/vector_math.nim |
08:46:45 | * | BlaXpirit joined #nim |
08:50:04 | dumdum | gokr: Parsers for some ugly languages/file formats at work |
08:50:56 | Varriount | Sigh. 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:22 | dumdum | I write them for myself, I use the tools I write |
08:51:38 | dumdum | Anyway my work langauge is java :( |
08:53:09 | gokr | Java... yeah. sigh. |
08:53:38 | dumdum | Nim's fun part for me is, writing english like phrases by using appropriate method names, nims prefix, postfix calling syntax and procs |
08:53:43 | gokr | dumdum: I started porting over PetitParser to Nim, got sidetracked. It's a beautiful library to compose parsers. |
08:54:02 | gokr | Yeah, DSL style. PetitParser is exactly that. |
08:54:05 | dumdum | procs = Operators i meant |
08:55:47 | Varriount | dumdum: I feel for you. My comp sci classes are all java |
08:55:55 | gokr | In 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:19 | Varriount | Well, except for my assembly class, which is a breath of fresh air |
08:58:58 | dumdum | I do not consider Java as a bad language. It is just not fun :) |
08:59:16 | gokr | dumdum: If interested, here is the original slides: http://www.slideshare.net/renggli/mastering-grammars-with-petitparser |
08:59:29 | gokr | Examples in Smalltalk, so of course a bit foreign if you don't know it. |
09:00:02 | dumdum | gokr: Thank you!, I dont know Smalltalk but enough about it to respect |
09:00:22 | gokr | dumdum: There is a Java port of it. |
09:00:29 | gokr | And Dart too. |
09:00:43 | gokr | This is the original blog article: http://www.lukas-renggli.ch/blog/petitparser-1 |
09:00:50 | fowl | i have a parsing combinator(? is that what you call it?) |
09:01:14 | dumdum | Assembly I found tedious, then you start using the assemblers macro system , then you realise you might as well use C or similar |
09:01:34 | gokr | dumdum: That last link is actually best to get a grip. |
09:01:56 | * | wb quit (Ping timeout: 246 seconds) |
09:02:22 | gokr | dumdum: And if you are forced to use Java, check it out: https://github.com/petitparser/java-petitparser |
09:02:59 | qwr | dumdum: java is mediocre, but java coding culture is just terrible (to give one blatant example: writing useless one-line accessor methods) |
09:03:07 | Varriount | dumdum: You underestimate how much I dislike java |
09:03:46 | dumdum | gokr: links bookmarked, thanks! |
09:05:14 | * | kuzy000_ joined #nim |
09:05:22 | dumdum | I guess Java gives creative people who have not experienced other languages, a high by constructing complexes in Java |
09:05:36 | gokr | First 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:08 | Varriount | gokr: 'more and more [inflexible] mechanisms into the language' |
09:06:23 | gokr | As a Smalltalker - one can only cry. |
09:06:54 | NhanH | it'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:56 | TEttinger | the 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:40 | gokr | NhanH: You mean Sun I guess. |
09:08:49 | gokr | Oracle didn't buy Sun until... quite late in the game. |
09:08:53 | TEttinger | https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition |
09:08:59 | dumdum | Rust 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:38 | Varriount | I've been spoiled by Python too much. :/ |
09:10:24 | TEttinger | all 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:24 | NhanH | gokr: I think it was Oracle somehow ... but yeah Sun would have made more sense |
09:10:44 | NhanH | Rust's complexity might be justified though, memory safety without GC is a hard task |
09:10:52 | gokr | NhanH: I was around :) |
09:10:55 | dumdum | TEttinger: That link is exactly what I have to go through each day :( |
09:11:06 | TEttinger | dumdum, I'm sorry. |
09:12:08 | dumdum | For 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:09 | def- | 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:54 | gokr | I 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:23 | gokr | ...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:27 | dumdum | I thought it was created as a small language for embedded use |
09:13:38 | gokr | So now I simply attribute it to malice instead of ignorance. Pure evil :) |
09:13:52 | gokr | Yes it was, it was intended for electronics. |
09:14:06 | * | HakanD__ joined #nim |
09:14:21 | Araq | Gosling simply designed the language for the mediocre programmer. |
09:14:25 | gokr | It was funny, they evidently made a prototype of a remote control - with a little youch display that adapted its "buttons". |
09:14:26 | dumdum | So he might have left out features to keep the jvm small |
09:14:32 | gokr | touch. |
09:14:46 | NhanH | JVM isn't the issue |
09:14:51 | gokr | Then they showed it to some executives from Japan, think like "Sony" etc |
09:14:53 | NhanH | it's actually a pretty amazing piece of tech |
09:15:18 | gokr | And they went... what? Nooo, customers don't want simple remotes. They want BUTTONS! As many as possible. |
09:15:26 | gokr | Hehe |
09:15:47 | gokr | JVM isn't amazing IMHO. Its just TONS of man hours. |
09:16:01 | dumdum | gokr: yep |
09:16:23 | gokr | The cool stuff, Hotspot, was bought from the outside. |
09:16:31 | gokr | And came from the Self project originally. |
09:16:56 | NhanH | btw gokr, which Smalltalk are you using professionally right now? |
09:17:08 | NhanH | Squeak, Pharo or one of the commercial one? |
09:17:13 | gokr | Gosling could have made a small Smalltalk-ish language instead - and it would have been smaller and more powerful at the same time. |
09:17:32 | gokr | Our system is based on Squeak 4.1. We also use Pharo for some peripheral stuff. |
09:17:42 | NhanH | java was trying to replace C++, isn't it? |
09:17:48 | NhanH | so smalltalk wasn't in the picture at all |
09:17:51 | gokr | I haven't used commercial Smalltalks in a long time. But I do love GemStone. |
09:17:53 | TEttinger | gokr: 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:59 | dumdum | highly expressive languages do not make sense for the corporate though |
09:18:41 | gokr | NhanH: 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:07 | gokr | And 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:08 | qwr | gokr: it reminds that, one guy once made small lispish language with C syntax... ;) |
09:19:15 | gokr | At the time IDEs were not free. |
09:20:03 | gokr | Many 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:12 | TEttinger | qwr: you mean JScript? |
09:20:17 | qwr | TEttinger: yes |
09:20:23 | gokr | I 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:11 | TEttinger | gokr: I have seen ads for lots of enterprise hardware and software at LA International airport |
09:21:29 | gokr | dumdum: You are wrong on the "highly expressive" part. Smalltalk was quite big back then, and its as expressive as it gets. |
09:21:48 | gokr | TEttinger: Ok, perhaps I simply don't visit the right airports ;) |
09:22:20 | TEttinger | it's totally weird though, you're right |
09:22:25 | gokr | But 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:34 | gokr | Smalltalk was very expensive at the time. |
09:22:44 | dumdum | gokr: I meant, expressive languages, need expressive people who in turn are rare, so are more risky and costly for the corp |
09:22:51 | keyle | nim off topic :) |
09:22:51 | TEttinger | they certainly have the enterprise ads next to the strip club immediately next to airport parking in LA :) |
09:22:59 | gokr | keyle: Yeah, sorry. |
09:23:00 | TEttinger | *certainly don't |
09:23:15 | dumdum | Java programmers like me are dime a dozen |
09:23:34 | keyle | don't get me wrong, I love Sun/java/smalltalk talks |
09:23:45 | TEttinger | is there a good starting point book or site for learning Nim? |
09:24:08 | dumdum | TEttinger: http://howistart.org/posts/nim/1 |
09:24:14 | gokr | keyle: But you are right :) |
09:24:16 | TEttinger | thanks |
09:24:28 | gokr | I just get carried away, I am too old. |
09:25:40 | gokr | TEttinger: 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:50 | dumdum | gokr: wasnt there drilling going on around your house? I wondered what for :) |
09:26:16 | gokr | dumdum: Join #nim-offtopic :) |
09:26:42 | gokr | But yeah, they drilled a 240m hole. |
09:27:14 | gokr | We are installing geo thermal heating. |
09:28:03 | dumdum | nice :) |
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:59 | NhanH | is it possible to do generics with ... 2 type parameters? |
09:59:36 | BlaXpirit | sure |
10:00:59 | NhanH | so just proc foo[x,y,z] () ... ? |
10:01:42 | def- | NhanH: exactly, see for example tables: http://nim-lang.org/tables.html#len,Table%5BA,B%5D |
10:03:28 | NhanH | oh I didn't know that page, thanks |
10:03:51 | * | fowl joined #nim |
10:04:59 | gokr | NhanH: Explore the documentation page. |
10:21:54 | * | bmaxa quit (Quit: Leaving) |
10:22:05 | * | sillesta joined #nim |
10:26:00 | gokr | new Urhonimo demo coming soon, just need to clean it |
10:26:17 | gokr | Nothing 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:26 | gokr | There: particle.nim demo added to Urhonimo |
10:52:22 | * | HakanD__ quit (Ping timeout: 240 seconds) |
10:52:26 | def- | gokr: nice |
10:52:49 | gokr | Works? |
10:53:11 | def- | Yes, perfectly |
10:54:06 | gokr | I wrote the port - then Araq fixed some issues in the wrapper (the 2D parts he hadn't used yet). :) |
10:54:57 | gokr | So... 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:30 | gokr | Time 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:46 | flaviu | koz_desktop: http://nim-lang.org/nimc.html |
12:04:35 | * | pafmaf quit (Quit: This computer has gone to sleep) |
12:05:36 | gokr | Damn, 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:57 | def- | gokr: yeah, looks like quite a different community than HN and r/programming |
12:06:02 | gokr | Ok, C++ fans can be quite fine people too, but... |
12:06:40 | gokr | ...skimming that Nim thread on Slashdot revealed almost NOTHING of insight or value. |
12:07:35 | gokr | Just blabla indenting, blabla, Python blabla. |
12:08:53 | gokr | Btw, 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:55 | gokr | This was interesting: https://botbot.me/mozilla/rust/search/?q=Nim |
12:18:00 | gokr | :) |
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:36 | rapstar | morning |
12:20:42 | jferg2010 | So 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:03 | rapstar | Nim 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:34 | def- | jferg2010: that looks interesting, needs to work with other browser sizes still |
12:24:52 | * | reem quit (Ping timeout: 245 seconds) |
12:25:12 | def- | rapstar: what's the problem with that? |
12:25:41 | def- | minor notes: you can write "echo(i)" or even "echo i" |
12:25:43 | rapstar | it doesn't chunk out, it waits until the loop is complete then sends it all |
12:25:58 | rapstar | yes nice, i'll lose the parans |
12:26:01 | jferg2010 | Def-: Lots to do to make it real, but wanted to get some early feedback to see if it was worth pursuing. |
12:26:04 | def- | rapstar: something is buffering then, need to flush |
12:26:23 | def- | flushFile stdout |
12:26:43 | rapstar | sec trying it |
12:27:22 | def- | jferg2010: I'm a bit conflicted whether it's better to have the page in the center or aligned left |
12:27:50 | def- | jferg2010: but i definitely love that the ToC on the left stays fixed |
12:28:05 | rapstar | wewt thanks! |
12:28:25 | rapstar | that did the trick. thanks def- |
12:28:55 | def- | 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:59 | def- | rapstar: you're welcome |
12:29:18 | jferg2010 | def-: 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:48 | rapstar | If 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:14 | rapstar | Only been playing with Nim now for a few hours, so feel free to critique |
12:31:36 | def- | 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:23 | def- | rapstar: echo "Hello", line, "!" |
12:33:37 | rapstar | on it |
12:35:03 | jferg2010 | def-: 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:02 | def- | jferg2010: either that, or add the proc signature to the TOC |
12:36:31 | def- | or combine both, collapse it, and show all signatures below? |
12:38:34 | jferg2010 | def-: Probably best to try and see what works/looks best. Besides search, responsiveness and continued UI tweaks, any other priorities? |
12:39:37 | jferg2010 | I see in the todo.txt a desire to decouple docgen from the compiler. Is there a desired set of requirements for that? |
12:39:52 | def- | I don't know, you'll have to ask Araq |
12:40:24 | def- | 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:27 | def- | jferg2010: And more examples, maybe even so you can run the examples in the browser (ekarlso was working on a nim-playpen) |
12:41:32 | Trixar_za | Nim is going to have a GSoC? |
12:41:41 | def- | Trixar_za: we'll try |
12:42:56 | * | rapind joined #nim |
12:44:17 | * | gokr quit (Quit: Leaving.) |
12:46:14 | jferg2010 | def-: 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:08 | def- | jferg2010: exactly |
13:09:31 | jferg2010 | def-: 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:33 | qwr | rapind: 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:45 | qwr | (ahok, sry, damn irssi scroll buffer was left) |
14:23:26 | Araq | hi qwr. thank you for helping rapind |
14:25:25 | qwr | hi, tried to help, but it was already solved :) |
14:27:49 | whitenoise | i was researching how to enhance the javascript backend last night |
14:27:55 | * | HakanD___ joined #nim |
14:28:03 | whitenoise | kind of just browsing last couple days |
14:28:40 | Araq | whitenoise: read our gsoc entry about it? |
14:29:47 | whitenoise | i'm not sure i'm qualified for any such endeavor :) |
14:30:06 | whitenoise | i have never written a compiler, and i don't know how code generation works |
14:32:19 | rapind | Araq: 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:55 | rapind | ahh, 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:21 | whitenoise | you can do pubsub with channels and queues within Nim without using Redis. |
14:58:16 | whitenoise | in my opinion, there is no point in it being a websocket chat if you're polling |
15:01:24 | whitenoise | Araq: where might one begin looking at the "javascript backend" |
15:01:45 | def- | whitenoise: compiler/jsgen.nim |
15:02:03 | whitenoise | lets see if i can learn how code generation works :P |
15:06:46 | rapind | whitenoise: 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:25 | rapind | Added 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:57 | dom96 | rapind: awesome! |
16:02:38 | def- | whitenoise: If you want to find bugs in JS, compiling these for JS should deliver some: https://github.com/def-/nim-unsorted |
16:07:17 | rapind | thanks dom96, i'm starting on a more feature rich poll / voting app using reactjs + websocketd + nim now :) hooked |
16:09:36 | def- | websocketd looks cool, but in the long run it would be nice to have a Nim websockets library I guess |
16:10:51 | whitenoise | def-: 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:55 | Araq | don't we have that in Nimble already? |
16:11:28 | Araq | I told you guys to implement websockets *years* ago |
16:11:34 | whitenoise | def-: 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:44 | Araq | nobody listens to me ... |
16:11:51 | def- | Araq: I know, I read the irc logs, but didn't find any finished implementations. someone started one somewhere iirc |
16:12:31 | def- | whitenoise: examples for what exactly? |
16:12:41 | whitenoise | def-: JS compiles failing, the link you gave me. |
16:13:06 | def- | 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:21 | def- | 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:47 | def- | Here's the started websockets library: https://github.com/onionhammer/onion-nimrod/tree/master/websockets |
16:14:25 | rapind | def-: 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:15 | rapind | but 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:33 | rapind | websockets 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:17 | whitenoise | apparently c2nim can't handle declarations like this: |
16:21:23 | whitenoise | unsigned char reserved:4; // 4-bits from the 6-bits of reserved space |
16:21:23 | whitenoise | unsigned char tcp_offset:4; // TCP data offset for little endian host |
16:22:05 | Araq | whitenoise: well c2nim in general knows what Nim's FFI supports |
16:22:37 | whitenoise | so that's not necessarily a bug, just an "unsupported" C syntax? |
16:23:06 | * | dyu quit (Quit: Leaving) |
16:26:43 | def- | https://pay.reddit.com/r/nim/comments/2w2e9y/higherkinded_type_in_nim/ |
16:32:10 | UberLambda | yay, HKT |
16:33:06 | infinity0 | covariant/contravarient generic types should probably come before that. or does nim already have them? |
16:33:31 | infinity0 | as 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:39 | Jehan_ | 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:00 | itsmeront | lusers |
17:15:31 | gokr | itsmeront: Hehe, that looked almost like an insult - but I guess some IRC cmd? :) |
17:15:46 | itsmeront | yeah was trying to get user count |
17:15:55 | gokr | 118 |
17:16:08 | def- | It's /names for me |
17:16:11 | gokr | Not a record, its evidently 120 :) |
17:16:39 | itsmeront | hmmm /lusers and /names doesn't work for me |
17:17:03 | gokr | rapind: Check my forking socket server article |
17:17:29 | gokr | rapind: http://goran.krampe.se/2014/10/25/nim-socketserver/ |
17:17:56 | gokr | The 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:24 | rapind | gokr: 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:22 | gokr | rapind: The threadpool in Nim is quite smart - it adapts to number of avialable cores etc |
17:32:51 | gokr | And since its a pool - you aren't paying for starting/stopping threads. |
17:33:23 | rapind | gokr: nice, that looks pretty performant |
17:34:12 | gokr | Yeah, 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:25 | infinity0 | Jehan_: it's "tied to" by the fact that the language supports both |
17:34:37 | infinity0 | so not having co/contravariance will lead to annoyances |
17:34:39 | gokr | Personally I like forking servers - otherwise you need to make everything asynch. |
17:35:10 | infinity0 | like the fact you would be able to cast List[int] to List[object] without a covariant definition of List[T] |
17:35:16 | infinity0 | you wouldn't be able to* |
17:35:33 | Jehan_ | infinity0: Yes, but is there a need to? |
17:35:55 | infinity0 | is there a need for anything? what would you accept as a valid supportive argument? |
17:36:00 | Jehan_ | 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:31 | infinity0 | and what does this have to do with "nim doesn't need covariant generics" |
17:37:34 | rapind | gokr: 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:42 | Jehan_ | infinity0: I didn't say that. |
17:37:49 | Jehan_ | I said it's less of a concern. |
17:38:16 | infinity0 | that's a very vague statement, i don't understand what it means concretely |
17:39:25 | rapind | s/cheap/cheap server |
17:39:38 | Jehan_ | It means that the fact that constraints on Nim's type parameters are not restricted to subtyping eliminates a class of problems. |
17:39:50 | gokr | rapind: 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:32 | rapind | gokr: i head ya |
17:40:37 | rapind | s/head/hear |
17:41:15 | gokr | Also, 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:18 | infinity0 | Jehan_: what class of problems, and what do you mean "constraints"? not supporting co/contravariant parametric types is the more restrictive scenario |
17:41:29 | rapind | gokr: I think we may be at the point where for many use cases you don't need anync or threaded. |
17:41:55 | Jehan_ | 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:27 | gokr | Jehan_: Yeah, sure, but... I have mostly seen the "networking servers" use case. |
17:42:31 | rapind | i'm trying to imagine htop w/ 10k ws processes. |
17:42:33 | gokr | You know, nodejs stuff. |
17:42:42 | Jehan_ | infinity0: constraint = the condition a type parameter has to satisfy. |
17:42:57 | gokr | rapind: Why 10k threads? |
17:42:58 | infinity0 | yes, and without co/contravariant definitions they have to match exactly |
17:43:09 | Jehan_ | In Nim, or ML, that constraint is expressed through type signatures. |
17:43:22 | Jehan_ | In Scala/Java, through subtyping. |
17:43:25 | infinity0 | ML doesn't have subtypes, co/contravariance doesn't apply |
17:43:26 | gokr | rapind: With a pool you only need as many threads as you are concurrently serving. |
17:43:41 | infinity0 | what do you mean by "type signatures"? |
17:43:57 | rapind | gokr: not threads, processes. take a look at http://websocketd.com/ |
17:44:14 | rapind | gokr: just something I was toying with |
17:44:27 | Jehan_ | infinity0: The signature of the type. |
17:44:35 | infinity0 | how is that different in scala/java? |
17:44:56 | gokr | rapind: Nice website ;) |
17:44:56 | infinity0 | also, java doesn't have real co/contravariance, you shouldn't put that together with scala during this discussion |
17:44:58 | rapind | gokr: obviously terribly inneficient compared to forking, but the idea is interesting |
17:44:58 | Jehan_ | It means that in Scala/Java you have to inherit from a specific type for it to fit the correct constraint. |
17:45:19 | Jehan_ | In Nim/ML, the type only has to support the functions without any need for inheritance. |
17:45:33 | rapind | gokr: 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:51 | gokr | rapind: I know. I was just joking a bit, I do like the website. |
17:45:58 | Jehan_ | gokr: We're using them in computer algebra, too, where they are very convenient. |
17:46:00 | infinity0 | that'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:20 | Jehan_ | infinity0: I know exactly what co-/contravariance is, thank you. |
17:46:21 | rapind | gokr: yeah perty :) i just like the concept and how trivial it is to throw up a WS |
17:46:32 | Jehan_ | And it's not the same in Scala/Java, sorry. |
17:46:42 | gokr | Jehan_: 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:55 | infinity0 | Jehan_: 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:03 | rapind | gokr: any idea what the memory footprint was on your websocket forks? |
17:49:22 | gokr | If its not in the article, I don't recall. |
17:49:32 | * | superfunc|lab quit (Quit: leaving) |
17:49:39 | Araq | infinity0: that's not a sound typing relation by any means. |
17:49:56 | infinity0 | it depends on your class definition, and it can be sound |
17:50:07 | infinity0 | in the specific cases where it's sound, the programmer would like to express this to the compiler |
17:50:27 | Araq | it only happens to work when your subtype relation happens to imply "pointers under the hood" |
17:50:53 | Araq | and even then you have to care about mutability etc |
17:51:03 | infinity0 | it'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:08 | Araq | it's not a coincidence it took version 4 of C# to suppor that |
17:51:08 | Jehan_ | infinity0: The issue here is that Java and Scala overuse subtype polymorphism where parametric polymorphism would be superior. |
17:51:10 | infinity0 | i forget the exact algorithm |
17:51:20 | * | reem quit (Ping timeout: 264 seconds) |
17:51:25 | Jehan_ | Subtype polymorphism is really only necessary where you require dynamic dispatch. |
17:51:28 | infinity0 | no, parametric and subtyping are two different things. i'm talking about if your language wants to support both |
17:51:46 | infinity0 | perhaps, when you write a specific library, maybe it's incorrect to use subtyping when it's better to use parametric |
17:51:54 | infinity0 | but that's not what i'm talking about |
17:52:02 | infinity0 | there are valid cases where you could use both at the same time |
17:52:10 | Jehan_ | 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:12 | infinity0 | and in that case, co/contravariance helps your code be *less* restrictive |
17:52:48 | Araq | infinity0: well this discussion is futile. we know what co/contravariance is. we disagree about how often it is useful/required. |
17:53:19 | infinity0 | so then, i won't have a way to cast immutableList[int] to immutableList[object] ? |
17:53:31 | Araq | int is not a subtype of object anyway |
17:53:31 | infinity0 | or to cast function[int,object] to function[object,int]? |
17:53:42 | infinity0 | ok, well number or whatever it is |
17:54:07 | Araq | well 'cast' is nearly always possible since it's unsafe to begin with |
17:55:14 | Jehan_ | infinity0: I think an actual application would be needed to support the claim that it's necessary or beneficial. |
17:56:05 | Jehan_ | And given that ML (including OCaml) and Haskell seem to do fine without, that seems difficult. |
17:56:33 | infinity0 | ML and Haskell don't support subtypes, is why |
17:56:51 | infinity0 | the point is when you want to have both subtypes and generics in the same language, it's best to have co/contravariance |
17:56:58 | infinity0 | take for example Function[-T, +R] |
17:57:03 | Jehan_ | OCaml has subtypes. |
17:57:51 | * | filwit joined #nim |
17:57:53 | infinity0 | that 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:02 | Jehan_ | Plus, algebraic datatypes are essentially a restricted form of subtyping. |
17:58:07 | filwit | 118 eh? |
17:58:09 | infinity0 | ok, i will look into ocaml |
17:58:12 | Araq | do not lecture me. |
17:58:29 | Jehan_ | 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:19 | infinity0 | so what sort of arguments do you consider valid, when talking about "beneficial"? |
17:59:32 | Jehan_ | 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:53 | Araq | infinity0: by your logic C# before version 4.0 was unusable for software development. I disgree. |
18:01:19 | infinity0 | what? no i'm saying C# and Scala are better than they would be if they didn't have co/contravariance |
18:01:31 | infinity0 | if i think nim is "unusable" i wouldn't be packaging it for debian |
18:01:35 | infinity0 | stop getting defensive |
18:02:01 | Jehan_ | 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:18 | Jehan_ | If you disagree, that's okay, too. |
18:02:37 | Araq | well even if it's beneficial "objectively", we have 400 bugs open and want to release version 1.0 in the near future. |
18:02:53 | Araq | so it's a totally futile discussion |
18:03:00 | infinity0 | apparently OCaml has co/contravariance https://blogs.janestreet.com/a-and-a/ |
18:03:18 | infinity0 | well, fine |
18:03:51 | infinity0 | but i was just defending the point that, disconsidering cost of implementation, that it's objectively not useful |
18:04:10 | Jehan_ | 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:23 | Araq | no, it's objectively a poor complexity vs expressitivity tradeoff |
18:04:37 | Araq | well not "objectively" |
18:04:39 | Araq | but IMO |
18:09:29 | * | springbok joined #nim |
18:10:49 | Jehan_ | 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:45 | Araq | Jehan_: well the idea is to use that model for semantic checking of the 'parallel' statement, not for optimization |
19:05:19 | Araq | so the idea is to apply it in a different but related context |
19:05:28 | Jehan_ | Araq: That's understood, but that checking would be subject to the same assumptions. |
19:06:22 | Araq | I dunno if it makes for a nice GSOC project or rather a PHD thesis |
19:06:37 | Jehan_ | 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:21 | Araq | well 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:29 | Jehan_ | Araq: *nod* It's a pretty difficult problem in the general case (that, incidentally, would be a Ph.D. thesis). |
19:11:15 | Araq | oh 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:17 | Araq | def-: can you make https://github.com/Araq/Nim/pull/1840 mergable again please |
19:31:26 | def- | Araq: sure |
19:32:52 | * | davidhq quit (Max SendQ exceeded) |
19:33:20 | * | davidhq joined #nim |
19:33:37 | * | Lady joined #nim |
19:34:17 | Araq | def-: https://github.com/Araq/Nim/pull/2137 close or apply? |
19:35:02 | def- | Araq: that really looks wrong to me, but someone with Windows should check |
19:35:31 | def- | Nim in wine didn't work for me |
19:36:00 | Araq | why not? that's awful |
19:36:28 | def- | Error: unhandled exception: File not found. |
19:36:45 | def- | That's all I get, I guess it can't find mingw even though I selected to install it |
19:37:18 | Araq | does installation work? |
19:37:21 | def- | yes |
19:38:01 | Araq | added it to your PATH via the installer? |
19:38:24 | def- | yes |
19:38:44 | Araq | hrm ok, will look into it. eventually. |
19:39:04 | dom96 | gokr: How does your spawn server compare to asynchttpserver? |
19:39:26 | gokr | dom96: Not sure. |
19:39:51 | gokr | Feel free to test ;). Do note though that my code there didn't actually *do* much at all. |
19:40:05 | gokr | I mean, as in parse and respond. |
19:40:25 | gokr | dom96: The code in the article is quite trivial. |
19:40:28 | dom96 | gokr: Yeah. I did test, but I found http benchmarks results odd on my laptop at least. |
19:40:54 | gokr | I 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:10 | gokr | And kudos to you and Andreas, it was quite easy. |
19:42:13 | dom96 | gokr: 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:29 | dom96 | At some point you will run out of threads. |
19:43:25 | * | Lady quit (Quit: Page closed) |
19:43:58 | dom96 | New user record btw: 124! |
19:45:09 | def- | Araq: rebased, should be mergable |
19:45:46 | BlaXpirit_ | def-, umm |
19:45:46 | * | rapind quit (Ping timeout: 252 seconds) |
19:45:55 | BlaXpirit_ | I don't see any files written by installer in Wine |
19:46:23 | def- | BlaXpirit_: i get a fine installation and all seems to work except calling gcc in the end |
19:46:57 | BlaXpirit_ | oh lol, I just tried to install it to my root drive |
19:47:04 | BlaXpirit_ | and it didn't say any error |
19:47:29 | def- | Oh right, it tried to do that by default, don't know why |
19:47:34 | * | rapind joined #nim |
19:50:19 | BlaXpirit_ | Error: unhandled exception: ╨д╨░╨╣╨╗ ╨╜╨╡ ╨╖╨╜╨░╨╣╨┤╨╡╨╜╨╛. |
19:50:21 | BlaXpirit_ | righto |
19:52:19 | * | rapind quit (Ping timeout: 265 seconds) |
19:55:03 | BlaXpirit_ | 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:33 | BlaXpirit_ | def-, Araq, i got it to work on Wine! |
20:05:44 | BlaXpirit_ | the problem was just PATH |
20:06:00 | def- | BlaXpirit_: ok, what to do? |
20:06:44 | BlaXpirit_ | 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:21 | BlaXpirit_ | replace "; " with an "Enter" keypress :p |
20:08:57 | def- | 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:21 | BlaXpirit_ | def-, all I can guess is PATH is not set automatically? maybe you just did something wrong |
20:09:50 | BlaXpirit_ | one can easily modify PATH permanently in Wine, I just didn't look for that specifically |
20:10:07 | def- | no, i mean how can the installer fix that |
20:10:18 | def- | i just ran the installer, don't think that's wrong |
20:10:24 | BlaXpirit_ | def-, have you tried Nim on Windows at all? |
20:10:43 | BlaXpirit_ | because I'm pretty sure I had problems with PATH on normal Windows too |
20:11:52 | * | BlaXpirit joined #nim |
20:12:27 | def- | BlaXpirit_: nope, i don't have windows |
20:13:20 | BlaXpirit | so maybe there aren't any additional problems with Wine |
20:14:04 | * | dashed quit (Quit: Connection closed for inactivity) |
20:14:15 | def- | I assume it just works on Windows without manually setting paths, especially because the installaer has the option to set paths |
20:14:42 | BlaXpirit | there 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:04 | filwit | Araq: 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:28 | filwit | that said, I built fine with the build_generic.sh |
20:43:10 | filwit | but i'm still getting link errors trying to build character.nim: character.cpp:(.text+0x1279): undefined reference to `Urho3D::CollisionShape::SetTerrain()' |
20:43:40 | filwit | has anyone gone through these steps already and know to to fix it (I'm on Linux) |
20:44:25 | def- | filwit: yes, it doesn't work with Urho3D |
20:44:28 | def- | head* |
20:44:34 | def- | you need the latest release version |
20:44:41 | filwit | ah, 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:29 | Mat4 | hi all |
20:48:34 | * | vendethiel quit (Ping timeout: 250 seconds) |
21:01:52 | Varriount | Meep |
21:02:38 | * | perturbation joined #nim |
21:04:40 | * | brson joined #nim |
21:05:12 | gokr | filwit: I think it was called cmake_gcc.sh in *1.32* :) |
21:05:37 | gokr | Ah, right, sorry, didn't read all. |
21:05:45 | filwit | gokr: yeah i'm building it now |
21:05:54 | gokr | I just added instruction text to the particle demo ;) |
21:06:22 | gokr | I am on Linux too. |
21:06:35 | filwit | nice. the instructions are pretty clear, I just missed the part about needing 1.32 not head |
21:07:01 | gokr | You mean you missed "Urho3D version 1.32 (exactly)" ;) |
21:07:22 | filwit | yeah, i was being lazy :) |
21:07:28 | gokr | Hehe |
21:08:15 | gokr | There are some small "gotchas" porting samples from C++ - but not many. |
21:08:28 | gokr | I 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:58 | Mat4 | exist there a rule for advertisings (in the forum ore here) ? |
21:13:26 | filwit | hmm... 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:26 | filwit | ../Urho3D-1.32/Source/Engine/Container/RefCounted.h: In copy constructor ‘Urho3D::Object::Object(const Urho3D::Object&)’: |
21:13:26 | filwit | ../Urho3D-1.32/Source/Engine/Container/RefCounted.h:76:5: error: ‘Urho3D::RefCounted::RefCounted(const Urho3D::RefCounted&)’ is private |
21:13:26 | filwit | 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:35 | filwit | def-, 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:10 | gokr | The CoreData and Data is just for running. |
21:16:24 | gokr | libUrho3D.a with lower case l, right? |
21:16:40 | filwit | gokr: right |
21:17:04 | gokr | hmmm |
21:17:13 | filwit | in the 'lib' folder (with a lower case) but that's not in the examples directory |
21:17:27 | filwit | should it be? let me try |
21:17:33 | gokr | No, no, its correct |
21:17:36 | def- | filwit: if you first built Urho3D from #head then there are 2 lib directories |
21:17:39 | gokr | Its directly in Urhonimo |
21:17:56 | gokr | Did you do "make install" at any time? |
21:18:05 | filwit | no |
21:18:12 | gokr | Good :) |
21:18:22 | gokr | 2 lib directories? |
21:18:23 | filwit | never ran make install, I never trust that |
21:18:37 | filwit | gokr: no.. but i'm not sure what you're asking? |
21:18:46 | gokr | def- said it |
21:18:52 | filwit | there's only one lib dir (in the Urhonimos dir) |
21:18:55 | * | yibter quit (Remote host closed the connection) |
21:19:25 | filwit | i first built Urho3D head with build_generic.sh, then make |
21:19:39 | filwit | that built (outside of the Urhonimos dir) just fine |
21:19:44 | gokr | Sure. |
21:19:52 | filwit | wait... i think i messed up, thinking back |
21:20:28 | gokr | Then you got 1.32 source ball? |
21:20:42 | filwit | i 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:45 | filwit | that's probably it |
21:20:49 | gokr | Ouch. |
21:20:51 | filwit | crap |
21:21:01 | filwit | oh well, let me restart |
21:21:25 | gokr | So unpack source. |
21:21:34 | def- | filwit: yep, you overwrote the existing Urho3D-1.32 dir |
21:22:10 | gokr | Then 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:26 | gokr | Then "cd Build && make" |
21:22:46 | filwit | okay. Thanks for the help, let me restart here and get back to you |
21:23:07 | * | itsmeront quit (Ping timeout: 246 seconds) |
21:23:45 | gokr | sure! |
21:24:00 | gokr | You can join #urho3d too - they are curious about us ;) |
21:25:42 | filwit | sure, sounds like fun |
21:26:07 | filwit | but I have to do other things pretty soon |
21:27:29 | def- | filwit: got the source files for nim graphics up somewhere already? |
21:28:27 | filwit | def-: http://www.reign-studios.net/philipwitte/nim/Artwork/NimArt.zip |
21:28:42 | def- | Page not found |
21:29:07 | def- | http://www.reign-studios.net/philipwitte/nim/artwork/NimArt.zip works |
21:29:42 | filwit | yeah whoops i just did that too... dunno how it capitalized the URL.. |
21:31:14 | * | yibter joined #nim |
21:31:24 | def- | thanks |
21:36:04 | flaviu | Nim 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:38 | def- | 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:26 | flaviu | Apparently they're patching linux: |
21:39:27 | flaviu | > Several core (e.g. linux) and other packages have already received patches to make them build reproducibly |
21:39:45 | def- | flaviu: ah, so we just need a little switch to disable that optionally I guess |
21:39:56 | flaviu | I don't see why it's needed. |
21:40:12 | flaviu | Use the commit hash or the commit date instead. |
21:43:50 | * | NimBot joined #nim |
21:44:14 | Araq | yeah, commit date is fine |
21:44:25 | * | yibter quit (Quit: yibter) |
21:44:47 | ekarlso | heya guys |
21:45:02 | Mat4 | hi ekarlso |
21:46:23 | ekarlso | def-: yeah ill do more stuff on the play stuff once I'm back home and settled |
21:46:30 | ekarlso | it's more or the less ready |
21:47:58 | filwit | woohoo! character demo runs great! |
21:48:32 | gokr | Super :) |
21:49:07 | * | HakanD___ joined #nim |
21:50:00 | Araq | amazing how many people are playing with this |
21:51:04 | filwit | yeah I want to play around more, but I need to stop now. Will get to messing around later. |
21:51:15 | gokr | filwit: Port the driving car demo ;) |
21:51:28 | * | reem joined #nim |
21:51:42 | filwit | gokr: i was thinking of hammering out a spaceship in Blender and making my own demo ;) |
21:51:52 | gokr | Yeah |
21:52:07 | gokr | That's of course even cooler. A spaceship with the letters NIM on the side. |
21:52:48 | filwit | there we go :) |
21:53:00 | onionhammer | Varriount running bars? |
21:53:23 | filwit | I 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:54 | Mat4 | sadly 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:55 | Araq | Mat4: I think it's too heavy of a dependency for that |
22:06:16 | Mat4 | hmm ok, thanks |
22:07:47 | Araq | but it surely works for 2D, gokr just ported a nice 2D particle demo |
22:11:56 | BlaXpirit_ | what's with the hype though |
22:12:07 | BlaXpirit_ | have people interested in 2D seen SFML? |
22:13:11 | BlaXpirit_ | Mat4 |
22:14:44 | Mat4 | I use 3D acceleration for emulating a classical video-display processor inclusive display characteristics |
22:15:37 | BlaXpirit_ | huh |
22:16:06 | * | gokr_ quit (Ping timeout: 246 seconds) |
22:17:16 | flaviu | https://github.com/Swordfish90/cool-retro-term ? |
22:17:16 | Mat4 | it helps me speed up development of dedicated hardware |
22:17:28 | flaviu | Ah |
22:18:46 | Mat4 | flaviu: Nice link, do you know: http://www.secretgeometry.com/apps/cathode/ ? |
22:19:33 | * | jfchevrette joined #nim |
22:20:49 | flaviu | Nope, 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:11 | flaviu | Looks cool though |
22:22:00 | Mat4 | let'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:18 | gokr | Idiotic question: Remove all elements of a seq? |
22:25:28 | Araq | x.setLen(0) |
22:25:35 | gokr | thanks. |
22:25:53 | gokr | Thats... not easy to guess. |
22:27:13 | def- | "clear x" would be nice, but I guess the standard library is quite big already |
22:27:33 | Araq | *shrug* it may surprise you but I don't lose sleep over the question "how can others learn Nim effectively?" ;-) |
22:28:03 | BlaXpirit_ | it's not the library that is big |
22:28:09 | BlaXpirit_ | the documentation is "big" |
22:28:21 | Mat4 | ehm, no |
22:29:32 | gokr | Araq: The issue is not that actually, the issue is that... I am not sure how to find out without asking here. |
22:29:46 | gokr | Any advice for that appreciated. |
22:30:04 | BlaXpirit_ | that is indeed one of the biggest problems |
22:30:15 | Araq | well I have no solution for this problem. |
22:30:20 | BlaXpirit_ | and people often ask just this "how to find out things" |
22:30:36 | def- | so, how do you find out things in other languages? |
22:30:49 | Araq | well working auto-complete goes a long way of solving this |
22:30:54 | gokr | In Smalltalk it would be easy, I just look at the class and see all behaviors it supports. |
22:31:03 | gokr | Now, how do I see all I can do with a seq? |
22:31:11 | BlaXpirit_ | ctrl+f -_- |
22:31:11 | * | jfchevrette quit (Ping timeout: 246 seconds) |
22:31:14 | gokr | Araq: Yeah, I know. |
22:31:21 | def- | so typing "x." and hitting <TAB> would show everything that works on seq? |
22:31:21 | Araq | that's just IDE support |
22:31:32 | * | UberLambda quit (Ping timeout: 245 seconds) |
22:31:34 | Araq | def-: it already does |
22:31:46 | BlaXpirit_ | this does not help much |
22:31:46 | Araq | with nimsuggest |
22:34:34 | Araq | well 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:55 | Araq | and if you want to remove every element, use x.setLen(0)" |
22:36:02 | Mat4 | I 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:29 | BlaXpirit_ | all I can say is https://docs.python.org/dev/library/stdtypes.html |
22:38:25 | Mat4 | ok, it's an documentation isue |
22:38:30 | Mat4 | issue |
22:38:43 | gokr | Well, I don't really want tons of documentation to wade through that rots. |
22:38:55 | gokr | I want browser and navigation tools. |
22:39:21 | gokr | Now... nimsuggest will be able to do it given a context. |
22:39:37 | gokr | Could it also ... help in creating a navigational browseable model? |
22:39:47 | Jehan_ | What I would suggest is to have proc/method documentation indexed by type. Still tricky for types that are used a lot. |
22:40:14 | Araq | Jehan_: yeah that is planned for the docgen |
22:40:31 | gokr | Its the lowest fruit for sure. |
22:40:57 | flaviu | http://reign-studios.net/philipwitte/nimrod/docs/docs.htm |
22:40:58 | Araq | no, making nimsuggest work well is less work than an overhaul of the docgen |
22:41:26 | gokr | Ok, but... sure, most of the time I suppose I will be in a "suggest" situation. |
22:41:30 | def- | Someone was here before, working on the docgen and produced this: http://www.unraveltechnology.com/img/times.html |
22:41:54 | gokr | I looked at nimsuggest btw, but... I was lost. I couldn't see where the real action was. |
22:42:21 | Araq | compiler/suggest.nim |
22:42:50 | gokr | I thought that was the code I looked at. Found def, sug etc |
22:42:55 | gokr | Oh well, i will take another look |
22:43:06 | Araq | and that statement coming from a smalltalker is not without irony ;-) |
22:43:18 | BlaXpirit_ | def-, what does that change? |
22:43:20 | Jehan_ | 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:29 | gokr | Which statement? |
22:43:38 | Araq | "smalltalk: everything happens elsewhere" wasn't that a common complaint? |
22:43:47 | def- | BlaXpirit_: looks nice, sidebar stays fixed when scrolling, sorted types/procs/... |
22:43:48 | BlaXpirit_ | what is present at flaviu's link would of course be majestic |
22:43:54 | shevy | smalltalk syntax is awful! |
22:43:54 | BlaXpirit_ | we've been waiting for it for ages |
22:44:00 | Jehan_ | 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:06 | gokr | Araq: Ha! Well, yeah, some people felt like that. |
22:44:16 | dhasenan | Are there forward declarations for types? |
22:44:16 | gokr | shevy: No, its beautiful. ;) |
22:44:46 | * | Varriount quit (Read error: Connection reset by peer) |
22:45:11 | def- | dhasenan: trying to have 2 types that use each other? you can put them in the same type block |
22:45:17 | Jehan_ | 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:23 | BlaXpirit_ | def-, I don't think sorting like that is an advantage |
22:45:43 | Araq | Jehan_: or subtyping |
22:45:46 | def- | BlaXpirit_: yes, should be by type instead, like filwit did. |
22:45:49 | dhasenan | def-: thanks. |
22:46:09 | Jehan_ | Araq: Yeah, but that adds overhead that you can avoid. |
22:46:24 | BlaXpirit_ | filwit, please finish the documentation overhaul, it is very nice and very improtant |
22:46:53 | flaviu | BlaXpirit_: That's just a mockup. |
22:47:06 | BlaXpirit_ | so you'd need to start it first, huh :| |
22:48:54 | Mat4 | a mockup is a start, go on |
22:49:22 | Araq | Jehan_: ok, I think I can add that feature |
22:50:12 | Araq | hrm tut1 is still so weak on 'sequence' |
22:50:32 | Araq | I thought it would also tell about the most common ops |
22:50:36 | def- | Araq, Jehan_: such a search would also be useful for the website |
22:51:08 | Jehan_ | def-: Which search? |
22:51:49 | def- | Jehan_: > "list all procs that take a Foo as their first argument" ... |
22:52:26 | Jehan_ | def-: Oh, yes. And now I understand the reference to subtyping, too. Sorry, was trying to follow multiple conversations at once. |
22:52:28 | gokr | Araq: I wrote an article on seq, but ... I missed several bits of course. |
22:54:56 | gokr | Btw, whats the official stance on sequtils? Can we add more things? Is there an idea on naming stuff? |
22:59:29 | Araq | yeah and we have some rather slim ideas about the naming conventions: |
22:59:53 | Araq | http://nim-lang.org/apis.html |
23:00:23 | Araq | oh .. and it also says "For coding guidelines see the Internals of the Nim Compiler documentation." which is completely outdated |
23:00:44 | Araq | that's the problem with documentation, you need to maintain it. |
23:01:00 | Araq | better tooling doesn't have this problem |
23:01:20 | gokr | I'm with ya. |
23:02:38 | shevy | that's why no documentation is better, you don't need to maintain it |
23:02:41 | BlaXpirit_ | another link i see for the first time |
23:03:17 | shevy | BlaXpirit_ there are many more world-wide, trust me :-) |
23:03:41 | def- | gokr: sequtils has bad performance, see for example here: http://hookrace.net/nim-iterutils/iterutils.html |
23:04:07 | Araq | def-: does that work now? you said the compiler doesn't eat it |
23:04:14 | def- | Araq: nope, still doesn't compile |
23:04:20 | Araq | yay |
23:06:58 | * | pafmaf__ quit (Quit: This computer has gone to sleep) |
23:07:27 | Jehan_ | 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:36 | def- | Jehan_: i reported that already for name |
23:08:59 | Araq | Jehan_: no there is something going on with () parsing |
23:09:03 | BlaXpirit_ | this brackets skipping is so inconsistent and adds so little that I just gave up on it |
23:09:06 | Jehan_ | Araq: Gotcha. |
23:09:50 | Araq | I think it's actually a regression introduced with the rather dubious (;;) construct |
23:09:52 | Jehan_ | I stumbled upon it because I essentially wanted to do f(x .op y), which has the same underlying issue. |
23:10:37 | Jehan_ | It's not particularly pressing, I was just wondering if it was a bug or a feature. |
23:10:58 | Araq | I'm quite sure this thing used to work much better |
23:11:46 | dhasenan | Is there a guide to nim project / config files somewhere? |
23:12:43 | def- | dhasenan: something like this?: http://howistart.org/posts/nim/1 |
23:13:21 | def- | Should soon be linked from http://nim-lang.org/learn.html |
23:13:29 | * | fizzbooze joined #nim |
23:15:11 | Araq | which is remarkable since (;;) predates (foo 1) syntax ... hrm |
23:16:05 | dhasenan | def-: no, not really. I'm wondering if there is a way to access environment variables from foo.nim.cfg in particular. |
23:16:53 | dhasenan | A reference for the expected syntax would also be nice. |
23:16:59 | Araq | dhasenan: with devel you can do gcc.path %= "$PATH" |
23:17:10 | Araq | to access the PATH env var |
23:17:51 | Araq | and the syntax is obvious: It uses Nim's lexer and Nim's preprocessor coming from a time when Nim had a preprocessor |
23:18:33 | gokr | Can we have notNil? :) |
23:18:40 | flaviu | I don't think obvious means what you think it means ;) |
23:18:44 | dhasenan | Araq: "obvious" is a relative term :) |
23:19:37 | Araq | I rarely mean the term "obvious" seriously |
23:20:07 | dhasenan | Hrm, perhaps divining the syntax is left as an exercise to the reader? |
23:21:02 | Araq | well config/nim.cfg contains all there is to know about it |
23:22:08 | Araq | gokr: if you can promise me it's the last thing that will be added to system.nim |
23:22:39 | gokr | Doesn't have to be in system |
23:22:49 | Araq | where else should it be? |
23:22:55 | Araq | isNil is in system.nim |
23:22:58 | dom96 | gokr: Can't 'not isNil' be used instead? |
23:23:07 | flaviu | or just `!= nil`? |
23:23:16 | gokr | Sure, but I mean, you can answer anything with that answer |
23:23:34 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:23:39 | shevy | 42 |
23:24:06 | filwit | BlaXpirit_: I'll making a PR for the forums, and after that I'll be talking with flaviu about how updating the docs. |
23:24:07 | flaviu | ` != nil`: 7, `not .isNil`: 10, `.notNil`: 7 |
23:24:19 | filwit | I'll be* |
23:24:22 | * | cjbest quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
23:24:23 | BlaXpirit_ | thanks |
23:24:31 | BlaXpirit_ | what does all this stuff mean |
23:24:42 | filwit | god that sentence (mine) is horrible, lol |
23:25:04 | Araq | filwit: others have opinions about the docs too |
23:25:11 | filwit | BlaXpirit_: was the directed towards me? if so, I don't know what you mean. |
23:25:13 | BlaXpirit_ | no |
23:25:26 | BlaXpirit_ | != nil doesn't always work, by the way |
23:25:30 | flaviu | huh? |
23:25:42 | * | sillesta quit (Ping timeout: 245 seconds) |
23:25:55 | gokr | I presume you also think isEmpty is daft? Better to compare len with 0? |
23:26:06 | BlaXpirit_ | I may have confused something |
23:26:16 | BlaXpirit_ | but I remember having to use isNil instead of != nil |
23:26:37 | Araq | no you're right, == is lifted from the element type's == which might not exist |
23:26:44 | Araq | for seqs |
23:26:54 | Araq | that's why isNil was added in the first place |
23:27:01 | Araq | not for convenience |
23:27:07 | filwit | Araq: 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:17 | flaviu | I haven't put any work in the docs. |
23:27:24 | filwit | oh.. |
23:27:25 | flaviu | boydgreenfield did the new doc layout. |
23:27:39 | flaviu | I don't remember who did that more recent mockup. |
23:27:40 | filwit | i thought the docs looked a lot like your Nim-by-example, so I assumed you did it |
23:27:49 | filwit | nevermind then |
23:28:14 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
23:28:32 | Araq | gokr: personally I think yes, 'len' is 1 useful operation, isEmpty etc are bloating the APIs |
23:28:41 | filwit | who did updated the docs then? |
23:29:43 | Araq | boydgreenfield |
23:29:54 | filwit | k |
23:30:12 | Jehan_ | 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:12 | Araq | gokr: but it's not worth fighting over |
23:30:27 | Jehan_ | Oh, right, templates. |
23:30:47 | Araq | Jehan_: == nil for seq[T] lifts the == from the element's type |
23:31:00 | Araq | which is suboptimal |
23:31:09 | Jehan_ | Araq: Gotcha. |
23:31:15 | Araq | maybe I'd better specialized this via AST based overloading |
23:31:18 | gokr | I am just... sensing the community. In Smalltalk we like to have intentful messages. Other communities think differently. |
23:31:24 | Araq | but that had not been invented back then |
23:32:39 | * | yibter joined #nim |
23:33:00 | flaviu | Yeah, AST based overloading is better IMO |
23:33:43 | gokr | intsets can evidently answer to "empty" |
23:33:56 | * | yibter quit (Client Quit) |
23:34:14 | Araq | gokr: sometimes things are not pulled by me |
23:34:21 | gokr | But it doesn't have len ;) |
23:34:43 | Araq | that's because it's expensive to support or something |
23:34:51 | Araq | but good point |
23:35:11 | Araq | yeah, isEmpty can be faster than len == 0 |
23:35:27 | gokr | Since it has a counter... ;) |
23:35:56 | * | flaviu quit (Remote host closed the connection) |
23:36:01 | Jehan_ | It would be nice to have a minimum standard interface for containers, I guess. |
23:36:14 | gokr | But I digress, I don't want to start a war. I just like intent. |
23:36:17 | Araq | gokr: the counter doesn't count what you think it does though |
23:36:48 | gokr | Well, the empty proc checks if the counter == 0 so... perhaps I don't get it. |
23:37:09 | Araq | there is a correlation :P |
23:37:16 | Araq | when counter == 0 it's empty |
23:37:25 | Araq | but the counter doesn't count the number of elements |
23:37:52 | * | yibter joined #nim |
23:37:56 | gokr | So a very good example of having intentful behaviors then. |
23:38:11 | Araq | yup |
23:38:15 | gokr | It can't answer len, but it can answer empty. |
23:38:37 | * | flaviu joined #nim |
23:38:55 | gokr | I recall a similar discussion with a Smalltalk oldtimer. I wanted to add a polymorphic removeAll to Collection (thus works for all containers). |
23:39:25 | flaviu | "<Araq> yeah, isEmpty can be faster than len == 0". What about TR macros? Isn't this the perfect place for one? |
23:39:27 | gokr | He 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:47 | gokr | This is exactly the same. Intent is key. |
23:40:06 | * | Hakaslak joined #nim |
23:40:08 | Araq | it's also wrong btw |
23:41:00 | * | yibter joined #nim |
23:41:19 | Araq | intsets.empty is completely wrong, lol |
23:41:19 | Jehan_ | 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:43 | Araq | flaviu: TR macros must not change semantics and can be disabled on a global level |
23:41:52 | Araq | so you cannot use them for these things |
23:42:16 | flaviu | I'm not sure I understand. Isn't the definition of empty "len == 0"? |
23:42:48 | * | onionhammer quit (Ping timeout: 276 seconds) |
23:42:49 | Araq | only if 'len' exists |
23:43:22 | flaviu | So you require that the parameter be of the collection type you're implementing it for. |
23:43:25 | def- | 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:35 | flaviu | I didn't even consider that it could be generic. |
23:44:21 | flaviu | You can even optimize `coll.removeAll(coll)` with the alias specifier. |
23:45:56 | gokr | For 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:02 | gokr | But hey, this is just simple OO ;) |
23:47:15 | gokr | Couldn't resist. |
23:47:20 | Araq | gokr: yeah but then 'clear' is a common alias |
23:47:26 | Araq | and then what do you do? |
23:47:35 | Araq | add the alias so people can guess the name? |
23:47:36 | gokr | Come again? |
23:47:45 | Araq | removeAll vs clear |
23:48:05 | gokr | Oh, I didn't comment on that. |
23:48:09 | Araq | if you have both it's easier for some people to remember |
23:48:29 | Araq | but other then think "wait a sec! are these somewhat different?" |
23:48:40 | gokr | Nah, in that sense I like to stick to one. |
23:49:05 | * | yibter quit (Remote host closed the connection) |
23:49:18 | gokr | Perhaps I lost you somewhere. |
23:49:51 | Araq | well I was asking about your opinion on that aliasing business and got an answer |
23:49:54 | gokr | In the Smalltalk example of removeAll - then I could optimize in some classes, nuking a backing array in one swoop for example. |
23:50:07 | gokr | Yeah, I don't like aliasing as "helping programmers". |
23:50:26 | gokr | In that sense I am with you - keep the API as small as possible. |
23:54:11 | gokr | One 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:38 | gokr | C++ers seem to be fairly verbose. |
23:55:01 | Araq | typing annoys me |
23:55:11 | Araq | nah ;-) |
23:55:35 | gokr | I can appreciate both styles, unless when it turns into gibberish. |
23:55:38 | Jehan_ | gokr: I like long names. :) |
23:55:41 | * | onionhammer joined #nim |
23:55:51 | Jehan_ | But then I also like OOP. :) |
23:55:57 | gokr | Hehe, yeah. |
23:56:10 | Jehan_ | In the end, however, pragmatism is my middle name. |
23:56:20 | gokr | I am torturing Andreas with Smalltalk code now you know. Its fun ;) |
23:56:38 | Jehan_ | I think he'll survive. :) |
23:56:50 | gokr | Yep. |
23:58:14 | Jehan_ | 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:21 | gokr | Btw, Araq, all this 0.2f32 all over in Urhonimo... |
23:58:55 | Araq | gokr: I don't think it's necessary |
23:58:57 | flaviu | ack '(let|var) \w{1,2}\b' | wc -l |
23:58:57 | flaviu | 1651 |
23:58:57 | flaviu | :P |
23:59:12 | Jehan_ | flaviu: :) |