<< 07-03-2015 >>

00:02:12*reem joined #nim
00:04:21*reem quit (Remote host closed the connection)
00:06:14*gmpreussner|lapt joined #nim
00:08:56*tumult joined #nim
00:09:49*Roin quit (Ping timeout: 245 seconds)
00:11:01*Dirkson joined #nim
00:11:10*Dirkson left #nim ("Cheers!")
00:16:08*tumult quit (Quit: Page closed)
00:19:01federico3(and afaict a set should support "in" as well)
00:19:08federico3oops
00:26:39*OderWat_ quit (Ping timeout: 246 seconds)
00:27:51*reem joined #nim
00:32:34*Jehan_ quit (Quit: Leaving)
00:41:47*mpthrapp joined #nim
00:44:21mpthrappI'm having some trouble with the httpclient module. I'm trying to loop through the results I get back from an API call, but I'm getting "undeclared identifier: 'counter'"
00:44:40mpthrapphttps://bpaste.net/show/fc6812773a83
00:45:10*Sembei quit (Read error: Connection reset by peer)
00:45:37*MyMind joined #nim
00:48:23mpthrappSpecifically, it's the StringTableRef object in the Response object.
00:52:45Araqwhy do you think it has a counter?
00:52:45*gmpreussner|lapt quit (Read error: Connection reset by peer)
00:53:00Araqthat's a private field
00:53:23mpthrappAhhhh, okay. I was looking at the strtabs module and I didn't realize it was private.
00:53:33mpthrappHow do I iterate over the results then?
00:57:50mpthrapp.pairs?
00:58:32Araqsure
00:59:54*MyMind quit (Quit: WeeChat 1.2-dev)
01:06:08*TEttinger joined #nim
01:07:11*masterlongs7989 joined #nim
01:08:12*masterlongs7989 left #nim (#nim)
01:36:46*saml_ joined #nim
01:41:55onionhammerI think _ is easier to use, but im not sure if it should be used all that much :P
01:41:58onionhammeroops
01:43:48*Sembei joined #nim
01:47:43*reem quit (Remote host closed the connection)
01:48:31flaviuHow about the GSOC? Wasn't the meeting today?
01:48:52def-flaviu: i wrote an email instead
01:48:58def-https://gist.github.com/def-/cb01b21094e34ece4c30
01:49:27flaviudef-: thanks
01:49:51flaviuSeems like they wanted to downsize the program this year, they also rejected some long-time applicants.
01:52:04*reem joined #nim
01:59:53*reem quit (Remote host closed the connection)
02:08:03*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
02:16:15*reem joined #nim
02:16:26*randomwalk_ joined #nim
02:17:13*randomwalk quit (Ping timeout: 264 seconds)
02:28:16*davidhq joined #nim
02:29:11*reem quit (Remote host closed the connection)
02:32:10*reem joined #nim
02:33:50*reem quit (Remote host closed the connection)
02:35:04*randomwalk__ joined #nim
02:35:05*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
02:35:12*reem joined #nim
02:35:26*^aurora^ quit (Quit: Leaving.)
02:38:06*darkf joined #nim
02:38:13*randomwalk_ quit (Ping timeout: 264 seconds)
02:39:42*Kasprosian joined #nim
02:39:54Kasprosianin nim, are there lightweight datastructures a la JSON?
02:42:09*reem quit (Remote host closed the connection)
02:46:10*Kasprosian quit (Quit: Page closed)
02:53:01*chemist69_ joined #nim
02:55:27flaviu"lightweight datastructures"?
02:55:58*chemist69 quit (Ping timeout: 256 seconds)
02:57:56def-flaviu: forum thread: http://forum.nim-lang.org/t/987/1#5951
02:58:08*reem joined #nim
02:58:47flaviuHow about the json data type?
03:00:21*jferg2010 joined #nim
03:00:22*reem quit (Remote host closed the connection)
03:02:59*pregressive joined #nim
03:03:56*reem joined #nim
03:04:00*randomwalk_ joined #nim
03:05:18jferg2010It's been a little while since I checked in, but I've finally got some new potential enhancements to the docs to share. I would love some feedback on this - http://www.unraveltechnology.com/img/times.html
03:07:11*jholland quit (Quit: Connection closed for inactivity)
03:07:27*randomwalk__ quit (Ping timeout: 256 seconds)
03:08:10*reem quit (Remote host closed the connection)
03:08:20*bjz joined #nim
03:10:01Varriountjferg2010: You might want to check in with filwit - he was also working on something related to documentation.
03:12:04def-jferg2010: it certainly looks nice, but an immediate issue I have is that the site feels more sluggish than the current one
03:14:10*reem joined #nim
03:14:18Varriountdef-, jferg2010: Chrome says that react.js takes the longest to load.
03:15:07flaviujferg2010: Looks great, but there should be more padding around .code, the text almost touches the border. "$(TimeInfo)" would be better as "`$`(TimeInfo)" IMO, that way it's syntactically valid.
03:15:34def-Varriount: not to load, scrolling is sluggish
03:16:01*jferg2010 quit (Ping timeout: 264 seconds)
03:16:20Varriountdef-: Oh, well I don't know why that would be. Doesn't feel sluggish to me.
03:16:20*aidanh quit (Ping timeout: 246 seconds)
03:16:29flaviuI don't think the problem is so much in how long it takes to download stuff, but that rendering takes a moment.
03:17:01def-Varriount: it's the sidebar with absolute position probably
03:18:31VarriountAlso, (and I don't know if this is something that should be changed) code examples aren't resized/repositioned with the rest of the layout.
03:18:56flaviuThe scrollbar uses javascript actually, so dom reflows (I have no idea what I'm talking about) might be it.
03:21:00Varriountflaviu: I don't know what that is. I'm just looking at the page in device mode in chrome.
03:21:32*aidanh joined #nim
03:22:37*reem quit (Remote host closed the connection)
03:23:13*reem joined #nim
03:23:25*randomwalk joined #nim
03:25:49*reem quit (Remote host closed the connection)
03:25:59*randomwalk_ quit (Ping timeout: 252 seconds)
03:27:58*reem joined #nim
03:28:26*randomwalk_ joined #nim
03:30:01*reem quit (Remote host closed the connection)
03:31:40*randomwalk quit (Ping timeout: 256 seconds)
03:32:05*reem joined #nim
03:33:47*jferg2010 joined #nim
03:34:34*reem quit (Remote host closed the connection)
03:35:40*starless joined #nim
03:38:11jferg2010def-: I did use a JS script to stick the sidebar. I can take a look at whether that's contributing to any sluggishness. I also need to switch to react.min instead of the dev version.
03:39:17*starless left #nim ("Leaving")
03:40:07*reem joined #nim
03:40:09jferg2010flaviu: I'll fix the padding and the syntax on the operator procs.
03:40:36*Jesin quit (Quit: Leaving)
03:43:16jferg2010def-, varriount, flaviu: Do the different options under types to look at procs, etc that use that type or return that type make sense?
03:43:58flaviu"Argument to" makes sense
03:44:12flaviuHere is another mockup: http://reign-studios.net/philipwitte/nimrod/docs/docs.htm
03:46:53flaviuThat's by filwit, so you'll probably want to have a chat with him when he shows up. He did the web stuff (except the current docs).
03:49:50jferg2010flaviu: Got it. I'll keep an eye out for filwit.
03:51:54*randomwalk_ quit (Ping timeout: 245 seconds)
03:56:18*aidanh quit (Ping timeout: 246 seconds)
03:58:23*aidanh joined #nim
04:09:07*reem quit (Remote host closed the connection)
04:11:50*jferg2010 quit (Quit: Leaving)
04:24:30*reem joined #nim
04:31:31onionhammeroops
04:32:24onionhammerflaviu, typo: Desciptions
04:32:58*reem quit (Remote host closed the connection)
04:34:28*reem joined #nim
04:37:43*Jesin joined #nim
04:38:09*darkf quit (Ping timeout: 245 seconds)
04:40:29*reem quit (Remote host closed the connection)
04:45:51*darkf joined #nim
04:46:43*reem joined #nim
04:56:09*reem quit (Remote host closed the connection)
05:00:18*reem joined #nim
05:02:50*reem quit (Remote host closed the connection)
05:04:15*reem joined #nim
05:07:34*reem quit (Remote host closed the connection)
05:09:36*reem joined #nim
05:10:47*randomwalk_ joined #nim
05:10:53*randomwalk_ is now known as randomwalk
05:14:22*kashyap_ joined #nim
05:16:05kashyap_Hi ... I am trying to implement a nim function that is meant to be invoked from C - http://lpaste.net/123407
05:16:22kashyap_It is supposed to copy a "char *" into another
05:30:07*reem quit (Remote host closed the connection)
05:30:40*reem joined #nim
05:35:09Varriountkashyap_: You still there?
05:35:15kashyap_yes
05:36:17Varriountkashyap_: First off, a cstring is already passed via pointer
05:36:34kashyap_ok
05:37:44Varriountkashyap_: Have you looked at the generated C code to see how the generated function differs.
05:38:49kashyap_I looked at the generated c ....it looked right
05:39:44kashyap_This code http://lpaste.net/123407 works fine
05:40:08kashyap_it only reads from the input ... the moment I try to write to "o", I get a segfault
05:42:15*reem quit (Remote host closed the connection)
05:42:19Varriountkashyap_: This is going
05:42:54VarriountSorry, this is going to sound like a stupid question, but are you sure you're allocating the string?
05:43:32kashyap_yup .. I'll paste my c code
05:44:28kashyap_I've updated the link with c code --- essentially, I am storing the string on the stack and have validated it with a ccopy
05:46:05*reem joined #nim
05:48:16Varriountkashyap_: What command line arguments are you using?
05:48:53kashyap_nim c --noLinking --os:standalone --deadCodeElim:on --noMain --parallelBuild:1 --gcc.exe:$(GC\ C) --passC:"-I$(NIM)/tinyc/win32/include" --passC:"-w" --passC:"-O2" --passC:"-Wall" --passC:"-Wextra" --passC:"-\ ffreestanding" --passC:"-mcmodel=kernel" --threads:on libmain.nim
05:53:04*reem quit (Remote host closed the connection)
05:53:37VarriountHuh. I can't get the procedure to appear in the generated code. dead code elimination seems to be disabling it.
05:53:41*reem joined #nim
05:55:11kashyap_let me push it to github
05:56:45*reem quit (Remote host closed the connection)
05:59:40kashyap_Varriount - https://github.com/ckkashyap/nimc
06:04:14Varriountkashyap_: I'm on Windows. Will the makefile work with Mingw?
06:04:56kashyap_It's two commands essentially
06:05:08kashyap_first - compile nim file libmain.nim
06:05:23kashyap_and then gcc main.c nimcache/*.o
06:09:45kashyap_new finding ... I get the crash only when declare the parameter with var
06:12:26*saml_ quit (Quit: Leaving)
06:20:39kashyap_Varriount ... any luck?
06:21:59Varriountkashyap_: Yeah.
06:22:38Varriountkashyap_: I haven't tried compiling your program, but I was able to get the file to compile with the exported procedure (I had to add --header)
06:22:51VarriountI mean, I haven't tried compiling the program from the repo
06:23:07kashyap_ok
06:25:48Varriountkashyap_: A cstring (as defined in nimbase.h) is a typedef char* NCSTRING;
06:26:03*Demos joined #nim
06:26:23kashyap_ok
06:26:29VarriountSo when you add 'var', it adds an extra pointer of indirection (which probably shouldn't happen)
06:27:03kashyap_hmm ... and without var, I cant compile
06:27:26kashyap_I need to write to cstring in the proc
06:27:32Varriountkashyap_: What about using a 'ptr char' and a cast?
06:27:46kashyap_I could do that
06:27:48kashyap_let me try
06:28:01Varriountkashyap_: Well, all you need to do is create a pointer to the pointer to the character.
06:28:39Varriountkashyap_: This is actually something that needs to be brought up. Exported types need to be stricter with regards to code generation.
06:28:40kashyap_you mean ptr uint8 rught
06:28:59Varriountkashyap_: Yes?
06:29:23kashyap_ptr uint8 instead of ptr char
06:33:15kashyap_Thanks Verriount ... your suggestion worked .. you can checkout the code on github .... do you need me to file a bug for the exported types ?
06:34:25Varriountkashyap_: Yes. Make a general bug stating that code generation for exported procedures needs to be strict with regards to argument and return types.
06:35:25kashyap_ok ... just so I understand, can you explain, once the bug is fixed, what would the generated code look like?
06:36:24*reem joined #nim
06:36:36Varriountkashyap_: 'var cstring' wouldn't generate an extra '*'
06:36:53kashyap_oh okay got it
06:37:30Varriountkashyap_: For reference types, the 'var' keyword would do nothing. For object types, it would generate an extra pointer.
06:37:45kashyap_right
06:38:04*rkj-b joined #nim
06:38:23Varriountkashyap_: Of course, my ideas might be wrong (I am by no means an expert in C or C++) so Araq might say differently.
06:38:42VarriountIf nothing else, how types are exported needs to be cleared up.
06:38:46rkj-bHave one more question.
06:38:54cazovhow about for ptr types?
06:39:03kashyap_oh okay ... let me post a note on the forum then
06:39:21Varriountrkj-b: Yes?
06:40:16Varriountkashyap_: Uh, please don't. The forum is meant for discussion, not issues.
06:40:36kashyap_ok
06:40:59Varriountkashyap_: Unfortunately, some people don't know this.
06:46:56rkj-bAm comparing Nim to Rust. Rust avoids many "pitfalls" by having rather complex protective mechanisms. Now, would it be reasonable to say that nim seeks to avoid "pitfalls" by instead having carefully chosen extra (maybe somewhat high-level) features that avoid the usage of "pitfall" prone techniques???
06:47:31Varriountrkj-b: Pretty much.
06:47:46Maxdamantusparse.nim(132, 7) Warning: 'l' should not be used as an identifier; may look like '1' (one) [SmallLshouldNotBeUsed]
06:47:49Maxdamantuslol
06:48:16VarriountMaxdamantus: Well, it's true.
06:48:27*Maxdamantus wonders if that app1ies more generally.
06:48:44Varriountrkj-b: I can't say what Rust does (I haven't checked out the language much)
06:49:14Varriountrkj-b: However Nim generally takes the approach that 'things should be safe be default'
06:49:19cazovMaxdamantus, i think clang will also give that warning :]
06:49:24*Maxdamantus doesn't get that sense.
06:49:33*Maxdamantus gets the sense that Nim is just trying to be convenient, not safe.
06:49:46VarriountMaxdamantus: Well, that too.
06:50:08Maxdamantuseg, if you write anything generic, it's not actually typechecked until you instantiate it.
06:50:27Maxdamantusand when you do instantiate it, you're only checking it against particular types.
06:50:35VarriountMaxdamantus: I still don't see how you can typecheck a generic before you instantiate it.
06:50:50VarriountIsn't that the whole point of a generic?
06:51:09MaxdamantusVarriount: no. It's already been solved by languages like Java and Haskell.
06:51:28VarriountMaxdamantus: I've used Java, and I don't see how it solves the problem.
06:51:38MaxdamantusThe way generics work in Nim is like templates in C++, which isn't exactly a well-thought-out language.
06:51:50Maxdamantusit was initially a bunch of hacks some guy thought would make C more convenient.
06:52:17VarriountMaxdamantus: I'm assuming type classes don't add anything to this?
06:52:21MaxdamantusVarriount: you can't get an error in someone else's code by using bad generic parameter.
06:52:26Maxdamantus(in Java)
06:53:26VarriountMaxdamantus: Um, what happens instead then?
06:53:48*Varriount is still confused
06:53:51cazovneither can you in c++*. all your template stuff is in _your_ compilation unit </pedantic>
06:53:52MaxdamantusVarriount: you get an error only at your invalid use of the type of thing someone else has provided.
06:54:36*pregressive quit ()
06:54:41MaxdamantusVarriount: proc add3[T](a, b, c: T): T = a + b + c
06:55:06MaxdamantusVarriount: add3(4, 5, 6) probably works, because `+` is usually defined for int, int: int
06:55:24rkj-bOK. For example, "I" read that in Nim there are statements and such that enable one to do things that in C that could not be done without pointers. (That's the sort of thing "I" mean.)
06:55:30MaxdamantusVarriount: but if you do add3("4", "5", "6"), it's going to point to the line inside that add3 proc.
06:55:40VarriountMaxdamantus: Oh, so what you're saying is that the error given by the compiler is unclear.
06:55:52MaxdamantusVarriount: no. I'm not saying that.
06:56:08MaxdamantusVarriount: I'm saying you can't get a type error in code you didn't write.
06:56:37MaxdamantusVarriount: the type error in Java would have to be at the bad usage of the add3 function.
06:56:46VarriountMaxdamantus: That's what I meant.
06:57:01VarriountIt's a matter of what kind of traceback the compiler shows.
06:57:11MaxdamantusVarriount: not the unapplicability of T=string in some proc call in some expression in some line of someone else's code.
06:57:16MaxdamantusIt's not.
06:57:51VarriountCould you perhaps give me something of a side-by-side comparison?
06:58:27Maxdamantusin Haskell, you'd be required to write something like: add3 :: Num a => (a, a, a) -> a; add3 a b c = a + b + c
06:59:04Maxdamantusso the type specifies that the + operation exists (by saying the type parameter `a` is in the `Num` class)
06:59:23Varriountrkj-b: I don't see exactly what you mean. Since Nim compiles to C, technically C can be converted to Nim.
06:59:31Maxdamantusif you didn't have `Num a => ..`, the definition of `add3` would fail to typecheck.
07:00:10Maxdamantusbut since it does have the `Num a => ..` there, the typecheck will pass and you will never have a static error inside that function.
07:00:57Maxdamantuser, that should've been: Num a => (a, a, a) -> a; add3 (a, b, c) = a + b + c
07:01:12Maxdamantus(just changed `add3 a b c` to `add3 (a, b, c)`)
07:01:49VarriountMaxdamantus: Have you looked at type classes in Nim?
07:01:52Maxdamantusthat correction should also still have `add3 :: ` at the beginning; accidentally chopped that off.
07:02:03MaxdamantusVarriount: yes. Typeclasses help there, but they're not enforced.
07:02:51DemosMaxdamantus, yes. Nim's generics sometimes check later than Haskell's. However this adds some flexibility and when type checking does fail the errors are pretty good tbh
07:02:56VarriountI would argue though that doing it the Java way causes you to lose information as to what part of the other person's code you are actually violating.
07:03:43MaxdamantusThat should be irrelevant. The other person's code can change. It can be extremely complex.
07:03:59MaxdamantusYou should have a type that specifies the constraints.
07:04:00cazovit could be argued that you don't need to know that; your type doesn't fulfill the interface that has[n't] been [properly] documented by the vendor
07:04:08Demosc++ is one of the only languages that does generic programming in a complete way, and it does pretty good. Aside from having a truly horrendous syntax for it. In fact c++'s templates are strictly MORE powerful than haskell's generics because c++ has variadic generics
07:04:20Demoss/strictly//
07:04:29Varriount(Which, unfortunately, Nim doesn't have yet)
07:05:07DemosYeah, I want em really bad
07:05:20Demosthey come up quite a lot in the code I have been writing
07:05:23MaxdamantusIt's more powerful than Haskell's parametric polymorphism because its type system isn't turing complete (though there are GHC extensions for that)
07:05:33*reem quit (Remote host closed the connection)
07:05:42Maxdamantusturing completeness means there's no guarantee the typechecker will finish.
07:06:13DemosMaxdamantus, you usually just limit the depth of recursion and then fail if too deep, which seems to work OKJ
07:06:14Maxdamantusthough that's already the case in Nim because of macros (which I also generally dislike as a language feature)
07:06:38rkj-bI mean I read that Nim has statements and read Nim has techniques that make it possible to use less scary pointers and such. When transpiled to C the pointers would presumably reappear. That sounds like a nice way to promote safety. Wonder if it has other features that make it safer than C. Is it, all-in-all generally safer than C?
07:06:42MaxdamantusDemos: then it's not turing complete.
07:07:16Varriountrkj-b: Well, it has optional run-time checks (these are usually turned off in release mode)
07:07:54*reem joined #nim
07:08:02DemosMaxdamantus, right, well I think it is specified as turing complete, but implementations limit it. In the same way that in reality computers behave more like a LBA than a turing machine
07:08:10Varriountrkj-b: Yes, it's generally safer than C
07:08:18MaxdamantusI'm not sure they do normally limit it.
07:08:31MaxdamantusBecause I think they have a hard time coming up with suitable limits.
07:08:46DemosMaxdamantus, they do. Make a infinite recursive template in any C++ compiler
07:09:15DemosThe compile will fail before you run out of memory
07:09:39cazovi think the gcc depth is 500 by default. there's a flag that lets you set it though
07:09:45VarriountNom nom.
07:10:01*Varriount eat all of Maxdamantus' memory
07:10:14MaxdamantusWell, even if it has a maximum depth of something like that, you can still have it run essentially forever.
07:10:19Maxdamantusie, millions of years.
07:11:57Varriountcazov: '-ftemplate'
07:12:09VarriountSorry, '-ftemplate-depth=n'
07:12:13cazovyeah
07:12:18cazovi had to use that once
07:12:49DemosMaxdamantus, I mean you just need an algorithm that has a complexity such that with n=500ish it will take that long, but it is unlikely for a compile to take that long
07:13:41Demosand to be honest for most c++ projects template instantiation is not a huge portion of their compile time. The real killer is just reading from disk and parsing the massive amount of code that tends to be in each translation unit.
07:16:15rkj-bSorry to pester. If safety of C is "1" and safety of Rust is "10", what is "x" safety of Nim? Subjective as heck, I know.
07:16:42MaxdamantusI'd say about 3.
07:17:10*reem quit (Remote host closed the connection)
07:17:21Demosrkj-b, I would say maybe 8 or 9
07:17:22VarriountMaxdamantus: Have you taken into account effect tags and region pointers?
07:17:27Demosthey are both totally memory safe
07:17:29Maxdamantusbut it largely depends how the C and Nim code at least you're dealing with is written.
07:17:44Demoswell totally aside from escape hatches :D
07:18:22Varriountrkj-b: I can't give any answers, not knowing Rust.
07:18:25MaxdamantusVarriount: I don't think they're very significant compared to the generics system.
07:18:49Maxdamantusand macros in general
07:19:25*reem joined #nim
07:19:26DemosI really don't see how the generic system is less safe. Just gives errors perhaps later
07:19:42Demosbut you will still get a compile error afaict
07:19:59VarriountI took 'safety' to mean 'errors the runtime and compile time systems don't catch'
07:20:06MaxdamantusNo. You can write your generic code wrong and use it and not realise it's not wrong.
07:20:23Varriountcazov: Man, the number of options, arguments, and flags GCC takes is phenomonal
07:20:25Maxdamantusie, doesn't have the correct type constraints.
07:20:34cazovyes. clang is worse about that
07:21:13Varriountcazov: How do they maintain/track them all? There must be some miniature macro system or something in place...
07:21:33Maxdamantus.eval proc foo[T](i: string): T = i; echo foo("hello world")
07:21:39MimbusMaxdamantus: hello world
07:21:40cazovno idea. at my old job i went throught all of them hunting for size optimizations that might not be enabled even with -Os
07:21:52Maxdamantus.eval proc foo[T](i: string): T = i; echo foo(42)
07:21:56MimbusMaxdamantus: eval.nim(4, 8) Error: type mismatch: got (int literal(42))
07:23:33VarriountKeep in mind mimbus only prints the first line of error output.
07:23:34*untitaker quit (Ping timeout: 245 seconds)
07:24:41MaxdamantusAlso, when you do get something wrong in a system using generics, it's preferable to have a single point of error rather than many possible points of error.
07:25:13Maxdamantuswhich is what happens in Haskell, as long as you declare types for definitions occasionally.
07:25:45*Maxdamantus usually doesn't bother reading much into the error message in Haskell, just looks for the approximate location.
07:26:31Maxdamantusotherwise it's essentially the same as debugging runtime errors using stacktraces.
07:26:48Maxdamantuswhere was the actual error? Maybe in one of these hundreds of positions, maybe not.
07:30:09*untitaker joined #nim
07:30:21VarriountHi untitaker
07:38:59Varriountcazov: Size optimizations? Usually it's performance optimizations that people want.
07:39:18cazovdeeply embedded
07:39:48cazovlike, we could only debug one TU at a time on the target because our memory was that limited :]
07:48:44rkj-bToo old to learn Emacs or Vim. For PCLinuxOS, would Geany, Scite, Notepad++ w/ Wine, Kate, or (If I MUST spend bucks) Sublime Text, be among the best answers? (Hate Eclipse.)
07:50:04DemosI think someone here has a good Kate syntax definition
07:55:30*Demon_Fox quit (Quit: Leaving)
07:55:43*reem quit (Remote host closed the connection)
07:56:57*randomwalk_ joined #nim
08:00:32*randomwalk quit (Ping timeout: 246 seconds)
08:04:34*reem joined #nim
08:07:32*Demos quit (Read error: Connection reset by peer)
08:07:40*aidanh quit (Ping timeout: 272 seconds)
08:07:44Varriountrkj-b: Last I checked, Sublime Text was free-ish
08:08:29VarriountOf course, I maintain the Sublime Text plugin for Nim (currently undergoing major refactoring)
08:12:09*randomwalk_ quit (Quit: Leaving)
08:12:52*aidanh joined #nim
08:13:13rkj-bI know Sublime Text "free-ish" but am too damn honest. I'm really wondering which one is the "best". There are many considerations; for example Kate could birth a KDevelope offspring. Sublime Text sure sounds smart, though.
08:28:33Maxdamantushttps://gist.github.com/Maxdamantus/08b6cdf7fc02b325e273
08:28:38Maxdamantuslots of generics and tuples.
08:33:28Maxdamantus.eval type T = distinct proc(); var a = T(proc() = discard); a()
08:33:32MimbusMaxdamantus: Error: execution of an external program failed; rerun with --parallelBuild:1 to see the error message
09:14:38*reem quit (Remote host closed the connection)
09:37:06*BlaXpirit joined #nim
09:52:22*xificurC joined #nim
09:55:27*aidanh quit (Ping timeout: 256 seconds)
10:03:50*aidanh joined #nim
10:12:52*Matthias247 joined #nim
10:15:14*randomwalk joined #nim
10:17:07*Zuchto joined #nim
10:20:33*Zuchto is now known as Zehobs
10:22:06*Zehobs is now known as Zuchto
10:23:12*rkj-b quit (Quit: ChatZilla 0.9.91.1 [Firefox 35.0.1/20150122214805])
10:31:37*aidanh quit (Ping timeout: 264 seconds)
10:32:38*aidanh joined #nim
10:48:33AraqMaxdamantus: when people talk about "safety" they usually mean "memory safety" or other aspects that are mostly concerned with runtime behaviour.
10:48:49Araqthat nim's generics are lazy has nothing to do whatsoever with this question
10:49:10AraqI know this "feature" bothers you but please stay honest.
10:49:17*aidanh quit (Ping timeout: 264 seconds)
10:51:49*aidanh joined #nim
10:54:00Araqand proc foo[T: Addable](x, y: T): T = x + y is not the best solution in the world either. With that you essentially write down the algorithm *twice*
10:55:25Araqnow if it's all inferred like in Haskell that's pretty good indeed. But Nim embraces overloading and unrestricted overloading within a Hindley–Milner type system is NP complete.
11:05:07*^aurora^ joined #nim
11:05:23*davidhq joined #nim
11:06:10*Matthias247 quit (Read error: Connection reset by peer)
11:07:41MaxdamantusAraq: that's what safety would come down to in a language like C (assuming limited use of the CPP) or Java.
11:07:57MaxdamantusThings like macro systems can be unsafe if they produce invalid (non-compiling) code.
11:10:28MaxdamantusYou could always just say that Java is completely safe because you can capture pretty much any error (I think there are a few that you can't .. maybe OutOfMemoryException)
11:15:37Maxdamantusbtw, I added the relevant .isNil checks for tuple nodes' PTypes in the uses I could find.
11:17:13MaxdamantusThere's an error intentionally thrown in evalffi.nim when packing anonymous tuples which I've only added a # XXX comment to.
11:27:44*chemist69_ quit (Quit: WeeChat 1.1.1)
11:29:19*chemist69 joined #nim
11:40:39Araqso when I use proc foo(a, b: int): int = a+b that is a type that is fuzzy, see dependent typing. Does that mean it's unsafe? Is Haskell then unsafe too?
11:41:17Araqthat's not what people usually mean when they ask about "safety"
11:41:35MaxdamantusThe legal uses of that definition are completely described in the type in Haskell.
11:42:10MaxdamantusThat's not necessarily the case in dependent typing, and that's the main source of discomfort for me.
11:42:46Maxdamantusin Agda and Idris—haven't really looked into others—the source of the definition is also essentially part of the interface.
11:43:43MaxdamantusNum a => (a, a) -> a
11:44:03MaxdamantusThe + you refer to in the definition in Haskell will come directly from the Num instance.
11:44:41Maxdamantuswhich is next determined at the use of the definition.
11:47:51Araq"that's what safety would come down to in a language like C (assuming limited use of the CPP) or Java." No, not at all.
11:48:55MaxdamantusA demonstration of what happens in Haskell might look like: proc foo[A](inst: Num[A], a, b: A): A = inst.add(a, b)
11:49:34Maxdamantuswhere: type Num[A] = object add: proc(a, b: A): A; ..
11:49:45AraqI know how it works in Haskell thanks
11:49:59MaxdamantusOkay.
11:50:29*filwit joined #nim
11:51:23MaxdamantusYou can't actually represent all of that like that in Nim though (even restricted to things of kind *), because you'd need rank-two types.
11:51:54*Maxdamantus doesn't really like rank-two types.
11:52:36AraqVarriount: btw your musings that 'var cstring' should be 'cstring' are completely off ;-)
11:52:51Araqand 'var ref' cannot be 'ref' either.
11:53:31*kashyap_ quit (Ping timeout: 246 seconds)
11:55:45*randomwalk wonders why fishing is called trolling...
11:56:26MaxdamantusMisspelling of "trawling"?
11:57:19*randomwalk thinks the waters are chum...the ignore list failing...
11:58:52*randomwalk quit (Quit: Leaving)
12:02:22AraqMaxdamantus: Haskell doesn't prevent buffer overflows at compile-time, ergo Haskell is safer than C thanks to its *runtime* checks. Safety is about *runtime* aspects of a program. Your definition focusses on compiletime aspects and is as such completely off.
12:02:47MaxdamantusSafety is about catching errors early.
12:02:55Maxdamantuseg, before you use a definition.
12:03:16Maxdamantusin Haskell the definition is checked for all possible insantiations.
12:03:28Maxdamantusbefore you actually try to instantiate it.
12:04:31Araqand yet you will not find a *single* safety criticial hotfix thanks to this feature of Nim, because the runtime is not affected whatsoever.
12:05:15Araqmaybe we need to distinguish between safety and security properly though
12:06:46MaxdamantusI think the focus on being able to catch runtime errors would be more of a security thing.
12:07:02*BlaXpirit quit (Quit: Quit Konversation)
12:07:52Maxdamantushigh security would mean you could be given some object and call some method on it knowing it's not going to crash the system or open /proc/self/mem and write weird stuff to it.
12:08:09Maxdamantusboth of which are offered by Java.
12:08:51*BlaXpirit joined #nim
12:15:42Maxdamantushttp://docs.oracle.com/javase/7/docs/api/java/security/Permissions.html
12:17:19Araqwell "memory safety" is a term, "memory security" is not.
12:17:33MaxdamantusI don't think memory was mentioned in the question.
12:17:38Maxdamantusit was just safety.
12:17:57Araqwhen people talk about safety they mostly mean memory safety
12:18:05Araqespecially in the context of Rust
12:18:39MaxdamantusRust is also quite good at the other meanings of safety afaik
12:18:49Maxdamantuswell, the other elements of it.
12:19:02Maxdamantusand they're relevant, because it has things like generics.
12:19:31Araqand that would be my next issue with your line of argumentation
12:19:44Araqfor your unsafe generics are worse than no generics at all!
12:19:48Araq*for you
12:20:17MaxdamantusNo.
12:20:27MaxdamantusFor me unsafe generics are less safe than safe generics.
12:20:40Araqok, good.
12:20:55Araqcan't argue against that ;-)
12:21:04MaxdamantusI think unsafe generics encourage better safety than no generics, for certain tasks.
12:21:46Maxdamantushttps://gist.github.com/Maxdamantus/9184ff4b72017a8de0cc
12:22:01MaxdamantusThis is particularly unsafe, because Go doesn't have generics.
12:30:40Maxdamantus`interface{}` would be the analogue of `void *` in C.
12:31:21Maxdamantusthough logically it doesn't represent a pointer.
12:31:26Araqand yet it's safer than C
12:31:38MaxdamantusYes.
12:31:39Araqbecause it produces a runtime check
12:35:59MaxdamantusBetter late than never.
12:36:43Maxdamantusor better then than later, when the error might have already caused undesired code to be executed.
12:39:35*Jehan_ joined #nim
12:45:34*Maxdamantus has thought a bit about a dynamic language where everything is completely structurally typed.
12:47:55Araqproc `$`*[T: object](x: T): string =
12:47:56Araq result = ""
12:47:58Araq for name, value in fieldpairs(x):
12:47:59Araq result.add(" " & $value)
12:48:36Araqis it really so hard to accept that I'm not thrilled by using 'T: ObjectWhereEveryFieldTypeHasToString'
12:49:03Araqwhere ObjectWhereEveryFieldTypeHasToString is a generic that essentially repeats $'s body?
12:50:00MaxdamantusNo. It's not hard to accept. You just don't consider safety as important as me.
12:50:12Maxdamantuss/as/as as/
12:54:51Araqbtw this is safer than Java as toString in Java belongs to Object and all you can do is to override it to throw a runtime error
12:55:54MaxdamantusYou can implement an alternative mechanism in Java.
12:55:58Maxdamantusbut it will be uglier than Nim.
12:56:08MaxdamantusWell, Java probably already is.
12:56:24Maxdamantusat least in terms of syntactic clutter.
13:00:05*aidanh quit (Ping timeout: 265 seconds)
13:06:03*aidanh joined #nim
13:10:56Maxdamantusanyway, if you find static typing restrictive, you could always just use plain dynamic typing :p
13:11:10*Maxdamantus sleeps.
13:12:11Araqyeah, and when I like to take a bath nothing else but the ocean works for me
13:16:35*aidanh quit (Ping timeout: 246 seconds)
13:21:27*aidanh joined #nim
13:22:15Jehan_:)
13:22:52Jehan_I like static typing also, but I do tend to draw the line where the type-checker becomes a full-fledged theorem prover.
13:26:13*aidanh quit (Ping timeout: 264 seconds)
13:27:31*aidanh joined #nim
13:30:39filwithmm.. I'm trying to get 'parallel' working in this code: https://gist.github.com/PhilipWitte/81db3972b6dcee092e0f
13:31:02filwitbut i keep getting error: (35, 19) Error: cannot prove: i <= len(people) + -1
13:31:27filwitit works if I remove the parallel and just use spawn/sync
13:31:55filwitwhat is hanging the disjoint checking up in this code?
13:32:49Araqwell people.len is not known to be 20 by the compiler
13:33:24filwitso what are my options then?
13:33:25Araq'parallel' also tries to prove your array bounds
13:33:46Araqfor i in 0 .. <people.len:
13:33:55Araq spawn people[i].greet
13:34:19filwityeah... why am i not doing that in the first place... gah was thinking wrong
13:34:51filwiti wanted to spawn only two threads.. not one for each.. my brain this morning is not good. Thanks though.
13:38:47filwitAraq: btw, using `for p in people:` and `for i in 0 .. <people.len:` does not work, but `for i in 0 .. people.high:` does... I'm sure you're probably aware of that limitation right now, just wanted to put it out there in case you weren't
13:39:51filwitsweet though.. using parallel prevents the string copy :)
13:42:39Araqno, report it
13:44:16filwitreally? Are strings special or something here?
13:44:49filwiti mean, i can totally hose the program now by modifying friend.name.. but i expected that.
13:45:57filwitohh... wait sorry, you're talking about the 'people.high' vs '<people.len' thing... gotit, will report
13:46:41Jehan_filwit: Strings still sit in the main thread's heap, so it's not safe to do anything with them that causes reallocation.
13:47:02*aidanh quit (Ping timeout: 246 seconds)
13:47:08Araqhow can you modify friend.name?
13:47:13filwitJehan_: yeah that's what I assumed was going to happen really.
13:47:25filwiti just wanted to prove it mostly
13:47:44filwitplus i want to monitor the ref-counts and see what's going on
13:47:56Araqer ... report this hole program. why doesn't it copy?
13:48:12Araqyou're using 'ref objects' that's not safe
13:48:17filwitidk, it copies without the parallel (using spawn)
13:48:39filwitusing ref-object's not safe with parallel/spawn?
13:48:51Araqwell it needs to copy
13:49:03Araqyou can cast to 'ptr' to avoid the copy
13:49:37Araqbut then you're on your own so that's fine
13:49:59filwitso should I report the 'people.high' in a separate issue then, or is that already known?
13:50:10Araqno, that's another bug :P
13:50:16filwitk
13:50:23Araqthanks for testing it btw
13:50:34Araqit's high time this thing gets more tests
13:52:01filwitno problem.. though now i probably need to fix my raytracer.. i think it's relying on this bug now (it used to cast Pixmap, which is a ref-array, to ptr to process each region but i discovered i didn't need that anymore and thought it was a feature :P)
13:52:47Araqwhen you use Nim's parameter passing immutability it doesn't need to copy
13:53:04Araqbut this immutability stops at 'ref'
13:53:24filwitthat's why i said Pixmap was a ref-array
13:53:35Araqdeep immutability for 'ref' would really help in the language
13:53:56filwityes i completely agree
13:54:12*pafmaf_ joined #nim
13:54:52Araqbut it's hard to do and for your example you can always do people[i][]
13:54:54filwiti mean.. i have kinda relying on the fact that that doesn't exist, but it really doesn't make too much sense to be able to modify components of a ref-type that's passed when you can't do that to a regular object
13:55:12*aidanh joined #nim
13:55:18Araqwell the compiler itself uses it everywhere
13:55:41filwitAraq: so make [] an "unsafe" operator on objects? or just warn about it at least.
13:55:53Araqand often what starts as "immutable" ends up as "mutable" for efficiency
13:56:24filwitwe basically have the feature now anyways with auto-dereference
13:56:42filwitit just means you can't declare things as ref-object though..
13:56:55Araqno, we don't have this feature
13:57:14filwiter.. i just tested it a few days ago.. was it killed off for some reason?
13:57:41Araqwhen do person[] in your example, the thing 'friend' points to is still *mutable*
13:57:53Araqit's still not deep
13:58:08Araq(autoderef is still in the language, yes)
13:58:10filwitah, right i see
13:59:21filwitso (about deep immutability).. can't you make [] unsafe for objects and add it in that way? What other problems are there that make the feature challenging to implement? Curious.
13:59:23*aidanh quit (Ping timeout: 240 seconds)
14:00:52AraqI don't understand what you're saying
14:01:10*aidanh joined #nim
14:01:18Araq[] is not unsafe for 'ref object' (ignoring the 'nil' issue)
14:01:25filwityou said deep-immut was hard cause of `people[0][]`
14:01:41Araqno it's hard because it is hard
14:01:47filwitk
14:02:24*pafmaf_ quit (Quit: Verlassend)
14:02:25Araqit's hard because you have 2 types that act like 1 type depending on the context.
14:03:26Araqit's time dependent, which is exactly what type systems are not very good at modelling since type system model invariants
14:05:43Araqwe planned to have '!ref' for a mutable ref, and the other ref default to "deep immutability"
14:06:29filwitwouldn't that just be `var ref` instead?
14:06:38Araqno, it is not
14:07:04Araqproc setHeadofList(x: var ref T) = x = root
14:07:24AraqI don't understand why people have problems with what 'var ref' means...
14:07:42Araq'var ref' allows you to write the pointer
14:07:44Jehan_I have always wondered, why, unlike for the Pascal family of languages, the `var` comes after the colon in Nim.
14:08:05filwitAraq: yes i understand now
14:08:06Araq'!ref' would allow you to write *via* the pointer
14:08:47*aidanh quit (Ping timeout: 246 seconds)
14:09:31Araqmaybe we can still hack 'immutableRef T' into the language for 'parallel' support ...
14:09:47filwitAraq: you've obviously given this some thought and understand it's problems more than me, so it's fine. Thanks for the explanation.
14:10:06AraqJehan_: because it obviously belongs to the type. Ada uses 'inout' after the colon too.
14:10:16*aidanh joined #nim
14:10:26Jehan_Hmm, I think that's one thing that you can argue either way.
14:10:56Araqproc someview(x: var T): var S
14:11:03Jehan_I see why you'd say it belongs to the type, but one could also make a convincing argument that it's part of the calling convention for the parameter.
14:11:16Araqsee my someview example
14:11:19filwitAraq: one thing though.. if you where going to add in `immutableRef`.. why not just default `ref` to that, fix the compiler, and make `mutableRef` instead?
14:11:21Jehan_I.e. part of the procedure's rather than the argument's type.
14:11:53Araqfilwit: that breaks every nim program out there
14:11:58Araqnot just the compiler
14:12:06filwitso? we're not at 1.0 :P
14:12:22Araqso? we still have not infinite resources
14:12:29*saml_ joined #nim
14:12:48Araqeither way, this needs a good migration path
14:13:05Araqand it's not easy to solve:
14:13:31Araqproc foo(): JsonNode # mutable or not? --> caller decides
14:14:24Araqit's not like we have a good design and it's just required to update every Nim project out there
14:14:36*aidanh quit (Ping timeout: 252 seconds)
14:14:41Araqwe don't even have a solid design that's proven to work
14:14:51filwitmeh, just shelf it for Nim 2.0 far from now
14:15:19filwitso one distant date you can break things and people can adapt during that major junction
14:16:33filwiti agree.. i mean it would be great to get everything right up-front before 1.0.. but that's not realistic, obviously. So just fix things up and say if things do eventually change, they will happen at some major junction far down the road
14:16:54filwit"fix things up" == "make things stable"
14:17:14filwit(stable meaning remove bugs.. damn my words are confusing right now, lol)
14:17:38AraqI think it's far more important to communicate that we will break compat to get a better language, but we will do so with a very good migration strategy
14:17:59Araqso nothing like Python 2 vs 3 should happen
14:18:15*aidanh joined #nim
14:18:17Araqand if that means we will have {.version: 2.0.} in the language, so be it
14:18:37Araq(language version pragma)
14:18:47filwityes i agree with that. (idk about the Python analogy.. never used it much)
14:19:03Jehan_One concept I've been toying with is objects that can alternate between being immutable and mutable at runtime. Not sure if that is an idea that has a future, but it may be interesting.
14:19:23AraqJehan_: that's what 'shallow' already gives us, to some extend
14:20:27Jehan_No, that's not really what I'm thinking of. Unless I'm misunderstanding you.
14:21:01Jehan_Basically, such an object would support (let's call them) "freeze" and "thaw" operations.
14:21:24Jehan_It could be shared while in a frozen state, and could only be thawed while not shared.
14:21:56BlaXpiriti smell rust
14:21:58filwitso it's kinda like Rust's concurrent borrow checking system, only more explicit?
14:22:14Jehan_filwit: There's no static checking going on there, really.
14:22:20BlaXpiritlol how can something be more explicit than Rust?
14:22:29Jehan_So, not at all like Rust.
14:23:06filwitJehan_: i see, so 'thaw' would runtime check for sharing (like ref-counting thread use)
14:23:14Jehan_Pretty much.
14:23:28Jehan_Note that it also has applications for single-threaded use.
14:23:44Jehan_E.g. to make sure that a collection does not change while iterating over it.
14:24:17Jehan_That's in fact where I got the idea from (an old Eiffel library that implemented this via preconditions).
14:25:10filwitidk, static-checking that seems more appealing, honestly
14:25:17filwit(for iteration i mean)
14:25:37Jehan_filwit: This is about things that cannot necessarily be type-checked.
14:25:56Jehan_Or rather, where the opportunity cost of type-checking greatly exceeds the gains.
14:26:25Araqand then there is also my "write tracking" algorithm, which I can simplify and will give us roughly the same with not much code breakage
14:26:49Jehan_In general, people tend to overestimate how much type-checking buys them once you get past a certain point and hit diminishing returns.
14:26:52AraqI think that's a good route to take for 'parallel'
14:27:01Jehan_Except for "if this software bugs out people will die" kind of situations.
14:27:43Jehan_Araq: Yeah, but, there are still the usual aliasing problems.
14:28:18Jehan_I've started looking at what I described above because aliasing doesn't cause any inherent problems for the scheme.
14:28:25filwitAraq: have you written anything about your write-tracking? I would love to read it if you have.
14:28:43Araqwell I wrote an old blog post about it
14:29:04Araqhttp://nim-lang.org/blog/writetracking.html
14:29:34gokrI think I might end up giving a talk on Nim at the Stockholm Google Tech group meeting.
14:29:37filwitk, thanks
14:29:59filwitgokr: nice! :)
14:30:13gokrThere will be a Rust and Go presentation too ;)
14:30:26Araqfilwit: note that one can do it in a significantly simpler way
14:30:46AraqI think.
14:30:56filwitAraq: i'll keep that in mind.
14:31:03Jehan_Hmm, I guess I may have to write my post about constructors after all.
14:31:30AraqJehan_: when you only track "writes something via its passed arguments" then an alias analysis is not required
14:31:50filwitgokr: i think we should make it an unwritten rule to always print-out and wear a paper crown when giving Nim presentations :P
14:32:08Jehan_Araq: I'm interested in a bit more than that (for my own purposes).
14:32:11gokrHas this rule been followed earlier? :)
14:32:28filwitlol no.. but never too late to start!
14:32:44gokrI can wear a crown, no problem. :)
14:33:01filwit(i'm mostly just joking.. but I think it would be a fun thing to do if I ever talked about Nim publicly)
14:33:28gokrIf you design it - I will wear it. Make it so that I can print it on my color printer - cut it out, and then tape it together.
14:33:36filwiti mean.. the logo is a crown! it's would be so tempting to do, lol
14:33:47gokrI am with ya, all the way.
14:33:50filwitgokr: ha! awesome, you're on :)
14:34:36gokrAnd oh, can you give me a better logo to give them for this page? https://sites.google.com/site/stockholmgtug/2015-03-25
14:34:52gokrIt even says "nimrod".
14:35:18filwityes, I just gave def and flaviu all the artwork and the put it somewhere... one sec
14:37:01filwitgokr: well here's the logo... but we need one for a white background it seems: https://github.com/nim-lang/assets/blob/master/Art/logo-simple.png
14:37:48gokrYeah... that doesn't fly on white.
14:38:04filwityeah i'm making you one for a white-background. One sec.
14:38:24gokrNo problem, I am going to go fetch my plate with lunch :)
14:38:40dom96hrm, I might add something to the forum which detects when a thread gets lots of referrals from a certain website and notifies us somehow. Totally missed this for example and it got the linked forum thread over 500 hits in a single day: http://www.reddit.com/r/rust/comments/2y0izv/nim_forum_discusses_rust/
14:38:47*aidanh quit (Ping timeout: 256 seconds)
14:40:05filwitdom96: just check Google Analytics more
14:40:23dom96others might be interested in this information too though
14:40:45filwityou can make GA information public
14:40:57filwitthey have tools for that.. idk much about it though
14:41:00dom96i'd rather not.
14:41:29filwitno i mean you don't make the whole thing public.. there's just tools which you can use that expose specific parts
14:42:05flaviudom96: Another potential feature is to put a list of used IPs on user's profile pages for admins.
14:42:27dom96yeah. Tons of features need to be implemented.
14:42:33dom96Most importantly email notifications
14:42:38dom96and password reset
14:42:48*aidanh joined #nim
14:43:29filwitnot to mention my front-end additions.. which i've been completely putting off
14:43:35dom96I wonder if we should have banned runvnc, it seems that r/rust mods would have done so.
14:44:39flaviudom96: Haha, nice: http://www.reddit.com/r/rust/comments/2y0izv/nim_forum_discusses_rust/cp790j6
14:44:50dom96;)
14:45:08filwitdom96: a ban is too much, IMO.. it would be better if you could just change his title's post and edit his posts with an "this behavior will not be tolerated" message
14:45:18filwitpost's title***
14:45:36gokrI dunno, IMHO (and its mine) web forums (normally anonymous etc) tend to ... invite to these "not so polite" posts.
14:46:03flaviurunvnc isn't anonymous though.
14:46:21gokrIn what way is he not?
14:46:36gokrI can't see his name or email.
14:46:42*gokr fetching lunch...
14:46:43flaviuhttps://github.com/runvnc
14:47:06gokrOk, fine. But that takes research to find.
14:47:50Araqdom96: I cannot see why a ban would have been justified
14:48:01filwiti don't like the idea of banning people just because they're abrasive.. at least not on first offense. Just change the title (if you can), or delete it. Then warn him in private.
14:48:27flaviufilwit's approach seems like the best idea.
14:49:06dom96What would you change the title of the forum thread to?
14:49:49Araqhum? "Rust pwnage"? you want to censor *that*?
14:49:53*vezzy quit (Read error: Connection reset by peer)
14:50:09Araqmaybe pwnage doesn't mean what I think it does
14:50:33dom96yeah, it's not that bad IMO.
14:52:13dom96His post would be far better if he didn't write "LOL" at the end of each paragraph.
14:52:48dom96I do feel like we need to come up with concrete guidelines of what is and what isn't ok.
14:52:56Araqso now you want to censor "LOL"?
14:53:09dom96I don't want to censor anything.
14:53:24flaviuAt this point, just leaving it be is probably the best solution. It'll drop off the front page soon.
14:53:37filwithonestly, i think even with his title and post, our responses did just fine in addressing this as-is
14:53:37dom96At this point, yes.
14:53:45dom96Question is what do we do in the future if a similar post shows up?
14:53:58Araqwe'll continue to use our brains :P
14:54:11*quasinoxen joined #nim
14:54:14dom96fair enough :P
14:54:27gokrIMHO its not about censoring, its about being nice or not.
14:54:45ekarlsohttp://185.56.186.94/#/
14:54:52ekarlsosome new stuff deployed..
14:55:08Araqekarlso: can I write a 'while true' loop now?
14:55:09ekarlsoadding cc / version switch in a bit
14:55:12ekarlsoAraq: haha
14:55:14ekarlsoyeah
14:55:24Araqwe'll see about that
14:55:38filwitflaviu: do i have push-rights to the nim-lang/assets repo?
14:56:01flaviufilwit: yep
14:56:07filwitk, thanks :)
14:56:21Araq"Output too long..."
14:56:32ekarlso:P
14:56:34Araqwell but it didn't show a single line of output!
14:56:44flaviuOutput playpen: timeout triggered!
14:56:49dom96ekarlso: Seems that "devel" overlaps some other text.
14:56:50ekarlsoif your output is longer then 1k lines
14:56:57ekarlsoit stops you :p
14:57:03*darkf quit (Quit: Leaving)
14:57:21Araqer .. that's not how you prevent endless loops
14:57:30Araqthe loop doesn't have to produce output
14:57:42flaviuAraq: That just prevents sending GBs back to the client.
14:57:53flaviu"Output playpen: timeout triggered!" prevents infinate loops.
14:58:00Araqok ok, good
14:58:02ekarlsoAraq: yeah I know..
14:58:06Araqgotta go, bbl
14:58:32dom96ekarlso: Very nice.
14:58:39flaviuekarlso: API seems simple enough too. POST /runs, {"version":"devel","cc":"tcc","input":"while true:\n discard"}
14:58:52ekarlsoflaviu: it is :p
14:58:58dom96ekarlso: might be better to just have one output box though
14:59:11ekarlsodom96: well got some ideas around that :p
14:59:12dom96For smaller screens you have to notice that it goes below your viewport
14:59:24dom96I would put it on the right
14:59:28ekarlsodom96: the idea is that anything that's not latest will be "hidden"
14:59:34ekarlsothen have a scroll bar
14:59:39ekarlsoso newest is always on top
14:59:39flaviuI like the multiple boxes, but wouldn't adding the output to the top be better?
14:59:47flaviuThat way the most recent command is always on top.
15:00:08ekarlsopatches are always welcome :p
15:00:14dom96hehe
15:00:16dom96Fair enough
15:00:38ekarlsogot some code on my macbook also to allow options to be passed
15:00:55dom96I agree, it's easy to ask for things to be changed but the code is open source so we should just make the changes ourselves. I've been there :)
15:00:58ekarlsoso like {"options": {"cc": "tcc", "checks": "off"}}
15:01:10dom96ekarlso: It uses jester right?
15:01:14ekarlsodom96: yeah :p
15:01:21dom96ekarlso: yay cool
15:01:25ekarlsohttps://github.com/ekarlso/nim-playpen < is the api
15:01:33dom96ekarlso: Now that you've had time to play around with Jester, what do you think of it?
15:01:44ekarlsodom96: it's pretty ok :P
15:01:56ekarlsostill could have better support for stuff like auth etc :P
15:02:08^aurora^hello …
15:02:12dom96ekarlso: It's not even at version 0.1 yet :P
15:02:20dom96ekarlso: but please create issues on github for the stuff you want
15:02:23*aidanh quit (Ping timeout: 240 seconds)
15:02:37^aurora^i would like to ask if there's somewhere a little "tutorial" available of what exactly tainted strings are …
15:02:41^aurora^on this page for example:
15:02:42ekarlsodom96: eh, you are allowed too to do it :p
15:02:43^aurora^http://nim-lang.org/manual.html#taint-mode
15:02:58^aurora^it just says: "it is safe here to output the name without any input validation" …
15:03:02dom96ekarlso: to do what?
15:03:05^aurora^but it does not say, what it prevents :)
15:03:12ekarlsodom96: create issues on stuff _you_ want ;P
15:03:24dom96ekarlso: I don't need to, I own the project, it's all in my head
15:03:39ekarlsodom96: ah, you meant for jester :p
15:03:41BlaXpirit^aurora^, it prevents echo name
15:03:41ekarlsook
15:03:43dom96^aurora^: It's only activated when you compile with --taintMode:on
15:04:29dom96ekarlso: yeah :)
15:04:39flaviuekarlso: I'm not going to send a PR because I haven't tested locally, but `run in results.slice().reverse()` in https://github.com/ekarlso/nim-play-frontend/blob/master/src/app/runs/index.html#L42 should work.
15:04:58dom96^aurora^: So when you get data from stdin.readLine it's a TaintedString because it comes from an unknown source, the string could contain anything.
15:05:33dom96^aurora^: When taint mode is on, the compiler makes sure you are aware of this by making you explicitly convert it to a string.
15:06:19^aurora^dom96: mmm … ok i understand. so it's for example to prevent SQL injections or shell-injections and such kind of things?
15:06:20*aidanh joined #nim
15:06:27dom96^aurora^: Exactly.
15:06:36^aurora^dom96: thanks!
15:06:44dom96^aurora^: Of course converting it to a string is not all you need to do in that case.
15:06:51flaviuI'd hope it isn't your primary defense against SQL injections.
15:06:53dom96You should have some sort of escape procedure.
15:07:18dom96the db_* (db_sqlite etc) modules provide a slightly different mechanism for this though.
15:08:48^aurora^dom96: yes … i understand this. so it's just to make the developer aware of possible security implications. because i could also just use "normal" strings and validate / escape them
15:09:08dom96^aurora^: Precisely.
15:09:24^aurora^cool. thanks very much :) …
15:09:39*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
15:10:10gokrfilwit: New logo comijng? :)
15:10:21gokrfilwit: New logo coming? ;)
15:10:46*davidhq joined #nim
15:10:55filwitgokr: yes i'm working on it now. I just need to remake the mono-chrome version cause I guess I didn't save that one before. Almost finished.
15:11:27*davidhq quit (Client Quit)
15:12:27*davidhq joined #nim
15:16:02gokrMy presentation will be the 25/3, about 40 minutes. After Rust and then Go after me.
15:16:23gokrIt will not be only about Nim, I will try to mix it up with what we are doing with it. People like 3D :)
15:16:39gokrBut it usually draws about 50 people at least, and I think they may record.
15:17:13*davidhq quit (Ping timeout: 255 seconds)
15:17:14filwitgokr: https://github.com/nim-lang/assets/blob/master/Art/logo-monochrome-black.png
15:17:37filwitgokr: there's a white and blackSVG version in the parent director as well
15:17:53filwitgokr: if you want something specific, let me know.
15:18:23gokrOk, yeah it works. :) One could imagine taking the one from the homepage but "cutting it out" as a "plaquet" with rounded corners or something. Like a banner.
15:19:27*aidanh quit (Ping timeout: 245 seconds)
15:19:38filwitgokr: I can make that if you prefer it that way. Want it?
15:19:42gokrIn fact, if you take "new-design.png" and just cut it out.
15:20:02filwitsure
15:20:04gokrThe only black version looked a bit... "dry".
15:20:21filwitnp :)
15:20:25dom96gokr: you're making a presentation? where?
15:20:33flaviugokr: https://raw.githubusercontent.com/nim-lang/assets/master/Art/logo-github.png
15:20:42gokr25/3, GTUG Stockholm.
15:20:49dom96filwit: I like that.
15:21:15gokrHmmm, well... I want the Nim name + and rounded corners :)
15:21:16dom96gokr: cool
15:21:49gokrI mean *with* the Nim name.
15:21:56filwitdom96: :) (ps. We've made it an unofficial rule to wear Nim crowns when giving presentations :-D)
15:22:03gokrdom96: I presented there before, its a good crowd.
15:22:13filwitdom96: paper cutout crowns i mean
15:22:27gokrYeah, filwit will produce a paper cutout for me.
15:22:49filwit(just joking about the unofficial rule bit, but I think it's fun either way)
15:24:29filwitgah, i need to clean up this assets folder.. some of this artwork is older iterations of the logo and shouldn't be used
15:25:42*jsudlow quit (Remote host closed the connection)
15:29:28*jsudlow joined #nim
15:30:46*aidanh joined #nim
15:35:29filwitgokr: https://github.com/nim-lang/assets/blob/master/Art/logo-withBackground.png
15:35:30gokrfilwit: Something like: http://files.krampe.se/nim-banner.png
15:35:56gokrAh, yes, yours is better.
15:36:42filwitgokr: please don't use that (the one you linked too).. that's exactly why I need to remove that 'new-design' thing.. it's old (notice it doesn't have all the effects, like white rim)
15:36:51gokryes, I realized
15:37:28flaviufilwit: btw, what's happening with the shadow on the i's dot?
15:38:14filwitflaviu: you've got a good eye or your screens brightness is turned way up.. didn't notice that. Let me take a look.
15:38:47gokrfilwit: Is this ok? http://files.krampe.se/nim-logo2.png
15:39:01gokrI can send him that, need to run now.
15:39:07dom96filwit: I like that rule :)
15:39:41filwitgokr: that's fine, though personally I would have left in all the padding, but maybe you need it at the resolution. Either way it's fine.
15:39:49filwitdom96: ;)
15:39:57gokrfilwit: Cool, later
15:40:48dom96I would really love to get a Nim t-shirt. You guys know of any good companies that could make some Nim t-shirts?
15:43:00ekarlsolumx is pretty cool for UI
15:43:05ekarlsomaterial design ftw
15:46:28*gokr_ joined #nim
15:48:01TEttingerdom96: shapeways
15:48:15TEttingermake the Nim logo in brass
15:48:35TEttingerwho needs a t-shirt when you have the Nim Crown
15:49:53dom96hah
15:50:03filwitflaviu: i fixed the visual issue with the Nim 'i'. Nice catch, thanks.
15:50:22ekarlsoI think honestly
15:50:29ekarlsoI will switch packages too to use lumx
15:51:22filwitdom96: just pick any of the many online printing companies out there.
15:51:53dom96filwit: I'm sure there are many. Question is which one is the best and can deliver to the UK in a reasonable amount of time.
15:52:03filwitdom96: the main thing is how the shirts will fit, and the quality.. but that all depends on each person's body type and preferences.
15:52:14BlaXpiritlol just walking around in a crown
15:53:17BlaXpiritand no problem with fitting
15:53:46filwitekarlso: lumx looks pretty cool.. i just usually don't like the current trend of bolting on JS as a front-end UI language.
15:55:49filwitI'm going to need to make the crown cutout in two sections so it can be printed on anyone's printer
15:56:48dom96filwit: ooh, you're actually going to make this? :O
15:56:59filwitof course!
15:57:07dom96Awesome!
15:57:16dom96I may just go into my lectures wearing it :P
15:57:24filwithell yeah!
15:57:25filwitlol
15:58:16filwitmakes me want to give a talk on Nim now :) We have the best logo for it.. other people just wear shirts be we have a good excuse to wear silly hats. it's brilliant, lol
15:58:54dom96:D
15:59:27filwitproblem is printing it is going to be a pain for most people... i should two version: one anyone can print with a few steps, and one you have to take to kinkos (cause it'll be longer than a single sheet of paper)
16:00:04filwitthere's no way you can accurately do two-sided printing (without a lot of drift) on most household printers
16:00:52filwitso we're going to have to like fill the whole page with gold on one side, black on the other,then print over that with a white outline so you can see where to cut.
16:01:13flaviufilwit: Sounds like more people need to get duplex printers :)
16:01:33gokr_go go :)
16:02:40filwitwait gokr: is your talk today? I don't think I can get this done in the next 15 mins...
16:03:20filwiti can try though
16:03:44flaviuLooks like it's 2015-03-25.
16:03:57filwitoh, okay nevermind
16:03:59gokr_yeah
16:04:15gokr_no hurry
16:08:09*kniteli quit (Ping timeout: 245 seconds)
16:09:31filwitAraq, dom96: I've decided I don't really need vertical tabs in Aporia right now.. I mean, you can only really manage so many tabs at once, and a file-browser basically works for browsing a project.
16:09:58dom96filwit: that's good
16:10:25filwiti'll add de-indent on backspace eventually though, but I'm mostly going to just work on my own project now (and fix up the forums)
16:11:58ekarlsoflaviu: :P
16:18:22*JusticeFries joined #nim
16:22:31BlaXpiritguys, umm you're talking about printers
16:22:35BlaXpiritu cant just print gold
16:22:50BlaXpiritbut there is gold/shiny hard paper
16:23:14BlaXpiritu could print a schematic easily and use it to cut with scissors or something
16:23:20flaviuYou could print a cutting stencil
16:23:41flaviuWhich you can tape on top of some gold paper and use a knife.
16:26:33BlaXpiritwell yeah
16:27:28filwitnot a bad idea
16:30:02dom96would be nice to get a cardboard crown
16:40:56*goobles joined #nim
16:53:53filwitAraq: unfortunately now even `0 .. nums.high` is not working inside a parallel :\
16:54:05*gokr_ quit (Ping timeout: 250 seconds)
16:55:00onionhammerekralso i got the site to 'gulp' :P
16:55:05onionhammerekarlso*
16:55:36filwitAraq: In fact I cannot get this to work at all anymore (it works with the more complex example, but a simplified version doesn't pass disjoint checking no matter what I do
16:55:44*gokr_ joined #nim
16:56:34filwitguess I'll just error report all the code
16:57:20*Matthias247 joined #nim
16:58:59filwitahh.. it doesn't work with arrays.. but works with seqs
17:00:04*jsudlow__ joined #nim
17:02:24*jsudlow quit (Ping timeout: 246 seconds)
17:02:33ekarlsoonionhammer: ?
17:03:04onionhammertook me a half hour but i finally got the front end running :P
17:03:20ekarlsoonionhammer: hah :p
17:03:23onionhammernot sure why u had to use *all* of the crazy front-end libraries u could find :P
17:04:18onionhammerdoes the app isolation stuff work on OS X?
17:04:42Araqfilwit: report it, report it, report it
17:04:47*JusticeFries quit (Ping timeout: 246 seconds)
17:05:04Araqpeople who developed a feature shouldn't be the same who test it ;-)
17:05:32Araqbut 'parallel' should end up in .experimental anyway
17:05:44Araqnot that it matters, everybody uses .experimental
17:07:17filwitprobably shouldn't be the first slide on the website then
17:07:57filwitbut heh, it's a great feature really
17:08:06filwitreported both issues
17:10:23*gokr_ quit (Ping timeout: 246 seconds)
17:17:33ekarlsoonionhammer: no :)
17:17:46ekarlsoonionhammer: but there's a vagrant file that brings up a vm if you have vagrant installed !
17:19:06onionhammerah ok
17:19:09onionhammeri'll maybe give that a spin
17:21:00*_1_Giovanni joined #nim
17:21:33*_1_Giovanni quit (Remote host closed the connection)
17:23:21*saml_ quit (Remote host closed the connection)
17:47:20reactormonkAraq, want an issue for overlong arrays too?
17:48:26reactormonkactually, it does check.
17:55:04gokrLooks better, this time Nim ontop of Rust ;): https://sites.google.com/site/stockholmgtug/2015-03-25
17:55:30reactormonkgokr, except the image doesn't load here
17:55:35reactormonkah, now it does
17:55:56gokrOh, he actually linked from my site, hmm, ok.
17:57:54*UberLambda joined #nim
18:00:30AraqMaxdamantus: dunno why I didn't mention it earlier but type checking for generics when the generic types all have a type should really be done at some point
18:01:27Araqwell I mean when every T is constrained by a "generic"
18:01:38reactormonkis `var` transitive?
18:01:49reactormonkehh, rather the other way. is not `var` transitive?
18:04:04*UberLambda quit (Remote host closed the connection)
18:04:35Araqno its not
18:05:27reactormonkyou can have an object with a var field?
18:10:17*UberLambda joined #nim
18:13:09*^aurora^ quit (Quit: Leaving.)
18:15:23ekarlsoonionhammer: bare in mind though I got a ok large patch atm here locally :p
18:27:03*wb quit (Read error: Connection reset by peer)
18:29:44Araqreactormonk: no you cannot
18:36:04*TEttinger quit (Ping timeout: 256 seconds)
18:36:28novistis c sources for bootstrapping version say 8_2 actually meaning 0.8.2?
18:37:57onionhammerekarlso ah ok
18:38:01onionhammeri'll wait to see what u have in store
18:38:25*Matthias247 quit (Read error: Connection reset by peer)
18:39:12BlaXpiritwhat, novist?
18:39:42novistthat https://github.com/nim-lang/csources/tree/devel/c_code/8_2
18:39:59novisttrying to make sense of version cause apparently i have no better things to do
18:40:20BlaXpiritthat's not versions
18:40:39BlaXpiritor is it..
18:40:51def-that's the combination of os and cpu architecture
18:40:57def-8 is the OS, 2 the cpu
18:41:08BlaXpiritcoool
18:41:11dom96Araq: I refactored suggest in Aporia a bit. It might work a bit better now.
18:41:40novistnow thats interesting
18:43:04dom96I think I will make nimsuggest exit with a pre-defined exit code if the port is already being used.
18:57:07Araqbtw Maxdamantus gave Nim the alternative (int, int, float) syntax for tuples! :D
19:06:27def-nice work, Maxdamantus
19:08:22BlaXpirithow did you learn the workings of the compiler?
19:10:03*jsudlow__ is now known as jsudlow
19:15:40AraqBlaXpirit: believe it or not, some people can read and modify the compiler :P
19:16:14dom96implementing new things is easy, fixing bugs on the other hand...
19:18:09filwitgokr: Nim logo looks good. Looks like the Go gopher is a bit taken aback by it or something.
19:18:55BlaXpiritit's more than taken aback, because it doesn't even load for me
19:19:11filwitoh, that's unfortunate
19:19:14filwitloads here just fine
19:19:45BlaXpiritI was able to download it, but on page it just doesn't show o.o
19:19:54filwitodd
19:20:11gokrI can tell him to copy it
19:20:38BlaXpiritshows in chromium... don't mind this
19:21:59*lnr quit (Read error: Connection reset by peer)
19:22:04filwitwhat browser where you using before? just tried in firefox and it works there too
19:23:38flaviuDoesn't work for me neither, firefox.
19:23:53BlaXpiritit is not a valid image file. it is not png, for sure
19:24:14BlaXpirit"RIFF (little-endian) data, Web/P image"
19:24:31BlaXpiritmm probably offtopic
19:28:39BlaXpiritwill conversion from one integer type to another always work the same on every platform? for example, converting a large integer to uint8
19:29:07flaviuYes.
19:29:43flaviuHowever, array[4, uint8] -> uint32 is UB
19:30:00BlaXpiritno, I mean like 345346364 -> uint8
19:30:13flaviuYeah, that's fine
19:31:16*^aurora^ joined #nim
19:33:33BlaXpirituhh so converting it to uint8 works, but converting to int8 gives RangeError
19:34:58flaviuWell, int8 is a number, uint8 is a bit pattern. So it makes some amount of sense.
19:35:42BlaXpiritso how can I convert any integer type to any integer type, giving priority to little bits?
19:36:32flaviuand 0xFF?
19:36:54BlaXpirit?
19:37:27flaviu.eval let x: uint = 25940840239; echo(int(x and 0x7F))
19:37:31Mimbusflaviu: eval.nim(3, 14) Error: type mismatch: got (int64) but expected 'uint'
19:37:47flaviu.eval let x: uint = 25940840239u; echo(int(x and 0x7F))
19:37:52Mimbusflaviu: 47
19:38:22BlaXpiriti think that gives me enough information. thanks.
19:40:17Jehan_BlaXpirit: use cast?
19:40:26BlaXpiritI want consistent behavior
19:40:34BlaXpiriton litle endian, big endian
19:40:36flaviuCast will be consistant.
19:40:47BlaXpirithow so?
19:40:57BlaXpirithm this is news to me
19:40:58flaviuIt's just when you're converting array[4, uint8] that it won't be consistant.
19:41:24Jehan_Because cast between ints have nothing to do with endianness. Casts between ptr int and ptr int8 etc. can.
19:41:28BlaXpiritcast is perfect then
19:42:29Jehan_Of course, I'm not sure if you want to really cast 0xffff to -1'i8, for example.
19:50:19*fowl quit (Ping timeout: 252 seconds)
19:53:46federico3getContent() from httpclient can raise TimeoutError. I'm trying to catch it but I'm getting an "undeclared identifier" build error
19:54:14federico3otoh, HttpRequestError is declared/defined
19:55:29BlaXpiritgive code
19:59:09*federico3 hands http://paste.debian.net/160150/
19:59:18federico3line 69
20:01:39dom96federico3: You probably need to import net
20:02:54federico3dom96: thanks, it worked. Now: how am I going to find out which module I should have imported next time?
20:02:59BlaXpiritexactly
20:03:08BlaXpiritdom96, can you see the problem here?
20:03:49flaviufederico3: http://nim-lang.org/theindex.html
20:03:59BlaXpiritfederico3, by examining every single module from "Imports"
20:04:00flaviuand you can search for Timeouterror.
20:05:40dom96BlaXpirit: I see it. Can you provide a reasonable solution?
20:05:55federico3out of curiosity, given that httpclient's procs can raise TimeoutError, why isn't httpclient also exporting that exception?
20:06:02BlaXpiritalso ^this
20:06:22BlaXpiritwell one solution would be to mention all the used external symbols in the docs...
20:09:18dom96httpclient doesn't raise it, net does.
20:10:56BlaXpirithttpclient has .raises. TimeoutError
20:11:14BlaXpiritawesome solution: make every symbol a link
20:11:35BlaXpiritthen every doc page will weigh a couple megabytes, but whatever
20:11:52flaviuCompression!
20:12:54BlaXpiriti think this shouldn't even be very difficult
20:13:27dom96PRs welcome
20:13:28dom96bbl
20:17:13VarriountAraq: Well, I did say that I might be wrong.
20:26:11BlaXpiritthen I wonder why cast[int](-1'i8) == -1
20:27:04BlaXpiritshouldn't it be 255
20:27:27BlaXpirit0xff casts to 0xffffffff
20:31:53BlaXpiritc++ says it's an invalid cast :o
20:32:57BlaXpiritoh i see now why it works like this...
20:33:03BlaXpiritsimple C cast is used
20:33:52BlaXpiritI thought nim's cast is reinterpret_cast, and I was wron
20:33:54BlaXpiritg
20:34:26BlaXpirit(well obviously not literally C++ cast, but maybe implemented through pointers)
20:37:18*filwit quit (Quit: Leaving)
20:45:08*reem joined #nim
20:53:36Varriountonionhammer: Can you explain to me exactly what the 'set project file' command is supposed to do?
20:56:42onionhammerVarriount it was used for idetools project file
21:02:34dom96you should add some detection mechanism for that
21:02:57onionhammerthe detection mechanism should be in nimsuggest
21:05:46dom96agreed
21:18:26*bcinman joined #nim
21:26:54ekarlsoonionhammer: around ? :p
21:27:25*reem quit (Remote host closed the connection)
21:30:03federico3I'm trying again with a new PR, #138
21:30:57*reem joined #nim
21:33:08*reem quit (Remote host closed the connection)
21:39:59*UberLambda quit (Quit: Leaving the Matrix)
21:42:38*OderWat joined #nim
21:45:17*aidanh quit (Ping timeout: 245 seconds)
21:47:42*greato joined #nim
21:47:44*aidanh joined #nim
21:53:45*^aurora^ quit (Quit: Leaving.)
21:56:54*Menche quit (Quit: Leaving)
22:01:50Araqreactormonk: did you really update our PR without testing anything?
22:02:02BlaXpiritis there a better way to write sizeof(T)*8 ?
22:02:09reactormonkAraq, which one?
22:02:20Araqthe 'result' shadowing message
22:03:04AraqBlaXpirit: no. it's fine. octets did win three decades ago
22:03:41BlaXpiritthanks
22:05:54reactormonkAraq, apparently I tested the wrong branch -.-
22:07:01*reem joined #nim
22:09:17BlaXpiritwhy can't I do this?
22:09:19BlaXpirit.eval proc zero(T: typedesc): T = T(0); echo zero(int)
22:09:22MimbusBlaXpirit: eval.nim(4, 9) Info: instantiation from here
22:10:32BlaXpiritwell, all I want is turn stuff[int]() into stuff(int)
22:10:38BlaXpiritbut apparently it's not such a good idea
22:10:57Araqyeah there are many typedesc related bugs
22:11:21Araqit's already reported btw, don't bother
22:11:40BlaXpiritthx for reply anyway
22:13:45def-.eval proc zero[T]: T = T(0); echo zero[int]()
22:13:48Mimbusdef-: 0
22:14:20ekarlsodef-: switching it to use the api soon ? :p
22:14:30*saml_ joined #nim
22:14:32def-ekarlso: switching what?
22:14:42ekarlsoMimbus:
22:14:48def-i have nothing to do with mimbus
22:14:51ekarlsoah ok
22:14:53ekarlso:P
22:15:32def-ekarlso: and the website still is unreachable for everyone after one person did a "while true" loop
22:17:09ekarlsowhile loops are the root of evil :(
22:17:57*Jesin quit (Quit: Leaving)
22:23:04def-even if something runs for just 1 second, you can't have the website unavailable for a second then
22:25:54*Menche joined #nim
22:29:18ekarlsodef-: yeah, I gotta try out the asyncproc stuff :p
22:29:44BlaXpiriti'd just run everything on the same server that rust uses
22:29:55BlaXpiritlet's be reasonable here
22:30:06ekarlsoBlaXpirit: what you mean ?
22:30:20BlaXpiritit never occured to me that Nim would be used to run the server for playpen
22:30:39ekarlsoBlaXpirit: what you mean ?
22:31:08def-ekarlso: he means that you could just have used this web interface: https://github.com/rust-lang/rust-playpen
22:31:09BlaXpirityou are using Nim and Jester to run your playpen, is that correct?
22:31:37ekarlsoBlaXpirit: and so ?
22:31:41BlaXpirithah, even Rust's playpen uses Python
22:31:58BlaXpiritekarlso, and so you might run into problems and get unnecessary work to do
22:32:32*fowl joined #nim
22:33:35ekarlsomight as well fix it BlaXpirit ...
22:33:40ekarlsomade alot of effort already :p
22:35:37ekarlsou dont like it BlaXpirit ?
22:35:39ekarlso:p
22:36:11BlaXpiritI don't like it when it's down
22:36:25ekarlsoi'll try out the asyncproc in a bit
22:36:49ekarlsoI wonder how to avoid the oom stuff though
22:38:42onionhammerekarlso back
22:48:40BlaXpirithah, workaround
22:48:49BlaXpiritproc zero[T](): T = T(0); proc zero*(T: typedesc): T = zero[T](); echo zero(int)
22:49:54*xificurC quit (Ping timeout: 272 seconds)
22:50:02ekarlsoBlaXpirit: dont think my effort is that bad :p
22:50:26ekarlsobest of it is to get to learn more nim haha
22:50:50BlaXpiritman, i got myself on the wrong side of nim
22:50:55BlaXpiritdoing all kinds of low level stuff
22:51:09ekarlsowhat you doing BlaXpirit ?
22:51:13BlaXpiritfrom C bindings to bitwise number manipulation
22:51:27ekarlsoBlaXpirit: another thing I got locally also is a supervisord conf for it
22:51:35ekarlsoso even if it crashes it'll be backup
22:51:53BlaXpiritthat's nice but can it serve multiple people at once, at least?
22:52:10ekarlsoBlaXpirit: that's why I hope for the async stuff
22:52:16BlaXpiritgood luck
22:52:18ekarlsoor i guess I'll have to do a thread pr thing :p
22:52:29ekarlsoBlaXpirit: doesnt sound too positive :p
22:52:57BlaXpiriti'm always like that
22:59:20flaviuekarlso: Can you disable minification for Play temporally?
23:00:57ekarlsoflaviu: :/
23:01:01ekarlsoa bit hard to do sorry
23:01:49flaviufair enough, thanks for looking into it.
23:02:19*potsmodern1 joined #nim
23:03:13*potsmodern1 is now known as slkdfj
23:03:33*slkdfj quit (Client Quit)
23:05:13*greato quit (Ping timeout: 265 seconds)
23:05:27ekarlsoflaviu: what's wrong ? :p
23:06:00flaviuIt takes a moment to load, and I wanted to see what was taking all that time.
23:06:14ekarlsoah
23:09:08BlaXpiritflaviu, maybe it's because the server is not responsive?
23:10:23dom96what's minification?
23:10:23flaviuhmm, maybe. 862K JS? :O
23:10:28flaviuI think that's it.
23:10:43flaviuSince the CSS doesn't appear to load until the JS has loaded in.
23:11:02flaviuAnd there is no caching, so that JS has to be downloaded every time.
23:11:03BlaXpiritsinglethreaded and whatnot
23:11:13BlaXpiritmaan
23:11:22ekarlsothink ill go back to plain jquery..
23:11:27ekarlso:p
23:12:04flaviuBlaXpirit: No, singlethreaded has nothing to do with this. I *think* HTTP2 would improve performnace here.
23:13:17def-dom96: usually making javascript smaller (and unreadable)
23:13:26flaviuekarlso: Check out closure compiler, see how much it can squeeze out of that JS.
23:13:40dom96oh right
23:13:45ekarlsoflaviu: ?
23:14:14dom96is this angular that's so big?
23:14:33ekarlsoi tihnk it's the lumx crap
23:14:43BlaXpiritflaviu, I'm pretty sure it's minified as best as possible
23:14:44ekarlsothat pulls in overkill stuff
23:14:53BlaXpiritthese scripts are given in already minified state
23:15:11*jferg2010 joined #nim
23:15:27flaviuBlaXpirit: Closure compiler does some fancy stuff...
23:15:43BlaXpiritflaviu, what i mean is they might even have used it
23:16:31onionhammerekarlso went a little overboard on the client side libs :p
23:16:37dom96Best way to fix this problem: remove lumx, reimplement the stuff you actually use out of it in Nim :P
23:16:42ekarlsoonionhammer: :p
23:17:01ekarlsodom96: usually just scrapping lumx
23:17:03ekarlsoshould be fine
23:17:04BlaXpiritthe only justifiable lib here is text editor
23:17:15ekarlsouse aceeditor and jq
23:17:19onionhammerso i got the vagrant running ekarlso
23:17:22onionhammerwhat now? :P
23:17:39dom96what do you need jquery for?
23:17:54ekarlsowhat else you wanna do post etc with ?
23:18:22BlaXpiritwell that's justifiable too
23:18:36onionhammeryeah jquery is fine imo, that and ace are all u need :p
23:18:57flaviudom96: Everything is difficult without jquery.
23:19:16dom96I disagree.
23:19:35onionhammernot difficult, but more verbose
23:19:41dom96indeed.
23:20:04dom96Maybe you will reimplement some things that jQuery implements but you'll end up with leaner JS.
23:20:32onionhammerjquery is definitely bloated, dont get me wrong
23:20:36Araqyou'll also learn lots of things and at the end you can debug it
23:20:48dom96http://youmightnotneedjquery.com/
23:21:15dom96it's not even that much more verbose
23:21:24dom96(Look for the AJAX section)
23:23:58ekarlsois there a simple css thing to use ?
23:24:02flaviulooks like closure compiler only does 866.33KB -> 706.3KB
23:25:12flaviuekarlso: 97% of the css is unused.
23:26:21flaviuekarlso: https://github.com/ben-eb/gulp-uncss ?
23:26:40ekarlsoflaviu: or just scrap lumx..
23:27:05flaviuDunno, lumx looks pretty great.
23:27:08ekarlsoallmost tempted to let onionhammer code it :p
23:27:19MaxdamantusAraq: hm, so `proc foo[T: Bar, U: Baz]()` would be checked but `proc foo[T: Bar, U]()` wouldn't?
23:27:48Araqwell actually more like
23:28:04Araqif would be checked but 'U' is like "ok, everything goes"
23:28:09Araq*it would
23:28:19ekarlsoonionhammer: suggestions ?
23:28:23dom96ekarlso: This really shouldn't be that difficult. It's a very simple site, CSS should be minimal.
23:28:34dom96just grab normalise.css
23:28:42dom96and add some simple rules
23:28:50ekarlsodom96: ... I SUCK at css
23:28:53ekarlsoand I do hate it :p
23:29:02ekarlsoa reason why I go with bootstrap / lumx :p
23:29:22dom96ekarlso: You've got an excuse to learn it then :P
23:29:36ekarlsodom96: I got enough stuff at $job$ to learn :p
23:29:46MaxdamantusAraq: by "everything goes", you mean "this works for all types"?
23:30:20ekarlsowhat I dont get with lumx is why it puls stupid jq
23:30:26ekarlsowhen angular really doesnt need it
23:31:01onionhammerekarlso im more than happy to let you do the coding, I was just offering to help you pretty up the front end styles more than anything :0
23:31:04Araqno, I mean if there is a 'u' of type 'U' then function(u) is valid for any function
23:31:13onionhammerIm only belly aching because it's such a PITA to get it set up and running :P
23:31:18Araqsince it's unconstrained
23:31:25Maxdamantusbecause of things like: 22:27 < ljharb> NIH is a dangerous disease
23:31:27ekarlsoonionhammer: yeh, readme's are lacking atm :p
23:31:32flaviuekarlso: The minimal-effort, maximum-yield solution is to enable caching.
23:31:50onionhammerjust use nginx and let it handle caching
23:31:50MaxdamantusSorry ljharb.
23:31:58ekarlsoflaviu: still I think lumx pulls in lots of stuff that even angular for this isn't needed ..
23:32:19ekarlsolike jquery ..
23:32:38ekarlsoit doesnt cache currently ?
23:33:29BlaXpiritapparently not
23:33:31MaxdamantusAraq: mm, so it becomes a bottom type.
23:33:35onionhammerare you guys counting gzipped too?
23:33:43onionhammernginx would do the gzipping
23:33:45BlaXpiritif it's even gzipped
23:33:46*clynamen joined #nim
23:33:49BlaXpiritwhich i doubt
23:34:01onionhammeralso serve the static stuff
23:34:25flaviuekarlso: http://imgur.com/hx0ByAG,PaYGMIZ
23:34:48flaviuYou want as much as possible to be orange triangles.
23:34:49ekarlsoflaviu: yeah, and that vendor thing
23:34:51ekarlsocontains
23:34:51dom96Jester still needs to have caching implemented.
23:35:02ekarlsohttp://ui.lumapps.com/ < all of that
23:35:28ekarlsoangular, jq, velicoity, moment.js,
23:35:36ekarlso+ aceeditor
23:35:40*Maxdamantus noticed he missed something in the parsercomb.nim test he added: forgot to specify the generics in the `fail` proc, which is the only one unused.
23:35:55ekarlsojq velocity and moment should be easy to kil
23:36:06ekarlsoif one stopped using lumx
23:36:09*Maxdamantus wonders if he should make a PR for it.
23:36:21flaviuLet's point and laugh at lumx: http://i.imgur.com/cGxuH8N.png
23:36:38onionhammeryuck
23:36:42ekarlsoouch :p
23:36:48BlaXpiriti can't even
23:37:14Maxdamantuss/Result(/Result[T, O](/
23:37:42AraqMaxdamantus: btw why do you use generic methods?
23:37:44flaviuekarlso: Try purecss? 4K of css.
23:38:05MaxdamantusAraq: I didn't realise the distinction methods made when I first tried to write them.
23:38:10MaxdamantusThey should be procs.
23:38:37*reem quit (Remote host closed the connection)
23:38:45AraqMaxdamantus: well PRs are always welcome
23:38:59ekarlsoflaviu: gimme some
23:39:10*reem joined #nim
23:39:16MaxdamantusOkay, might as well fix those few things then.
23:41:24*jferg2010 quit (Quit: Leaving)
23:42:14MaxdamantusApparently that first fix causes invalid C code to be generated.
23:43:29Araqand now you have something to do ;-)
23:44:02*reem quit (Remote host closed the connection)
23:44:34*reem joined #nim
23:45:06Maxdamantusit sounds like it's another case of that last .eval I did here.
23:45:42Maxdamantus.eval type T = distinct proc(); var a = T(proc() = discard); a()
23:45:47MimbusMaxdamantus: Error: execution of an external program failed; rerun with --parallelBuild:1 to see the error message
23:46:09Araqdistinct procs are unfair :P
23:46:19Araqnever used these
23:46:44federico3dom96: the package check script could be run with TravisCI
23:48:06dom96federico3: right. I guess i'll need to set that up.
23:50:00BlaXpiritOderWat, here?
23:50:27BlaXpiritthat reservoirSamples thing is pretty useful
23:50:30OderWat@BlaXpirit If you summon me like that :)
23:50:32ekarlsoso nice
23:50:34BlaXpiriti definitely wanna add it to my lib
23:50:38ekarlsodog puked all over carpet :/
23:50:41BlaXpiritD:
23:50:44ekarlsodamne furball
23:50:52BlaXpiritso why not just be content with that
23:51:03BlaXpiritand then insist Jehan's macro be added to stdlib
23:51:26BlaXpiriti even stopped trying to push my random lib into standard library
23:52:08BlaXpiriti've done so many reworks on it that i lost all confidence in its stability
23:52:36OderWatekarlso.. look at my pull request for "nim-vm" please... just worked on that an hour :)
23:54:41OderWat@BlaXpirit Well I like that reservoir sampling thingy too. I translated that from some ruby code I found in an article. Actually I think I have some more cool algorithms in a book about using Haskell to solve stuff. Things where you are like "no way that could be done or optimized"
23:55:34BlaXpiriti remember myself inventing this algorithm, but i forgot about it since :D
23:56:12ekarlsomerged OderWat
23:56:28ekarlsomeh, so many freakin css frameworks :p
23:56:30OderWatso nice.. "nim-vm install devel" "nim-vm update devel" "nim-vm install v0.9.4" "nim-vm install v0.10.2" "nim-vm use v0.9.4" .. "nim-vm use devel" :) I love it! thanks for the idea and the script ekarlso
23:56:34ekarlsomaterial, ionic, bootstrap, lumx ...
23:56:37ekarlsogawd :p
23:56:49ekarlsothank god my dayjob aint webdevel
23:56:58ekarlsoor frontend rather
23:57:09federico3dom96: I'll try setting up a .travis.yml ifle
23:57:12federico3*file
23:57:24dom96federico3: thanks
23:57:44OderWat@ekarlso do you plan to output c code side by side to playpen? I saw this for GCC and Rust with ASM and thought thats cool to have and not to hard to implement I guess
23:58:13ekarlsoOderWat: create a issue and we'll see :/
23:59:18*akiradeveloper joined #nim
23:59:27flaviuekarlso: you need to add a scripts/ in the automatic installation
23:59:44ekarlsoflaviu: ? :p