<< 27-11-2017 >>

00:00:07*rbrt joined #nim
00:00:40*rbrt quit (Remote host closed the connection)
00:01:26*rbrt joined #nim
00:02:03*rbrt quit (Remote host closed the connection)
00:02:37*rbrt joined #nim
00:02:43*ryanhowe joined #nim
00:03:08*ryanhowe quit (Client Quit)
00:03:42*rbrt quit (Remote host closed the connection)
00:04:26*rbrt joined #nim
00:04:59*rbrt quit (Remote host closed the connection)
00:05:39*rbrt joined #nim
00:06:16*rbrt quit (Remote host closed the connection)
00:06:39*xkapastel quit (Quit: Connection closed for inactivity)
00:06:56*rbrt joined #nim
00:07:33*rbrt quit (Remote host closed the connection)
00:08:11*rbrt joined #nim
00:08:44*rbrt quit (Remote host closed the connection)
00:09:33*rbrt joined #nim
00:10:09*rbrt quit (Remote host closed the connection)
00:10:52*rbrt joined #nim
00:11:25*rbrt quit (Remote host closed the connection)
00:12:12*rbrt joined #nim
00:12:49*rbrt quit (Remote host closed the connection)
00:13:35*rbrt joined #nim
00:14:12*rbrt quit (Remote host closed the connection)
00:15:07*rbrt joined #nim
00:15:43*rbrt quit (Remote host closed the connection)
00:16:28*rbrt joined #nim
00:17:03*rbrt quit (Remote host closed the connection)
00:17:43*rbrt joined #nim
00:18:19*rbrt quit (Remote host closed the connection)
00:19:10*rbrt joined #nim
00:19:45*rbrt quit (Remote host closed the connection)
00:20:33*rbrt joined #nim
00:21:06*rbrt quit (Remote host closed the connection)
00:22:11*rbrt joined #nim
00:22:45*rbrt quit (Remote host closed the connection)
00:23:47*rbrt joined #nim
00:24:25*rbrt quit (Remote host closed the connection)
00:25:15*rbrt joined #nim
00:25:50*rbrt quit (Remote host closed the connection)
00:26:48*rbrt joined #nim
00:27:26*rbrt quit (Remote host closed the connection)
00:28:02*rbrt joined #nim
00:28:36*rbrt quit (Remote host closed the connection)
00:29:12*rbrt joined #nim
00:29:48*rbrt quit (Remote host closed the connection)
00:30:32*rbrt joined #nim
00:31:04*rbrt quit (Remote host closed the connection)
00:31:43*rbrt joined #nim
00:32:16*rbrt quit (Remote host closed the connection)
00:32:55*rbrt joined #nim
00:33:34*rbrt quit (Remote host closed the connection)
00:34:10*rbrt joined #nim
00:34:47*rbrt quit (Remote host closed the connection)
00:35:28*rbrt joined #nim
00:36:02*rbrt quit (Remote host closed the connection)
00:36:37*rbrt joined #nim
00:36:41*Guest21319 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:37:01*Ven joined #nim
00:37:24*Ven is now known as Guest66362
00:37:29*Guest66362 quit (Client Quit)
00:38:00*rbrt quit (Remote host closed the connection)
00:38:39*rbrt joined #nim
00:39:14*rbrt quit (Remote host closed the connection)
00:39:57*rbrt joined #nim
00:40:16*skrylar joined #nim
00:40:48*rbrt quit (Remote host closed the connection)
00:40:59*vivus quit (Quit: Leaving)
00:41:23*themagician quit ()
00:46:16dom96Are we sticking to our guns with how strutils.split behaves? https://github.com/nim-lang/Nim/issues/4377
00:46:25dom96Please state your opinion :)
00:57:02*skrylar quit (Ping timeout: 268 seconds)
01:03:41FromGitter<Quelklef> I do like the property of V.split(S).join(S) always being equal to V. However, there are times when the alternative functionality (no "" in return list) is useful, for instance turning all whitespace into single spaces via sentence.split(" ").split("\t").join(" ")
01:04:50*Jesin joined #nim
01:08:46FromGitter<Quelklef> Oh, I guess it doesn't make a difference in this case. Anyway, an argument for [""]: the number of times c occurs in str is -1 + the length of str.split(c) ; this preserves that
01:13:50*xkapastel joined #nim
01:20:38FromGitter<techate> there's also vyper, an ancient reimplementation of Python in O'Caml. That's what I thought viper was when I heard of it
01:21:36*vlad1777d quit (Ping timeout: 248 seconds)
01:21:55*skrylar joined #nim
01:26:35*skrylar quit (Ping timeout: 240 seconds)
01:43:38*rauss quit (Quit: WeeChat 1.9.1)
01:45:53*couven92 quit (Quit: Client Disconnecting)
01:48:46*rauss joined #nim
02:10:37*chemist69 quit (Ping timeout: 250 seconds)
02:13:58*MJCaley joined #nim
02:14:07*sz0 quit (Quit: Connection closed for inactivity)
02:19:40*marenz__ quit (Ping timeout: 268 seconds)
02:24:30*chemist69 joined #nim
02:34:30*SenasOzys joined #nim
02:46:44*endragor joined #nim
03:01:26FromGitter<raydf> hi everyone
03:03:49FromGitter<raydf> How can i make a proc import for karax using the global cordova plugin object? Ex: ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5a1b8094cc1d527f6bbb7a4d]
03:03:59*dddddd quit (Remote host closed the connection)
03:06:44FromGitter<raydf> I'm trying to figure out the js backend for importcpp pragma ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a1b8143ffa3e37919c31f63]
03:20:44*MJCaley quit (Quit: MJCaley)
03:47:39*ryanhowe joined #nim
03:47:41*ryanhowe quit (Client Quit)
03:52:04*ryanhowe joined #nim
03:58:43alexdayin nim, is there any way to convert "200 OK" to Http200 ?
04:00:33pydsignerAn if tree!
04:01:28alexdaybut for lets say I have to do something like, if http status code is < 400 then return "ok" (for say) then I have to write all the status codes
04:01:45alexdayend up with a huge case of statement
04:03:46alexdayI could do something like split the string, get the first part convert to int and wrap that in a menthod
04:04:50alexdayalso %(req) is not working if req is of a type that has Table field. it says undeclared field counter. why!
04:09:02FromGitter<raydf> alexday is this for a srever api or a client?
04:09:08FromGitter<raydf> *server
04:10:48alexdayclient. sending request and recieving response from server.
04:11:15FromGitter<raydf> split the string as you said
04:14:34alexdayok
04:18:21*BitPuffin|osx joined #nim
04:26:19alexdaythe % operator is very limited I presume. is there a way to say that if add a method to a Table and say only include these fields when its called by the % method?
04:30:41alexdayI will use a JsonNode for now
05:52:57*Amrykid2 quit (Quit: Leaving)
06:31:36alexdaywhere do I need to look for how to get to import local files in nim, using nimble probably!!
06:35:35*nsf joined #nim
06:48:23*JappleAck joined #nim
06:48:48*JappleAck quit (Remote host closed the connection)
06:59:19*JappleAck joined #nim
07:07:04*jjido joined #nim
07:07:58*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
07:19:20alexdayhow to import local files men! I don't want to have a single .nim file with the world's code :P
07:21:32alexdayhttps://github.com/nim-lang/nimble#configuration this possibly
07:42:58alexdayI don't see a nimble.ini in my ~/.config/nimble :( on macosx
07:44:26alexdayI guess I have to follow what is written under libraries and configuration to make an importable module (which is little uncool, a python like __main__.py . but anyway
07:48:43FromGitter<mratsim> @alexday can't you use a case statement with code < 200:
07:49:24alexdayresponse.status is a string. cant use comparision other than ==
07:49:49alexdayI split it anyway. I am stuck with making my code importable locally :P
07:53:01alexdayI want to say. using git as a storage for package is a bad idea. Please. anyday github goes down, everything gets affected. there should be something as minimal as npm.
07:54:59alexdayI don't know why people are leaning towards such solution. even go lang does this, and its more fucked up because now my directory structure has to represent this wired <code-host-domain>/some-group-name-or-shit/project-folder-name . and now I github/bitbucket/gitlab/source.golabs.io its frustrating. I had to write a bash script to find my projects
07:55:46*vlad1777d joined #nim
08:03:51alexday`If your package exposes only a single module, then that module should be present in the root directory (the directory with the .nimble file) of your Git repository` :( now I have to push my code to github!!
08:24:43Araqalexday: you don't, all you need to do is to learn about --path and nim's config system
08:25:25alexdaygot it man. thanks.
08:27:27*claudiuinberlin joined #nim
08:33:32*sz0 joined #nim
08:34:56*floppydh joined #nim
08:49:42*jjido quit (Ping timeout: 260 seconds)
08:58:18euantoralexday: Regarding `response.status`, take a look at `response.code()` instead - it's much easier to use and miles more useful in the vast majority of cases: https://nim-lang.org/docs/httpclient.html#code
09:00:18*couven92 joined #nim
09:13:48FromGitter<andreaferretti> wow, there was a lot of activity on github in the weekend!
09:17:00*dddddd joined #nim
09:18:07*jjido joined #nim
09:23:56*SenasOzys quit (Ping timeout: 268 seconds)
09:33:38*xkapastel quit (Quit: Connection closed for inactivity)
09:33:51*SenasOzys joined #nim
09:43:03*BitPuffin|osx quit (Ping timeout: 268 seconds)
10:05:25*PMunch joined #nim
10:06:11*dddddd quit (Remote host closed the connection)
10:17:04alexdayhey
10:17:53*vlad1777d quit (Ping timeout: 276 seconds)
10:19:22couven92alexday, hello there! :)
10:19:45alexdayI have an yaml like this https://pastecode.xyz/view/bf8b60cb . I am using the nimyaml. how to I represent this as an object? like Targets = seq[string] but the rest how to do, the key name is dynamic
10:28:26FromGitter<mratsim> @alexday probably the best resource is there: https://nimyaml.org/schema.html or ping NimYAML dev. He hangs there as well.
10:29:23FromGitter<mratsim> Or this: https://nimyaml.org/index.html
10:30:05alexdayok
10:30:24FromGitter<mratsim> Btw that's quite the nice documentation, seems to integrate nim docgen + some kind of menu.
10:30:56alexdayI did check their docs page. things are pretty simple there. predictiable things :P
10:31:15alexdaythere should really be something for Table types :P
10:31:24alexdayoh its there
10:31:36alexdayin Collection Type. nice #respect
10:36:50*astronavt quit (Remote host closed the connection)
10:36:52*sz0 quit (Quit: Connection closed for inactivity)
10:37:19*astronavt joined #nim
10:41:04*astronavt quit (Remote host closed the connection)
10:41:13*astronavt joined #nim
10:45:11*astronavt quit (Client Quit)
10:49:15flyxalexday: did you manage to load your YAML?
10:49:28flyxalexday: targets should be seq[string]
10:50:01alexdaytargets I know. trying the map with Table
10:50:52flyxalexday: only use Table if you do not use in advance which keys will be present. otherwise, define an object with the expected keys.
10:50:59flyxs/use/know
10:51:03flyxbrain what are you doing
10:51:42alexdaywhose brain?
10:51:49flyxmine
10:51:52alexdayoh :D
10:52:26alexdayin my case inside the upstreams: each key can be user defined. So I guess table is the correct choice
10:53:16flyxokay, reasonable. hopefully, the values are fixed objects
10:54:37flyxbtw, mentioning yaml in this channel automatically pings me ;)
10:58:07alexdayoh because its your library NimYAML . smooth
11:04:30*flyx quit (Excess Flood)
11:04:38*flyx joined #nim
11:16:16*arnetheduck joined #nim
11:27:55alexday@flyx . is this not correct?
11:27:57alexdaytype
11:27:59alexday Targets = seq[string]
11:28:01alexday Upstream = object
11:28:03alexday targets: Targets
11:28:05alexday Upstreams = Table[string, Upstream]
11:29:01alexdayoh sorry
11:29:03alexdaymy bad
11:29:05alexdaynvm
11:31:02alexdaydone. Upstreams = object upstreams: Table[blablabla]
11:31:12flyxalexday: I was about to mention that
11:31:20alexday:))
11:31:32flyxwill be afk for a while
11:44:09*Ven joined #nim
11:44:33*Ven is now known as Guest37997
11:44:50alexdayAnchor on non-ref type [YamlConstructionError] what does this mean https://pastecode.xyz/view/e74ee610
11:53:50*r4vi quit (Ping timeout: 255 seconds)
11:55:33*r4vi joined #nim
11:56:57*bozaloshtsh quit (Ping timeout: 240 seconds)
11:59:16*bozaloshtsh joined #nim
11:59:16*bozaloshtsh quit (Changing host)
11:59:16*bozaloshtsh joined #nim
12:00:02FromGitter<krux02> I know it's off topic, but I am officially a dad now.
12:00:10FromGitter<mratsim> Congrats !
12:00:39FromGitter<mratsim> Now you have a reason other than Travis failing to wake up at night ;)
12:01:08FromGitter<raydf> congrats @krux02
12:01:09FromGitter<krux02> haha
12:01:31FromGitter<krux02> Probably
12:01:36FromGitter<krux02> thank you
12:02:18*livcd quit (Ping timeout: 246 seconds)
12:03:12*livcd joined #nim
12:10:53*noonien quit (Quit: Connection closed for inactivity)
12:11:26Araqkrux02: congratulations
12:11:27*Guest37997 quit (Ping timeout: 240 seconds)
12:14:43*Ven_ joined #nim
12:14:56*SenasOzys quit (Ping timeout: 248 seconds)
12:21:12livcdIs there something like this for Nim or I have to build my own ? https://godoc.org/golang.org/x/sys/windows/svc/mgr
12:24:57*SenasOzys joined #nim
12:27:01Araqlivcd: I think some people wrote Windows Services via COM but I doubt there is a nimble package for it
12:27:52AraqI found Windows services hard to debug though and so write my own watchdog to keep my processes alive
12:28:19*Ven_ quit (Read error: Connection reset by peer)
12:31:20*Ven joined #nim
12:31:45*Ven is now known as Guest32259
12:31:59FromGitter<andreaferretti> Congratulations!
12:35:26euantorJust use NSSM - it's called "Non Sucking Service Manager" for a reaosn :P
12:35:34euantorhttps://nssm.cc/
12:37:00PMunchCongrats krux02!
12:37:23PMunchNoticed any degredation of joke quality yet?
12:38:46alexdayawesome
12:46:56alexday@flyx ntk yet?
12:51:13Araqeuantor: seems a nice piece of software
12:52:30*Snircle joined #nim
12:52:31euantorAraq: It's saved me a lot of hassle in the past - can redirect stdout/stderr to files and all sorts too
13:01:27*ryanhowe quit (Quit: WeeChat 1.4)
13:05:32*ryanhowe joined #nim
13:07:22*Vladar joined #nim
13:12:49alexdaywhy are yaml anchor tags not working with nimyaml :(
13:18:05*nhywyll joined #nim
13:24:43*couven92 quit (Read error: Connection reset by peer)
13:25:12*couven92 joined #nim
13:38:32*endragor quit (Remote host closed the connection)
13:38:50dom96congrats krux02 :)
13:41:06*Jesin quit (Quit: Leaving)
13:57:16*manjaro-kde5 joined #nim
13:59:14*endragor joined #nim
14:04:42*endragor quit (Remote host closed the connection)
14:06:30*endragor joined #nim
14:06:40*manjaro-kde5 quit (Quit: Konversation terminated!)
14:06:40*endragor quit (Remote host closed the connection)
14:09:19*endragor joined #nim
14:11:04*endragor_ joined #nim
14:13:40FromGitter<raydf> when i try to import jsffi with karax it says they are a lot of ambiguous call. I'm trying to use JsObject for binding methods in a cordova app
14:14:17*endragor quit (Ping timeout: 258 seconds)
14:15:24alexdayafter doing a new(object_name) how can I convert the resultant to a non ref ?
14:15:47*endragor_ quit (Ping timeout: 276 seconds)
14:16:25Araqalexday: deref it, object_name[]
14:16:32alexdayoh cool. thanks
14:16:49Araqraydf: I don't use jsffi :-)
14:16:50*voidspacexyz joined #nim
14:17:11Araqyou can do import x except y, z to resolve ambiguities
14:21:32alexday:( even trying to create a yaml file the opposite way didn't work https://pastecode.xyz/view/c4ba02eb . will go back home and check
14:21:39Araqspeaking of bad docs ... https://nim-lang.org/docs/asynchttpserver.html is not enough, how can I access POST data?
14:22:14*dexterk joined #nim
14:27:20*voidspacexyz quit (Ping timeout: 268 seconds)
14:30:02FromGitter<raydf> @Araq, i'm really trying to see how to do a simple proc callback with karax to a cordova plugin
14:31:13FromGitter<raydf> in mediaplayer.nim you use a importc but i can't understand an example with a callback
14:32:27FromGitter<raydf> 1) i can't find an example
14:32:37FromGitter<raydf> \* i can't
14:34:21AraqI don't know what to say, callbacks are not special. a Nim proc is mapped to a JS function, just pass it around
14:34:50Araqproc takesCallback(x: proc()) {.importc.}
14:34:59AraqtakesCallback proc =
14:35:03Araq echo "my code here"
14:38:15*endragor joined #nim
14:42:32dom96Araq: That's the body field in request.
14:42:35*endragor quit (Ping timeout: 255 seconds)
14:42:51Araqyes, that's what I guessed
14:49:57*jjido quit (Ping timeout: 240 seconds)
14:53:21FromGitter<alehander42> Araq: why don't you use jsffi ?
14:54:20Araqit overloads '.'
14:54:41Araqweakens the type system too much
14:55:08AraqI like my typos to be detected at compile-time and I'm willing to type more to get that benefit
14:55:31dom96hrm, that's pretty bad
14:55:37dom96Maybe we should rename this module?
14:55:41dom96jsffi sounds too official
14:57:15FromGitter<alehander42> well often it's useful to prototype something using `.` + casts and then strengthen it with adding type definitions, but I see where you're coming from
15:07:29Araqdom96: maybe we can fix it or introduce a --define:strict variant?
15:08:26dom96if we can fix it then sure
15:08:32dom96No clue how we can do that though
15:08:40*Jesin joined #nim
15:11:47*PMunch quit (Ping timeout: 260 seconds)
15:21:30Araqmain.js:3776 OPTIONS http://localhost:8080/mykey 500 (Internal Server Error)
15:21:45Araqnow what? My server didn't crash :-)
15:23:42*dddddd joined #nim
15:25:58*BitPuffin|osx joined #nim
15:31:17*PMunch joined #nim
15:34:16FromGitter<andreaferretti> to be fair, it overloads `.` only for objects of type `JsAssoc`
15:34:34FromGitter<andreaferretti> which are meant to be used as dynamic containers anyway
15:35:16FromGitter<andreaferretti> much like Scala `Dynamic` (which I think comes from C#)
15:35:34FromGitter<andreaferretti> it does not overload `.` for other types
15:35:57Araqoh that's good to know :-9
15:36:48Araqthe other reason why I don't jsffi is that I don't need it ;-)
15:37:12*Snircle_ joined #nim
15:37:33AraqI know 'importc', 'importcpp' pretty well, I invented it.
15:40:17*Snircle quit (Ping timeout: 276 seconds)
15:40:21*floppydh quit (Read error: Connection reset by peer)
15:41:14*floppydh joined #nim
15:41:18*BitPuffin|osx quit (Ping timeout: 258 seconds)
15:46:33dom96Araq: Can we please rename runnableExamples to runnableExample?
15:47:04dom96or meh
15:47:12dom96I guess we can have multiple runnableExamples blocks too
15:49:42Araqactually we can't right now :-)
15:50:11Araqwell you can, but the doc comment between them is silently ignored, yay
15:50:28dom96oh, so that's how you'll determine the positioning of it
15:50:37dom96That's better than my ID idea
15:50:40dom96how do I run these btw?
15:50:53Araq'nim doc'
15:51:00FromGitter<andreaferretti> do we have runnable examples in documentation now?
15:51:08Araqyep.
15:51:12FromGitter<andreaferretti> great!
15:51:20Araqalso ... I thought about renaming 'doAssert' to 'ensure'
15:51:28Araqwhat do you think?
15:51:40dom96they're not being run
15:51:46FromGitter<andreaferretti> well, `doAssert` vs `assert` is more clear
15:52:00dom96yeah, let's not rename it
15:52:01FromGitter<andreaferretti> `ensure` vs `assert` I know I would mix them up
15:52:20Araqdom96: I ensured that they are. 'koch boot -d:release' perhaps?
15:52:26dom96are system.nim runnableexamples ignored perhaps?
15:53:33dom96for strutils they are executed
15:53:37dom96but not for system.nim
15:54:50Araqsystem.nim declares runnableExamples at the very bottom, how could it work?
15:55:22dom96oh
15:55:30Araqyou can move up that declaration though. however, that should cause an error at compile-time
15:55:48dom96yeah, it sould
15:57:35dom96moved my code down
15:57:39dom96still not running the examples
15:58:09Araqoh yeah, it's probably a bug
15:58:28Araqwhat are you adding to system.nim anyway
15:58:31Araq:P
15:59:20dom96https://github.com/nim-lang/Nim/pull/6819
15:59:49AraqI don't want them in system.
15:59:57dom96why?
16:00:01dom96doAssert is in system
16:00:17floppydhhttps://bpaste.net/show/da7f925792a9 this makes the compiler throw c error-messages and hang / never exit
16:00:38dom96floppydh: report it, it's a bug
16:00:45floppydhdom96: yes sir
16:00:57Araqyeah, I dunno how to fix the hang
16:01:02Araqit doesn't hang on Windows fwiw
16:01:18Araqit hangs in the streaming read of osproc
16:02:24FromGitter<andreaferretti> I see from https://nim-lang.org/docs/strutils.html#removeSuffix that the output of runnable examples is still a little messed up, though
16:03:00dom96andreaferretti: Pretty sure that's not runnable examples.
16:03:08dom96Those docs are for 0.17.2
16:06:46*floppydh quit (Quit: WeeChat 1.9.1)
16:09:30FromGitter<andreaferretti> ah ok
16:10:22Araqso ... any posix experts up to the challenge?
16:10:41Araqfix osproc.execProcesses as the compiler uses it
16:10:49dom96I don't think you need an expert, just someone who has time on their hands :)
16:14:44Araqhahahaha
16:14:51Araqwe're talking about osproc here
16:15:13Araqthe module that I only touch when drunk.
16:21:03*alpha joined #nim
16:21:25*alpha is now known as Guest82301
16:23:36Guest82301hello, I am a beginner at programming and new to nim. I wanted to log into a website using nim to scrape some data. So i think i have to take the cookies from after i successfully login and then send those cookies along with the requests to other web pages. So i want to ask how do i get cookies from a request and send those cookies along with the request to another page? Is there an easy way to do it or do i have to do it manually? Wha
16:25:16dom96Right now you'll have to do it manually by looking at the cookie headers
16:32:47Guest82301So i have to use https://nim-lang.org/docs/httpclient.html#request,AsyncHttpClient,string,string,string,HttpHeaders and send the previous response's set-cookie into the headers argument? (sorry i am a newbie)
16:50:44Araqdom96, I don't want it in system.nim, it smells too much of a unittest feature anyway
16:51:45Araqwe can move assert/doAssert out of system.nim perhaps but meh, yet another import I always end up using
16:52:10Araqin fact, we should move the io procs into an io.nim module
16:52:24dom96Araq: it's very useful for runnable examples too
16:52:49Araqwhy so? exceptions are documented in the .raises section
16:53:07dom96if you want to explain the circumstances under which the exception is raised
16:53:15Araqwhat kind of "example" is "ensure this raises KeyError"?
16:54:12FromGitter<Varriount> Araq: Would this io module still be implicitly imported?
16:54:21AraqI dunno
16:54:51dom96if we really want a small system.nim then we should move a lot of stuff out of it
16:55:00dom96one thing that comes into my mind is the FFI types
16:56:02Araqwell everything is tradeoff
16:57:10FromGitter<Varriount> "splitting" system.nim into other implicitly-imported modules would benefit documentation. Even with search options, it's a pain to find something in the system.nim documentation page.
16:58:24euantorI'd love to see an `io` module personally
17:00:00FromGitter<andreaferretti> I'd love to see a module with the ffi types :-)
17:02:13*couven92 quit (Quit: Client disconnecting)
17:06:40FromGitter<Varriount> @dom96 Do we have raw irc logs anywhere?
17:06:54dom96yes, s/.html/.json/ to the irclogs url
17:07:57dom96okay, so looks like there is plenty of demand to split system up
17:08:07dom96yet another thing to do to improve the stdlib, help welcome :)
17:08:54dom96Araq: Anyway, for now let's please just include this in system
17:09:42FromGitter<alehander42> can I have backend dependent exportc
17:09:53FromGitter<alehander42> I want to fix programResult so it compiles to `process.exitCode` in nodejs
17:10:03FromGitter<alehander42> hm I can just define it with `when`
17:10:48Araqdom96, -.-
17:11:15dom96alehander42: precisely
17:11:26dom96Araq: Pretty please? :)
17:12:20*Guest82301 quit (Ping timeout: 260 seconds)
17:12:23*PMunch quit (Quit: Leaving)
17:12:39FromGitter<Varriount> What's so bad about splitting system.nim up?
17:13:23dom96It's a lot of work :)
17:14:50*Trustable joined #nim
17:15:06FromGitter<alehander42> can I somehow make nim not generate initialization for `var` ?
17:15:25FromGitter<alehander42> e.g. not generate `var <programResult> = 0` for var programResult* in js
17:15:45dom96noinit pragma or something
17:15:49dom96look in manual
17:15:58*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
17:16:02FromGitter<alehander42> I tried it, it didn't seem to affect it
17:17:04FromGitter<mratsim> It might be JS limitation. in C/C++ it works
17:18:16FromGitter<Varriount> @alehander42 Why don't you want an integer to be initialized?
17:18:49FromGitter<mratsim> It’s the poor man random number generator ;)
17:18:58FromGitter<Varriount> Eew, no
17:19:19FromGitter<mratsim> but is JS strongly typed? maybe programResult is not an integer
17:19:25*Guest32259 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:19:55FromGitter<Varriount> JS isn't strongly typed
17:19:56FromGitter<alehander42> :D because I am trying to map `programResult` to `process.exitCode` in js
17:20:04FromGitter<alehander42> but I don't need process.exitCode to be initialized
17:20:15FromGitter<alehander42> because node will return 0 by default anyway
17:20:33FromGitter<alehander42> and if nim generates the init, it does "var process.exitCode = 0" which is wrong js
17:20:46FromGitter<alehander42> so that seemed as a quick wrokaround
17:21:43FromGitter<Varriount> Are you using emit, or the ffi pragmas?
17:21:44dom96You should define a Process type with an exitCode field I guess
17:23:58FromGitter<raydf> how can i add a event listener to karax? ```js ex: document.addEventListener("deviceready", function (e) {... ```
17:24:59*BitPuffin|osx joined #nim
17:25:42FromGitter<alehander42> @dom96 that seems to work, I hope it's not too heavyhanded for system.nim
17:27:35dom96Araq: So can I merge it? I have a use for it in my next PR
17:35:00*PMunch joined #nim
17:40:50*Ven joined #nim
17:41:13*Ven is now known as Guest73722
17:44:35FromGitter<mratsim> Meeeh >_>
17:44:40FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/n1Mp/2017-11-27_18-44-11.png)
17:45:12dom96Araq: btw, running `nim doc2 lib/pure/strutils.nim` results in an empty html file
17:46:06dom96mratsim: oh yeah, that's annoying. If you can isolate it, that would make a good issue
17:46:16dom96cool to see you're using Nimble :)
17:47:14FromGitter<mratsim> My nimble file is 170 lines ;)
17:47:27FromGitter<alehander42> the Process type with exitCode wouldn't really work actually, as the int field isn't mutable and eg `programResult +=1` wouldn't change it
17:47:40FromGitter<alehander42> where is the definition of `noInit` ? I can't seem to grep it
17:49:54FromGitter<mratsim> I wonder if it’s because I am now using forward declaration of CudaStorage
17:52:10dom96alehander42: in the compiler probably
18:02:07*Guest73722 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:05:34*xkapastel joined #nim
18:06:37*nhywyll quit (Quit: nhywyll)
18:09:43FromGitter<alehander42> ugh I am an idiot, much simpler solution
18:09:48*tefter quit (Read error: Connection reset by peer)
18:15:51AraqprogramResult is in system
18:17:10FromGitter<alehander42> I know, I wondered about `noInit`, but I don't need it obvsly
18:17:25FromGitter<alehander42> I made the pr about programResult
18:24:45AraqprogramResult shouldn't be in system.nim at all
18:24:59Araqunittest.nim requires it iirc
18:26:57FromGitter<mratsim> So apparently Khronos group is keeping the Vulkan spec in a Github repo: https://github.com/KhronosGroup/Vulkan-Docs/commit/64fa8ef4df3bff37214e717abe490f7ea7ea44b0 wow
18:27:27*scriptum quit (Quit: Leaving)
18:29:55FromGitter<alehander42> maybe other code depends on programResult, not sure
18:38:20Araqthe CI will tell you.
18:39:39Araqwhat's process.exitCode?
18:39:59AraqJS != NodeJS
18:40:29Araqin fact, Nim's JS targets browser-side JS.
18:41:26FromGitter<alehander42> well the CI result depends on the exit code of my nim-compiled-to-js test
18:41:43FromGitter<alehander42> ok then what's the symbol for node ? defined(nodejs) ?
18:44:20Araqyes
18:44:30FromGitter<alehander42> ah ok
18:46:23FromGitter<raydf> If anyone can help, i tried to call a cordova plugin ```nim ⏎ cordova.plugins.barcodeScanner.scan( ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5a1c5d7fcc1d527f6bc0302e]
18:47:47FromGitter<raydf> If anyone can help, i tried to call a cordova plugin ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a1c5dd2cc1d527f6bc0327b]
18:48:32*couven92 joined #nim
19:05:42*vivus joined #nim
19:10:14*BitPuffin|osx quit (Ping timeout: 276 seconds)
19:12:01*ftsf quit (Ping timeout: 248 seconds)
19:14:00*ftsf joined #nim
19:16:29FromGitter<Araq> so ... is Nim supposed to guess your '.bind(this)' ?
19:19:26*gangstacat quit (Quit: Ĝis!)
19:21:10*gangstacat joined #nim
19:50:11*claudiuinberlin joined #nim
20:03:41*Vladar quit (Quit: Leaving)
20:15:23*sendell joined #nim
20:15:40sendellI'm trying to post on the forum but have: "input(10, 11) Error: '*' expected"
20:16:00*crashgord joined #nim
20:16:16sendelllooks like my post... isn't compiling ? :D
20:18:29sendelloh got it, my c++ example escaped the markdown, nevermind
20:20:50*crashgord quit (Read error: Connection reset by peer)
20:27:46*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:31:09*claudiuinberlin joined #nim
20:31:10*JappleAck quit (Ping timeout: 268 seconds)
20:41:40cremNim error messages are misleading sometimes, but still much better than ones of Borland C++. :)
20:41:52crem(unrelated comment)
20:42:35cremIt was pretty usual for Borland C++ to fail compilation with "syntax error" error at EOF.
20:44:36Araqmaybe but Nim is always compared to the few that do better
20:45:00Araqnot the plethora of compilers/runtimes/language implementation that did far worse things
20:45:49Araqplus we already established the errors are bad because I don't know Elm. XD
20:48:45*vlad1777d joined #nim
21:13:37*Sentreen quit (Ping timeout: 248 seconds)
21:20:10*SenasOzys quit (Ping timeout: 264 seconds)
21:27:20*Sentreen joined #nim
21:30:22*Trustable quit (Remote host closed the connection)
21:33:42*Nikky quit (Quit: WeeChat 1.9.1)
21:34:57sendellElm errors are more an interactive tutorial than actual errors :p
21:35:55*MJCaley joined #nim
21:40:03*sz0 joined #nim
21:42:10*Nikky joined #nim
21:42:42PMunchsendell, yeah Elm errors are really good when you're first learning the language
21:43:38sendellyeah probably the best way to learn functional programming nowadays, they did an awesome job
21:47:55PMunchWell the concept will still be just as foreign for the uninitiated :P
21:50:01*skrylar joined #nim
21:59:15subsetparkwhat's the idiomatic way to provide default values for optional fields in JSON
21:59:17subsetpark?
22:07:24skrylarthere is a default value field in the getters
22:07:32skrylarex. foo.getNum(32) # 32 is the default
22:08:26skrylarif you mean denote to the user, there is no official schema system. although Khronos has one they use for glTF
22:09:24subsetpark32 is only the default if `foo` exists, though - i'm talking about `foo.getOrDefault("field_name").getNum(32)`
22:09:34subsetparkbut shorter...
22:11:23skrylarcould always template it?
22:12:46dom96foo{"field_name"}.getNum(32)
22:14:26skrylari did notice something weird happens if you try to do a typecast and nim finds it ambiguous
22:14:30subsetparkah -- is that what that weird template at the bottom means??
22:14:46skrylarex. Courier.Font # compiler complains about "enumerations.Font or blah.Font" and you can't do Courier.fl.Font)
22:14:55skrylarDidn't try `fl.Font` but i ended up replacing it with a cast
22:15:29subsetparkdom96: can you unpack that syntax for me? I can't tell exactly how it gets from simpleGetOrDefault to your usage example
22:16:04dom96foo{"field_name"} returns nil if field_name doesn't exist
22:16:15dom96getNum returns 32 if its argument is 'nil'
22:16:22subsetparkno, i can see what it does - i literally can't read the definition
22:16:31subsetparktemplate simpleGetOrDefault*{`{}`(node, [key])}(node: JsonNode, key: string): JsonNode = node.getOrDefault(key)
22:17:00dom96https://github.com/nim-lang/Nim/blob/master/lib/pure/json.nim#L927 ?
22:17:34subsetparkoh i thought it was simpleGetOrDefault
22:17:43subsetparkwhich has these weird curly braces in the definition
22:27:42FromGitter<raydf> thanks @Araq for checking the code. You must know what would be my next question, :), how to to create the bound function in nim and how can i simulate the parameter `error` in the second callback?
22:35:48*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
22:38:43*maximpertsov joined #nim
22:40:45*PMunch quit (Quit: leaving)
22:40:58subsetparkD: basic2d was removed from stdlib!
22:51:36*marenz__ joined #nim
22:52:52dom96there should be a nimble package for it
22:54:52skrylari have some code for that around somewhere
22:54:59skrylari don't think i published the skgsmath package
22:55:22*nsf quit (Quit: WeeChat 1.9.1)
23:07:57*endragor joined #nim
23:08:47*MJCaley quit (Quit: MJCaley)
23:11:45*sendell quit (Remote host closed the connection)
23:12:27*endragor quit (Ping timeout: 260 seconds)
23:16:10*Jesin quit (Quit: Leaving)
23:39:29*yuken left #nim ("Leaving")
23:42:51Araqdo we want 'multiMatch' in re.nim?
23:43:20AraqI still have the code lying around and noticed it's not even version controlled
23:43:59skrylarwhat does it do
23:44:20Araqit's a shitty lexer generator
23:44:44AraqmultiMatch input:
23:45:00Araqof re"[a-z]*": echo "identifier"
23:45:12Araqof re"[0-9]+": echo "Int like"
23:45:18Araqyou get the idea ;-)
23:49:39*sz0 quit (Quit: Connection closed for inactivity)
23:50:04Araqwe have multiReplace, we should have multiMatch
23:52:55skrylarso basically re2c
23:52:58skrylarseems neat
23:53:43*skrylar quit (Remote host closed the connection)