<< 13-05-2017 >>

00:10:41*user0 joined #nim
00:12:11Araq'of RootObj' enables inheritance
00:12:20*PMunch quit (Quit: leaving)
00:13:59*PMunch joined #nim
00:14:28PMunchYeah, but how?
00:14:51PMunchIs it just syntactic or is there a different structure to them
00:24:44PMunchAraq?
00:25:11Araqit has a typeinfo field at offset 0 then
00:25:31Araqso that type conversions can be checked at runtime
00:25:34Araqgood night.
00:26:56*Trioxin joined #nim
00:28:08TrioxinI was thinking about it last night as I try to go to sleep. Nim is the all around best programming language of all time.
00:28:50Trioxinone of us. one of us. gooble gobble gooble gobble
00:32:16*user0 quit (Quit: user0)
00:32:25PMunchAah, thanks for the answer
00:32:37PMunchGoing to bed as well now
00:32:37*user0 joined #nim
00:32:52*user0 quit (Client Quit)
00:35:51*PMunch quit (Quit: Bye)
00:36:05*jsgrant_om quit (Ping timeout: 240 seconds)
00:39:35*rauss joined #nim
00:47:20*chemist69 quit (Ping timeout: 258 seconds)
00:47:24*Serenitor quit (Read error: Connection reset by peer)
00:48:03*Serenitor joined #nim
00:50:40*chemist69 joined #nim
00:50:44zachcarterAnyone have any tips on how I can bind to :
00:51:15zachcarterhttps://github.com/bkaradzic/bgfx/blob/master/examples/common/nanovg/nanovg.h#L37-L45
00:52:32*user0 joined #nim
00:53:14*Jesin quit (Ping timeout: 245 seconds)
00:58:49*Jesin joined #nim
01:00:19enthus1astif i remember right c structs are nim object but no gurantee on that
01:03:40*user0 quit (Quit: user0)
01:03:42enthus1astc2 nim creates this https://gist.github.com/anonymous/4dae0635f8dd3d0f37c25b35d9b9efdf
01:03:47enthus1ast^ zachcarter
01:04:00zachcarteryeah :/
01:04:07enthus1astmaybe i understand you wrong i can barely hold my eyes open ; )
01:04:27zachcarterit’s just that doesn’t seem to be working fo rme
01:04:28zachcarterfor me
01:04:30zachcarterwhat c2nim produces
01:05:11enthus1astwhat does it say?
01:05:49zachcarterwell I mean everything compiles
01:06:08zachcarterit’s just where the object is used in other function calls, memory doesn’t seem to be laying out as I expect
01:07:01zachcartervalues aren’t assigned to the fields correctly
01:07:06*jsgrant_om joined #nim
01:08:15*arnetheduck joined #nim
01:10:35enthus1astsorry i'll be no help
01:14:39zachcarternp
01:14:49zachcarterthanks for trying
01:21:04FromGitter<Varriount> zachcarter: Have you tried using the `pure` pragma on data types?
01:21:16zachcarterI haven’t
01:21:41zachcarteron enums yes
01:57:31*dddddd quit (Remote host closed the connection)
01:58:39*chemist69 quit (Ping timeout: 245 seconds)
02:11:35Trioxinhow can I return mysql query results to something associative?
02:11:46TrioxinI'm using getRow at the moment
02:12:08TrioxinjobQ = db.getRow(sql"SELECT * FROM `jobs` WHERE `progress` = 0 LIMIT 1")
02:12:21Trioxinthen I have to do like echo jobQ[0]
02:12:36*chemist69 joined #nim
02:16:58ftsfdom69 after installing switching to devel it works \o/ and nimble tasks work too
02:25:20Trioxinis it possible to get apache to serve up nim applications?
02:25:44TrioxinI know I could serve up my own http requests but I don't really want to
02:29:21*zachcarter quit (Quit: zachcarter)
02:38:25ftsfTrioxin, apache can serve up whatever app via cgi
02:41:14*ftsf_ joined #nim
02:47:42*enthus1ast quit (Ping timeout: 258 seconds)
02:47:54*enthus1ast joined #nim
02:53:56Trioxinnever had to do that before. I do see the nim cgi module
02:56:47*brson quit (Quit: leaving)
03:08:39Trioxingot it goin with cgi module and apache's cgi-bin. sick of crappy PHP for my APIs
03:08:56Trioxin:)
03:09:47FromGitter<ftsf> cool
03:09:51FromGitter<ftsf> yeah php =(
03:10:54TrioxinPHP has been great for so many things for me and I always justified it with "It's rapid dev" but nim is far more rapid and can't beat performance
03:10:58Serenitorzachcarter was trying something like that the other day as well but gave up on recreating it exactly since apparently nim can't have something like anonymous unions/structs (where the contants "drop down" into the parent struct)
03:13:03FromGitter<ftsf> I switched from PHP to python for web stuff a long time ago and never looked back, but these days i'd give nim a try for it
03:13:18FromGitter<ftsf> lack of static typing in python was really annoying
03:15:30TrioxinI never got into python until recent years for machine learning. I'm just ready to go all in with Nim though. Obciously using a pre-processor has its benefits but I don't REALLY need it.
03:18:57*ftsf_ quit (Ping timeout: 240 seconds)
03:23:37FromGitter<Varriount> Nim needs better DB support though
03:24:09*Serenitor quit (Quit: Leaving)
03:31:10TrioxinI'm using Nim's MySQL right now. First thing I'm missing right off the bat are associative arrays as results
03:31:27Trioxinbut that's okay
03:32:57ftsfI suspect it wouldn't be too hard to add
03:33:06ftsfif you know the column names and the order
03:36:39Trioxinhmm. also, it seems that all results are returned as strings
03:39:06ftsfhmm that doesn't surprise me
03:39:50Trioxincrap
03:40:09Trioxincast?
03:40:10ftsfthat's how the mysql c api works
03:40:28ftsfno you need to parse not cast
03:40:47ftsfparseInt parseFloat etc
03:40:58Trioxinah thx
03:41:05ftsffrom strutils
03:42:17*def-pri-pub quit (Quit: leaving)
03:42:33Trioxinparseutils
03:42:58ftsfhmm weird, wonder why those functions are in both modules
03:43:57Trioxinoh wait, you're right
03:44:14TrioxinI was looking at the h2 of the doc page
03:45:40ftsfgotta go, good luck
04:03:38*niomix joined #nim
04:05:18niomixhey guys, i get this error while i am trying to install nimble: ... Error: execution of an external program failed: 'gcc -c -w -O3 -fno-strict-aliasing -I/usr/lib/nim -o /home/yogurt/nimble/src/nimcache/compiler_algorithm.o /home/yogurt/nimble/src/nimcache/compiler_algorithm.c'
04:05:41niomixbut then i copy and paste the command and it works
04:06:02niomixthen i can continue but then i get the same error so i have to copy and paste all the time
04:08:01niomixi don't mind tbh, im just letting you know this issue
04:10:28*Trioxin quit (Remote host closed the connection)
04:11:12*Trioxin joined #nim
04:26:31Trioxinwhen I use roun() I wind up with a number like 1494649465.0. In C you use (int) but I don't see how to do it here.
04:27:15Trioxinthink I have to use cast in this case
04:35:57*Trioxin quit (Ping timeout: 240 seconds)
04:39:23*Trioxin joined #nim
04:39:54FromGitter<Varriount> Triokin: What are you trying to do?
04:40:01FromGitter<Varriount> *Trioxin
04:40:57FromGitter<Varriount> Trioxin: https://nim-lang.org/docs/manual.html#statements-and-expressions-type-conversions
04:41:31*Trioxin2 joined #nim
04:43:54*asdasdwqeq joined #nim
04:43:57*Trioxin quit (Ping timeout: 240 seconds)
04:47:12*Trioxin2 quit (Ping timeout: 272 seconds)
04:48:55asdasdwqeqoh, it's int
04:49:02*asdasdwqeq is now known as Trioxin
04:52:26FromGitter<Varriount> niomix: Hm, any other information on why GCC is failing?
04:53:02niomixidk, what info do you need?, im completly noob
04:54:01niomixBuilding nimble/nimble using c backend, this is taking too much time
04:54:21FromGitter<Varriount> Well, full output would be nice.
04:54:27niomixok
04:54:35FromGitter<Varriount> Generally GCC will print out why it fails
04:55:00niomixbut when i run the command in the terminal it works
04:56:28FromGitter<Varriount> niomix: Which could be due to a number of things - permissions, environment variables, paths, etc
04:57:28niomixoh
04:58:09FromGitter<Varriount> So try running nimble with the '--verbose' flag, post the output here, and we'll see if there's anything to glean from the output.
04:58:23*bjz joined #nim
04:58:24niomixok thanks, i will do that
04:58:53FromGitter<Varriount> Uh, please use a paste service though.
05:00:12niomixok
05:02:34niomixwell i gtg, i carry on later, thanks for the help
05:02:43*niomix quit (Remote host closed the connection)
05:31:10*rauss quit (Quit: WeeChat 1.7.1)
05:58:16*Trioxin2 joined #nim
06:01:14*Trioxin quit (Ping timeout: 240 seconds)
06:49:08Trioxin2I'm trying to pass an argument to exec() for my MySQL query. The argument was returned as a result of a previous query: var jobIdStr:string = job[0] but then passing that to exec I get: [jobIdStr])' has no type (or is ambiguous)
06:51:04ftsfTrioxin2, what's the code you're using?
06:51:25Trioxin2db.exec(sql"UPDATE `jobs` SET `progress` = `progress` + 1 WHERE `ID` = ?", jobIdStr)
06:52:20Trioxin2well, actually I should have passed an int there but same result
06:53:10Trioxin2db.fastRows(sql"SELECT * FROM `jobs` WHERE `progress` < `clicks`") then var jobId = job[0].parseInt then var jobHold = db.exec(sql"UPDATE `jobs` SET `progress` = `progress` + 1 WHERE `ID` = ?", jobId)
06:53:45ftsfdb.exec expects strings as the last varargs
06:55:07ftsfalthough it coerces everything to string for you
06:55:24ftsfwhat's the code where you get the error?
06:55:34Trioxin2db.exec(sql"UPDATE `jobs` SET `progress` = `progress` + 1 WHERE `ID` = ?", jobId)
06:55:43ftsfand the error is?
06:56:09Trioxin2SqlQuery(r"UPDATE `jobs` SET `progress` = `progress` + 1 WHERE `ID` = ?"),
06:56:11Trioxin2 [jobId])' has no type (or is ambiguous)
06:56:34ftsfwhat is jobId?
06:57:03Trioxin2the return of another mysql query assigned as: var jobId = job[0].parseInt
06:57:17Trioxin2but same result even if I don't use parseint
06:57:48Trioxin2it's returned from db.fastRows(sql"SELECT * FROM `jobs` WHERE `progress` < `clicks`")
06:58:42*Trioxin2 is now known as Trioxin
06:59:07ftsfworks for me when i defined var jobId = 0
06:59:21Trioxinfor job in db.fastRows(sql"SELECT * FROM `jobs` WHERE `progress` < `clicks`"):
06:59:23Trioxin var jobId = job[0].parseInt
06:59:37ftsfhttps://gist.github.com/ftsf/ac567edb744397c5bbe8bae912ad8f3d compiles fine
06:59:45Trioxintry fastRows
06:59:53ftsfgist your whole code
07:01:01ftsfhttps://gist.github.com/ftsf/955728c9ea122357f1ef725c0d5eee8f compiles fine too
07:02:53Trioxinhttps://gist.github.com/anonymous/96371d1b2a020a69461bb788af4f20df
07:03:35Trioxinhttps://gist.github.com/anonymous/f34c2dcb691f059638fbd1cf5ab699e5
07:03:49Trioxinmeh. one sec...
07:05:27ftsfok you're trying to return a value from db.exec
07:05:33ftsfwhich doesn't return a value
07:05:45ftsfremove the "var jobHold = "
07:13:13Trioxinyeah, just figured that out and it compiles but when I run it I get: Error: unhandled exception: Commands out of sync; you can't run this command now [DbError]
07:13:45ftsfquerying before you've read all the data?
07:14:00Trioxinoh
07:14:02Trioxindamn
07:26:17Trioxin"Breaking the fastRows() iterator during a loop will cause the next database query to raise an [EDb] exception " what constitues a break?
07:26:43ftsfcalling break ?
07:27:15Trioxinwell, I didn't call a break and it still raised it. I just tried to run another query within the iteration
07:28:27ftsfyeah, i suspect you can only run one query at a time until you've flushed all the results
07:28:36*gokr joined #nim
07:28:51ftsfhttps://dev.mysql.com/doc/refman/5.7/en/commands-out-of-sync.html
07:56:04*zachcarter joined #nim
08:03:38*Trustable joined #nim
08:25:34*Matthias247 joined #nim
08:28:51*ftsf_ joined #nim
08:36:17*Trustable quit (Remote host closed the connection)
08:57:18*Trustable joined #nim
08:59:48*zachcarter quit (Quit: zachcarter)
09:09:38*BennyElg quit (Remote host closed the connection)
09:14:29Trioxindo any of these return without waiting for the process to finish? https://nim-lang.org/docs/osproc.html
09:15:40Trioxinguess I could just use &
09:16:44Trioxin> /dev/null 2>&1 &
09:17:10TrioxinexecProcesses() is super helpful
09:17:51AraqrunProcess vs execProcess is the naming convention irrc
09:18:00Araqplease patch the docs to make it clear
09:18:22Araqdon't use & or other shell crap, not portable and a security problem
09:19:43*ftsf_ quit (Quit: Leaving)
09:20:08*yglukhov joined #nim
09:22:29TrioxinexecProcesses: executes the commands cmds in parallel.
09:32:07*chemist69 quit (Ping timeout: 246 seconds)
09:37:11*BennyElg joined #nim
09:37:29*chemist69 joined #nim
09:39:04*yglukhov quit (Remote host closed the connection)
09:40:44*yglukhov joined #nim
09:40:55AraqI said 'execProcess'
09:41:01Araqsingular
09:45:09*bjz quit (Quit: Textual IRC Client: www.textualapp.com)
09:53:40ftsfTrioxin, sounds like you want to fork and exec the process perhaps?
09:54:02ftsfnot sure if nim has something along those lines other than via the posix module
09:55:58Trioxinftsf. I think startProcess returns before the command is done. I ran nano and it didn't block
09:56:53ftsfok cool
09:56:57Trioxindiscard startProcess("nano","/usr/bin")
09:57:22Trioxinit should say that in the doc though
10:01:34*adeohluwa joined #nim
10:01:48Trioxinediting docs in this manner is cumbersome
10:03:54*bjz joined #nim
10:07:33Araqyou mean with the 'edit' button right on the page?
10:07:50Trioxinthe ## in the markdown
10:08:07Araqit's not markdown, it's RST.
10:08:17Trioxinoh. still
10:08:24*Tiberium joined #nim
10:08:27Araqyou can also use ##[multi line comment here]##
10:08:52Trioxinthat wasn't done for some reason
10:08:57Trioxinedit!
10:09:30Trioxinmy favoriate language docs are actually PHP's
10:14:55Araqmy favorite are Nim's
10:15:48Trioxinwell, would be nice for every proc to have a good description and example(s). comments wouldn't hurt either
10:16:21Araqeverybody complains about them but I like them. they document types, raised exceptions and don't contain chapters that describe the type signatures again in prose.
10:16:27FromGitter<Varriount> Python's and MDN's JavaScript docs are my favorite.
10:16:58Araqmore examples are missing though.
10:18:09Trioxinthere are some things about nim docs I don't even get yet
10:18:34Trioxinsomething like this seems more of a nightmare than a help:
10:18:37Trioxinproc execProcesses(cmds: openArray[string];
10:18:39Trioxin options = {poStdErrToStdOut, poParentStreams};
10:18:40Trioxin n = countProcessors(); beforeRunEvent: proc (idx: int) = nil;
10:18:42Trioxin afterRunEvent: proc (idx: int; p: Process) = nil): int {..}
10:19:08*yglukhov quit (Remote host closed the connection)
10:19:36Araqsee? that's a good example. I can understand everything in that piece immediately. :P
10:19:59Trioxinyeah idk what's going on there until I start messing with code
10:20:15Araqcmds # well it runs these
10:20:23Trioxinyea
10:20:32Trioxinnext is params
10:20:38Trioxinnext is how many to spawn
10:20:41Araqoptions = {poStdErrToStd # obvious stderr -> stdout redirection is default
10:20:46Trioxinafter that is an enigma
10:21:06Araq poParenStreams -> processes inherit stdin/stdout/etc file handles
10:21:26Araqn # used number of CPUs, autodetection is the default
10:21:52AraqbeforeRunEvent # callback before cmds[idx] is executed
10:22:10AraqafterRunEvent # callback after cmds[idx] was executed
10:22:26Araqdefault to 'nil', so usually nothing is done
10:22:42Trioxinah
10:23:16TrioxinbeforeRunEvent: proc (idx: int) .... idx: int?
10:23:37FromGitter<Varriount> The index of the process being run
10:23:40Trioxinoh.. what is passed to callback
10:23:43Trioxinoh
10:23:57FromGitter<Varriount> I mean, command
10:27:06*Snircle joined #nim
10:30:02Trioxinrunning nano would have blocked my program if startProcess() waited for finish right?
10:30:25Araqyeah I think so
10:30:29Trioxinnvm I'll just make an infinite loop to test
10:31:31*Matthias247 quit (Read error: Connection reset by peer)
10:36:45Trioxinyeah it doesn't block
10:46:08*xet7 joined #nim
10:53:54Trioxinls
10:53:58Trioxinoops
10:54:16*zachcarter joined #nim
11:01:19*zachcarter quit (Read error: Connection reset by peer)
11:01:40*zachcarter joined #nim
11:04:02Trioxinhow do I set ProcessOption? https://nim-lang.org/docs/osproc.html#startProcess
11:04:30TiberiumTrioxin, https://nim-lang.org/docs/osproc.html#ProcessOption
11:04:31Trioxinoptions: set[ProcessOption] = {poStdErrToStdOut}
11:04:45TiberiumTrioxin, like {poEvalCommand, poDemon} but you'll have different ones
11:04:54Tiberiumoptions={poEvalCommand, poDemon}
11:05:32Trioxinoh enums
11:12:00Araqsee? the docs are awesome, it's just that you need more knowledge of Nim in general, the API docs don't teach the language ;-)
11:16:39Trioxinyeah sometimes that's the case. I've only casually used Nim but now I'm really getting into production. Best way to master
11:19:29TrioxinI'm having a problem now. What should be my last problem for a while. I'm trying to do `npm start` so I do this: https://hastebin.com/axogohahiq.go but in a separate session I do `ps x` and I see a bunch of these: pts/0 Z+ 0:00 [npm] <defunct>. Also, startProcess doesn't block or return anything (Good) but if I kill my program, all the npm die (They're children like that?). I'm 99% sure they're not starting up properly though.
11:36:48zachcarterCould use some help with this one
11:36:52zachcarterhttps://gist.github.com/zacharycarter/2798a346211782c943b0eb6cfee929a5
11:37:03zachcartertop output is from Nim, bottom output is from C
11:37:10zachcarterhere are the bindings and the data structures
11:37:38AraqTrioxin: I think that's just Unix's process model. children die with their parents
11:39:14Araqzachcarter: what about it?
11:39:53zachcarterhttps://gist.github.com/zacharycarter/bbeaa36f402a5c98b760bf7ed2e7f0d8
11:40:27zachcarterAraq: I’d expect the values in the C invocation to match what they were prior to being passed in on the Nim side
11:40:34zachcarterbut they seem to be way off
11:40:44zachcarterso I’m guessing something in my bindings is screwed up
11:42:04Trioxini think it's working now (somehow)
11:42:20zachcartermaybe because I’m using floats and not cfloats?
11:42:47Araqzachcarter: sorry c2nim doesn't yet add .bycopy to the object decls
11:42:53Araqthat should fix your problems
11:43:09Araqalso float != cfloat, Nim's float == cdouble
11:43:12zachcarterAraq: thank you - which objects do I need to add that pragma to
11:43:26Araqevery object that is passed by value to C
11:43:35zachcartergotcha thank you
11:43:40Araqwithout the 'ptr'
11:43:50zachcartermuch appreciated as always!
11:46:24*MyMind joined #nim
11:48:25*Pisuke joined #nim
11:48:26*Sembei quit (Ping timeout: 255 seconds)
11:50:44*MyMind quit (Ping timeout: 240 seconds)
11:58:40*PMunch joined #nim
11:59:37Trioxinis there any reason to compile with C++ other than interop?
12:00:44AraqTrioxin: yes, faster exception handling
12:00:53Trioxink
12:03:09zachcarterAraq: brilliant it fixed it
12:03:42zachcarterbycopy I mean
12:04:05Araqyeah please create a c2nim issue for that, it's a serious omission
12:04:55zachcarterwill do
12:04:59zachcarterhttp://imgur.com/a/dMHRC
12:05:08zachcarternanovg support for frag now!
12:06:47zachcarterhttps://github.com/nim-lang/c2nim/issues/84
12:09:33Trioxindoes require() work in Nim for js compile?
12:10:41Trioxinalso await?
12:11:12TrioxinI need require, await, yeild
12:11:57*vendethiel joined #nim
12:14:39zachcarterTrioxin: I think you can wrap JS functions with Nim
12:16:06zachcarterso worst https://github.com/zacharycarter/nim-playground-frontend/blob/master/src/app.nim#L11-L14
12:16:08zachcarterwoops
12:16:15zachcarterI didn’t mean to type so worst
12:16:27zachcarterI did mean to share that link
12:17:08FromGitter<stisa> Trioxin: you can probably use jsffi and something like ``proc require(module:string):JsObject {.importcpp: "require(#)".}`` for require, no idea for the others
12:18:28Trioxinhmm. will not take that leap yet
12:19:33Araqwhat does 'require' do? run some bullshit at runtime that should really be done at compiletime?
12:19:55zachcarteryeah it’s like module injection
12:19:57zachcarterI believe
12:20:49zachcarterthere’s - http://requirejs.org/
12:20:49zachcarterand
12:20:57zachcarterhttp://browserify.org/
12:21:00zachcarterwebpack might use require too
12:21:02zachcarterI dunno
12:21:10TrioxinI'm talking about for use with node
12:21:12FromGitter<stisa> oh I was thinking of https://nodejs.org/api/modules.html
12:21:33zachcarteroh… I haven’t played with Node and Nim yet
12:22:10Trioxinwas thinking about converting all my node code for this project but time is better spent elsewhere for now
12:31:19*adeohluwa quit (Quit: Connection closed for inactivity)
12:33:13*Arrrr joined #nim
12:33:13*Arrrr quit (Changing host)
12:33:13*Arrrr joined #nim
12:49:41*Trioxin quit (Quit: Konversation terminated!)
12:55:26*Arrrr quit (Read error: Connection reset by peer)
12:58:28*Arrrr joined #nim
13:03:29Tiberiumhttps://github.com/nim-lang/Nim/pull/5677 zahary is, indeed, doing very good work. But this PR is already very huge, and it also contains other new features. Will it be merged in a month at least?
13:17:02*bjz_ joined #nim
13:17:04*bjz quit (Ping timeout: 260 seconds)
13:18:33Tiberiumalso, can I safely say that nim doesn't include runtime in compiled programs?
13:18:50Tiberiumor I misunderstood a "runtime" word?
13:19:48FromGitter<zacharycarter> you mean runtime as in like virtual machine?
13:19:59FromGitter<zacharycarter> like the .NET CLR or JVM?
13:20:52Tiberiumand like in Go
13:20:57Tiberiumdoes it mean Go contains a VM too?
13:22:21FromGitter<zacharycarter> no golang doesn't run on a VM
13:22:50FromGitter<zacharycarter> go does have a runtime
13:23:13FromGitter<zacharycarter> I see what you mean
13:24:45*PMunch quit (Quit: leaving)
13:25:10FromGitter<zacharycarter> I don't have a good answer
13:25:35FromGitter<zacharycarter> @dom96 - is there any way to see the output from the nim compile command when building a binary with nimble? My build is erroring out but I can't tell why
13:26:27dom96zacharycarter: upgrade your Nimble.
13:26:39dom96zacharycarter: or run with --debug flag
13:26:46FromGitter<zacharycarter> thanks
13:37:21*nsf joined #nim
13:44:08*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
13:49:11*Snircle joined #nim
13:59:31*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
14:20:35*jsgrant_om quit (Ping timeout: 240 seconds)
14:21:25*Tiberium quit (Remote host closed the connection)
14:22:42*Tiberium joined #nim
14:30:16*Tiberium quit (Remote host closed the connection)
14:31:25*Tiberium joined #nim
14:33:13*Tiberium quit (Remote host closed the connection)
14:34:31*Tiberium joined #nim
14:39:43*Ven joined #nim
14:40:07*Ven is now known as Guest13320
14:46:21*nsf quit (Quit: WeeChat 1.7.1)
14:46:37*Tiberium quit (Remote host closed the connection)
14:48:05*Tiberium joined #nim
14:50:13*FromGitter quit (Remote host closed the connection)
14:50:21*FromGitter joined #nim
14:51:00*gangstacat quit (Quit: Ĝis!)
14:54:10*Guest13320 quit (Ping timeout: 240 seconds)
14:59:06*Ven_ joined #nim
15:08:35*Ven_ quit (Ping timeout: 240 seconds)
15:10:36*Ven_ joined #nim
15:12:15*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
15:17:30*bjz joined #nim
15:18:28*krux02 joined #nim
15:22:13*sz0 quit (Quit: Connection closed for inactivity)
15:25:21*krux02 quit (Remote host closed the connection)
15:25:38*krux02 joined #nim
15:40:38*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:48:29FromGitter<almynic> why does not work correctly nim string are zero terminated right? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59172acc83cb5db07329831d]
15:58:09FromGitter<almynic> ok figured it on my own ;) the for loop doesn't have a 0 as last index
16:07:14*Matthias247 joined #nim
16:24:44*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
16:28:00Tiberiumwhat's the simplest way to filter all duplicated entries in a seq?
16:34:45FromGitter<yglukhov> @dom96, @Araq, @almynic, another nice sample of null terminator inconsistency
16:41:34*gangstacat joined #nim
16:43:22*zachcarter quit (Quit: zachcarter)
16:46:49*chemist69 quit (Ping timeout: 246 seconds)
16:47:59*yglukhov joined #nim
16:50:17*chemist69 joined #nim
16:50:28*arnetheduck quit (Ping timeout: 272 seconds)
16:51:13*libman joined #nim
17:15:05*PMunch joined #nim
17:23:08*Ven joined #nim
17:23:31*Ven is now known as Guest10447
17:34:49*Guest10447 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:41:04*nsf joined #nim
17:42:52*Matthias247 quit (Read error: Connection reset by peer)
18:04:37PMunchIs there a way to iterate over a slice of some varargs?
18:05:04*Ven_ joined #nim
18:10:33FromGitter<konqoro> @PMunch try using '@' proc over varrargs
18:11:58PMunchAh, so turning it into a seq
18:29:38*PMunch quit (Quit: leaving)
18:57:59*miningold joined #nim
19:04:40*BennyElg_ joined #nim
19:05:03*miningold quit (Quit: leaving)
19:07:33*BennyElg quit (Ping timeout: 260 seconds)
19:33:19euantorTiberium: Easiest way is https://nim-lang.org/docs/sequtils.html#deduplicate,seq[T]
19:41:56Tiberiumeuantor, lol, I didn't noticed that :D
19:42:43krux02what is the easiest way to open a file relative to the executable in nim?
19:43:15Tiberiumkrux02, probably https://nim-lang.org/docs/os.html#getAppDir, ?
19:43:24*Jesin quit (Quit: Leaving)
19:43:51krux02looks good, I try it now
19:47:03*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:55:40*Ven joined #nim
19:56:04*nsf quit (Quit: WeeChat 1.7.1)
19:56:04*Ven is now known as Guest93089
20:00:11*Arrrr quit (Read error: Connection reset by peer)
20:02:46*Tiberium quit (Remote host closed the connection)
20:03:39*Tiberium joined #nim
20:17:26krux02getAppDir does work
20:20:52krux02a question about nimble and reproducable projects. Lets say I have a dependency that had a bug, I fixed that bug, and did nimble install. Now the projects works only on my machine. How can nimble detect that this case happened? I would like to have a build test that only uses packages in the lowest version that is required and installable via nimble.
20:21:34krux02In other words I would like to test the correctness of my dependencies that I specified
20:54:57*gokr quit (Ping timeout: 240 seconds)
20:56:31FromGitter<stisa> krux02: if your dependencies have git tags, I think you can specify the version of the dependency in your `.nimble` file. You have to change them and build by hand though, don't know of anything more automated
20:58:44*Sentreen quit (Ping timeout: 240 seconds)
21:00:58*Tiberium quit (Remote host closed the connection)
21:04:06FromGitter<almynic> hi what is the best way to increment a value when using tables? i have words as keys and the wordcount as value.
21:09:24Araquse a CountTable and its 'inc' operation?
21:10:07FromGitter<almynic> i use the Table from tables
21:11:28*Sentreen joined #nim
21:21:50FromGitter<stisa> @almynic maybe something like ``if t.hasKeyOrPut("hello",1): t["hello"] += 1`` ?
21:23:32*bjz joined #nim
21:25:09def-stisa: then you need to search for "hello" twice. What Araq said or t.mgetOrPut("hello", 0) += 1
21:25:35def-or just mget if you know it's in
21:26:17FromGitter<almynic> ok thanks
21:42:41*zachcarter joined #nim
21:50:13FromGitter<almynic> this doesn't work why? I get an illegal storage access error like this SIGSEGV: Illegal storage access. (Attempt to read from nil?) ⏎ Error: execution of an external program failed: 'c:\Users\Nicolas\Documents\NimProjects\review.exe ' ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59177f95d1a7716a0ac2bc33]
21:52:12*nsf joined #nim
22:03:02subsetparkHey all, I know there probably isn't a huge market for it, but here's a RPN calculator I wrote in Nim: https://github.com/subsetpark/ad
22:09:40FromGitter<almynic> ok the solution was to write this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59178424c4d73f445aa3c5fb]
22:14:11*Trustable quit (Remote host closed the connection)
22:51:00*libman quit (Quit: Connection closed for inactivity)
22:51:52*hcorion joined #nim
22:52:16hcorionHi all! Is there a quick easy way I can convert a cstring to a fixed length char array?
22:56:05Araqhcorion: system.copyMem
22:56:47Araqor use a for loop and let the C backend optimize it to the same. you gain memory safety
22:56:47*Trioxin joined #nim
22:57:06Trioxinback to work time
23:01:28*Trioxin2 joined #nim
23:04:23*Trioxin quit (Ping timeout: 260 seconds)
23:04:55*Trioxin2 is now known as Trioxin
23:12:05dom96subsetpark: awesome, I wrote an RPN language interpreter when I first started out with Nim :)
23:13:13subsetparkYeah, I'm resisting the urge to make it turing complete :)
23:13:22subsetparkbut it's nice to have a quick CLI calculator
23:35:30*user0 joined #nim
23:39:17TrioxinI can't wait to get into the macro system. no need yet
23:46:13*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:46:21*zachcarter quit (Quit: zachcarter)
23:55:31*user0 quit (Quit: user0)