<< 06-06-2015 >>

00:00:38letianSame code on java finished in 3 secs, and java implementation is pretty inefficient.
00:01:25letianhere is an example:
00:01:33pigmejletian: you would need to show implemenattion
00:01:51letianvar nums = toSeq(1..10); var i: int; while true: i+=1 if len(filterIt(nums, i mod it == 0)) == len(nums): echo i; break
00:02:33letianso for toSeq(1..10) it words and yields 2520 correctly
00:03:07letianbut when I increase it to toSeq(1..20) the code runs for a much longer time
00:05:08letianI think its my implementation which is bad, can you provide a faster one?
00:05:15pigmejbecause in the 10 to 19 loop you're doing 10**10 iterations
00:05:28pigmej(roughly estimated)
00:06:40letianwow
00:06:57pigmejbut it's 2AM there, so if I'm wrong sorry :]
00:10:31letianso, could we say that nim is just slow or is it the implementation that sucks?
00:10:39letianjava deals with this in 3 secs
00:11:10letianand it basically the same code in java, even worse
00:12:14letian"worse" I mean is that I do a while true loop with a for loop over 1-20 inside that does the same i%num == 0 check
00:12:51letianonly in nim I call filterIt proc which intuitively should be faster
00:13:09letianfaster than doing while + for loop
00:13:24pigmejwell it's implementation complication
00:13:27*ingsoc quit (Ping timeout: 256 seconds)
00:13:36pigmejthis is brutal implementation
00:16:11pigmej232792560 this is the answer for 1-20?
00:17:59letianyea
00:18:15letianI wonder how python would perform
00:18:25pigmejpython ? slow as hell
00:18:32pigmej(if cpython)
00:18:39pigmejfor pypy it would be probably quite fast
00:19:25pigmejletian: http://wklej.to/5OtpN/text that would be python equivalent
00:25:12letianhah, thanks pigmej, never used any() in my life, neat
00:25:19*Kingsquee quit (Read error: Connection reset by peer)
00:25:35pigmejit's iterator
00:26:53*Kingsquee joined #nim
00:31:19pigmejletian: anyway, there are at least 2 algorithms of solving this problem
00:34:10letianwell,python is slow too, my laptop shall overheat here if I wait till it finishes:)
00:34:36pigmejget pypy
00:34:39pigmejcpython will be terrible slow
00:34:50pigmejon pypy it should be as fast as C
00:35:40letianyeah, but I am interested in faster implementation on nim
00:36:08pigmejhmm
00:36:12letianI am just trying to learn nim by solving simple tasks
00:36:44pigmejletian: https://en.wikipedia.org/wiki/Least_common_multiple#Computing_the_least_common_multiple
00:37:35pigmejletian: and nim implementation: http://wklej.to/wnoOi/text
00:37:55pigmejit uses kinof the same method as python one was using
00:39:07letianyeah,
00:39:33letianthanks, I shall try it out tomorrow, bed calling
00:39:49letianalmost 3am, damn
00:40:54vikatonletian: is PE simple for you?
00:41:09letianwhat is PE?
00:41:55vikatonprojecteuler.net
00:42:26letianno, not simple, first tasks are :D
00:42:39vikatonyeah same here
00:42:44vikatonmost I could do is 15 problems
00:43:07pigmejletian: oh same time zone as mine :p
00:43:15letianwell, I just started with 5, so maybe I won't go that far :D
00:43:23letiangermany
00:43:32pigmejpl :)
00:43:54letianheh, neighbors
00:44:25letianok, thanks for help guys, bb
00:46:57fiocoI still need help
00:47:07fiocoWill someone PLEASE help?
00:47:36pigmejfioco: no idea sorry ;/
00:47:58fiocoOk
00:48:09fiocoWhat even is Future?
00:48:52*letian quit (Ping timeout: 246 seconds)
00:49:02pigmejisn't it that one from asyncdispatch?
00:49:14*dddddd quit (Ping timeout: 272 seconds)
00:49:16pigmejyeah looks like http://nim-lang.org/docs/asyncdispatch.html#Future
00:50:11fiocoYes
00:50:15fiocoI get it now
00:50:16fiocoThanks
00:50:45*pregressive joined #nim
00:51:09*NimBot joined #nim
00:51:50*gsingh93 quit (Quit: ZNC - http://znc.in)
00:52:21*gsingh93 joined #nim
00:56:01*pregressive quit ()
01:03:34*ozra quit (Ping timeout: 246 seconds)
01:05:29*Siecje quit (Ping timeout: 246 seconds)
01:05:56*Siecje joined #nim
01:06:36*pregressive joined #nim
01:11:03*pregressive quit (Client Quit)
01:11:46*pregressive joined #nim
01:12:41fiocoIt's late
01:12:53fiocoSorry
01:13:04fiocoWring channel
01:18:32*pregressive quit ()
01:18:52*boop is now known as boopisaway
01:20:14*pregressive joined #nim
01:30:47vikatonIs there a bot that evals nim code?
01:31:20fiocoYes
01:31:27pigmej~~ eval 1 + 1
01:31:31pigmejbroken?
01:31:42fiocoHttps://github.com/dtscode/nimbus
01:34:36*jaco60 quit (Ping timeout: 265 seconds)
01:35:08fiocovikaton ^^
01:35:22vikatonoh swag
01:35:30fiocoYeah
01:35:34fiocoDts is awesome
01:35:45fiocoI'm working on a nim html tag
01:36:16fiocoThat will allow for nim to be embedded in html for browsers to run
01:37:22*askatasuna quit (Quit: WeeChat 1.2)
01:37:38vikatonfioco: nice!
01:37:54fiocoI need help actually
01:38:05fiocoMy strings arent working
01:38:08fiocoThank you
01:45:40*Nimbus joined #nim
01:45:43*Nimbus quit (Read error: Connection reset by peer)
01:47:03*pregressive quit (Remote host closed the connection)
01:51:04*pregressive joined #nim
01:55:53*saml_ joined #nim
02:04:55vikatonsome interesting comments: https://news.ycombinator.com/item?id=9667230
02:13:00*milosn joined #nim
02:13:49cazovpyre made the best comment
02:17:09*kashyap_ joined #nim
02:17:20kashyap_Hi ... how do I "join" a list of strings?
02:17:43kashyap_essentially number of strings is determined at runtime
02:19:04*vendethiel quit (Ping timeout: 265 seconds)
02:19:06onionhammerhttp://nim-lang.org/docs/strutils.html#join,openArray[string],string
02:19:08flaviukashyap_: http://nim-lang.org/docs/strutils.html#join,openArray[string],string
02:19:09cazov`foldl(words, a & b)` (see http://nim-lang.org/docs/sequtils.html )
02:19:13flaviuhaha
02:19:15cazovor that
02:19:26kashyap_awesome!!!!
02:20:44flaviufwi, http://nim-lang.org/docs/theindex.html, ctrl-f join
02:20:47notfowlCan we have nimbot search the index
02:21:07notfowlI'm calling nose-goes if you guys think thats a good idea
02:21:37kashyap_flaviu .. I think join expects an array which implies knowing the count at compile time ...
02:22:31notfowlkashyap_: seqs are openarray
02:22:33flaviukashyap_: "openarray"
02:22:49flaviuhttp://nim-lang.org/docs/manual.html#types-open-arrays
02:23:13kashyap_oh I see .... then join seems more straight forward ... let me give it a shot
02:23:49pigmejok guys, company + nimsuggest + emacs works
02:23:57pigmejreactormonk: ;-)
02:27:34*kashyap_ quit (Ping timeout: 246 seconds)
02:28:44*kashyap_ joined #nim
02:28:47kashyap_flaviu .. http://lpaste.net/133965 could you please check what I am doing wrong
02:33:32reactormonkpigmej, perfect
02:34:05kashyap_how can I pass a queue to a function that expects a seq?
02:37:30reactormonkpigmej, expecting a PR >:)
02:42:36*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
02:43:10notfowlkashyap_: convert it to a seq
02:43:13fiocoHow can I get a certain value from a hashset?
02:43:20flaviukashyap_: A Queue is not an openarray.
02:43:33flaviuso, what notfowl said
02:43:49cazovcould you use $ on the queue to cause a concatenation of strings?
02:44:13cazovoh but wait, that would add a ", " between each element
02:47:36*bjz joined #nim
02:54:32fiocoI have a HashSet[string] that claims to be a char
02:54:45fiocoI can't convert to cstring due to that
02:54:49fiocoSuggestions?
02:57:29*darkf joined #nim
03:19:53*yglukhov________ joined #nim
03:20:03*fioco left #nim ("See")
03:24:25*yglukhov________ quit (Ping timeout: 264 seconds)
03:51:57kashyap_sorry I had to step out .... how can I convert a queue to a seq?
03:54:41kashyap_got it ... toSeq does the job
04:17:06*saml_ quit (Remote host closed the connection)
04:29:52*pregressive quit (Remote host closed the connection)
04:57:43*kashyap_ quit (Ping timeout: 246 seconds)
05:00:27*jbomo left #nim (#nim)
05:02:27*BlaXpirit joined #nim
05:09:18*Siecje left #nim (#nim)
05:21:38*jokra quit (Quit: WeeChat 1.0.1)
05:22:34*JinShil quit (Quit: Konversation terminated!)
05:27:33*BitPuffin|osx joined #nim
05:28:42*datanoise quit (Ping timeout: 246 seconds)
05:32:40*BitPuffin|osx quit (Ping timeout: 255 seconds)
05:51:48*kashyap_ joined #nim
05:54:51*datanoise joined #nim
05:59:38*vikaton quit (Quit: Connection closed for inactivity)
06:04:01*BlaXpirit quit (Quit: Quit Konversation)
06:04:05kashyap_Hi, I am using httpclient and running it repeatedly is giving me Error: unhandled exception: Can't assign requested address [OSError]
06:04:44Xekashyap_: pastebin code?
06:06:05kashyap_http://pastebin.com/eTE2hFqi
06:06:34kashyap_oops wrong code ...
06:08:19kashyap_complete code here - http://pastebin.com/JQmF6Hmx
06:35:05*gsingh93 quit (Quit: ZNC - http://znc.in)
06:35:37*gsingh93 joined #nim
06:39:24*gsingh93 quit (Client Quit)
06:39:57*gsingh93 joined #nim
06:43:05*datanoise quit (Ping timeout: 250 seconds)
06:43:56*gsingh93 quit (Client Quit)
06:44:27*gsingh93 joined #nim
06:45:42*gsingh93 quit (Client Quit)
06:46:13*gsingh93 joined #nim
06:50:52*vendethiel joined #nim
06:56:43*kashyap_ quit (Ping timeout: 246 seconds)
07:16:20*BitPuffin|osx joined #nim
07:21:17*BitPuffin|osx quit (Ping timeout: 256 seconds)
07:23:59*kumul quit (Ping timeout: 245 seconds)
07:34:23*vendethiel quit (Ping timeout: 244 seconds)
07:45:23*yglukhov________ joined #nim
08:00:47*EastByte quit (Ping timeout: 265 seconds)
08:01:48*Arrrr joined #nim
08:15:07*Ven joined #nim
08:24:41dtscodeAll of the file reading/writing stuff is in system right?
08:25:05Varriountdtscode: Yes, for basic, cross-platform IO
08:25:16dtscodePretty much all I need for this little app
08:25:22*OnO joined #nim
08:25:26dtscodeThanks Varriount
08:25:32Varriountdtscode: For async stuff, you'll need the 'asyncfile' module (I think that's the right name)
08:26:06dtscodeNah this isn't async. A buddy of mine just wants a word/line/character count of all his files in a project
08:26:51Varriountdtscode: wc?
08:26:56dtscodeeh
08:27:31dtscodeI stay away from bash if I can help it
08:27:34VarriountThe wc utility, assuming (s)he's on a *nix OS, or on Windows with Msys/gnu-utils
08:28:12VarriountWell, it'll be a fun excercise in any case. :D
08:44:42dtscodeOk... I *think* it worked properly
08:52:15*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:05:06*BitPuffin|osx joined #nim
09:07:18r-kuapparently switf also does this thing with inclusive ranges http://stackoverflow.com/questions/26083873/swift-non-inclusive-range-with-double-dot
09:09:59*Ven joined #nim
09:09:59*BitPuffin|osx quit (Ping timeout: 250 seconds)
09:13:59wuehlmausdtscode: maybe it's time for some zsh if you stay away from bash :)
09:14:33wuehlmaussadly the windows port is not current but it's a hell of a shell
09:15:20*filcuc joined #nim
09:17:29dtscodewuehlmaus: eh
09:17:52*johnsoft quit (Ping timeout: 256 seconds)
09:17:58*johnsoft joined #nim
09:25:12*milosn quit (Quit: leaving)
09:26:47*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:30:00*vendethiel joined #nim
09:35:42*datanoise joined #nim
09:36:20*BlaXpirit joined #nim
09:40:28*datanoise quit (Ping timeout: 264 seconds)
09:52:26*vendethiel quit (Ping timeout: 256 seconds)
09:57:30*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
10:22:06*OnO joined #nim
10:23:39buttplugdoes nim do anything with multiple threads?
10:23:54buttplugtasks? coroutines?
10:23:57buttplugchannels/
10:26:50*Ven joined #nim
10:30:07dom96buttplug: threads? yes. Coroutines? kinda
10:30:12dom96channel? yes
10:39:18*BitPuffin|osx joined #nim
10:41:22*ingsoc joined #nim
10:48:47buttplugi mean how do you communicate across threads in nim? I don't see docs dealing with threads much?
10:48:55buttplugit doesn't do shared memory right?
10:53:52buttplugcan nim do type classes or something similiar?
10:56:11*Ven quit (Disconnected by services)
10:56:31*Ven_ joined #nim
11:02:52strcmp1afaik there's global variables, a shared heap where you manage the memory yourself, and i guess channels.
11:05:35*dddddd joined #nim
11:05:50*filcuc quit (Ping timeout: 252 seconds)
11:10:16*jaco60 joined #nim
11:13:58pigmejreactormonk: yeah PR will be there :)
11:18:18*gokr_ joined #nim
11:18:35*boogaboo joined #nim
11:21:46*boogaboo left #nim ("Leaving")
11:24:51*gokr_ quit (Read error: Connection reset by peer)
11:25:39*boopisaway is now known as boop
11:27:40Araqbuttplug: we have channels but also spawn+dataflow variables
11:31:00*vendethiel joined #nim
11:39:40*Kingsquee quit (Quit: Konversation terminated!)
11:43:29*Arrrr quit (Quit: WeeChat 1.2)
11:59:27*JinShil joined #nim
11:59:59*yglukhov________ quit (Quit: Be back later ...)
12:01:41*yglukhov________ joined #nim
12:03:04*yglukhov________ quit (Client Quit)
12:04:34BitRdom96: I'm having issues compiling nimsuggest from the new repo. When using 'nim c' I get an error regarding prettybase.nim requiring the ast module, when using nimble it says it requires nim version 0.11.3, which hasn't been tagged yet.
12:05:35dom96BitR: 0.11.3 is the devel version of the Nim compiler
12:06:57dom96but perhaps the version requirements should be a bit softer
12:07:03dom96I'll change it so that it works with 0.11.2
12:07:37BitRdom96: Aha thanks, got it working after checking out the devel branch, doing koch boot and then nimble install from nimsuggest
12:08:37Araqreactormonk: any idea why nimsuggest still works unreliably?
12:08:38BitRwell, compiling at least - now I get a bunch of runtime errors instead :)
12:08:38*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
12:09:19*datanoise joined #nim
12:10:32AraqBitR: I still like to get proper bug reports about nimsuggest ;-)
12:10:57Araqdom96: I still think it shouldn't be a nimble package
12:11:16BitRAraq: Sure
12:11:17dom96Araq: why?
12:11:18pigmejAraq: the major problem with nimsuggest is it's quite frequently returning wrong data
12:11:57dom96Araq: How do you expect others to write tools which require the compiler's code when you can't even do it?
12:12:41Araqdom96: I don't expect them to do that. the compiler's API is not stable nor well documented
12:13:35dom96I think we should move towards making it stable.
12:14:39*skyfex quit (Quit: (null))
12:17:45pigmejwho uses emacs there ?
12:18:06Araqpigmej: well it returns a "best effort" if it cannot determine the type properly
12:18:18Araqpigmej: at least reactormonk
12:19:42pigmejAraq: yeah I know that reactormonk uses emacs :)
12:19:59pigmejAraq: the problem for me is that it usually returns weird data
12:20:26pigmejAraq: http://wklej.to/WwtwR/text
12:20:43pigmejput cursor on c1.vocal{there}
12:24:08*TEttinger quit (Ping timeout: 246 seconds)
12:29:45dom96pigmej: You can't indent 'method' like taht
12:29:48dom96*that
12:33:43pigmejdom96: that's from example ;-)
12:34:01dom96huh?
12:34:36pigmejthat code is copy&pasted
12:34:41pigmejfrom some examples
12:35:14dom96what examples?
12:35:37pigmejhttp://nim-by-example.github.io/oop_macro/
12:35:39pigmejthis one I think
12:35:50pigmejyeah that's this one
12:35:57Araq1. that does it differently
12:36:19Araq2. that the OOP macro still confuses nimsuggest is on my todo
12:36:19pigmejah ok
12:36:21pigmejI see
12:36:28pigmejok that would explain :)
12:38:09strcmp1awesome macro tho
12:39:28pigmejbut well, http://wklej.to/OhC8T/text
12:39:33pigmejpretty nothing changes
12:41:01dom96I think we need highlighting of errors in code
12:41:10dom96for example line 24 is incorrect in that example
12:41:21dom96so I'm guessing nimsuggest gets confused because of that
12:41:28dom96what suggestions are you getting for that?
12:41:38*ingsoc quit (Ping timeout: 246 seconds)
12:41:40pigmejI would say "all possible"
12:41:51*ingsoc joined #nim
12:42:30Araqwell as I said, this is the fallback behaviour
12:42:42pigmejAraq: is there any way to detect it?
12:43:04Araqno, but I can easily add that info
12:43:05*milosn joined #nim
12:43:24Araqthe more interesting question is: Is this a good idea at all?
12:43:38pigmejI think that would be cool if nimsuggest would return 'sure' and 'unsure' results or something like that
12:43:54dom96A percentage would be nice
12:44:13pigmejdom96: I'm not sure, I would say 0/1 would be better
12:44:40dom96depends how many factors nimsuggest has to work with
12:44:53pigmejthe good thing guys, is that we have now emacs working together with nimsuggest :)
12:44:57Araqdom96: we have no percentages. either we have a type to work with or we don't
12:44:59pigmejwith company backend :)
12:45:03dom96I think being able to tell nimsuggest "I want fallback behaviour" would be good
12:45:13dom96no fallback behaviour by default
12:45:15pigmejdom96: then it would require 2 iterations
12:45:18*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:45:35Araqdom96: yeah, how is the editor/programmer supposed to know?
12:45:44pigmejfirst normal and then "maybe" fallback
12:45:53Araqbut sure/unsure could get different colors in the editor
12:45:58pigmejyeah
12:46:39dom96I think you should use percentages for the future when we do have multiple ways to determine the likelihood of suggestion correctness
12:47:10dom96but meh, floats will do too I guess
12:47:32Araqso what do you do with a 70% suggestion?
12:47:54dom96Eclipse (or IntelliJ IDEA, can't remember) gives percentages.
12:48:04Araqreally?
12:48:07pigmejdom96: how would that percentage work?
12:48:23dom96As for fallback, perhaps the user only wants to see certain suggestions?
12:48:41dom96For example: procedures in the current file get a higher percentage
12:49:27dom96By 'certain suggestions' I mean suggestions which are 100% certain
12:50:27dom96If I want to configure my editor not to show these unreliable suggestions then why should I wait until I receive this huge dump of all the procedures?
12:51:13dom96A more important feature though is the ability to check the file for errors.
12:51:19dom96Perhaps that is already possible via nimsuggest?
12:51:26pigmejnope
12:51:34pigmejnimsuggest generally will parse everything
12:51:42dom96Then the user knows to fix the problems before attempting to invoke suggest
12:51:57pigmejdom96: and now imagine you're in the middle of writting proc
12:52:18pigmejand it's probably always 'syntax incorrect' (discard, return type missmatch etc)
12:52:36dom96pigmej: You've already provided us with 2 examples with errors which are far from the code you were writing, you didn't seem to be aware of them.
12:52:55dom96All IDEs already do that, they complain about code you are writing.
12:52:58dom96It works fine.
12:53:20dom96Your IDE could always ignore errors on the line which you are on
12:53:47pigmejdom96: but we're talking about nimsuggest
12:53:52Araqdom96: pretty sure nimsuggest can also report errors
12:54:15dom96pigmej: hrm?
12:54:22pigmejdom96: nvm
12:54:26dom96Araq: Is there a 'check' command?
12:57:56pigmejdom96: afaik no
12:58:02Araqdom96: no but in debug mode it also reports error messages
12:58:43pigmejAraq: does nimsuggest filter suggestions somehow ? for me it seems that it always return all methods/etc that are possible
12:59:01dom96Araq: hmmm. We need a check command then.
12:59:15pigmejhttp://wklej.to/Fh6kd/text and cursor after 'ad'
12:59:27pigmejand nimsuggest returns `contains`
12:59:43pigmej(which is quite ok, because contains is valid for animals)
12:59:53pigmejexcept it doesn't makes sense with 'ad' prefix
13:00:12Araqwell first of all
13:00:27Araqthe 'ad' prefix is irrelevant, this is not how nimsuggest works
13:00:32pigmejok
13:00:43pigmejthat's then the answer.
13:00:48Araqnimsuggest looks until the '.' and then expects the editor to do prefix based filtering
13:00:55pigmejok, cool
13:01:40Araqdom96: maybe but 'sug' also needs to output errors if no suggestions can be given
13:01:51pigmej+1
13:02:21*datanoise quit (Ping timeout: 276 seconds)
13:06:43Araqdom96: https://github.com/nim-lang/nimsuggest/issues/4
13:07:14Araqso nimble install still doesn't work, nimsuggest needs to be in the bin/ where 'nim' lives.
13:08:43*gokr_ joined #nim
13:09:21dom96Araq: That's easy to fix.
13:09:25dom96(I hope)
13:09:47dom96Can I override the path where the compiler looks for lib/ from nimsuggest?
13:10:59*OnO joined #nim
13:11:52Araqvia --lib
13:15:15*gokr_ quit (Read error: Connection reset by peer)
13:18:16pigmejAraq: I have to admit, nimsuggest is really cool tool
13:19:18*xet7 quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com ))
13:19:43*xet7 joined #nim
13:21:21pigmejreactormonk: ping
13:22:19Araqpigmej: thanks. ;-)
13:24:04*Ven joined #nim
13:26:15pigmejanyone knows in what timezone reactormonk lives?
13:26:35AraqTexas?
13:27:13pigmejso it's 8:30 AM saturday there :)
13:34:13pigmejOk emacs completion works
13:34:31pigmejgoto definition not yet, show doc seeems working also
13:36:16*BlaXpirit is now known as Guest92464
13:36:16*BlaXpirit_ joined #nim
13:36:16*Guest92464 quit (Killed (card.freenode.net (Nickname regained by services)))
13:36:16*BlaXpirit_ is now known as BlaXpirit
13:38:13*JinShil quit (Ping timeout: 265 seconds)
13:44:10r-kuany way to bind proc to generic type? like proc new*[T](_: type list[T]) ? it ofc throws error that no generic parameters are allowed for list.
13:45:03Araqr-ku: typedesc?
13:45:33r-kureplacing "type" with "typedesc" still yields same error
13:47:00Araqproc new*(x: typedesc[list])
13:47:16Araqso don't have a T here. this should then work, I hope.
13:50:48r-kuAraq: actually it seems generic aprams arent allowed for distinct types. i have type list = distinct seq. any way to work-around this?
13:50:55*filcuc joined #nim
13:51:22Araqdunno. the language works better when you're not fighting it all the time.
13:52:58Araqsee "Utf-8 aware strings" ... I argued why UTF-32 won't help you, you chose to ignore the reasons.
13:55:00r-kucome on. you cant seriously mean that containers implemented in stdlib are ones true and holy containers to be used. even in c++ i use custom containers because they are so much better than stl. so i dont really call it "fighting" against language. as for strings - not everyone supports hundred chinese dialects. utf-8 covers most of word's needs. and when it doesnt work good enough i suppose anyone is welcome to implement <their encoding
13:55:00r-kuof choice>-aware string class.
13:56:42r-kuand correct way to do it apparently is type list*[T] = distinct seq[T] / proc new*[T](_: typedesc[list[T]]) = \o/
13:58:45*datanoise joined #nim
14:03:52*reloc0 left #nim ("WeeChat 0.3.8")
14:04:59*Arrrr joined #nim
14:07:22Araqr-ku: not in my opinion, but fair enough.
14:07:54Araqin my opinion "encoding-aware string class" creates more problems than it solves, but ok.
14:10:57r-kuAraq: i guess i understand your position. string not unicode-aware by default - fine. as long as there is non-masochistic solution, so a custom string implementation. well i made one for myself, even if crude and underfeatured it works after half-days work. that "distinct" for built-in types is a true lifesaver.
14:12:01Araqthe solution that the stdlib is after is to make you use --taintMode:on and then perform input validation which can include utf-8 validation
14:18:47*skyfex joined #nim
14:24:16*Siecje joined #nim
14:28:58*datanoise quit (Ping timeout: 256 seconds)
14:31:45*yymoto2 joined #nim
14:34:20*superfunc joined #nim
14:36:46*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:36:51*no_name quit (Remote host closed the connection)
14:36:51*devzerp quit (Remote host closed the connection)
14:39:15*superfunc quit (Quit: Lost terminal)
14:44:40*devzerp joined #nim
14:44:40*no_name joined #nim
14:46:57*Siecje quit (Read error: Connection reset by peer)
14:50:24*skyfex quit (Quit: (null))
14:54:00*vikaton joined #nim
14:55:07reactormonkpigmej, I usually get up at 10
14:58:27*Ven joined #nim
14:58:49ArrrrHello, how do i iterate over files in a directoy?
14:58:52Arrrr*directoy
14:58:56Arrrr**directory
14:59:53AraqArrrr: something in the os.nim module
15:00:10ArrrrFine, thanks!
15:00:13AraqwalkDir or something
15:01:00pigmejreactormonk: ah :)
15:01:02pigmejhey man :)
15:01:07reactormonkmorning
15:01:23pigmejreactormonk: check this out https://github.com/pigmej/nim-mode/tree/epc
15:01:24pigmej;-)
15:02:03*t4nk754 joined #nim
15:02:03pigmej(the elisp code probably sucks)
15:02:11pigmej*should be without the
15:02:18reactormonkpigmej, the nimsuggest part should go to nim-mode for ac-nim
15:02:43pigmejreactormonk: yeah
15:02:50pigmejalso for 'goto definition etc'
15:03:02pigmejthat's why it's not yet pull request
15:03:08pigmejthe company-nim.el is self contained for now
15:03:30*t4nk754 quit (Client Quit)
15:03:55reactormonkI'd rather not go for positional arguments (e.g. company-nim--format-candidate) just because I don't like magic numbers, but eh...
15:04:39pigmejreactormonk: that function is hmm, crappy
15:04:45pigmejthere is even comment that it sucks
15:04:53vikaton10:59:58 AM <Araq> walkDir or something
15:04:55*kumul joined #nim
15:04:56pigmejI have no idea how to parse it better
15:05:02vikatondoesnt even know his own language smh
15:05:28Araqvikaton: it's been a while since I used walkDir
15:05:49vikatonAraq: lol I was just kidding :P
15:06:40reactormonkpigmej, https://github.com/pigmej/nim-mode/blob/epc/nim-mode.el#L982
15:06:48Varriountpigmej: walkDir and walkDirRec both need to be deprecated and replaced.
15:06:48reactormonkpigmej, just use nim-call-epc
15:07:13*kumool joined #nim
15:07:18pigmejVarriount: ee ?
15:07:28pigmejreactormonk: hmm
15:08:18reactormonkpigmej, also, I do the parsing just below the line mentioned
15:09:18*filcuc quit (Ping timeout: 252 seconds)
15:09:22*darkf quit (Quit: Leaving)
15:09:28vikatonThat new addition to the FAQ got some attention on HN
15:09:38pigmejhmm so in fact I can reuse it completely (nim-parse-epc) isn't it reactormonk ?
15:09:46vikatonwe should make an official FAQ on nim-lang.org
15:09:48reactormonkpigmej, I certainly hope so
15:09:50Varriountvikaton: Link?
15:10:00vikatonVarriount: https://news.ycombinator.com/item?id=9667230
15:10:05*kumul quit (Ping timeout: 244 seconds)
15:10:06Varriountvikaton: http://nim-lang.org/question.html
15:10:09pigmejreactormonk: what about nim:start-nimsuggest (and family)
15:10:40reactormonkpigmej, all handled by nim-call-epc
15:11:06reactormonkpigmej, see nim-find-or-create-epc
15:11:13pigmejyeah looking at it
15:11:20pigmejcallbacks...
15:11:28pigmejI don't know how to use it ;/
15:11:43pigmejI mean, it usually calls wrong function for me (see the async backend)
15:11:47reactormonkinstead of having a return value, you get the return value passed to a function.
15:12:06Varriountvikaton: *winces at the HN comments*
15:12:10pigmejyeah I knwo how callbacks works
15:12:18pigmejbut https://github.com/pigmej/nim-mode/blob/eb3e41a1cd9d3983b5fb8ff378393611b31963e4/company-nim.el#L111
15:12:37pigmejthe callback is't the same callback as in arguments and I have no bloody idea why
15:12:49vikatonVarriount: yeah some of them dont make sense at all, but that main comment isnt even about the Topic
15:12:51vikatonlol
15:13:03ArrrrFine, thanks!
15:13:03reactormonkpigmej, yeah, gotta use a lexical-let as I did in the above function because the callback is out of scope
15:13:24Varriountpigmej: That's a lot of parenthesis.
15:13:59pigmejVarriount: lisp...
15:14:43pigmejreactormonk: what is lexical-let ?
15:14:52reactormonkpigmej, see nim-call-epc
15:15:12pigmejreactormonk: the good thing about my super code is that company works ;)
15:15:16reactormonkpigmej, elisp has a few wierd scopes... one to know is that callbacks in lisp are not in the normal function scope.
15:15:39reactormonkor rather the other way, arguments passed to a function are NOT in lexical scope, and therefore not available in callbacks
15:15:49pigmejweird
15:15:57pigmejwhat's the reason for this ?
15:17:01reactormonkI have no idea
15:17:12reactormonkNot even sure if my explanation is correct
15:17:19Araqemacs and vim lived for far too long? ;-)
15:17:58vikatonlol @ rust reddit trying to improve their benchmarks
15:18:44pigmejAraq: emacs is still in good shape, they are changing elisp to guile
15:21:21vikatonguys since Rust is frantically trying to improve their benchmarks, we should too https://github.com/kostya/benchmarks
15:21:54reactormonkpigmej, and you can go code scheme instead of elisp :-)
15:22:23pigmejstill better;d
15:22:53Araqvikaton: as I'm working on an alternative GC mode, most benchmarks should improve automatically ...
15:24:33pigmejreactormonk: so i'm refactoring then that company-nim
15:24:43reactormonkpigmej, preferably
15:24:44pigmejto use functions from nim-mode
15:26:07reactormonkpigmej, btw, it might not be callbacks with the lexical-let, it might just be deferred, which evals the block at a later point out of the function scope, only lexical bindings are available
15:26:09pigmejreactormonk: did you checked how company works ?
15:26:17reactormonkpigmej, kinda, apparently not too well
15:26:57pigmejbtw what about text properties :nim-doc etc ?
15:27:04pigmejany other / better way to do so?
15:28:03reactormonkpigmej, I just attach the nim-epc object.
15:28:33pigmejcompany requires text strings
15:29:26reactormonksure, but the text properties don't matter too much
15:29:43reactormonkafter all, you can use your own function to extract the required properties
15:30:09reactormonkor you could use (nim-epc-section struct) etc. instead of (xth)
15:30:24pigmejoks
15:30:50pigmejbtw I really hate elisp:P
15:31:02reactormonkyou'll get used to it.
15:32:31*yymoto2 quit (Quit: leaving)
15:33:30*skyfex joined #nim
15:35:06*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:35:15*skyfex_ joined #nim
15:38:06*skyfex quit (Ping timeout: 256 seconds)
15:42:34vikatonAraq nice
15:43:48*dhasenan left #nim (#nim)
15:45:00vikatonAraq, for the next release?
15:45:31Araqthis is offtopic, but how come my Mac .app now opens "Choose a File"?
15:45:49Araqvikaton: not sure
15:46:33vikatonOkay, keep up the good work
15:47:52ArrrrIs there an easy way to read integers bigger than 8 bytes from files, or do i have to play with sifts
15:48:31Araqintegers bigger than 8 bytes? I don't think there is a standard binary format for bignums
15:48:59Arrrrsorry, i meant 8 bits
15:50:01Araqstreams has readInt8 and similar
15:50:30Arrrrujj, didt know that
15:55:15*kumool quit (Ping timeout: 276 seconds)
16:01:11*ingsoc quit (Quit: Leaving.)
16:04:42*yglukhov________ joined #nim
16:06:20*Ven joined #nim
16:09:33*yglukhov________ quit (Ping timeout: 276 seconds)
16:13:54*kumool joined #nim
16:15:18*yglukhov________ joined #nim
16:16:12*noneofmynickswor joined #nim
16:16:16ArrrrI have a table of type 'TableRef[int16, seq[Object]]', initialized with 'newTable 10_000' but i get the error "tables.nim(434, 16) Error: cannot instantiate: 'A'"
16:19:37*kumool quit (Ping timeout: 256 seconds)
16:21:12AraqArrrr: use newTable[int16, seq[RootRef]]
16:21:24AraqArrrr: use newTable[int16, seq[RootRef]]()
16:24:39ArrrrThat was it, thanks.
16:30:51*devzerp quit (Remote host closed the connection)
16:30:51*no_name quit (Remote host closed the connection)
16:38:41*devzerp joined #nim
16:38:43*no_name joined #nim
16:40:31reactormonkAraq, mind transferring the repo to nim-lang?
16:53:57*filcuc joined #nim
17:10:15*datanoise joined #nim
17:15:20*datanoise quit (Ping timeout: 272 seconds)
17:20:45*gokr_ joined #nim
17:21:03*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:21:25*Senketsu quit (Quit: Leaving)
17:25:19vikatonyeah I think Nim should be in nim-lang
17:26:17*milosn quit (Ping timeout: 265 seconds)
17:28:41Araqreactormonk: nah, can do it tonight.
17:28:52reactormonkAraq, perfect.
17:29:09vikatonswagg
17:30:33*wuehlmaus quit (Quit: Lost terminal)
17:33:54*milosn joined #nim
17:34:51*wuehlmaus joined #nim
17:35:34pigmejreactormonk: i checked that nim-call-epc
17:35:36*filcuc quit (Ping timeout: 272 seconds)
17:35:41pigmejand it seems that I have no idea how to use it
17:36:36reactormonkpigmej, hm. (with-current-buffer (get-buffer <something>)) <- wrap this around if you wanna test it in another buffer, otherwise you don't need it
17:36:52pigmejnah this is fine
17:37:09pigmejjust elisp problems I think
17:37:17pigmejhttps://bpaste.net/show/d98d73009d2e
17:38:46reactormonkpigmej, looks about right
17:39:09onionhammerAraq what is the new gc mode?
17:39:51pigmejreactormonk: sadly it 'explodes' emacs:d
17:39:58reactormonk?
17:40:13pigmejwhole emacs freezes for 5 seconds
17:40:24pigmejand it segfaulted once even
17:40:31reactormonkO.o
17:41:13Varriountonionhammer: Hi! If you have time, could you please test the latest version of Nimlime on ST3, and give me all the juicy bugs?
17:41:29reactormonkpigmej, yup, the freeze is kinda expected because nimsuggest is started up sync :-/
17:42:04pigmejreactormonk: but everytime?
17:42:11Varriountpigmej: I can only imagine how dangerous the parenthetical shrapnel was.
17:42:13reactormonkpigmej, maybe not.
17:42:42reactormonkpigmej, in scratch.el, there's a command to enable epc debug - try again with that
17:43:03pigmejthe roblem is nothing is printed
17:43:07pigmejalso epc:controller is empty
17:43:17reactormonkwtf.
17:43:18pigmejso I suppose the 'start' is not working correctly
17:43:35reactormonkO.o
17:43:50*brson joined #nim
17:43:55reactormonkthen try nim-find-or-create-epc
17:43:58pigmejah
17:44:00reactormonk... with a with-buffer around
17:44:05pigmej(defvar nim-nimsuggest-path nil "Path to the nimsuggest binary.")
17:44:17reactormonk:D
17:44:41pigmejwhy it's defvar not defcustom ?
17:44:44onionhammerVarriount I'm up at a state park with no internet or cell service so maybe Sunday evening
17:44:52reactormonkpigmej, ehh, change it.
17:44:58reactormonkbecause I didn't know better
17:45:16onionhammerI'm at a visitor center with WiFi atm
17:47:01Varriountonionhammer: Oh, ok. Have fun at the park!
17:47:05Varriount:D
17:47:06pigmejok reactormonk that works
17:47:13reactormonkpigmej, perfect.
17:48:21*Ven joined #nim
17:50:37pigmejbut company still not ;/
17:51:01*Ven quit (Client Quit)
17:51:20*Varriount wonders how complicated nim-mode is compared to NimLime
17:51:35pigmejI think something is wrong with your epc functions reactormonk
17:51:38reactormonkVarriount, gotta do some stuff async because no multithreading
17:51:40pigmejit always crashes after one use
17:51:41reactormonkpigmej, entirely possible
17:51:53pigmej!! Process Sentinel [epc con 12] : #<process epc con 12> : "connection broken by remote peer
17:51:54pigmejetc
17:51:55reactormonkare the messages epc gives correct?
17:51:59Varriountreactormonk: Ouch.
17:52:09pigmejit doesn't even reply
17:52:50reactormonkpigmej, that's not epc, that's nimsuggest crashing
17:53:02pigmejyeah yeah
17:53:05pigmejI even know why
17:53:11reactormonknice
17:53:13pigmejyour structs / texts are weird
17:53:21reactormonkexample plz
17:53:26pigmej>> SEND : ["000070(call 13 sug (#(\"/tmp/blah.nim\" 1 4 (face flx-highlight-face)) 24 10 \"/tmp/pigmej/nim-dirty12546SsO/blah.nim\"))
17:53:46reactormonklooks about right? or how should i tbe?
17:53:54pigmej(#(\"/tmp/blah.nim\" 1 4 (face
17:53:55pigmej flx-highlight-face))
17:53:57pigmejwithout this
17:54:14pigmejI mean just plain text
17:54:16reactormonkwtf? where does the face come from.
17:54:17pigmejwithout props
17:54:27reactormonkah, gotta clean off props before calling it.
17:54:53pigmejthe thing is, I had no problem with this
17:54:54reactormonkmaybe make nimsuggest a bit more resilient too :-/
17:55:20reactormonkhow were you calling epc?
17:55:31pigmejis the answer 'normally' valid ?
17:55:35reactormonksure
17:55:51reactormonkyou can a) find out my version isn't working b) write your own
17:55:55pigmejhttps://github.com/pigmej/nim-mode/blob/epc/company-nim.el#L119
17:56:18reactormonkah, you call sync
17:56:22reactormonkI called async.
17:56:54pigmejasync was also in the same way
17:57:03pigmejbut hmm
17:57:11pigmejhow the heck buffer-file-name contains faces?
17:58:42reactormonkpigmej, maybe you have some advising?
17:59:07pigmej"buffer-file-name #("/tmp/blah.nim" 1 4 (face flx-highlight-face))"
17:59:08pigmejwtf
18:00:00*DecoPerson quit (Remote host closed the connection)
18:00:01*TylerE quit (Remote host closed the connection)
18:00:57pigmejreactormonk: the good thing is that mine company is also not working now
18:00:59*fioco_ joined #nim
18:01:10pigmejbecause I also have that faces in buffer-file-name
18:01:37*fioco_ is now known as fioco
18:01:38*fioco quit (Changing host)
18:01:38*fioco joined #nim
18:01:46*fioco left #nim (#nim)
18:03:05pigmejhmm, my emacs theme changed because of time change
18:03:24reactormonkpwnd
18:03:50reactormonkalso, your theme sucks if it's changing buffer-file-name
18:04:22pigmejmaybe it uses some hook (because I also have powerline)
18:04:22pigmejanyway
18:04:35pigmejI see that quite common is (str (format "c(\"%s\")" (buffer-file-name))
18:04:45reactormonksounds about right to me
18:04:47pigmejso that's probably frequent issue ;d
18:05:04reactormonkso remove text properties?
18:05:15pigmejyup
18:05:54pigmejand now the other question is, should nimsuggest epc handle text with properties as normal text or what?
18:06:03reactormonkhopefully.
18:07:36reactormonknimsuggest doesn't understand text properties.
18:11:34pigmejhmm
18:12:45*gokr_ quit (Read error: Connection reset by peer)
18:17:51*pipeep quit (Ping timeout: 248 seconds)
18:19:30pigmejreactormonk: also I have now 10 nimsuggest processes
18:19:35Varriountreactormonk: text properties?
18:19:37pigmej9 dead 1 live, but epc sees them all
18:19:51pigmejVarriount: in elisp you can attach properties to text
18:19:54reactormonkpigmej, hm, maybe nim-find-or-create-epc needs to find the correct one
18:20:16Varriountpigmej: Neat. What is that mechanism used for?
18:20:20*pipeep joined #nim
18:21:01pigmej"everything" :D
18:21:08pigmejemacs uses it to display text
18:21:26pigmejyou have a string where each position in string can have one or more properties (key / value pairs)
18:23:36pigmejreactormonk: >> SEND : ["00004e(call 4 sug (\"/tmp/blah.nim\" 24 10 \"/tmp/pigmej/nim-dirty12946Ipz/blah.nim\")) this also doesn't look valid
18:23:49reactormonkpigmej, yup :-/
18:23:51reactormonkbut better
18:24:03reactormonkwhat would be valid?
18:24:09pigmejwithout ()
18:24:14pigmejflat structure
18:24:26pigmej"sug" "/tmp/blah.nim" ....
18:25:39pigmejah no
18:25:39pigmejnvm
18:28:26*brson quit (Quit: leaving)
18:30:29buttplugaraq whats this new gc
18:30:58Araqan idea in my head
18:31:45Araqthat turns the per-thread GC into a bump-pointer allocator per-thread, turning it into a memory region allocator
18:32:13Araqbut it's wrong to call it a "GC"
18:32:33*filcuc joined #nim
18:32:52Araqinstead it frees the whole region with a single call and we tell the OS to unmap these pages so accesses trigger segfaults. yummy.
18:33:05Araqwhether this idea has any merit remains to be seen.
18:33:37pigmejreactormonk: I think I will stay with my implementation, your way of managing epc seems problematic and I'm unable to fix it
18:34:14reactormonkpigmej, ok, just take over the nim-epc struct and make the calls to epc distinct from company so I can implement it in ac too
18:34:34pigmejthat logic of autoselection thigns
18:34:42reactormonkhuh?
18:34:43pigmejand auto managing seems broken somewhere ;/
18:34:51pigmej(project, and correct epc conn)
18:34:58pigmejI'm getting nils everywhere now
18:35:18reactormonkah fuck
18:35:19pigmejdeferred error : (void-function nil)
18:35:20pigmejetc
18:35:43pigmejbut my elisp fu is way to small to debug it ;/
18:36:18reactormonkpigmej, that just says that the callback is dead
18:36:41pigmejhm
18:37:01pigmejthen I have no ide why epc closes connection (which is exactly what happens)
18:37:19pigmejbut I thought that it closes it because async crashes, but it seems that it's the other way
18:38:10*Mat4 joined #nim
18:39:11pigmejhttp://wklej.to/rDQaB/text
18:39:17pigmejand nothign more reactormonk
18:40:14reactormonkpigmej, so nimsuggest sends nil back. sounds good to me
18:40:23reactormonkthat's an empty list.
18:41:02reactormonknim-parse-epc should handle that correctly.
18:41:54pigmejreactormonk: well, when I spawn nimsuggest on my way
18:41:58pigmejit returns suggestions
18:42:09pigmejand that's weird
18:42:17reactormonklemme compare
18:42:28pigmejcode looks the same
18:43:49pigmejalso if this resposne is valid then nim-parse-epc crashes
18:44:09pigmejit crashes even before it reaches nim-parse-epc
18:44:32*ggVGc quit (Ping timeout: 256 seconds)
18:45:43reactormonkso we're just calling it sync and be done with it?
18:46:43pigmejno idea
18:46:55pigmejI will check it in next 2hours
18:47:05pigmejbecause Champions League Final ;)
18:47:26*TylerE joined #nim
18:47:26*Siecje joined #nim
18:47:50pigmejreactormonk: if I will fail with your functions (they are cool), then I will just move that structs, I will move my current "startserver" things
18:47:55pigmejand we will fight with async later
18:48:10reactormonkpigmej, I'll fight with async once mor
18:49:17pigmejmaybe I did something wrong also (quite possible)
18:50:26reactormonkso nim-find-or-create-epc works here
18:51:23ArrrrnewFileStream should be renamed to openStream, just saying
18:53:18reactormonkpigmej, >> SEND : ["000045(call 17 sug (\"/tmp/test.nim\" 1 9 \"/tmp/nim-dirty4025E2T/test.nim\")) the call looks good
18:53:30reactormonkINCOMING: [epc con 16] ["00000F(return 17 nil)"]
18:53:31reactormonkmuh
18:53:45reactormonkdom96, btw, nimsuggest still doesn't work outside the compiler
18:56:39pigmejreactormonk: works
18:56:41pigmejfor me it works
18:56:45reactormonkhm.
18:57:50pigmejchcek my implementation and just nim:start-nimsuggest
18:59:09reactormonkpigmej, tells me it can't find system.nim
18:59:53pigmejah yeah you have to have nimsuggest in the same dir as compiler
19:00:04pigmejI thought you mean to complete something other than compiler
19:02:25reactormonkError: cannot open '/tmp/nim-dirty40254es/test.nim'
19:02:30reactormonkapparently the file is deleted too fast
19:09:51reactormonkpigmej, yup, got it to work
19:10:45pigmejthat was taht delete?
19:12:05reactormonkhttps://github.com/reactormonk/nim-mode/commit/e1414f4907c7aa35d71c7f7cbe7fbfdee9668de4
19:12:32reactormonknow the async part should work as expected, before that nimsuggest gave an error because it couldn't find the dirty file passed which was already deleted
19:13:02pigmejah
19:14:03reactormonkhttps://gist.github.com/e4074a6b0d5bbd432d7d works for me now
19:17:52vikatonweird question, but whats an effective way of raising the CPU
19:18:11*Siecje quit (Quit: Leaving.)
19:18:39Varriountvikaton: Raising the CPU?
19:19:01Varriountvikaton: Perhaps putting your computer on a table will help?
19:19:07pigmej:D
19:19:17vikatonI mean taking up alot of memory
19:19:26vikatonidk why I said raising CPU
19:19:40Varriountvikaton: Oh, you mean CPU cycles? Or Physical memory?
19:21:26vikatonVarriount: http://prntscr.com/7dwh7q
19:21:43pigmejreactormonk: shouldn't it be nextc ?
19:21:45pigmejnot mext ?
19:21:49Varriountvikaton: Repeatedly calling a system-based function should take up CPU cycles. Or adding a number over and over.
19:21:51reactormonkah fuck
19:22:13vikatonah ok
19:22:17Varriountvikaton: I'd call a system-based function, as the compiler might inline/unroll/optimize loops.
19:22:44VarriountIt can't optimize away a function it knows nothing about (like one called from a system dll)
19:23:18reactormonkpigmej, still too early. :-/
19:24:10vikatonVarriount: example of a system-based function?
19:24:17vikaton(may I see one)
19:24:38dtscodeVarriount: Do you mean system call?
19:24:52pigmejreactormonk: also I have a question mabye we can use always the same file ?
19:24:56pigmejas a dirty file
19:25:24reactormonkpigmej, sounds like some ugly way to shoot yourself in the foot with two nimsuggest processes at the same time
19:25:54pigmejnah obviously one file per epc connection
19:26:01reactormonkstill
19:26:21pigmejis nimsuggest threaded ?
19:26:26reactormonkit can be
19:26:32pigmejthen yeah
19:26:33reactormonkalthough... probably not
19:26:42Varriountdtscode: Yes..?
19:26:53reactormonkbut still, if you have one async call in there you're gonna get in a world of hurt if you use the same dirty file
19:27:01Varriountdtscode: It would be more appropriate to say I mean a call to a function in a DLL
19:27:19dtscodeah
19:27:48Varriountdtscode: And since most (if not all) of the Windows API is accessed through DLLs...
19:28:04AraqVarriount: or you look at the assembler to see what the compiler did
19:28:42VarriountAraq: Or that. But I was trying to answer what the best way to increase CPU usage would be.
19:28:57*DecoPerson joined #nim
19:28:58vikatonVarriount: so windows would be more appropriate than os ?
19:29:08Varriountvikaton: Huh?
19:29:34vikatonfor the module
19:29:36Varriountvikaton: Windows is an OS
19:29:44Varriountvikaton: You've lost me.
19:29:48vikatonno module to use with Nim
19:30:09reactormonkpigmej, ok, now it works. argh.
19:30:18vikatonVarriount: import windows would be better than import os?
19:31:06pigmej;D
19:31:14reactormonkpigmej, async is messy. but after you understand it somewhat clear why it didn't work
19:31:38Varriountvikaton: Uh.. just importing a module won't cause the CPU usage level to rise.
19:31:43reactormonkpigmej, now you should have a working nim-call-epc
19:31:57vikatonVarriount: You said I should use a system-based function
19:32:19Varriountvikaton: Or do something that keeps the CPU busy.
19:33:11Araqvikaton: just compile a Nim program. compilers tend to use the CPU ;-)
19:33:30reactormonkpigmej, https://gist.github.com/e4074a6b0d5bbd432d7d <- that's what you get now
19:34:16Varriountvikaton: https://gist.github.com/Varriount/d578e06b920ae69a9bb7
19:34:38vikatonI see
19:34:42vikatonlet's test
19:34:51Varriountvikaton: That program should take up the processing time of 1 core.
19:35:57pigmejreactormonk: k
19:36:23pigmejhmm
19:36:54pigmejreactormonk: your method leaks processes
19:37:03pigmejI just had 99 epc processes
19:37:49reactormonkpigmej, fuck
19:38:35pigmejepc:controller
19:38:40pigmejM-x epc:controller
19:38:44reactormonkcannot confirm
19:38:51reactormonkI only got two.
19:38:56reactormonkafter 5 or so calls
19:39:15pigmejbut 2 is one too much
19:39:54reactormonkkilled all, only one after 5 calls
19:41:48pigmejhmm
19:42:02VarriountAraq: How would one go about using createThread with a procedure containing no arguments.
19:42:04Varriount?
19:42:04pigmejmaybe those are from errors
19:42:15reactormonkhttps://gist.github.com/73aa8cf1aa7f4bd5e0e8 <- works here
19:42:18reactormonklists a list of procs
19:43:56pigmejhmm
19:46:15pigmejreactormonk: how can I debug lisp code?
19:46:41pigmejbecause I get now: deferred error : (wrong-type-argument listp [cl-struct-nim-epc "sug" "skProc" ("system" "GC_ref") "/home/pigmej/Apps/Nim/lib/system.nim" "proc (x: seq[T]){.gcsafe, locks: 0.}" 2144 7 ""])
19:46:46pigmejwhich is clearly my fault
19:46:55pigmejbut I wonder where is the reason
19:47:41*filcuc quit (Quit: Konversation terminated!)
19:47:55reactormonkpigmej, deferred error tells you it's somewhere in the callback
19:48:19reactormonkwrong-type-argument lisp tells you it expected a list but you gave it something else, apparently an cl-struct-nim-epc
19:48:23pigmejhmm
19:48:32pigmejnim-parse-epc
19:48:41reactormonkthat one expects a list
19:48:51pigmejyeah but it crashes inside
19:49:00reactormonkstill, expects a list.
19:49:10reactormonkmapcar crashes because it expected a list
19:49:19pigmejeh
19:49:25reactormonkor rather, a list of lists
19:49:30pigmejI meant it crashes inside nim-mode.el
19:49:36pigmejnot coming from / to company
19:49:45reactormonkelisp to crash it?
19:50:32*filwit joined #nim
19:50:55*jefus quit (Ping timeout: 252 seconds)
19:51:02pigmejhttps://bpaste.net/show/27e03b207c37
19:51:05pigmejfrom epc log
19:51:13reactormonklooks good...
19:51:58pigmejbut crashes
19:52:47reactormonkstill need elisp
19:52:59pigmejhmm
19:56:07pigmejhmm
19:56:43notfowlVarriount: void
19:57:58pigmejreactormonk: can I somehow trace last function call or sth ?
19:58:45reactormonkpigmej, there's debug... lemme see
19:59:00reactormonkI only know toggle-debug-on-error, but that might not work on async
20:00:24reactormonkhttps://github.com/kiwanami/emacs-deferred#debugging
20:01:39pigmejyeah "print debugging"..
20:01:44*Trustable joined #nim
20:01:47reactormonkyup >:)
20:01:52pigmejmy favourite :D
20:02:12reactormonkhow do you produce the error?
20:02:33pigmejcompany
20:02:41reactormonkI can't get it to run :-/
20:02:47pigmejoh
20:02:51pigmejwait I will push my branch then
20:03:06pigmejit crashes but you will see the code
20:03:10*wan quit (Ping timeout: 272 seconds)
20:04:16pigmejreactormonk: pushed
20:04:31pigmejeval-buffer company-nim
20:04:41pigmejthen in nim file
20:04:45pigmejM-x company-mode
20:04:49pigmejM-x company-nim
20:04:54pigmejand it will crash
20:06:47pigmejworks?
20:08:33*cyraxjoe_ quit (Ping timeout: 256 seconds)
20:09:46reactormonkcan confirm
20:10:12*cyraxjoe joined #nim
20:10:59pigmejlast print is response from nim-mode.el:985
20:11:28reactormonkpigmej, found the problem
20:11:36pigmejwhat did I wrong?
20:11:38reactormonkpigmej, company-nim--format-candidate won't work anymore
20:11:39pigmej;D
20:11:47pigmejyeah I haven't yet changed it
20:12:04pigmejbut where is my (message) from there?
20:13:11*Arrrr quit (Quit: WeeChat 1.2)
20:14:54reactormonkjust kick it
20:16:00*wan joined #nim
20:31:54reactormonkpigmej, works?
20:35:00*vikaton quit ()
20:35:04pigmejwatching match.
20:40:05reactormonkpfft
20:41:27*brson joined #nim
20:46:08AraqVarriount: createThread[void](fn)
20:46:28Araqand yeah please add an overload for this, it's a common gotcha that even made it into the manual
20:46:38pigmejreactormonk: back
20:47:04*yglukhov________ quit (Quit: Be back later ...)
20:47:12Araqreactormonk: so ... how do I move this thing? any link for those of us to lazy to even google?
20:47:28Araq(or type ... it's "too" of course)
20:47:35reactormonkAraq, https://help.github.com/articles/transferring-a-repository/
20:47:40*yglukhov________ joined #nim
20:48:30*yglukhov________ quit (Read error: Connection reset by peer)
20:48:35Araq"However, we don't redirect GitHub Pages associated with the repository." what does this mean?
20:48:51*yglukhov________ joined #nim
20:49:20reactormonkAraq, do we have any github pages?
20:49:43AraqI have no idea what that is
20:49:58reactormonkthen probably not
20:50:04Araqyeah lol
20:50:13reactormonkIIRC they're a website hosted from your github repo from the ghpages branch
20:50:22Araqthe wiki doesn't count, does it?
20:51:45pigmejreactormonk: nim-epc-{name_there} is some kind of macro ?
20:52:02reactormonkpigmej, yup, that's cl-defstruct
20:52:08pigmejlisp... ;D
20:52:39reactormonkAraq, nope
20:53:08Araqand it won't break the outstanding pull requests, right?
20:53:31reactormonkKeep in mind that users who have forked your repository will need to update their remote URLs to point to the new Git repository in order to continue opening pull requests.
20:53:42*yglukhov________ quit (Ping timeout: 265 seconds)
20:53:49Araq"continue"?
20:53:56reactormonkif you wanna open new ones
20:53:58pigmejchange remotes ?
20:54:03reactormonkyup
20:54:04Araqdoes this mean "for *new* PRs"?
20:54:12reactormonkfrom what I read
20:54:15Araqor "for *outstanding* PRs"?
20:55:11pigmejafair currently opened pull requests will be fine
20:55:23pigmejbecause github transfers them AFTER repo is transfered
20:59:44*datanoise joined #nim
21:00:13*no_name quit (Ping timeout: 250 seconds)
21:01:42pigmejreactormonk: i changed that function and it still crashes, it's not even reaching it
21:01:52reactormonkpigmej, ah fuck
21:03:13*no_name joined #nim
21:03:25pigmejgot it
21:03:38reactormonkwhat was it?
21:03:39pigmejworks ;)
21:03:47reactormonkgenius.
21:03:56pigmejfuzzy match
21:04:11pigmejit was still doing (last (car (nth 2 cand)))
21:04:26pigmejand because it was in mapcar then... :)
21:04:35pigmejit was really not reaching format function:)
21:05:32*jefus joined #nim
21:06:08reactormonk^^
21:06:50pigmejrebasing...
21:08:16*jefus quit (Client Quit)
21:10:57pigmejdone reactormonk
21:11:03pigmejthough we have a mess there still ;/
21:11:10reactormonktime for some cleanup?
21:11:29*BlaXpirit_ joined #nim
21:11:29*BlaXpirit quit (Killed (sinisalo.freenode.net (Nickname regained by services)))
21:11:29*BlaXpirit_ is now known as BlaXpirit
21:12:08pigmejwould be smart
21:12:30pigmejhmm
21:12:35pigmejI could delete my repo completely
21:12:37pigmejfork again
21:12:41pigmejthen add company-nim.el
21:12:45pigmejas new file
21:14:13pigmejalso reactormonk one more question
21:14:26pigmejdo we add backend to company automaticaly or we will leave it for user?
21:18:22*gokr joined #nim
21:20:22*vikaton joined #nim
21:20:39vikatonWhats the equivalent of try: except: in Nim ?
21:23:06Araqtry: except:
21:23:15vikatono
21:23:54pigmejrotfl:D
21:26:16Mat4how are reference cycles detected by the garbage-collector in Nim ?
21:26:44AraqMat4: the algorithm is called "trial deletion" I think
21:27:17reactormonkpigmej, if you load company-backend, follow whatever the guys do in the other file you linked
21:27:50*vikaton quit ()
21:28:02*vikaton joined #nim
21:29:46Mat4Araq: Thanks, get it
21:30:02pigmejreactormonk: which one?
21:30:15reactormonkpigmej, the one you linked in the issue
21:30:25pigmejah this one
21:30:55Araqyay. we have something to celebrate.
21:30:55pigmejthey don't load auttomaticaly
21:31:03Araq8000 posts on the forum. :-)
21:31:07pigmejAraq: oh :)
21:32:47reactormonkAraq, sweet
21:34:14*datanoise quit (Ping timeout: 265 seconds)
21:37:55*OnO quit (Ping timeout: 250 seconds)
21:38:40pigmejhmm
21:39:57pigmejreactormonk: I did it wrong, fixing ;P
21:42:44*brson quit (Ping timeout: 245 seconds)
21:46:00*Mat4 left #nim (#nim)
21:47:28pigmejreactormonk: hmm
21:47:40pigmejagain my elisp fu is way too low
21:50:23pigmejI now get Symbol's value as variable is void: arg with company backend enabled, and I have no idea why, because interactive funct works
21:51:43*pregressive joined #nim
21:54:19*strcmp1 quit (Remote host closed the connection)
21:54:25*skyfex_ quit (Quit: (null))
22:01:59Varriountonionhammer: I found out why add_on_change callbacks weren't working for me. Apparently ST2 doesn't like symlinked package dirs
22:03:02*bhishma joined #nim
22:07:43*strcmp1 joined #nim
22:11:30*BlaXpirit quit (Quit: Quit Konversation)
22:24:28*Trustable quit (Remote host closed the connection)
22:28:18*gokr_ joined #nim
22:29:56*gokr_ quit (Client Quit)
22:31:19*datanoise joined #nim
22:39:27vikatonAraq, 2000 stars on github is a soon to come celebration
22:44:30reactormonkpigmej, maybe the macro's bugged?
22:45:49pigmejit's exactly like in others as I see
22:46:42pigmejreactormonk: https://github.com/pigmej/nim-mode/blob/epc/company-nim.el#L109
22:47:10pigmej'args' there is "Symbol's value as variable is void: arg"
22:47:12pigmejwtf
22:54:42*datanoise quit (Ping timeout: 258 seconds)
23:04:54vikatonwhat does Error: expression 'echo ["The Negotiator"]' has no type (or is ambiguous) usually mean?
23:05:04reactormonkpigmej, sorry, had to blow up some internet spaceships
23:05:27reactormonkpigmej, I would assume arg is not set here... try a lexical-let around cl-case command
23:05:31Araqit means you do let foo = echo() but it makes no sense since echo doesn't return a value
23:05:38reactormonkpigmej, or cl-defun
23:05:43reactormonk... if that exists
23:06:02vikatonohhh
23:06:05vikatonmakes sense
23:06:14reactormonkAraq, from what I read PRs are getting forwarded
23:06:18pigmejreactormonk: the problem is that noone is doing lexical-let there
23:06:29reactormonkpigmej, no one is doing async either?
23:06:33vikatonbut why cant I do proc foo: echo "hello"
23:06:34vikaton?
23:06:37pigmejthey do
23:06:39vikatonI have to set it to void?
23:06:58pigmejbut maybe without arg
23:07:18pigmejthere is one with async witohut lexical-let https://github.com/tonini/alchemist.el/blob/master/alchemist-company.el#L72
23:07:19Araqvikaton: use = instead of :
23:07:34vikatonoh woops
23:07:37vikatongot confused from python
23:11:37pigmejelpy also but they do different tricks: https://github.com/jorgenschaefer/elpy/blob/master/elpy.el#L3063
23:12:07pigmejalso the question reactormonk why it works as interactive function...
23:13:46reactormonkpigmej, then how about case instead of cl-case
23:14:36pigmejthe same, I already checked it ;D
23:15:34*TEttinger joined #nim
23:17:06*pregressive quit (Ping timeout: 256 seconds)
23:20:16*vendethiel quit (Ping timeout: 252 seconds)
23:23:26onionhammerVarriount ah hm
23:26:46onionhammerVarriount i got latest, doc comments still arent working for me
23:28:04onionhammerVarriount scratch that... it worked the second time i tried it
23:29:07onionhammerthen it stopeped for a while, then i restarted ST3 and it started working again the 2nd try
23:29:24onionhammernow it stopped again :)
23:30:31onionhammerfirst try in log says:
23:30:34onionhammerCould not import subprocess32 module, falling back to subprocess module
23:31:06onionhammerdefinition lookup gives me project.py", line 44, in get_project_file
23:31:09onionhammer raise IOError("Couldn't open session file.")
23:31:30Varriountonionhammer: I haven't worked on the lookup/nimsuggest stuff at all.
23:31:39onionhammerok
23:31:51onionhammerit still could be the result of refactoring though, no?
23:32:01Varriountonionhammer: Does doc comment continuation work?
23:32:10onionhammerno, its sporadic
23:32:16VarriountO_o
23:32:17onionhammermaybe 20% of the time it works
23:32:45VarriountHere, let me put some debug lines in.
23:35:12*someplace quit (Quit: poof)
23:35:53*someplace joined #nim
23:36:15onionhammerk lemme know
23:36:38Varriountonionhammer: https://gist.github.com/Varriount/de1fc3839c66583779fd
23:37:12onionhammerVarriount got to go
23:37:16VarriountAww.
23:43:16*skyfex_ joined #nim
23:47:42*skyfex_ quit (Ping timeout: 256 seconds)
23:49:26*ddl_smurf joined #nim
23:50:59*datanoise joined #nim
23:53:07vikatondoes Nim have something similar to printf ?
23:54:39pigmejthere is lib called sprintf afair
23:54:40Varriountvikaton: Not built-in. There are a couple of Nimble packages for printf functionality, and we have string formatting stuff in strutils.
23:55:05*Varriount wonders why people ask that question all the time
23:55:27VarriountI hardly ever hear it from people new to Python. :/
23:55:32pigmejreactormonk: fixed and pushed (no idea why others don't have lexical-bind)
23:55:34ddl_smurfbest practice is to create one file per string using http://nim-lang.org/docs/filters.html
23:55:39*datanoise quit (Ping timeout: 258 seconds)
23:57:43*JinShil joined #nim
23:57:54jackvhow do I make the Nim compiler output C?
23:58:10jackvah nvm I'm dumb
23:58:12Varriountjackv: It already does? Look in nimcache
23:58:23jackvyeah, I forgot about nimcache
23:58:35*dhasenan joined #nim