00:00:13 | Jehan_ | I do agree that in the long term, the compiler would benefit from fewer one-letter symbols. |
00:01:42 | gokr | Jehan_: Lots of Smalltalkers moved to Scala, but.. I am also allergic to the JVM eco system. |
00:01:45 | TEttinger | gokr, what is Urhonimo? |
00:02:05 | gokr | TEttinger: http://forum.nim-lang.org/t/870 |
00:02:30 | Jehan_ | gokr: It's not so much the ecosystem (though I think the JVM tooling is a ridiculous jungle), but the design decisions that enforced upon Scala. |
00:02:44 | * | johnsoft quit (Ping timeout: 245 seconds) |
00:02:47 | Jehan_ | 99% of Scala's problems, in my opinion, exists because of Java interop. |
00:03:00 | Jehan_ | It's still a darn nice language. |
00:03:17 | * | yibter joined #nim |
00:03:27 | Araq | yeah but only because they copied a decent amount of Nim :P |
00:03:28 | gokr | The latest work on Cog (VM for Squeak/Pharo) may soonish propel it into the vicinity of Java performance. |
00:03:30 | * | johnsoft joined #nim |
00:03:30 | Araq | (just kidding) |
00:04:27 | gokr | Jehan_: Cog just got a whole new object memory/gc and they are good on their way to add adaptive optimizations which Eliot thinks should put them in the same ballpark as Hotspot. |
00:04:58 | gokr | But whatever ;) |
00:05:16 | TEttinger | gokr: clojure uses hotspot too and idiomatic clojure is dog slow |
00:05:25 | Jehan_ | gokr: That's very nice. It just doesn't fix my one problem with Smalltalk. |
00:05:38 | gokr | Jehan_: Let me hear it! I can take it! |
00:05:46 | * | gokr grabs big fish... |
00:05:50 | Jehan_ | Which is that image-based development is definitely a love-it or hate-it thing, and I'm pretty firmly in the hate-it camp. |
00:05:56 | gokr | Ha! |
00:06:23 | Jehan_ | Otherwise, I have little issue with the language itself. |
00:06:26 | gokr | Well, then you should look at Pharo these days. Sure, it has the image - but it also has very nice source code management with git integration yaddayadda. |
00:06:58 | Jehan_ | In fact, the major reason why I used to program in Ruby so much was that it was the closest thing to "Smalltalk for the commandline" that I could find (other than gst). |
00:07:04 | gokr | So the "dark side" of the image isn't really there anymore. People tend to rebuild them and throw them away quite often. |
00:07:09 | Jehan_ | gokr: I have a copy of Pharo on my computer. |
00:07:15 | gokr | Which version? |
00:07:29 | gokr | Its evolving very fast these days. |
00:07:31 | Jehan_ | gokr: 3.0? |
00:07:51 | gokr | Mmm, that's pretty new - although 4 is... around the corner I think. |
00:08:03 | Jehan_ | What I want is basically the opposite of what Smalltalk is designed around. |
00:08:19 | gokr | What is that then? |
00:08:22 | Jehan_ | I.e. a blank slate that I fill in. |
00:08:49 | gokr | I wonder if you would find pleasure reading about Ian Piumarta's COLA stuff. |
00:09:18 | Jehan_ | The other thing is that I like to have my choice of editor. |
00:09:23 | dhasenan | gokr: COLA? Cache-oblivious lookahead array? |
00:09:56 | TEttinger | piumarta made a bunch of experimental languages, collectively the soda languages |
00:10:10 | gokr | TEttinger: Whoa! Impressed |
00:10:40 | gokr | Jehan_: He has more papers there, but this one I saw him present: http://piumarta.com/papers/DLS-2006-slides.pdf |
00:10:51 | TEttinger | he's been an inspiration to a lot of language writers, apparently |
00:10:54 | Jehan_ | gokr: But yeah, oddly enough it's the Smalltalk environment that's my issue, not the language (and I do realize all the stuff that Smalltalk has done for IDEs). |
00:10:54 | gokr | I think it was one of the first presentations of those ideas. |
00:11:07 | gokr | Jehan_: The COLA stuff is not Smalltalk. |
00:11:26 | Jehan_ | gokr: Yes, I was continuing my earlier train of thought. |
00:11:31 | gokr | Ah, ok. |
00:11:58 | gokr | Ian wrote the first port of the Squeak VM to Unix etc. |
00:12:13 | TEttinger | Maru is a recursive implementation of lisp that performs at something like 30% the speed of optimized C, which is pretty neat |
00:12:18 | gokr | He is ... a bit of a VM genius, but not a finisher ;) |
00:12:37 | gokr | Yeah, Maru is the latest incarnation of COLA. |
00:12:43 | gokr | AFAIK. |
00:13:05 | gokr | He wanted to get rid of the VM - make everything dynamic all the way down. |
00:13:21 | gokr | Oh well, its pretty cool stuff. |
00:14:08 | Jehan_ | gokr: As far as speed is concerned, I generally need considerably less than, umm, "C hand-coded by an omniscient deity", so I'm pretty flexible as far as implementations go, and don't really need a hugely optimized VM. I frequently run Nim code with all checks turned on during production, too. |
00:14:26 | gokr | Those slides included the 400 line js implementation that was faster than Firefox at the time. |
00:15:38 | gokr | the fun part is that the language "creates itself" when you start it up. Almost like... you know Steele's legendary presentation? |
00:15:53 | gokr | growing a language I think it was called. |
00:19:56 | gokr | Araq: I pushed huge.nim to gitlab, it doesn't compile ;) |
00:20:23 | gokr | But its "ported" AFAICT, modulo the usual slab of bugs |
00:26:53 | * | Trustable quit (Remote host closed the connection) |
00:37:33 | * | infinity0 quit (Remote host closed the connection) |
00:39:58 | * | gsingh93 joined #nim |
00:41:39 | * | Sharcho joined #nim |
00:47:38 | Mat4 | ciao |
00:47:44 | * | Mat4 quit (Quit: Verlassend) |
00:50:17 | * | 17WAA8EJD joined #nim |
00:53:06 | * | Varriount joined #nim |
00:55:00 | * | Jehan_ quit (Quit: Leaving) |
01:00:12 | whitenoise | def-: so can Nim do bit fields? |
01:01:31 | def- | whitenoise: maybe someone wrote a module for them, i don't know |
01:02:44 | Varriount | whitenoise: Not out of the box, unfortunately. There's the 'packed' pragma, but that doesn't give much granularity. |
01:03:21 | fowl | theres a workaround |
01:04:14 | fowl | use importc/header or importc with emit |
01:05:37 | Araq | bye |
01:07:16 | * | filwit quit (Quit: Leaving) |
01:12:53 | * | 17WAA8EJD is now known as fungos |
01:19:06 | * | smw_ quit (Read error: Connection reset by peer) |
01:25:35 | * | pogoplug joined #nim |
01:25:59 | * | reem quit (Remote host closed the connection) |
01:27:39 | pogoplug | I'm having problems bootstraping nim on Ansible linux. I get the following error: "nimcache/stdlib_osproc.c:1628:57: error: use of undeclared identifier 'POSIX_SPAWN_USEVFORK' LOC33 = posix_spawnattr_setflags(&attr, (NI32)((NI32)(POSIX_SPAWN_US..." |
01:28:07 | * | OnwardEuler joined #nim |
01:28:33 | def- | pogoplug: with which C compiler? |
01:28:44 | pogoplug | clang |
01:28:51 | pogoplug | and musl-libc |
01:29:07 | def- | ok, that explains it |
01:29:16 | pogoplug | not to me |
01:30:42 | def- | https://github.com/Araq/Nim/blob/devel/lib/posix/posix.nim#L1732-L1744 |
01:30:55 | def- | I noticed the same issue with TCC and added this workaround |
01:31:15 | def- | I guess we need it in a more general way |
01:34:32 | * | reem joined #nim |
01:35:42 | def- | Made a PR to fix this, don't know if there's a better way: https://github.com/Araq/Nim/pull/2156 |
01:37:03 | pogoplug | so its not a compiler issue, its a libc issue |
01:37:03 | * | koz_desktop quit (Remote host closed the connection) |
01:37:58 | pogoplug | def-: probably want to add that musl-libc doesn't specify VFORK in spawn.h |
01:38:13 | pogoplug | def-: I took your patch and add or defined(clang) and it built for me |
01:38:24 | pogoplug | of course that's not the right thing (its the libc not compiler) |
01:38:28 | pogoplug | but it moves me forwards |
01:38:50 | def- | pogoplug: yeah, i'll wait to see what Araq thinks about how to fix this properly |
01:39:45 | pogoplug | def-: pull in autotools of course! |
01:39:57 | def- | I doubt it |
01:44:23 | pogoplug | I need irc emoticons for sarcasm |
01:50:09 | * | dashed joined #nim |
01:51:01 | * | reem quit (Remote host closed the connection) |
01:57:30 | * | reem joined #nim |
02:01:16 | * | Sharcho left #nim ("Leaving") |
02:05:04 | * | JinShil joined #nim |
02:06:56 | * | pogoplug1 joined #nim |
02:09:33 | * | pogoplug quit (Quit: Page closed) |
02:09:40 | * | pogoplug1 quit (Client Quit) |
02:11:27 | * | chemist69_ joined #nim |
02:11:35 | * | pogoplug joined #nim |
02:11:53 | * | l04m33 joined #nim |
02:14:40 | * | chemist69 quit (Ping timeout: 255 seconds) |
02:15:32 | Varriount | pogoplug: We usually use ':3' or ';P' for sarcasm |
02:17:14 | * | JinShil quit (Quit: Konversation terminated!) |
02:18:02 | * | darkf joined #nim |
02:18:44 | * | JinShil joined #nim |
02:23:30 | flaviu | Varriount: I've never see ";P". Combining emoticons seems wrong :P |
02:27:05 | * | jholland quit (Quit: Connection closed for inactivity) |
02:27:43 | Varriount | flaviu: Ok, well at least ':3' |
02:27:52 | Varriount | I use that for when I'm joking. |
02:30:07 | l04m33 | Hi folks, I'm tying out the asyncdispatch module, and my program here produced some `type mismatch` message: https://bpaste.net/show/19d03ec9303d |
02:30:14 | l04m33 | Any ideas or pointers? |
02:32:43 | Varriount | l04m33: I don't think Asynccheck is a closure procedure. |
02:32:43 | * | pogoplug quit (Read error: Connection reset by peer) |
02:33:08 | Varriount | l04m33: You can wrap asynccheck in another procedure to get around the limitation |
02:34:11 | * | yibter quit (Quit: Textual IRC Client: www.textualapp.com) |
02:34:23 | * | johnsoft quit (Ping timeout: 246 seconds) |
02:36:25 | l04m33 | Varriount: Thanks! Never read about `closure procedures`. Diving into that now.... |
02:36:48 | * | johnsoft joined #nim |
02:37:17 | Varriount | l04m33: The rules about what can be implicitly converted to a closure and what can't are a bit complex, for reasons I can't recall at the moment. |
02:37:24 | Varriount | I do know that there are reasons though. |
02:38:24 | Varriount | l04m33: It's probably less of a headache to just for 'for f in y: asyncCheck(f)' |
02:38:30 | TEttinger | def-: I think it's cool what people are using TCC for these days |
02:38:31 | Varriount | *just do |
02:39:55 | l04m33 | Varriount: I see. Maybe it had something to do with the translated C code.... I'm just trying out different ways of doing something :) |
02:41:19 | Varriount | l04m33: Closures have two pointers - one to the actual procedure, and one to the procedure environment |
02:41:38 | Varriount | It has to do with that, I think (though I'm not sure) |
02:42:22 | def- | you can use every proc as a closure inside its module. from another module they need the closure pragma for that, I think |
02:43:08 | Varriount | I think Araq said that it's like that because of 'default arguments', though I didn't quite understand why that was. |
02:43:49 | def- | "for f in fList: asyncCheck(f)" looks more nim-like to me anyway |
02:44:05 | def- | Varriount: right, there was something with that too, but I forgot as well. in this case I don't see any default arguments |
02:45:16 | def- | asyncCheck doesn't even return anything, so a map doesn't make sense |
02:45:50 | l04m33 | def-: OK.... I came from the Python world you know :) |
02:46:07 | Varriount | l04m33: Ah, so you're like me. |
02:46:38 | Varriount | l04m33: If you use sublime text, onionhammer and I are the ones who develop the Nim extension plugin for it. |
02:47:01 | l04m33 | So besides the manual, are there any other docs about closure usage? |
02:47:28 | Varriount | l04m33: Well, there are language-agnostic explanations of closures |
02:50:02 | l04m33 | Varriount: I kinda understand what a `closure` is, but want to know more about how it works in Nim. |
02:50:37 | Varriount | l04m33: Well, in Nim, closures are usually inner functions |
02:53:56 | Varriount | l04m33: https://gist.github.com/anonymous/524404fe6fa42dc782ee |
02:54:53 | Varriount | l04m33: In that example, 'bar' is implicitly given 'closure' status |
02:55:15 | * | lavender joined #nim |
02:55:55 | Varriount | It grabs the outer variables ('c') and can use them past the scope of 'foo' |
02:57:28 | l04m33 | Varriount: hmm.... That looks pretty like closures in Python to me |
02:57:45 | Varriount | l04m33: Yes. Their fairly similar |
02:57:50 | Varriount | *They're |
02:59:23 | Varriount | l04m33: The thing is, behind the scenes they're represented as type containing two pointers. One pointer points to the function location, the other points to some allocated memory that holds the 'grabbed' variables. |
02:59:26 | l04m33 | I'm reading the manual, and I think we should have a section for closures in the tutorials.... |
02:59:44 | Varriount | l04m33: If you want to write one up, that would be great. |
03:00:09 | Varriount | l04m33: There's also http://nim-by-example.github.io/ , which could use some love. |
03:00:41 | Varriount | (Not all of the information there is 100% accurate) |
03:02:32 | * | johnsoft quit (Ping timeout: 250 seconds) |
03:03:05 | onionhammer | Varriount hows that mystery branch coming |
03:03:22 | Varriount | onionhammer: I'm halfway done with nimble.py |
03:04:05 | Varriount | onionhammer: While it's in my mind, I'll push what I have so far to a new branch, that way you can see what I'm up too. |
03:04:39 | * | johnsoft joined #nim |
03:08:52 | * | koz_ quit (Ping timeout: 240 seconds) |
03:08:58 | Varriount | onionhammer: https://github.com/Varriount/NimLime/tree/refactor |
03:10:06 | Varriount | onionhammer: Beware, that branch is likely broken in a few places. I'm testing commands as I makes changes. |
03:10:55 | * | flaviu quit (Ping timeout: 255 seconds) |
03:10:55 | * | Mimbus quit (Ping timeout: 255 seconds) |
03:12:11 | DecoPerson | Strange error with closures and tuples: https://gist.github.com/Deco/c9d9741a1f67d7d5ca94 |
03:13:22 | * | johnsoft quit (Ping timeout: 240 seconds) |
03:13:35 | Varriount | DecoPerson: Try renaming the inner closure. 'inc' is a built-in function (increments an ordinal) |
03:14:06 | DecoPerson | no difference |
03:14:06 | Varriount | Though, that should probably be reported as a bug, or at least a warning. |
03:14:29 | DecoPerson | oh wait, it's a different error now |
03:15:16 | DecoPerson | https://gist.github.com/Deco/c9d9741a1f67d7d5ca94 |
03:15:48 | DecoPerson | Ah, annotating blah with {.closure.} solved it |
03:15:49 | def- | DecoPerson: proc blah {.closure.} = |
03:16:22 | Varriount | Hm, probably because blah() doesn't actually capture any outer variables. |
03:16:41 | def- | Varriount: exactly, if you make it capture something, it's implicitly a closure |
03:16:59 | Varriount | DecoPerson: Could you look and see if those bugs have been reported, and if not, report them? |
03:17:10 | Varriount | onionhammer: No comments? |
03:18:21 | DecoPerson | Varriount: sure |
03:18:36 | DecoPerson | Works perfectly, thanks! https://gist.github.com/Deco/c9d9741a1f67d7d5ca94 |
03:27:19 | DecoPerson | Why doesn't my redefinition of inc shadow system.inc? |
03:28:06 | def- | DecoPerson: good question, i think it should |
03:28:21 | Varriount | DecoPerson: Bug in the compiler. |
03:28:31 | Varriount | Which is why it should be reported as a bug. |
03:29:31 | DecoPerson | I guess one is "proc inc() {.closure.}" and the other is "proc system.inc*(x: var T) {.stuff.}" |
03:30:47 | Varriount | DecoPerson: It's a magic proc |
03:30:48 | DecoPerson | Given that procedures aren't first-class values, like in Lua or Python (because overloading would be impossibly difficult)... how does it decide which overload to resolve to when treating them as such? |
03:31:05 | Varriount | (Literally, one of the pragmas is 'magic' |
03:31:08 | Varriount | ) |
03:31:32 | Varriount | DecoPerson: What do you mean, first class values? |
03:31:38 | reactormonk | DecoPerson, you can make them first-class just fine |
03:31:49 | Varriount | DecoPerson: You can pass around procedures and such just fine. |
03:32:12 | reactormonk | DecoPerson, you could consider them polymorphic functions. |
03:32:12 | fowl | DecoPerson, ret.inc should resolve to the field if thats what you named it, it probably works with an object type |
03:32:36 | Varriount | DecoPerson: Most of the 'overloading' is done at compile-time. The compiler does it's best to infer the best matching procedure. |
03:33:45 | DecoPerson | This is not an issue with magic procs: https://gist.github.com/Deco/c9d9741a1f67d7d5ca94 |
03:35:34 | Varriount | Hm. So the compiler is matching against the outer procedure first, not the inner. |
03:35:39 | Varriount | Definitely a bug. |
03:35:42 | DecoPerson | If there's any conflict at all, there seems to be an issue: https://gist.github.com/Deco/c9d9741a1f67d7d5ca94 |
03:36:08 | DecoPerson | oh, wait... what the |
03:36:26 | fowl | DecoPerson, try result.incval = incval |
03:36:28 | DecoPerson | The IDE hints say there's an error, but it compiles fine with "nim c" |
03:37:24 | Varriount | DecoPerson: What IDE are you using? |
03:37:40 | DecoPerson | Oh, nvm, I forgot to save |
03:37:42 | DecoPerson | https://gist.github.com/Deco/c9d9741a1f67d7d5ca94 |
03:38:00 | DecoPerson | Definately a bug |
03:39:15 | Varriount | DecoPerson: What IDE are you using? |
03:39:33 | DecoPerson | fowl: doing "result.incval = incval" worked |
03:39:40 | DecoPerson | and resolves to the inner proc |
03:40:01 | DecoPerson | Varriount: Sublime with NimLime, which runs "nim --verbosity:0 idetools --suggest" for hints |
03:43:31 | gmpreussner|work | quick question for wrapping a C library: i have a function that takes an array of SomeType, i.e. "SomeType* values". is it correct to convert this to "ref SomeTypeArray" with "SomeTypeArray* {.unchecked.} = array[1234, SomeType]" ? |
03:45:41 | gmpreussner|work | i thought i had read something about better C array support on the forums recently and recall this syntax, but i can't find it :/ |
03:46:22 | * | JinShil quit (Quit: Konversation terminated!) |
03:49:06 | Varriount | gmpreussner|work: Huh? |
03:49:41 | gmpreussner|work | Varriount: C function looks like this: void Foo(SomeType* values) |
03:49:51 | gmpreussner|work | SomeType* means array of SomeType |
03:50:01 | gmpreussner|work | a pointer to a static array is expected |
03:50:09 | Varriount | gmpreussner|work: You can just pass it an array. It doesn't need to be unchecked. |
03:50:50 | Varriount | Isn't an array just a pointer to a block of memory? You don't need the extra ref/ptr, do you? |
03:50:53 | * | lavender_ joined #nim |
03:50:53 | gmpreussner|work | oh, ok. So it would be: proc Foo(values: array[123, SomeType]) ? |
03:51:14 | gmpreussner|work | in C and C++, the name of an array is a pointer to its first element |
03:51:27 | Varriount | Ah, sorry, yes, you need an unchecked array if you want to write it that way. |
03:51:34 | gmpreussner|work | i thought so :) |
03:52:01 | gmpreussner|work | so is it this then: proc Foo(ref SomeTypeArray) ? |
03:52:09 | Varriount | You should probably set the length as zero though. The unchecked pragma doesn't affect memory allocation for arrays, just bounds checking. |
03:52:57 | gmpreussner|work | i see. i saw a lot of examples that use 10_000 or 100_000_000 for unchecked arrays. 0 will work just as well then? |
03:53:00 | DecoPerson | Varriount, def-, fowl: https://github.com/Araq/Nim/issues/2157 |
03:53:34 | * | lavender quit (Ping timeout: 245 seconds) |
03:54:34 | gmpreussner|work | Varriount: also, in general for non-array parameters, but pointers, is it safe to convert "SomeType* value" parameters to "value: ref SomeType" or should i use "value: ptr SomeType" ? |
03:54:54 | Varriount | gmpreussner|work: ptr |
03:55:06 | gmpreussner|work | ok thanks |
03:55:11 | Varriount | gmpreussner|work: 'ref' implies that the value is under the control of the garbage collector |
03:55:20 | gmpreussner|work | ah that's right |
03:55:33 | gmpreussner|work | so my array parameter should then be ptr as well, i suppose |
03:55:55 | gmpreussner|work | or is that a different situation? |
03:56:38 | gmpreussner|work | nevermind, i see that i have used ptr with arrays before, and it seems to work fine |
03:58:10 | Varriount | gmpreussner|work: Well, if my knowledge is correct, 'ptr array' is a pointer to a pointer to the first element of an array |
04:00:40 | * | johnsoft joined #nim |
04:05:05 | * | kapil___ joined #nim |
04:09:45 | * | zacts joined #nim |
04:13:11 | dhasenan | When I turned on the LineTooLong hint and compiled a hello world program, the compiler emitted some hints about the standard library (using a recent copy in the devel branch). Is there some way to constrain hints to only emit for my project rather than everything? |
04:14:04 | * | dashed quit (Quit: Connection closed for inactivity) |
04:15:08 | onionhammer | Varriount cool i'll check it out |
04:18:42 | reactormonk | dhasenan, uh-oh. File a bug. |
04:19:38 | onionhammer | Varriount you mind if i delete a couple of the old branches |
04:22:26 | onionhammer | Varriount it's all one commit :P |
04:22:51 | * | lavender_ is now known as lavender |
04:24:47 | DecoPerson | gmpreussner|work: here you go: https://gist.github.com/Deco/208ac923ecc66f42caf2 |
04:25:50 | DecoPerson | Should make it easier to work with raw C pointers |
04:26:24 | * | reem quit (Remote host closed the connection) |
04:28:28 | gmpreussner|work | thanks DecoPerson |
04:29:38 | DecoPerson | It has mistakes... I should probably write some unit tests |
04:32:13 | * | koz_ joined #nim |
04:32:28 | * | zacts quit (Quit: ERC Version 5.3 (IRC client for Emacs)) |
04:35:37 | DecoPerson | Isn't there a `..<` range operator? |
04:36:09 | TEttinger | holy crap, urho3d and urhonimo look awesome |
04:36:41 | TEttinger | I'm surprised it isn't mentioned on Urho3D's page |
04:42:22 | dhasenan | Is there a way to include an import trace when displaying errors? Like "Error: undeclared identifier: foo (in file imported at a.nim:12, imported by b.nim:47)" |
04:42:26 | dhasenan | GCC does this sort of thing, I think. |
04:43:05 | DecoPerson | I swear I saw someone do this in Nim: for i in 0..<len: |
04:43:15 | DecoPerson | Where the < means it will go up to len-1 |
04:46:59 | whitenoise | is there a difference in memalloc and malloc |
04:47:15 | * | polde quit (Ping timeout: 272 seconds) |
04:47:21 | whitenoise | oh, that was a template you made, nvm |
04:48:06 | Triplefox | DecoPerson: yes, < is used there to mean "len-1" |
04:48:26 | DecoPerson | Triplefox: but whenever I try to use it, it says unrecognised operator |
04:48:32 | Triplefox | add a space |
04:48:35 | Triplefox | after .. |
04:49:20 | * | reem joined #nim |
04:49:24 | Triplefox | it's a bit dangerous when you use it with a variable that will count into 0, since a negative index into a seq will give you the whole seq |
04:49:39 | Triplefox | we have an issue talking about that problem |
04:51:57 | * | lavender_ joined #nim |
04:52:56 | whitenoise | types.nim(10, 18) Error: type expected |
04:53:00 | whitenoise | what does this mean |
04:53:21 | DecoPerson | Depends on your code, paste to gist.github.com |
04:53:32 | whitenoise | https://www.irccloud.com/pastebin/SDAUtUvq |
04:54:23 | DecoPerson | Line 10, I think you mean "student = Student(...)" |
04:54:50 | DecoPerson | var varName : TypeName says "varName is of type TypeName" |
04:55:13 | whitenoise | I see. it's expecting a type but I'm giving it basically an object |
04:55:23 | whitenoise | makes sense |
04:55:28 | Triplefox | the verbose student:Student = Student() also works i think |
04:55:37 | * | lavender quit (Ping timeout: 264 seconds) |
04:55:39 | DecoPerson | whereas var varName = TypeName(something: "something") says "varName is of type TypeName and construct it with these values" |
04:55:50 | whitenoise | Triplefox: that does work, i have done it with ints |
04:55:53 | whitenoise | x: int = 10 |
04:56:21 | whitenoise | https://www.irccloud.com/pastebin/PbHvrlKR |
04:56:21 | Triplefox | yeah...stylistically it probably doesn't matter which you use, unless type inference is breaking for some reason |
04:56:24 | whitenoise | this works |
04:56:52 | DecoPerson | wow, just tried "var x: auto = 10" as a joke, and it broke the compiler |
04:57:01 | whitenoise | lol |
04:58:47 | DecoPerson | https://gist.github.com/Deco/53401151c669b944e554 |
04:59:06 | Triplefox | hmm |
04:59:26 | DecoPerson | Not exactly high-priority :) |
04:59:38 | DecoPerson | Not exactly high-priority :) |
04:59:44 | DecoPerson | opps, wrong window |
05:03:37 | * | lavender_ quit (Ping timeout: 244 seconds) |
05:06:43 | Triplefox | aha, you can make it compile with "var x: auto int = 10" |
05:06:56 | whitenoise | what is the auto doing |
05:07:05 | DecoPerson | why would "auto int" even be a thing? |
05:07:19 | whitenoise | ^ |
05:07:29 | Triplefox | i noticed that auto is defined as a type class |
05:08:36 | Triplefox | i don't understand that in any detail but it would mean it's a kind of categorization, just not a useful one in that situation |
05:08:59 | Triplefox | > If a proc param doesn't have a type specified, Nim will use the "distinct auto" type class (also known as "any"): |
05:10:00 | whitenoise | ah, sort of like interface{} in Go |
05:10:41 | Triplefox | it looks like every time we use "ref" or "ptr" we're actually working within the typeclass system |
05:12:48 | Triplefox | the part i really don't get is user-defined type classes...it's probably really powerful once i understand it |
05:14:05 | DecoPerson | gmpreussner|work: Here's the fixed + unit-tested version: https://gist.github.com/Deco/208ac923ecc66f42caf2 |
05:16:47 | * | polde joined #nim |
05:19:14 | gmpreussner|work | DecoPerson: looking nice. that will probably come in handy. |
05:21:17 | Triplefox | also i didn't notice that "unittest" existed so i guess i'll use that |
05:26:17 | * | reem quit (Remote host closed the connection) |
05:26:59 | * | reem joined #nim |
05:39:01 | ekarlso | ∞is devel broken ? |
05:43:13 | * | lavender joined #nim |
05:49:41 | DecoPerson | ekarlso: Latest devel on Win8.1 64 is working for me |
05:49:54 | DecoPerson | What's your issue? |
05:51:46 | * | kashyap_ joined #nim |
05:51:51 | * | polde quit (Ping timeout: 272 seconds) |
05:52:31 | kashyap_ | Some folks discussed my moving from Rust to Nim :) http://www.reddit.com/r/rust/comments/2vqy81/author_of_unix_in_rust_abandons_rust_in_favor_of/ |
05:53:50 | TEttinger | hi kashyap_, yeah I saw it mentioned on ##fsharp, I looked closer and popped in here :) |
05:54:55 | kashyap_ | :) ... I think I should write a more detailed article about my path to Nim |
05:55:11 | TEttinger | how did you get started with learning/writing Nim, kashyap_? |
05:56:42 | kashyap_ | A lady called Maxime had tweeted about Nim a few weeks ago...That's when I looked at Nim ... when I saw Nim, I could see that it was wat I had been looking for!!! |
05:57:07 | TEttinger | neat |
05:59:00 | Triplefox | that makes it sound so serendipitous |
06:01:02 | ekarlso | anyone wanna volunteer to help build the package indx ? |
06:01:32 | Triplefox | build it how? |
06:01:42 | ekarlso | code it ;) |
06:02:46 | Triplefox | as in add more, or as in automate the indexing..? |
06:03:16 | ekarlso | Triplefox: I've actually started doing a big deal of it .. |
06:03:22 | ekarlso | but more help would be nice |
06:04:33 | DecoPerson | Something like npmjs.com, ekarlso? |
06:04:39 | ekarlso | DecoPerson: yeah |
06:04:49 | ekarlso | https://nim-pkg.svcs.io < initial stuffs |
06:05:28 | DecoPerson | Oh boy, here come the growing pains |
06:05:34 | Triplefox | firefox doesn't like that certificate :D |
06:05:43 | ekarlso | DecoPerson: what's wrong now ? |
06:06:34 | * | polde joined #nim |
06:06:48 | Triplefox | oh, the tags browser is cool |
06:07:03 | ekarlso | Triplefox: there's a branch for nimble also |
06:07:34 | ekarlso | allows you to "nimble register" in the current dir of a new package and it does it for you |
06:07:36 | DecoPerson | ekarlso: nothing wrong with your site. it's really well :) |
06:07:49 | DecoPerson | I was commenting on how Nim is building inertia, yet it is still immature |
06:08:16 | DecoPerson | What if heaps of people use the "do" notation in their packages, but the developers decide to change it completely... |
06:08:27 | DecoPerson | growing pains, as faced by every other language :) |
06:08:58 | Triplefox | i'm dodging the problem by building nim libraries that only use the subset least likely to change |
06:09:41 | ekarlso | nim libs needs more CI / Docs automation.. |
06:09:55 | ekarlso | and not a static index :/ |
06:10:33 | Triplefox | here is an idea, docs that build on unit test code |
06:10:47 | Triplefox | so the unit test can also be an example |
06:11:31 | DecoPerson | Triplefox: I don't agree with that idea. Take the unit tests I just wrote for my memory library: https://gist.github.com/Deco/208ac923ecc66f42caf2 |
06:11:58 | DecoPerson | They're not very good examples, in fact effective coverage (the goal of unit testing) can be painful and result in ugly code |
06:12:11 | * | brson quit (Quit: leaving) |
06:14:25 | Triplefox | hide it because it is ugly? it still shows how code is used, and it doesn't have to be the central example |
06:14:43 | Triplefox | that goes for "this should fail" tests too |
06:16:56 | DecoPerson | Hmm, interesting. I suppose docs and tests could be meshed together. They could lead with introduction, rationale and introductory examples, and then have the typical type/proc documentation with expandable unit tests for each |
06:17:14 | DecoPerson | But you'd need a way to specify which unit test is for which proc(s) |
06:19:06 | Triplefox | i like it mostly because it would help keep code/tests/docs in sync, although it would force the workflow to be a certain way |
06:19:15 | * | bjz joined #nim |
06:19:20 | Triplefox | so there would certainly be a project at some point that couldn't handle it like that |
06:28:48 | * | bjz quit (Ping timeout: 250 seconds) |
06:36:23 | Varriount | onionhammer: You there? |
06:42:49 | * | TEttinger quit (Ping timeout: 244 seconds) |
06:44:17 | * | brson joined #nim |
06:53:08 | * | brson quit (Ping timeout: 264 seconds) |
06:55:04 | * | bjz joined #nim |
07:04:07 | * | kashyap_ quit (Ping timeout: 246 seconds) |
07:12:08 | * | kokozedman joined #nim |
07:14:14 | kokozedman | Hey guys, compared to other Hash map implementations (like STL, Judy, ulib, etc...), how good is Nim's Table? |
07:18:41 | Varriount | kokozedman: I don't think there have been any tests done. I know there has been talk about optimizing it though. |
07:20:19 | * | vendethiel- quit (Quit: q+) |
07:26:39 | DecoPerson | dhasenan: Regarding LineTooLong, you could try not enabling it and then wrap your code in {.push hint[LineTooLong]: on.} and {.pop.} |
07:44:32 | * | fizzbooze quit (Ping timeout: 246 seconds) |
08:00:16 | * | ChrisMAN quit (Ping timeout: 255 seconds) |
08:01:10 | * | HakanD___ joined #nim |
08:33:23 | * | lavender quit (Ping timeout: 256 seconds) |
08:34:33 | * | lavender joined #nim |
08:36:01 | * | Trustable joined #nim |
08:36:15 | * | Trustable quit (Remote host closed the connection) |
08:36:59 | * | jaapz joined #nim |
08:37:08 | * | Trustable joined #nim |
08:37:13 | jaapz | let's start a religious war, why would nim be better than rust? |
08:37:42 | vegai | hah |
08:37:47 | jaapz | other than that it's irc is on freenode like any other self respecting project |
08:40:37 | bjz | nim's name is shorter! |
08:41:21 | jaapz | bjz: you've convinced me |
08:41:25 | Triplefox | it comes first in the alphabet too |
08:41:47 | jaapz | another great reason |
08:42:31 | bjz | <insert syntactic preferences here> |
08:42:50 | jaapz | bjz: rust syntax is a bit weird |
08:43:00 | jaapz | and there's a lot of it |
08:43:16 | bjz | I will be the first to admit that |
08:43:23 | bjz | :) |
08:44:00 | bjz | nim has no annoying borrow checker |
08:44:25 | bjz | or ownership shenanigans |
08:44:38 | jaapz | some would say that's a strength in rust |
08:44:49 | bjz | some would (myself included) |
08:44:57 | bjz | but for some that is a plus |
08:45:53 | vegai | nim's syntax is also a bit weird when you're not used to it |
08:45:56 | bjz | nim's metaprogamming seems more powerful, and prettier |
08:45:57 | jaapz | does nim run on raspberry pi and other arm-type thingies? |
08:46:04 | bjz | vegai: indeed |
08:46:21 | jaapz | vegai: fair enough |
08:46:40 | vegai | only Forth's syntax isn't, really :P |
08:46:49 | gokr | It seems to me that there are some fairly deep differences that overrule things like "syntax" etc. Philosophy is very different. Memory handling very different. Error handling. And compilation targets. |
08:47:02 | bjz | gokr: indeed |
08:47:17 | bjz | jaapz: nim has exceptions, rust does not |
08:47:22 | gokr | Its kinda odd staring at syntax when those differences I mentioned are in comparison HUGE differences. |
08:47:53 | bjz | rust compiles to llvm IR, where as nim has multiple backends to intermediate language targets |
08:48:19 | jaapz | gokr: still, syntax is what people see and what can be incredibly annoying |
08:48:31 | bjz | jaapz: you get used to it |
08:48:45 | bjz | jaapz: so long as its not COBOL |
08:49:06 | jaapz | bjz: fair enough |
08:49:08 | gokr | Nim wants to be practical. Rust wants to satisfy a very specific use case (build a super multicore browser?) and sacrifices programmability to do it. |
08:49:15 | gokr | That's my perception at least. |
08:49:27 | jaapz | gokr: the browser thing is it's main use case indeed |
08:49:38 | vegai | I think it's trying generally to get into that place where C++ is |
08:49:44 | Varriount | Wait, rust doesn't have exceptions? |
08:49:53 | vegai | no, not really |
08:49:55 | Varriount | ._. |
08:49:57 | gokr | Varriount: Ha! You kiddin? |
08:49:58 | Triplefox | just this evening i mentioned nim in some other channel and got a kneejerk "not case sensitive?? reject" response |
08:50:02 | vegai | Varriount: I like it, actually |
08:50:13 | bjz | Varriount: no, it has mondaic error handling, and task failure |
08:50:17 | * | dumdum joined #nim |
08:50:48 | Varriount | Hm. I think 'mondaic' should be a real word |
08:50:51 | bjz | Varriount: monadic as in, Option or Result |
08:51:05 | bjz | lol woops |
08:51:17 | gokr | It seems to me that serious use of error handling in Rust would simply blow the code into a mess. |
08:51:36 | bjz | gokr: I haven't found it to be a problem |
08:51:43 | gokr | But I may of course be utterly mistaken. But every call site along the chain would need to be instrumented. |
08:51:45 | Varriount | bjz: No, I spotted your error. I'm just saying that 'mondaic' sounds like it should be a real word. |
08:51:54 | bjz | Varriount: heh, yup |
08:52:10 | vegai | the Go folks seem to moderately succeed without exceptions too |
08:52:22 | jaapz | vegai: pls don't talk about Go error handling |
08:52:24 | vegai | but Rust does it a bit better for the reasons mentioned above |
08:52:34 | jaapz | vegai: if statements everywhere |
08:52:36 | * | davidhq joined #nim |
08:52:56 | vegai | jaapz: mm, sure. |
08:53:06 | vegai | but conceptually simple |
08:53:13 | vegai | which is sometimes good |
08:53:18 | jaapz | vegai: true enough but it clutters the code like a bitch |
08:53:22 | * | vegai nods |
08:53:29 | bjz | jaapz: Nim has a single BDFL who calls the shots, where as Rust has a team people |
08:53:32 | * | chemist69_ is now known as chemist69 |
08:53:39 | jaapz | f, err := OpenSomething() |
08:53:46 | jaapz | if (err) { handle the error } |
08:53:58 | jaapz | not my cuppa |
08:54:00 | vegai | if you're crazy, you can inline that stuff inside the if clause, I think |
08:54:06 | DecoPerson | I'm of the school that if an exception has occured, the program should exit because it's an exceptional circumstance and the program could not possibly recover. If it's a situation the program has been designed to handle (disconnection, file not found, out of memory, etc), then it should be handle by traditional control flow... IMHO :) |
08:54:08 | * | davidhq quit (Max SendQ exceeded) |
08:54:09 | gokr | bjz: Do you use both btw? |
08:54:31 | jaapz | bjz: so kinda python-y |
08:54:42 | vegai | < bjz> Varriount: no, it has mondaic error handling, and task failure |
08:54:45 | bjz | gokr: mainly Rust - I follow nim though at a distance, and upvote all the posts on it :3 |
08:54:52 | vegai | I think they abandonded the erlang-style task failure thing |
08:55:00 | vegai | didn't they? |
08:55:17 | * | davidhq joined #nim |
08:55:22 | bjz | vegai: there is still failure to the task boundary, but no *linked* task failure |
08:55:27 | vegai | ah, ok |
08:55:48 | jaapz | if it's really bad you can panic!() your way out of the program |
08:55:53 | bjz | vegai: which is sad, and means no supervisors, but Rust's goals have shifted a tad |
08:56:22 | bjz | vegai: towards 'pay only for what you use' |
08:57:32 | bjz | gokr: what kind of stuff are you making in nim right now? |
08:58:22 | gokr | bjz: I work at 3DICC and our system is a 3D virtual worlds kinda thing. 100% in Smalltalk for the moment, but we just hired Araq and are moving towards Nim. |
08:58:36 | gokr | Did you miss the announcement the other day of Urhonimo? |
09:00:14 | bjz | that's pretty neat |
09:00:18 | bjz | yeah, I did |
09:00:44 | gokr | There were basically 3 important things in that announcement IMHO: 1) Araq works at 3DICC 100% Nimming 2) Nim can now wrap C++ very well automatically and 3) Urhonimo is a Nim wrapper of Urho3D |
09:00:52 | bjz | how is smalltalk to use? |
09:01:03 | bjz | awesome! |
09:01:06 | gokr | Of those 3 I would say the first one is the most important part for Nim. |
09:01:22 | bjz | will be good for nim to have commercial backing |
09:01:32 | Varriount | gokr: Hm. Wrapping C++ means Qt wrappers, right? |
09:01:36 | bjz | gutsy for the company, but hats off to them |
09:01:44 | gokr | Araq's work to produce Urhonimo produced a huge improvement in c2nim/nim to wrap C++ fully automatically. |
09:02:11 | gokr | 3DICC is small. Me and Araq is 50% of it ;) |
09:02:34 | bjz | ahh :D |
09:02:35 | Triplefox | it has an impressive name though |
09:03:47 | gokr | But yeah, having Araq be able to work 100% on/with Nim, from home, is quite a big deal for the Nim community IMHO. |
09:03:52 | bjz | gokr: it's also great that it is being used in production, especially by Araq |
09:03:58 | gokr | Definitely. |
09:04:08 | bjz | that is a big test for a language |
09:04:22 | gokr | Yeah, we will be phasing Nim in gradually. |
09:04:53 | bjz | it's one thing to bootstrap a compiler, and another to actually use it in a large project (that is the experience of Rust, at least) |
09:05:04 | gokr | Varriount: Yes, Qt should be very doable now. |
09:05:18 | bjz | compilers are different beasts to messy real world stuff |
09:05:25 | gokr | Definitely. |
09:05:35 | bjz | (even though compilers are also messy) |
09:05:47 | bjz | wait - is nim bootstrapped? |
09:05:58 | bjz | sorry - made that assumption |
09:06:02 | gokr | It is |
09:06:07 | gokr | Its all in Nim. |
09:06:09 | bjz | nice |
09:06:19 | gokr | I wrote an article on that process btw. |
09:06:31 | Triplefox | qt bindings will be nice, i know someone who might be interested in that |
09:06:48 | gokr | http://goran.krampe.se/category/nim/ - the "Bootstrapping" one at the far bottom |
09:07:37 | gokr | bjz: I also think this new C++ wrapping capability is a very strong feature of Nim. |
09:07:50 | bjz | yup, that is a big pluss |
09:08:04 | gokr | Urho3D is a beast, and we already have fairly advanced samples running quite fine. |
09:08:45 | bjz | I think nim would have an easier time wrapping C++ than Rust. It's overloading and template semantics would most likely match more closely |
09:09:19 | bjz | jaapz: there you go, it is easier to wrap C++ with nim than Rust |
09:09:19 | gokr | bjz: This is a small one I did yesterday: https://github.com/3dicc/Urhonimo/blob/master/examples/particle.nim |
09:09:31 | gokr | Its nice, because its fully clean - 100% Nim. |
09:09:53 | gokr | Araq's demo is much more advanced though: https://github.com/3dicc/Urhonimo/blob/master/examples/character.nim |
09:10:13 | bjz | great |
09:10:21 | gokr | It has an emit in the beginning, he will fix that, but otherwise also fully in Nim. |
09:10:35 | * | davidhq quit (Ping timeout: 246 seconds) |
09:10:52 | gokr | This is that demo: https://www.youtube.com/watch?v=-T0MrJkLB8Y |
09:11:34 | Triplefox | that sure does look like a 3d game |
09:12:17 | gokr | Its those 600 lines of Nim code I linked above. |
09:13:25 | gokr | Driving an animated avatar, Bullet physics etc etc. Tested on OSX, Windows and Linux (should run on iOS and Android too). :) |
09:13:26 | * | lavender quit (Ping timeout: 246 seconds) |
09:15:17 | Triplefox | what is your ultimate goal for wrapping this engine? or is that up for disclosure |
09:15:52 | gokr | Our current system is already used in production etc, we are not a VC company. |
09:16:27 | gokr | So we already have a 3D client with very advanced features. But we want to upgrade to the Urho3D engine. |
09:17:41 | gokr | So we are injecting Nim into our current client written in Smalltalk as a start. |
09:18:10 | Triplefox | sounds like a complex project, but also a good "real" test |
09:18:27 | gokr | Its a very complex project indeed. |
09:18:36 | gokr | And our system is HUGE. |
09:18:59 | gokr | So... its going to be a step-by-step thing. |
09:20:08 | Triplefox | when projects get bigger i always get frustrated that i can't really know it all very well anymore |
09:21:29 | * | davidhq joined #nim |
09:21:44 | gokr | One of our promos, 3D comes 48 seconds into it: https://www.youtube.com/watch?v=oK3xjPaKuSg |
09:22:27 | gokr | You can also search youtube for "Teleplace" and you will find lots more - since that was the name of the system earlier. |
09:27:40 | Triplefox | that pitch is getting me all fired up :3 like playing second life at the office |
09:27:47 | gokr | Yes it is. |
09:28:20 | gokr | And oh, its all in Smalltalk ;) |
09:28:31 | Triplefox | heh |
09:28:48 | gokr | But in a 2 years, perhaps all in Nim. |
09:29:01 | gokr | We will see. |
09:30:06 | Triplefox | i know a lot of people who are or used to work at IMVU, sort of similar domain but more consumer focused. |
09:30:44 | gokr | Yeah, we are mainly "big corp" focused at the moment - but future directions may include more consumer stuff. |
09:31:09 | Triplefox | their stack is some mashup of haskell and c++ and i think one other language |
09:31:10 | * | BlaXpirit joined #nim |
09:32:15 | gokr | On our server side we are basically all Smalltalk. On the client however we use several third party libraries in C and C++. |
09:32:29 | gokr | So C/C++ interop is important for us in Nim. |
09:32:29 | Triplefox | oh, it's actually way more than i thought, heh http://www.quora.com/What-is-IMVUs-technology-stack |
09:33:24 | gokr | Yeah, well, our full stack is of course also much more. |
09:33:59 | gokr | Btw, Araq's wife's birthday today - so he has a day off ;) |
09:39:02 | * | rinukkusu_ joined #nim |
09:39:42 | * | rinukkusu_ is now known as rinukkusu |
09:42:57 | * | pafmaf__ joined #nim |
09:47:25 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
09:48:09 | ekarlso | actually gokr u only have to run build.sh |
09:48:11 | ekarlso | -,,- |
09:48:15 | dtscode | how is math.random seeded? |
09:48:45 | * | davidhq joined #nim |
09:49:20 | * | davidhq quit (Client Quit) |
09:49:20 | gokr | ekarlso: Ehm? |
09:49:51 | ekarlso | gokr: instead of doing the whole snippet you have in your blogpost ;) |
09:50:37 | gokr | ekarlso: I am not following. |
09:57:45 | BlaXpirit | dtscode, what do you mean "how"? |
09:57:51 | BlaXpirit | it's basically undefined |
09:57:54 | BlaXpirit | whatever C does |
10:03:05 | * | teapot joined #nim |
10:05:27 | * | gsingh93 quit (Quit: Connection closed for inactivity) |
10:06:50 | * | sitaram joined #nim |
10:09:37 | * | kashyap_ joined #nim |
10:18:21 | * | reem quit (Remote host closed the connection) |
10:20:02 | * | reem joined #nim |
10:21:07 | fowl | did you guys know theres a wikipedia page now http://en.wikipedia.org/wiki/Nim_(programming_language) |
10:21:24 | rinukkusu | sick |
10:21:45 | fowl | it needs more references |
10:25:29 | * | Varriount|Mobile joined #nim |
10:26:00 | * | Var|Mobile joined #nim |
10:26:01 | * | Var|Mobile quit (Read error: Connection reset by peer) |
10:26:18 | * | Var|Mobile joined #nim |
10:28:26 | * | Var|Mobile quit (Read error: Connection reset by peer) |
10:29:33 | federico3 | nice |
10:30:07 | * | Varriount|Mobile quit (Ping timeout: 255 seconds) |
10:35:15 | * | Var|Mobile joined #nim |
10:35:31 | * | kuzy000_ joined #nim |
10:44:04 | * | Var|Mobile quit (Ping timeout: 255 seconds) |
10:51:15 | * | Varriount|Mobile joined #nim |
10:52:15 | * | Var|Mobile joined #nim |
10:52:17 | * | reem quit (Remote host closed the connection) |
10:53:45 | Var|Mobile | Hrm |
10:54:36 | Var|Mobile | ¤Var¤ |
10:54:55 | Var|Mobile | Interesting android keyboard |
10:55:22 | BlaXpirit | k |
10:56:03 | * | Varriount|Mobile quit (Ping timeout: 252 seconds) |
11:04:53 | * | HakanD____ joined #nim |
11:05:58 | * | TEttinger joined #nim |
11:07:22 | * | HakanD___ quit (Ping timeout: 245 seconds) |
11:14:14 | * | HakanD____ quit (Quit: Be back later ...) |
11:17:13 | rinukkusu | how does that make you guys feel? http://developers.slashdot.org/comments.pl?sid=6971335&cid=49059393 |
11:17:46 | * | flaviu joined #nim |
11:27:19 | * | flaviu quit (Remote host closed the connection) |
11:27:43 | * | HakanD____ joined #nim |
11:28:14 | teapot | personally i don't think it's representative, all irc channels get heated now and then and tbh it's nothing to do with the language, just people being people |
11:29:34 | * | flaviu joined #nim |
11:31:13 | BlaXpirit | as much as I complain about Nim's module system, it's so impressive |
11:31:45 | BlaXpirit | just turned my library's structure inside out, but kept backwards compatibility |
11:31:48 | qwr | it's just different communication styles imho |
11:32:52 | BlaXpirit | you guys might wanna see how that conversation started |
11:35:10 | rinukkusu | the comment on stackoverflow got me here |
11:35:40 | rinukkusu | I know that irc communication and generally conversation on the internet differs from reall life |
11:37:36 | def- | rinukkusu: Hi. Usually the communication here is quite nice. That day was an exception, where it got really heated. |
11:38:58 | rinukkusu | no problem at all |
11:39:05 | def- | fowl: nice, can we copy the old one into it? https://en.wikipedia.org/wiki/Draft:Nim_(programming_language) |
11:39:11 | TEttinger | rinukkusu, yeah I came in #nim initially to prove to someone that the IRC channel probably wasn't crazy, and I got help on getting started in a complex setup very quickly from friendly, polite people |
11:39:14 | def- | (need to fix many links and stuff first) |
11:43:29 | teapot | yep I've always found this channel quick to help with my new-to-the-language problems. Often Araq has helped directly. |
11:43:36 | gokr | rinukkusu: Welcome. Yeah, I have been here daily since... october? But my perception is that the community is very friendly. |
11:44:28 | * | sepisoad joined #nim |
11:44:54 | sepisoad | is there a function to generate unique id (UID) in nim lang libraries |
11:45:44 | gokr | sepisoad: At the far bottom perhaps: http://nim-lang.org/lib.html |
11:45:46 | BlaXpirit | sepisoad, what I'd do in that case is search for "UID" at http://nim-lang.org/lib.html |
11:46:30 | gokr | Anyone who knows cgen inside and out? |
11:46:38 | BlaXpirit | looks like linux-only, that uuid thing |
11:47:37 | sepisoad | thanks @gokr & @BlaXpiri |
11:47:54 | qwr | some "oids" library is also there |
11:48:29 | qwr | http://nim-lang.org/oids.html |
11:48:44 | BlaXpirit | this looks more promising to me |
11:49:33 | BlaXpirit | it's based on C rand though :/ |
11:50:53 | gokr | I just looked at the Cog VM and there is a UUID plugin there with specific code for mac, win, unix - using OS facilities. One could port that over. |
11:51:32 | BlaXpirit | I, as usual, turn to Python |
11:51:45 | gokr | Yeah, Python probably has something very similar. |
11:52:43 | gokr | Ha... the win code uses ole2. Talk about memory lane... |
11:52:52 | * | reem joined #nim |
11:53:46 | BlaXpirit | Python's implementation is extremely convoluted |
11:54:20 | gokr | It doesn't use OS facilities or? |
11:54:43 | BlaXpirit | it uses a ton of things. |
11:55:29 | BlaXpirit | https://github.com/python/cpython/blob/master/Lib/uuid.py if anyone is interested |
11:55:37 | BlaXpirit | I don't think it's worth copying |
11:56:27 | gokr | I could port over the one from Cog perhaps. Its very small. |
11:57:11 | * | reem quit (Ping timeout: 246 seconds) |
11:57:41 | gokr | I gather noone here except Araq (who is out having fun) knows cgen much? I stumbled onto a... bug. |
11:58:42 | * | untitaker joined #nim |
12:00:03 | * | jferg2010 joined #nim |
12:02:00 | * | reem joined #nim |
12:02:29 | Triplefox | There is a uuid generator in three.js, i didn't think i would have to port it but it's just a single function |
12:02:53 | * | reem quit (Remote host closed the connection) |
12:06:08 | * | HakanD____ quit (Quit: Be back later ...) |
12:07:54 | Triplefox | Also thinking this might be good to bind, or even port the minimal version http://www.pcg-random.org/ |
12:08:26 | BlaXpirit | Triplefox, have you worked with that library? |
12:08:34 | BlaXpirit | is there any confirmation that it's good? |
12:08:56 | * | antrix joined #nim |
12:09:24 | Triplefox | There is more than one version of the library, and it's been around a little while. Maybe not good if you are leaning conservative |
12:09:47 | Triplefox | I haven't tried it myself yet but I've kept getting pointed towards it |
12:09:51 | BlaXpirit | it could be backdoored, who knows |
12:10:34 | Triplefox | It's not for secure numbers |
12:11:29 | BlaXpirit | then what's the problem with just using mersenne twister? |
12:11:34 | * | Gnist joined #nim |
12:12:00 | Triplefox | The minimal implementation is smaller than mersenne twister |
12:12:27 | BlaXpirit | that's not even an argument |
12:12:46 | * | sillesta joined #nim |
12:12:49 | * | teapot quit (Ping timeout: 246 seconds) |
12:13:00 | Triplefox | You're acting like this is important to you what random numbers people generate |
12:13:25 | BlaXpirit | I have raised concerns over this topic more than once, yes |
12:14:07 | Triplefox | You could implement what you want then, i want this one for myself |
12:14:18 | BlaXpirit | I have implemented |
12:16:12 | BlaXpirit | and it looks like Apache license will not allow me to use PCG generator in my library https://github.com/BlaXpirit/nim-random |
12:16:19 | * | OnwardEuler quit (Quit: Leaving) |
12:19:12 | * | Gnist quit (Quit: Leaving) |
12:20:24 | * | antrix quit (Quit: Leaving) |
12:21:22 | BlaXpirit | I have no idea how that would affect it. Apache license may be undesired. |
12:25:20 | * | Gnist joined #nim |
12:31:00 | Triplefox | Looks like it is only an issue with gpl1 and 2 |
12:31:47 | Triplefox | Although dual licenses would be annoying |
12:32:14 | BlaXpirit | I don't think there is a way to add this without changing the license of my project |
12:32:28 | * | kapil___ quit (Quit: Connection closed for inactivity) |
12:32:43 | BlaXpirit | flaviu, maybe you have something to say. You have pointed me at PCG generators before, and I was about to add it, but ^ |
12:33:25 | * | jferg2010 quit (Quit: Leaving) |
12:33:25 | * | teapot joined #nim |
12:33:51 | BlaXpirit | Xorshift, on the other hand, is in public domain, so just tell me which one(s) exactly should be added |
12:34:03 | def- | BlaXpirit: I think PCG would be nice to have |
12:34:06 | * | bjz quit (Ping timeout: 250 seconds) |
12:34:13 | * | teapot quit (Client Quit) |
12:34:24 | BlaXpirit | ... |
12:34:26 | Triplefox | Also, derivative work may be relicensed so a native port will be fine |
12:34:33 | * | tapot joined #nim |
12:34:49 | BlaXpirit | where did you find that? -_- |
12:34:57 | Triplefox | Wiki |
12:35:08 | * | bjz joined #nim |
12:35:30 | BlaXpirit | hm |
12:35:53 | * | antrix joined #nim |
12:37:46 | * | flaviu quit (Ping timeout: 252 seconds) |
12:39:55 | * | flaviu joined #nim |
12:40:05 | flaviu | Sorry about that, my power went out. |
12:40:31 | flaviu | How about sending an email to Prof O'Neill? It's worth a try at least. |
12:40:46 | BlaXpirit | wiki might be lying though |
12:40:59 | BlaXpirit | I don't see anything about "derivative work may be relicensed" |
12:42:24 | flaviu | BlaXpirit: Section 9. |
12:42:55 | BlaXpirit | oh and 4 after the abcd list |
12:43:19 | BlaXpirit | mm not really... |
12:44:06 | BlaXpirit | flaviu, section 9 says about money |
12:47:34 | Triplefox | Oh well, I'm going to sleep now... have fun, don't stress too much just cause I raised the issue |
12:47:46 | * | rapind joined #nim |
12:49:45 | TEttinger | BlaXpirit: check out the xorshift PRNG shootout http://xorshift.di.unimi.it/ |
12:49:51 | TEttinger | all of these are public domain |
12:50:02 | TEttinger | well all that he implemented |
12:50:04 | BlaXpirit | [:33:50] <BlaXpirit> Xorshift, on the other hand, is in public domain, so just tell me which one(s) exactly should be added |
12:50:30 | TEttinger | a ha |
12:50:34 | TEttinger | I mussed that |
12:50:35 | TEttinger | http://xorshift.di.unimi.it/xorshift128plus.c |
12:50:44 | TEttinger | that's probably the best right now |
12:50:47 | flaviu | PCG has some really cool ideas behind it btw, and the paper is easily accessible (if long) |
12:52:14 | flaviu | Yes, Xorshift* is very near ideal: http://i.imgur.com/9pAZMKE.png |
12:53:07 | BlaXpirit | flaviu, you say Xorshift*, TEttinger sent a link to 128+ |
12:54:13 | flaviu | Ah, my bad. |
12:54:17 | TEttinger | yeah, on the shootout it talks about how xorshift+ combines properties of xorshift* with other things and it's a bit faster and has less flaws |
12:55:21 | flaviu | http://i.imgur.com/GdwPbHS.png |
12:56:53 | TEttinger | nice, how fast is pcg? |
12:57:56 | flaviu | http://i.imgur.com/Krh1ZFA.png |
12:59:03 | TEttinger | nice. |
12:59:08 | flaviu | I'm getting all this from the paper: http://www.pcg-random.org/pdf/toms-oneill-pcg-family-v1.02.pdf |
12:59:21 | TEttinger | ah ok |
12:59:40 | TEttinger | I'm curious about that apache license now |
12:59:48 | TEttinger | I thought it was GPL-compatible\ |
13:00:05 | BlaXpirit | we're talking about MIT |
13:00:10 | BlaXpirit | GPL is completely irrelevant here |
13:00:15 | TEttinger | oh, ok |
13:00:16 | * | kapil___ joined #nim |
13:00:23 | * | Jehan_ joined #nim |
13:00:34 | BlaXpirit | this might be off-topic, dunno |
13:01:25 | flaviu | good idea. |
13:02:40 | BlaXpirit | oh hi, Jehan_. I finally gave http://forum.nim-lang.org/t/533/1#2886 a serious look, and yes, this is definitely worth implementing. the problem is providing a generic API for different RNGs |
13:04:23 | Jehan_ | BlaXpirit: Yeah, I can relate. :) |
13:04:51 | BlaXpirit | may be worth changing the lowest common denominator from uint8 to uint32 |
13:05:40 | BlaXpirit | but then again, there is at least one RNG that just provides bytes |
13:07:11 | flaviu | BlaXpirit: Which one? |
13:07:24 | BlaXpirit | SystemRandom/urandom/CryptGenRandom |
13:07:46 | flaviu | Concatenate the bytes together. |
13:08:41 | * | JinShil joined #nim |
13:08:58 | BlaXpirit | then it's gonna be a waste |
13:09:28 | flaviu | Who cares? If performance matters, people should use a fast PRNG |
13:10:05 | flaviu | That's a bit harsh, sorry. |
13:10:10 | BlaXpirit | I'm talking more about a waste of system's entropy |
13:10:45 | * | HakanD____ joined #nim |
13:12:23 | flaviu | Well, if you're just throwing away the bytes, entropy isn't used. The system's counter will think it's been used, but there are lots of other sources of error in that counter. |
13:12:34 | flaviu | And /dev/urandom won't ever block, so it's not a problem. |
13:13:24 | * | rapind quit (Remote host closed the connection) |
13:14:14 | BlaXpirit | I wish there were some kind of conditionals on whether a function exists or not |
13:14:33 | flaviu | when compiles(...): ... |
13:14:57 | BlaXpirit | flaviu, wait a second... I just realized that this actually may work in generics |
13:15:15 | BlaXpirit | gotta check this out |
13:16:10 | * | TEttinger quit (Ping timeout: 255 seconds) |
13:16:49 | BlaXpirit | omg it totally does work |
13:17:10 | BlaXpirit | https://bpaste.net/show/5f2866e08996 |
13:17:54 | BlaXpirit | welp, I will go and rework the library now :| |
13:19:33 | * | reem joined #nim |
13:19:33 | * | reem quit (Remote host closed the connection) |
13:21:44 | * | tapot quit (Quit: Page closed) |
13:22:55 | * | teapot joined #nim |
13:23:01 | * | teapot left #nim (#nim) |
13:30:39 | * | untitaker quit (Ping timeout: 245 seconds) |
13:30:45 | * | HakanD_____ joined #nim |
13:31:06 | * | banister joined #nim |
13:31:55 | * | HakanD____ quit (Ping timeout: 255 seconds) |
13:35:05 | gokr | BlaXpirit: That's pretty slick :) |
13:35:36 | gokr | Lots of non Nimmers' eyes would roll back into the head though ;) |
13:35:52 | BlaXpirit | but this is exactly what I need |
13:36:17 | BlaXpirit | RNGs may provide any or all of randomByte, randomUint32, randomUint64 |
13:37:23 | gokr | Just got another Urhonim example going - after hacking cgen.nim ;) |
13:37:50 | * | untitaker joined #nim |
13:39:12 | * | HakanD______ joined #nim |
13:40:52 | * | antrix quit (Quit: Leaving) |
13:42:52 | * | HakanD_____ quit (Ping timeout: 240 seconds) |
13:44:24 | * | HakanD______ quit (Ping timeout: 245 seconds) |
13:45:12 | * | teapot1 joined #nim |
13:49:41 | * | Gnist left #nim ("Leaving") |
13:50:53 | * | sepisoad2 joined #nim |
13:52:01 | teapot1 | does anyone know if there are any plans to have features for safe sharing of memory between threads in nim? |
13:53:03 | * | kuzy000_ quit (Ping timeout: 265 seconds) |
13:53:15 | * | kuzy000 joined #nim |
13:53:28 | * | sepisoad quit (Quit: Leaving) |
13:53:33 | * | HakanD______ joined #nim |
13:53:48 | sepisoad2 | sepisoad |
13:58:23 | * | sepisoad2 quit (Read error: Connection reset by peer) |
14:01:33 | * | BlaXpirit_ joined #nim |
14:03:59 | * | BlaXpirit quit (Ping timeout: 245 seconds) |
14:05:41 | * | rapind joined #nim |
14:10:43 | * | gsingh93 joined #nim |
14:16:12 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:20:23 | * | reem joined #nim |
14:21:53 | * | jfchevrette joined #nim |
14:24:09 | * | Jehan_ quit (Quit: Leaving) |
14:25:02 | * | reem quit (Ping timeout: 250 seconds) |
14:32:56 | * | banister joined #nim |
14:40:33 | * | HakanD______ quit (Quit: Be back later ...) |
14:45:21 | * | wb joined #nim |
14:49:45 | ekarlso | if anyone is interested I got a vagrantfile that brings up fedora 21 with nim-vm and latest nim + nimble |
14:49:52 | ekarlso | fun for dev stuffs |
14:51:41 | jfchevrette | interesting. why not put it up on github and share the link? |
14:51:51 | jfchevrette | i'm interested :) |
15:01:32 | * | HakanD______ joined #nim |
15:09:19 | * | saml joined #nim |
15:11:30 | * | rapind quit (Remote host closed the connection) |
15:20:52 | * | JinShil quit (Quit: Konversation terminated!) |
15:26:01 | * | jholland joined #nim |
15:32:31 | * | saml quit (Quit: Leaving) |
15:38:46 | * | saml joined #nim |
15:39:26 | * | banister is now known as banisterfiend |
15:40:11 | shevy | ekarlso up with the link! |
15:41:13 | * | dumdum quit (Ping timeout: 256 seconds) |
15:45:40 | * | HakanD______ quit (Quit: Be back later ...) |
15:48:36 | * | rapind joined #nim |
15:55:46 | * | jfchevre_ joined #nim |
15:56:10 | * | jfchevrette quit (Ping timeout: 244 seconds) |
15:57:44 | * | kjo1 joined #nim |
15:58:19 | BlaXpirit_ | flaviu, I'm pretty sure this is wrong https://github.com/flaviut/furry-happiness/blob/master/rand.nim#L25 |
15:58:56 | BlaXpirit_ | first of all, the conversion won't work if the number has a sign. second, it just truncates one bit regardless of sign |
16:00:22 | * | skroll3 quit (Ping timeout: 240 seconds) |
16:02:10 | * | skroll3 joined #nim |
16:04:11 | * | jfchevrette joined #nim |
16:05:06 | * | ChrisMAN joined #nim |
16:06:07 | * | nickles joined #nim |
16:07:32 | * | jfchevre_ quit (Ping timeout: 264 seconds) |
16:07:52 | * | nickles quit (Client Quit) |
16:10:42 | flaviu | BlaXpirit_: Well, it does work :P |
16:10:43 | * | Ven joined #nim |
16:10:54 | Ven | !kirbyrape |
16:11:05 | Ven | I'm sorry, I had to try. |
16:11:31 | * | kuzy000 quit (Read error: Connection reset by peer) |
16:12:50 | * | kuzy000 joined #nim |
16:13:25 | federico3 | ekarlso: nim-vm? |
16:13:32 | flaviu | Or maybe it doesn't, investigating further. |
16:15:53 | reactormonk | How do I properly benchmark stuff? as in, circumvent dead code elimiation etc.? |
16:16:48 | flaviu | reactormonk: Typically, you set up an accumulator and do something non-optimizable with it like write it to stdout. |
16:17:17 | reactormonk | flaviu, yeah, but the problem with that it spends a non-trivial amount of time accumulating the results |
16:17:34 | reactormonk | e.g. converting to string. |
16:18:36 | flaviu | try grabbing the nth character of the string and adding it then. |
16:18:54 | reactormonk | nice idea |
16:20:14 | * | panzone joined #nim |
16:24:19 | * | panzone_ joined #nim |
16:25:19 | * | lavender joined #nim |
16:26:17 | * | banisterfiend quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:27:43 | * | panzone quit (Ping timeout: 265 seconds) |
16:29:26 | reactormonk | flaviu, meh, can't reproduce the differences :-/ |
16:30:58 | * | TEttinger joined #nim |
16:33:28 | * | panzone joined #nim |
16:35:17 | * | panzone quit (Client Quit) |
16:35:20 | * | Woflox joined #nim |
16:35:31 | * | gsingh93 quit (Quit: Connection closed for inactivity) |
16:35:44 | * | panzone_ quit (Ping timeout: 252 seconds) |
16:44:31 | * | irrequietus joined #nim |
16:45:08 | reactormonk | Araq, btw, any plans to move nim from Araq to nim-lang? |
16:47:35 | * | irrequietus quit (Client Quit) |
16:47:51 | * | HakanD______ joined #nim |
16:48:33 | ekarlso | federico3: nim version manager |
16:50:03 | TEttinger | but I like having a benevolent dictator for life |
16:53:30 | * | darkf quit (Quit: Leaving) |
16:54:25 | * | Jehan_ joined #nim |
16:55:15 | * | dumdum joined #nim |
16:57:01 | * | banister joined #nim |
17:06:38 | * | vbtt joined #nim |
17:07:44 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:09:37 | * | dhasenan_ joined #nim |
17:11:45 | vbtt | hello |
17:12:48 | * | davidhq joined #nim |
17:13:20 | def- | hi vbtt |
17:15:09 | vbtt | pretty nice to see nim get good publicity in the last few months |
17:15:34 | vbtt | official support for araq is awesome |
17:16:08 | vbtt | although I don't care for c++, hopefully nim compiler issues will get fixed soonish now. |
17:17:27 | reactormonk | vbtt, been coding anything in nim? |
17:17:32 | Jehan_ | vbtt: The importance of C++ support is to achieve a critical mass for external library support. Which is important for a lot of people. |
17:17:54 | Jehan_ | It doesn't matter much to me, but that's because my work doesn't depend much on external libraries. |
17:18:09 | vbtt | Jehan_:I understand, I'm not against c++ support. doesn't excite me, that's all. |
17:18:37 | vbtt | reactormonk:not much really |
17:18:38 | * | Matthias247 joined #nim |
17:19:07 | vbtt | i wrote a blog about generics last year. |
17:19:09 | Jehan_ | vbtt: As I said, it's not terribly important for me, but it makes Nim more viable for a number of people, which increases its userbase, which ultimately is good for Nim development. |
17:19:15 | vbtt | time to write another one about nim i think. |
17:19:23 | vbtt | Jehan_:agree |
17:19:28 | * | rapind quit (Remote host closed the connection) |
17:19:59 | reactormonk | vbtt, I can help, toss me something |
17:20:22 | vbtt | reactormonk:help with what? |
17:21:02 | reactormonk | vbtt, read-check etc. What do you want to write about? |
17:21:28 | vbtt | reactormonk:ah thanks. |
17:21:36 | vbtt | haven't decided yet. kinda short on time. |
17:22:05 | vbtt | i like server type code. |
17:22:23 | vbtt | maybe something about the concurrency models and async stuff. |
17:24:17 | vbtt | have to write more code in it first |
17:25:21 | * | rapind joined #nim |
17:26:21 | vbtt | btw, is there an stm library for nim? |
17:28:27 | reactormonk | What's stm? |
17:28:41 | Jehan_ | software transactional memory. |
17:28:43 | vbtt | software transactional memory. |
17:28:47 | Jehan_ | And not that I know of. |
17:29:00 | vbtt | so since heaps are isolated in nim, stm may be one good way to share data. |
17:29:13 | * | teapot1 quit (Ping timeout: 246 seconds) |
17:29:26 | Jehan_ | Yeah, but … really hard to do without a GC for shared heaps. |
17:29:48 | Jehan_ | There are also easier ways to do shared memory that don't involve STM. |
17:30:22 | vbtt | such as? |
17:30:35 | Jehan_ | Also, transactional memory is still at the point where its performance is essentially too poor for practical purposes without hardware support. |
17:30:47 | vbtt | depends on what you use it for |
17:30:48 | Jehan_ | Simple shared heaps that can be read-/write-locked. |
17:32:03 | Jehan_ | vbtt: Well, pretty much anything? The problem is that the constant overhead for transactional reads/writes is so big that it tends to kill a lot of the gains you get from parallelization. |
17:32:35 | Jehan_ | Furthermore, outside of specific data structures, there are easier approaches to get fine-grained parallelism working. |
17:32:49 | vbtt | Jehan_:depends on the implementation no? you could have read optimized stm, based on mvcc for e.g. |
17:33:09 | vbtt | it's mostly the writes that would be the problem |
17:33:23 | vbtt | anyway, does nim have shared heaps that can read/write locked? |
17:33:38 | Jehan_ | vbtt: Of course it depends on the implementation, but I don't know of any that's both reasonably general and fixes the performance issues. |
17:34:43 | Jehan_ | vbtt: No, but I've been advocating for it. |
17:35:12 | Jehan_ | It's low-hanging fruit that would fit in nicely with the existing thread-local heaps. |
17:35:41 | vbtt | so these shared heaps would also be isolated? i.e. could objects in the shared heap point to other heaps? |
17:37:38 | Jehan_ | vbtt: They'd be isolated. The point would be to have shared access to large data structures that you wouldn't have to move between threads. |
17:38:14 | vbtt | right, that would work too |
17:38:14 | Jehan_ | Simple example: A large shared hashtable. |
17:38:38 | Jehan_ | You'd still have to copy keys and values from the thread-local heap to the shared heap, but wouldn't have to move the entire table. |
17:38:53 | vbtt | i was thinking an stm that is isolated too. |
17:39:04 | Jehan_ | Ah, gotcha. |
17:39:13 | vbtt | so,e g, use a cow btree for a hashtable |
17:39:34 | vbtt | then you have multiple parallel reads but single writer |
17:39:44 | Jehan_ | But yeah, that would be tricky with GC again. |
17:39:48 | vbtt | very useful for caching type data that is common |
17:39:53 | vbtt | there would be no gc |
17:39:59 | vbtt | you'd have to remove the values yourself. |
17:40:00 | Jehan_ | If you have one read/writelock per shared heap, GC works fine. |
17:40:17 | Jehan_ | Since read access can't mutate the heap and with write access you have exclusive access and can GC at will. |
17:40:38 | vbtt | so all readers are locked out while the gc runs? |
17:41:03 | Jehan_ | vbtt: Yup. Remember, though, that Nim's GC is soft RT. |
17:41:33 | Jehan_ | And you actually have a lot of control over pause times. |
17:41:44 | vbtt | i see |
17:42:19 | Jehan_ | This is why I said that it's low-hanging fruit that fits the existing GC model pretty well. |
17:42:33 | vbtt | yeah that would be pretty useful |
17:42:43 | Jehan_ | It's not perfect, but it doesn't require a huge time investment, either. |
17:44:27 | vbtt | Jehan_:is it on the gsoc list? |
17:45:30 | vbtt | btw, is there is a way to deep copy an object in nim? |
17:45:32 | Jehan_ | vbtt: The GSOC proposal is more ambitious. What I've been suggesting would be a bit too simple for GSOC. |
17:46:02 | Jehan_ | vbtt: Yes, but I don't recall how you use it explicitly. It's used under the hood by spawn, I know that. |
17:47:04 | vbtt | also, is trunk stable enough mostly or should i use a published release? |
17:48:00 | * | rapind quit (Remote host closed the connection) |
17:48:55 | * | Ven quit (Remote host closed the connection) |
17:50:49 | reactormonk | vbtt, trunk is good |
17:52:11 | * | gsingh93 joined #nim |
17:54:55 | * | rapind joined #nim |
18:04:20 | * | banister joined #nim |
18:13:33 | * | lavender quit (Ping timeout: 250 seconds) |
18:17:00 | * | kjo1 left #nim (#nim) |
18:38:10 | * | UberLambda joined #nim |
18:40:32 | gokr | Araq: Here? Or still drinking champagne? |
18:43:33 | * | HakanD______ quit (Ping timeout: 264 seconds) |
18:44:10 | * | HakanD______ joined #nim |
18:57:34 | gmpreussner|work | is anyone using nim @ head on Windows today? |
18:57:56 | gmpreussner|work | i'm getting some odd segfaults at run-time in compiled programs. not sure what's going on. |
18:58:12 | gmpreussner|work | like local variable declarations can crash :/ |
18:58:20 | * | singularity joined #nim |
18:58:35 | * | singularity is now known as singul42 |
18:58:43 | singul42 | hi there |
19:00:01 | singul42 | I have just installed nimble and trying to install jester, but I get the following error: |
19:00:06 | singul42 | Error: unhandled exception: Unable to query remote tags for git://github.com/dom96/jester/. Git returned: fatal: write error: Invalid argument [OSError] |
19:00:25 | def- | singul42: hi. do you have git installed? |
19:00:46 | singul42 | yes, used a windows installer for it and it is also in the path |
19:01:28 | def- | On Linux it works for me |
19:01:43 | singul42 | using "git" on the command line just gives me the git help |
19:03:07 | def- | as a workaround you can "git clone git://github.com/dom96/jester/" and run "nimble install" in the jester directory |
19:03:14 | def- | i don't know what causes the error |
19:06:55 | BlaXpirit_ | Nim in Wine was such a great idea |
19:07:21 | BlaXpirit_ | it allows me to test for: Windows, Nim 0.10.2, sizeof(int)==4 all at once |
19:07:37 | dom96 | singul42: report this as a bug on Nimble's repo please |
19:09:38 | dom96 | singul42: What happens when you execute: `git ls-remote --tags git://github.com/dom96/jester/` ? |
19:09:47 | * | dhasenan_ left #nim (#nim) |
19:10:29 | singul42 | will try it in a second. just tried to clone it and also got an error. looks like git has problems on my machine with the git:// protocol |
19:10:50 | singul42 | when using http:// I am able to clone jester |
19:11:37 | def- | that's an issue we've had a few times. sometimes we use git://, sometimes https://. should always be the same (probably https?) |
19:12:00 | singul42 | using git ls-remote.... I get the error "fatal: write error: Invalid argument" |
19:12:23 | singul42 | that's the same error I also get when trying to clone with git:// |
19:13:03 | BlaXpirit_ | looks like it's time to search for this particular problem |
19:13:13 | BlaXpirit_ | this is not necessarily related to nimble |
19:13:49 | flaviu | Maybe it's related to corporate proxies? |
19:14:22 | singul42 | at least I have no proxies running |
19:14:29 | dom96 | Perhaps the ports which the git protocol uses is blocked? |
19:14:32 | singul42 | also swicthed my firewall off for testing |
19:15:40 | singul42 | well, I didn't restart windows after installing git .... hope that's not the problem |
19:17:39 | * | alexruf joined #nim |
19:22:36 | BlaXpirit_ | made some changes to random library, if someone is interested https://github.com/BlaXpirit/nim-random/compare/602467577653aa5770208f49c98119903316bc96...master |
19:24:06 | BlaXpirit_ | im away for now though |
19:24:48 | * | dom96 restored the draft of the Nim wikipedia article on https://en.wikipedia.org/wiki/Nim_%28programming_language%29 |
19:27:17 | flaviu | BlaXpirit_: Added some comments on the commits |
19:30:46 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:31:10 | BlaXpirit_ | mostly unimportant things |
19:32:03 | ldlework | dom96: +1 |
19:33:03 | flaviu | BlaXpirit_: Only the gitignore thing is unimportant IMO |
19:33:50 | ldlework | dom96: "Nim however differs greatly when it comes to semantics: for a start Nimr is statically typed." |
19:34:19 | dom96 | ldlework: please fix it, I need to head out now. |
19:35:15 | * | koz_ quit (Quit: Leaving) |
19:35:42 | def- | ldlework: I'm also fixing many references and renames from nimrod to nim |
19:35:53 | ldlework | Well I just submitted the fix. |
19:38:35 | * | brson joined #nim |
19:38:39 | * | dumdum quit (Ping timeout: 256 seconds) |
19:40:43 | BlaXpirit_ | flaviu, what's wrong with that cast? |
19:41:07 | flaviu | The cast is fine, the idea in general isn't. |
19:41:26 | BlaXpirit_ | which idea |
19:41:43 | flaviu | Of falling back to seeding with the time if urandom is unusuable. |
19:42:17 | * | fizzbooze joined #nim |
19:42:27 | * | UberLambda quit (Quit: Leaving the Matrix) |
19:43:17 | * | alexruf quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
19:43:45 | BlaXpirit_ | what then |
19:44:25 | * | alexruf joined #nim |
19:45:25 | flaviu | If an attacker can cause that fallback to occur, you're pwned. |
19:46:01 | BlaXpirit_ | people dont need to rely on that seed |
19:47:17 | * | singul42 quit (Quit: Page closed) |
19:48:42 | flaviu | But they will. It's the easiest way after all, and most people won't process the possible implications (or even be able to think of them!). |
19:49:15 | BlaXpirit_ | I don't see how urandom can be unusable |
19:49:51 | flaviu | File descriptor exhaustion is one thing that comes off the top of my head. |
19:50:50 | flaviu | Or what about a chroot where no one has bothered to add /dev/urandom. |
19:54:49 | * | johnsoft quit (Ping timeout: 245 seconds) |
19:55:30 | * | johnsoft joined #nim |
19:55:40 | * | kuzy000 quit (Ping timeout: 250 seconds) |
19:56:20 | * | kuzy000 joined #nim |
20:03:45 | * | vendethiel joined #nim |
20:06:32 | * | dhasenan_ joined #nim |
20:06:47 | * | singul42 joined #nim |
20:06:55 | singul42 | re |
20:07:49 | singul42 | still having the problem with git:// protocol under windows, but as a workaround git config --global url."https://".insteadOf git:// helps |
20:08:19 | singul42 | thanks for the help, hints and tips |
20:11:22 | TEttinger | singul42: woah that should help me too |
20:11:25 | TEttinger | thanks singul42 |
20:13:50 | singul42 | oh, I thought I am the only one on earth with the "fatal: write error: invalid argument" error when using nimble :-) |
20:15:37 | * | Mat4 joined #nim |
20:15:41 | Mat4 | hello |
20:18:10 | singul42 | hi Mat4 |
20:18:26 | Mat4 | hi singul42 |
20:21:29 | * | Hakaslak joined #nim |
20:26:48 | * | Hakaslak quit (Ping timeout: 246 seconds) |
20:30:48 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:32:37 | ekarlso | https://github.com/ekarlso/nim-vm < cd vagrant; vagrant up < voila wokring rust devel |
20:32:56 | def- | rust devel? |
20:33:04 | ekarlso | ehm, nim devel |
20:33:06 | ekarlso | haha |
20:33:08 | ekarlso | :P |
20:33:10 | ekarlso | dunno where rust came into it |
20:35:30 | Mat4 | from rust to dust |
20:36:10 | shevy | to lust |
20:36:44 | ekarlso | should it install nimble as well ? |
20:41:51 | vbtt | yes |
20:47:47 | * | UberLambda joined #nim |
20:51:36 | ekarlso | :p |
20:56:42 | * | HakanD______ quit (Quit: Be back later ...) |
21:02:03 | singul42 | is there a nim library that offers high level procs to show a notification icon in windows' notification area? maybe also with some popup-menu functionality? |
21:02:31 | * | Jehan_ quit (Quit: Leaving) |
21:03:56 | BlaXpirit_ | gtk? |
21:04:04 | BlaXpirit_ | no idea |
21:04:20 | BlaXpirit_ | Qt is my answer to everything, but it is not available for nim |
21:04:52 | flaviu | this is weird. If I replace one bit of code with another, it's 10x slower than the initial code. If I mark everything as inline, it's 2x faster than the initial code. |
21:07:11 | def- | flaviu: code pleae |
21:07:22 | singul42 | well, looks like I have to dig into win32 api |
21:07:28 | def- | if it's short enough |
21:08:37 | * | TEttinger quit (Ping timeout: 250 seconds) |
21:09:09 | * | filwit joined #nim |
21:09:15 | flaviu | def-: I'm not really asking for help, but ok: https://github.com/flaviut/nim-random/compare/BlaXpirit:master...master |
21:09:31 | def- | flaviu: i'm just curious |
21:11:34 | * | nimthusiast joined #nim |
21:14:54 | * | alexruf quit (Quit: Textual IRC Client: www.textualapp.com) |
21:16:12 | filwit | BlaXpirit_: was reading logs, and noticed your pastbin, just wanted to point out a couple of alternatives in case you weren't aware of them: https://gist.github.com/PhilipWitte/a9ecf4d36b109ee179b7 |
21:17:51 | BlaXpirit_ | that's no good |
21:18:31 | filwit | I'm not sure of your use case. I just wanted to put it out there in-case you didn't know you could do those things. |
21:19:37 | filwit | why do I add a hyphen in the word "in-case"... silly brain... |
21:20:51 | filwit | BlaXpirit_: that said, the second example is basically exactly what your code is doing, but I find it a bit cleaner (I always find `compiles()` a bit too "hacky") |
21:21:05 | BlaXpirit_ | but make it 4 classes |
21:21:11 | BlaXpirit_ | across different modules |
21:21:15 | BlaXpirit_ | it's oversimmplified |
21:22:05 | filwit | i'm not sure what you mean by "it makes 4 classes", sorry. Maybe I missed something in your original post. |
21:22:35 | BlaXpirit_ | i mean do the same thing with 4 classes across different modules |
21:24:07 | filwit | that shouldn't be a problem. type classes apply to any other type (they're basically a way of wrapping up the `compiles()` statement into a clean package which only gets invoked once per unique-type) |
21:24:27 | filwit | but again, i don't know your use case |
21:24:49 | filwit | so i'm only showing you in case you didn't know about them |
21:25:44 | filwit | (ah, i think you're referring to the top example... yes that wouldn't work with 4 classes across modules, but the bottom example would) |
21:28:13 | * | Mat4 quit (Remote host closed the connection) |
21:30:30 | filwit | very cool to see the Nim wikipage back up! |
21:30:55 | filwit | guess the recent traction Nim has been getting did the trick :) |
21:31:03 | BlaXpirit_ | ah i understand how your stuff works... yes, it'spretty much the same except you need to bother with typeclasses |
21:31:03 | gokr | 131 users? yowza |
21:31:36 | Varriount | This comment might be interesting to those who wonder why Nim can't seem to get a Wikipedia article: https://news.ycombinator.com/item?id=9063800 |
21:31:54 | Varriount | (or wasn't able to) |
21:32:13 | flaviu | filwit: I think it's up because they haven't noticed yet ;) |
21:32:14 | filwit | BlaXpirit_: yes, for a simple example the type-class might be overkill.. but type-classes can package a ton more than just checking for a single procedure (they can test anything), so it's very useful for this sort of thing. |
21:33:31 | flaviu | And don't typeclasses get lowered down to a series of when compiles(foo)? |
21:36:23 | * | singul42 quit (Quit: Page closed) |
21:36:47 | filwit | flaviu: that's my understanding, yes. But they clean up the code when you need to check multiple interfaces in multiple areas around your code. If you have an `Visual` type-class witch a few proc requirements (predraw, postdraw, draw, etc) and you need to work with "Visuals" in multiple places throughout your rendering pipeline, type-classes obviously make much more sense than doing `compiles(predraw(x)) and ...` all over the place |
21:37:05 | filwit | with** a few... |
21:37:33 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:37:53 | flaviu | Yep, 20 lines once is better than 20 lines 20 times, especially for more complicated type classes |
21:38:28 | filwit | yep |
21:39:24 | filwit | https://www.youtube.com/watch?v=22-HSjMS3Ks |
21:39:42 | filwit | whoops... wrong video, sorry (nevermind that) |
21:40:25 | flaviu | haha |
21:45:03 | gokr | Tidbit: Just got a new demo running in Urhonimo (but it takes a hack in nim compiler) that is a stress test. It indicates that the Nim version is basically same speed as the C++ version. |
21:45:04 | * | nimthusiast quit (Ping timeout: 246 seconds) |
21:46:29 | * | reem joined #nim |
21:46:38 | filwit | I remember Araq (or someone) talking about using the Ref-Count GC as a leak-detector for non-GC'd Nim code before, but I forgot exactly how to do it (or what was possible).. Reading the recent discussion on the forums makes me think this would be a good thing to know (in order to help those who want to use Nim without a GC). Does anyone know more about this? |
21:47:28 | * | Jehan_ joined #nim |
21:48:18 | filwit | hey Jehan_, was just wanting to ask you about something (hopefully you know).. let me quote what I just said.. |
21:48:24 | filwit | I remember Araq (or someone) talking about using the Ref-Count GC as a leak-detector for non-GC'd Nim code before, but I forgot exactly how to do it (or what was possible).. Reading the recent discussion on the forums makes me think this would be a good thing to know (in order to help those who want to use Nim without a GC). Does anyone know more about this? |
21:48:47 | filwit | Jehan_: Do you have any idea on how to use the GC in this way? |
21:49:02 | * | Boscop__ quit (Ping timeout: 245 seconds) |
21:49:03 | * | Woflox quit (Ping timeout: 244 seconds) |
21:49:51 | Jehan_ | filwit: Not in the sense that I know how to actually implement it as part of the current codebase, but the idea is that a GC will detect unreachable objects. If that happens during manual memory management, that object is a leak. |
21:50:02 | Jehan_ | The Boehm GC has explicit support for that, too. |
21:50:33 | Jehan_ | That said, I'm not sure if the people who want a GC-less version of Nim know what they're in for. |
21:51:04 | filwit | I agree, but it would be a nice thing to point them towards. |
21:51:22 | Jehan_ | Eh, that would only solve a fraction of their problems. |
21:51:43 | * | Boscop__ joined #nim |
21:52:17 | Jehan_ | And let's not even get into the hard real-time stuff. |
21:52:21 | filwit | well didlybom had a good point in that he did not know what parts of the stdlib he could use without the GC.. I remember hearing that you could use the GC to detect this, but didn't know exactly how to direct him to it (which is why I ask) |
21:52:41 | Jehan_ | At this point it may be easier to create a hard real-time GC or not do dynamic memory management at all. |
21:53:03 | Jehan_ | Very little, really. |
21:53:59 | Jehan_ | I mean, strings and seqs are the easy part, since they have copy semantics by default (like C++). |
21:54:51 | Jehan_ | Basically, if I tried, I'd simply not use any ref types at all and do it like ParaSail. |
21:55:08 | * | jsudlow quit (Quit: Leaving) |
21:55:30 | Jehan_ | Note that arguments and results are passed by reference by default even if not declared as var (unless they're very small). |
21:55:31 | * | reem quit (Remote host closed the connection) |
21:55:36 | Varriount | filwit: When the compiler has the GC switched off, it will warn when memory is being used that is ussually under GC control. |
21:55:51 | filwit | I imagine that would be best for embeded devices coding (areas you probably don't want the small overhead of the GC) |
21:56:01 | filwit | ^ (directed at Jehan) |
21:56:25 | filwit | Varriount: Okay awesome. So Nim basically does this out of the box. |
21:56:26 | filwit | nice |
21:56:56 | Jehan_ | Basically, what I'm saying is that you need to make do without GC, you probably want to make do without heap storage at all (or only under controlled circumstances). |
21:57:05 | filwit | hmm... I've tried with --gc:none before and didn't notice any messages though, maybe I wasn't looking hard enough.. |
21:57:39 | Varriount | filwit: Odd. They should be there. |
21:57:39 | Jehan_ | Nim is capable of working out of the box without ref types, which is the easiest way to get started. |
21:57:46 | * | davidhq joined #nim |
21:57:50 | filwit | Jehan_: yes i understood you, and I agree that's probably the best solution. |
21:57:51 | Jehan_ | You'd still have to deal with string/seq-resizing. |
21:58:33 | ekarlso | nimvm now handles multiple versions and allows you to "nim-vm use v0.10.2" |
21:58:44 | def- | filwit: definitely there: xy.nim(4, 3) Warning: 'add(s, i)' uses GC'ed memory [GcMem] |
21:58:46 | Jehan_ | I'd suggest to look at ParaSail and set Nim up to do it similarly. |
21:59:24 | filwit | Jehan_: that's an interesting idea actually... basically if you only used stack-allocation plus ptr types for referencing, you basically end up with something similar to Rust's memory management... |
21:59:35 | filwit | Jehan_: I feel like I'm really mistaken about that though... |
21:59:37 | Jehan_ | Does nim-vm work like rvm? I haven't looked at that. |
21:59:59 | ekarlso | Jehan_: kinda yeah ;) |
22:00:10 | filwit | def-, Varriount: Yes thanks. I wasn't really looking for the messages when I tried awhile ago (was benchmarking something).. so it was just me. |
22:00:19 | filwit | def-, Varriount: thanks for the heads up. |
22:00:21 | Jehan_ | filwit: ParaSail is sort of stack allocation + tree structures. |
22:00:42 | * | reem joined #nim |
22:00:43 | Jehan_ | ekarlso: Hmm, not so exciting, unless it manages to not pollute shell profile files as much as rvm does? |
22:00:52 | Jehan_ | I'm generally more of a fan of virtualenv. |
22:01:23 | Jehan_ | filwit: Which works mostly like unique_ptr, minus the need to actually have pointers in a lot of cases. |
22:02:35 | filwit | I've never really taken a look at Parasail, but I remember watching a talk about it's memory-safety with a GC awhile back (didn't understand most of it at the time) |
22:03:12 | filwit | but now that I think about it, basically stack-allocating everything (except for seq/strings) would mostly be memory-safe in Nim with a GC |
22:03:36 | filwit | I don't know what virtualenv is, and my understanding of unique_ptr is limited too |
22:03:55 | filwit | it's been awhile since I've worked with C++ code heavily |
22:04:08 | filwit | and I never really used those smart pointer types when I did |
22:04:13 | * | pafmaf__ quit (Quit: This computer has gone to sleep) |
22:04:26 | BlaXpirit_ | btw, when I did try to use typeclasses, the compiler failed big time |
22:04:39 | * | polde quit (Ping timeout: 272 seconds) |
22:04:51 | Jehan_ | filwit: virtualenv was "as opposed to rvm". :) |
22:04:52 | filwit | BlaXpirit_: do you have an example? |
22:04:56 | ldlework | typeclasses compile for me fine, but the compiler doesn't enforce them when used as generic constraints |
22:05:00 | Jehan_ | Two conversations at once, sorry. |
22:05:17 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:05:38 | BlaXpirit_ | filwit, quite likely that I don't |
22:05:55 | BlaXpirit_ | not anymore |
22:06:14 | filwit | BlaXpirit_: i mean can you post a simple example online (of what is failing for you) so that we can help fix the issue? |
22:06:44 | BlaXpirit_ | found it in logs, yay |
22:06:45 | filwit | the type-classes work fine in master and devel |
22:06:58 | ldlework | 'work fine' |
22:07:18 | BlaXpirit_ | https://bpaste.net/show/fddec6c851f2 on line 13 there are 2 generic arguments. if I make one of them normal, it works, just not with both |
22:07:24 | ldlework | filwit: they still don't work as constraints do they? |
22:07:34 | filwit | ldlework: yes my brain always types the wrong words that I'm thinking :S |
22:07:54 | ldlework | filwit: hehe |
22:08:13 | filwit | ldlework: if you mean `proc foo[T:MyTypeClass](x: T)` then yes, that works |
22:08:40 | filwit | BlaXpirit_: one sec, let me take a look |
22:09:25 | ekarlso | Jehan_: it just adds a single addition to PATH |
22:09:27 | ekarlso | nothing more |
22:10:03 | ldlework | filwit: as in it will only let me parameterize foo with a MyTypeClass? That's news to me. |
22:10:21 | ldlework | I'm pretty sure last time I checked user type-classes compiled but did not enforce against generics. |
22:10:23 | Jehan_ | ekarlso: Yeah, still not keen on that, I'm afraid. |
22:11:03 | ekarlso | Jehan_: how else would you solve it ? |
22:11:10 | Jehan_ | I mean, it's not as bad as rvm where I basically had to spend an hour ripping out everything it had put in there, but I still prefer it if my dot files are being left alone. |
22:11:20 | filwit | BlaXpirit_: to my knowledge you cannot use user-defined-TypeClasses like you're trying to (as regular type contstraints). Try: `proc draw*[D:Drawable](renderTarget: RenderTarget, obj: D)` |
22:11:22 | Jehan_ | ekarlso: As I said, I'd prefer a virtualenv-like approach. |
22:11:33 | BlaXpirit_ | filwit, maybe, maybe |
22:11:40 | ekarlso | Jehan_: hmmmms |
22:11:43 | BlaXpirit_ | but that... is not very useful |
22:12:00 | filwit | BlaXpirit_: I may be wrong about that, let me check. |
22:12:09 | Jehan_ | ekarlso: I mean, I'm not saying that it should be done this way. Just trying to explain my personal preferences. :) |
22:12:23 | BlaXpirit_ | filwit, Drawable works just fine if the RenderTarget argument is not there |
22:12:34 | BlaXpirit_ | RenderTarget works just fine if the Drawable is not there |
22:12:44 | BlaXpirit_ | the combination of them breaks things |
22:13:09 | Jehan_ | There used to be a problem with multiple generic arguments, that may be the same thing. |
22:13:21 | filwit | BlaXpirit_: your problem is with RenderTarget... define like this: type RenderTarget* = RenderTexture | RenderWindow |
22:13:22 | BlaXpirit_ | your line of code doesn't work either |
22:13:30 | filwit | notice i removed the 'or' |
22:13:39 | filwit | i think that's the problem at least, (didn't test) |
22:13:41 | BlaXpirit_ | doesn't help, filwit |
22:13:44 | filwit | crap |
22:13:55 | BlaXpirit_ | no change at all |
22:14:15 | filwit | one sec, let me try to compile this... |
22:17:03 | * | BlaXpirit joined #nim |
22:17:34 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
22:18:05 | * | kernasi joined #nim |
22:18:07 | kernasi | hola |
22:18:22 | filwit | BlaXpirit_: it looks like line 11 is causing the issue, but it's odd and I think it might be a bug |
22:19:20 | BlaXpirit | that's what everybody thought |
22:20:31 | filwit | BlaXpirit: actually I think it's because the semantics are wrong on that line (you can't pass 'RenderTarget' as a value to 'draw' cause it's a type not an instance) and just the error message is odd... one sec |
22:21:24 | ekarlso | Jehan_: how you think a venv approach could be done then ? |
22:21:36 | * | Cykacykacyka joined #nim |
22:22:00 | gokr | kernasi: welcome |
22:22:05 | Jehan_ | ekarlso: Umm, I haven't looked at it, but I think it may require changes to nimble at least. |
22:22:29 | ekarlso | Jehan_: what about nim compiler versions then ? |
22:22:30 | * | rapind quit (Remote host closed the connection) |
22:22:37 | Cykacykacyka | hello, I came across this language and it seems really great from what I've seen |
22:22:39 | * | rapind joined #nim |
22:22:40 | * | rapind quit (Remote host closed the connection) |
22:22:52 | Cykacykacyka | does the YCM plugin for vim support this language ? |
22:22:52 | ldlework | Cykacykacyka: welcome |
22:23:07 | Cykacykacyka | and what could be a good non trivial project to try the language out ? |
22:23:29 | Cykacykacyka | and will you ever try and write a llvm frontend compiler for it ? :D |
22:23:49 | def- | Cykacykacyka: All I know for vim is this: https://github.com/zah/nimrod.vim/ (a bit out of date i think) |
22:23:51 | Jehan_ | Different Nim versions can co-exist in different directories, the only issue there is the global config file. |
22:24:41 | def- | Cykacykacyka: someone was working on an llvm frontend, but it's been abandoned. you can compile through clang though, and that often gets nice speedups at compile and runtime |
22:26:12 | Cykacykacyka | yeah, but doesn't transpiling to c before bytecode mean that there are certain optimisations you simply can't do ? |
22:26:47 | def- | Cykacykacyka: a gameboy or nes emulator in Nim would be cool |
22:27:51 | Cykacykacyka | I haven't done any emulators yet, in fact, the only real life project I've made is an automisation framework for android in python, but hey, gameboy shouldn't be too hard, should it ? |
22:28:40 | BlaXpirit | nes emulator huh |
22:28:57 | BlaXpirit | isn't that too complicated |
22:29:01 | Cykacykacyka | and regarding the similarities to python, do you also do list comprehensions and the godly or operator in assignments ? |
22:29:07 | def- | at least those are fun projects i've been thinking about. |
22:29:10 | def- | BlaXpirit: he said non-trivial |
22:29:26 | BlaXpirit | Cykacykacyka, no |
22:30:01 | Cykacykacyka | BlaXpirit, although this is just speculation, I think that the cpu in the early gameboys are relatively well documented and are not brainwack craizy |
22:30:20 | def- | There seem to be quite good references on writing a gameboy emulator: https://github.com/mattrubin/Gambit |
22:30:53 | Cykacykacyka | and being a naive student with no understanding of anything, writing an emulator would give me good practical experience and force me to understand lower levels of hardware, shouldn't it ? |
22:31:08 | * | pregressive joined #nim |
22:31:31 | Araq | Cykacykacyka: the word "transpile" is verboten in this channel ... ;-) |
22:31:43 | def- | Welcome back, Araq |
22:31:48 | Cykacykacyka | Araq, noted. |
22:32:17 | Araq | (omg, seriously! if you don't know what you are talking about, stop acting like you do!) |
22:32:33 | def- | Araq: any plan to reupload the website soon? I like filwit's changes |
22:32:54 | Araq | that depends on dom96 |
22:32:57 | def- | ok |
22:33:00 | Araq | I have it ready |
22:33:06 | Araq | for upload |
22:33:45 | Cykacykacyka | well, then elaborate, are you not compiling nim code to c code to binary ? |
22:35:13 | def- | Cykacykacyka: YCM looks similar to the nimsuggest we have |
22:35:30 | def- | should see how to get it integrated into vim |
22:35:40 | filwit | Araq: could you help me figure out why this type-class code isn't working: https://gist.github.com/PhilipWitte/8935a52bcf945e7a878b ? |
22:36:07 | Jehan_ | Cykacykacyka: Transpiling generally means that the target language offers about the same level of abstraction as the source language and the translation process tries to preserve that; using C as a portable assembly language is not really the same thing. |
22:36:18 | Araq | filwit: no idea, sorry, I'm still busy getting static[T] into shape |
22:36:27 | filwit | Araq: np |
22:36:43 | filwit | I'm thinking it may be a bug in Type-classes anyways |
22:37:19 | Araq | but hey, at least I got their tests cleaned up |
22:38:36 | filwit | BlaXpirit: take a look at my gist: https://gist.github.com/PhilipWitte/8935a52bcf945e7a878b |
22:38:53 | filwit | BlaXpirit: it's not working, but the line i have commented out is along the lines of what you want to do |
22:38:54 | BlaXpirit | what am i supposed to see there |
22:38:56 | kernasi | how I can tell "nim" to use a different CC? in the output I see "CC" but setting CC doesn't have any effect; I'm used to this in C |
22:39:03 | kernasi | can I* |
22:39:04 | BlaXpirit | oh ok |
22:39:06 | kernasi | too much beer |
22:39:13 | filwit | BlaXpirit: i have `d is Sprite` just to make things compile |
22:39:26 | BlaXpirit | kernasi, --advanced shows some stuff |
22:39:31 | kernasi | I'm there :) |
22:39:38 | kernasi | but it still uses "gcc" |
22:39:52 | BlaXpirit | --gc:refc|v2|markAndSweep|boehm|none |
22:39:59 | * | UberLambda quit (Ping timeout: 256 seconds) |
22:40:04 | Jehan_ | kernasi: --cc:clang |
22:40:04 | BlaXpirit | oh damn |
22:40:07 | kernasi | oh |
22:40:15 | BlaXpirit | CC sorry, I confused with GC |
22:40:26 | filwit | dom96: 127, new record :) |
22:40:35 | Jehan_ | If you want to actually use a different version of gcc, that's slightly more complicated. |
22:40:49 | Jehan_ | Since you then will have to specify the path. |
22:40:51 | BlaXpirit | wasn't it just 128 cuz UberLambda left |
22:40:52 | kernasi | no, just a wrapper :) |
22:41:11 | * | Demos joined #nim |
22:41:12 | filwit | BlaXpirit: oh i missed that, you're right |
22:41:18 | filwit | nevermind... 128 again! |
22:41:22 | BlaXpirit | :> |
22:43:27 | * | grumbly joined #nim |
22:43:52 | BlaXpirit | :> |
22:44:45 | grumbly | Does anyone have experience making nim use tinycc? |
22:44:45 | kernasi | I was actually looking for --passL:"-static" as I already replaced my libc :) thanks guys |
22:44:59 | gokr | kernasi: Bottom: http://nim-lang.org/question.html |
22:45:09 | kernasi | I wanted to replace $CC because I have a wrapper I use in C ("musl-gcc") |
22:45:12 | kernasi | but that it works as well |
22:45:26 | * | JinShil joined #nim |
22:45:33 | gokr | filwit: We were at 130 earlier |
22:45:36 | gokr | ;) |
22:45:46 | def- | grumbly: yep, works perfectly, just need --cc:tcc |
22:45:54 | kernasi | gokr, nice, I change it in the config, perfect :) |
22:46:06 | kernasi | ya, sorry, I just downloaded nim and wanted to play around with it :) |
22:46:47 | def- | kernasi: --gcc.exe:musl-gcc should work |
22:46:56 | filwit | gokr: we're at that now too! quick, invite your friends! |
22:47:04 | grumbly | So I thought (--cc:tcc) however I get an error 'crt1.o not found' and 'crti.o not found' |
22:47:13 | filwit | :P |
22:47:17 | def- | filwit: https://gist.github.com/dom96/da2d4dead6fb00b71312 |
22:47:23 | grumbly | I get farther if I force --cpu:i386 |
22:47:42 | filwit | def-: er, okay then |
22:47:50 | grumbly | Both nim and tinycc work alone on hello world, but can't get them to work together. |
22:47:59 | filwit | this record goes up too fast these days I can't keep up! |
22:48:39 | kernasi | def-, yep :) |
22:48:48 | kernasi | seems flexible enough |
22:49:00 | def- | grumbly: maybe your tcc version is too old? i only tried with 0.9.26-r2 |
22:49:14 | kernasi | tcc is not developed anymore, I wouldn't invest in that |
22:49:19 | kernasi | though it's nice |
22:49:24 | * | jfchevrette quit (Ping timeout: 245 seconds) |
22:51:16 | grumbly | def-, I'm using tcc v. 0.9.26 from here [http://download.savannah.gnu.org/releases/tinycc/] |
22:51:43 | grumbly | kernasi, Sounds like the right idea |
22:52:05 | Jehan_ | kernasi: Set gcc.exe = "musl-gcc" in your config file. |
22:52:13 | def- | kernasi: grumbly if you google for it, there are some solutions: http://stackoverflow.com/questions/6329887/compiling-problems-cannot-find-crt1-o |
22:52:25 | Jehan_ | The --cc argument can only be one of a number of predefined values. |
22:52:29 | kernasi | my god, the help in here is overwhelming |
22:52:37 | * | kuzy000 quit (Ping timeout: 264 seconds) |
22:52:50 | kernasi | Jehan_, ya, noticed that :) |
22:53:08 | grumbly | kernasi, Thank you; I hadn't found that one yet. |
22:53:29 | kernasi | redirecting your thanks to def- |
22:53:30 | Jehan_ | For example, I have the following in ~/.config/nim.cfg |
22:53:32 | Jehan_ | @if gcc48: |
22:53:32 | Jehan_ | cc:gcc |
22:53:32 | Jehan_ | gcc.exe = "gcc-4.8" |
22:53:32 | Jehan_ | gcc.options.always = "-w -fpermissive" |
22:53:32 | Jehan_ | @end |
22:56:14 | * | pregress_ joined #nim |
22:56:54 | grumbly | def-, Thank you. I'm sure if I spent a few more hours I could port that solution to my mac, but it's a headache. I'll just stick with Clang. Thanks for the help - this is a great IRC community! |
22:56:59 | * | pregressive quit (Ping timeout: 256 seconds) |
22:57:33 | def- | grumbly: oh right, i only tried on linux. clang is pretty fast at compiling already |
22:58:34 | * | grumbly quit (Quit: Page closed) |
23:06:50 | filwit | BlaXpirix: got it working: https://gist.github.com/PhilipWitte/8935a52bcf945e7a878b |
23:08:10 | filwit | BlaXpirit: ^; So basically you just need to prove that both the RenderTexture and RenderWindow can be called with `draw` |
23:08:31 | BlaXpirit | o.o |
23:08:47 | filwit | BlaXpirit: unfortunately that's not idea.. I'm still trying to figure out how to make that cleaner (using RenderTarget instead) |
23:08:52 | filwit | ideal* |
23:09:10 | BlaXpirit | ok thanks |
23:09:26 | fowl | i used generics like that in sfmls cpp wrapper |
23:10:45 | * | pregressive joined #nim |
23:12:45 | * | pregress_ quit (Ping timeout: 244 seconds) |
23:17:25 | * | BlaXpirit quit (Quit: Quit Konversation) |
23:17:52 | Jehan_ | dom96: Where does nimble look for nim? |
23:19:31 | Cykacykacyka | has anyone used nim to produce binaries that run on android ? Not talking about using any of the android API's, basicall just using the c compilers provided by the android ndk ? |
23:21:00 | * | dom96_ joined #nim |
23:21:36 | dom96_ | Jehan_: It looks in your PATH. |
23:21:55 | Jehan_ | dom96_: Yeah, it wasn't finding it, but reinstalling from Git fixed that. |
23:21:57 | * | Var|Mobile quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )) |
23:23:26 | def- | Cykacykacyka: some old code here: https://github.com/gradha/nimrod-on-android |
23:24:41 | * | sillesta quit (Ping timeout: 250 seconds) |
23:24:59 | * | polde joined #nim |
23:25:19 | * | pregress_ joined #nim |
23:27:28 | kernasi | Jehan_, I had to add gcc.linkerexe = "/usr/local/musl/bin/musl-gcc as well; now it's perfect :) |
23:27:37 | kernasi | thanks for all your help |
23:27:42 | kernasi | great channel so far :P |
23:28:02 | Cykacykacyka | def-, this is not exactly what I need. I don't intend to app apps in nim, but rather 'traditional/linux-like' daemon that would do things with a socket and stuff. |
23:28:09 | * | pregressive quit (Ping timeout: 256 seconds) |
23:28:22 | * | jsudlow joined #nim |
23:31:01 | def- | Cykacykacyka: sorry, i misread. sounds like a case for cross compilation: http://nim-lang.org/nimc.html#cross-compilation |
23:35:14 | filwit | BlaXpirit: I found a different (probably better) way which uses RenderTarget inside the Drawable type-class: https://gist.github.com/PhilipWitte/8935a52bcf945e7a878b |
23:36:42 | filwit | BlaXpirit: however, that way is slightly different. It uses the type-classes slightly differently (in a way i'm not as familiar with) and avoids one of the procs completely. |
23:37:16 | filwit | BlaXpirit: not sure it will really be applicable to your real code |
23:41:28 | * | lavender joined #nim |
23:42:45 | * | pregress_ quit (Ping timeout: 252 seconds) |
23:45:04 | * | pregressive joined #nim |
23:45:37 | filwit | oh damn he left awhile ago... |
23:47:38 | * | rapind joined #nim |
23:57:34 | * | brson quit (Quit: Lost terminal) |
23:57:44 | * | brson joined #nim |
23:59:46 | Cykacykacyka | def-, actually, I shouldn't have jumped to conclusions, I don't have to use jni, but everything up to it is very well documented and fits my use case, thank you very much. |