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:16 | dom96 | Are we sticking to our guns with how strutils.split behaves? https://github.com/nim-lang/Nim/issues/4377 |
00:46:25 | dom96 | Please state your opinion :) |
00:57:02 | * | skrylar quit (Ping timeout: 268 seconds) |
01:03:41 | FromGitter | <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:46 | FromGitter | <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:38 | FromGitter | <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:26 | FromGitter | <raydf> hi everyone |
03:03:49 | FromGitter | <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:44 | FromGitter | <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:43 | alexday | in nim, is there any way to convert "200 OK" to Http200 ? |
04:00:33 | pydsigner | An if tree! |
04:01:28 | alexday | but 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:45 | alexday | end up with a huge case of statement |
04:03:46 | alexday | I could do something like split the string, get the first part convert to int and wrap that in a menthod |
04:04:50 | alexday | also %(req) is not working if req is of a type that has Table field. it says undeclared field counter. why! |
04:09:02 | FromGitter | <raydf> alexday is this for a srever api or a client? |
04:09:08 | FromGitter | <raydf> *server |
04:10:48 | alexday | client. sending request and recieving response from server. |
04:11:15 | FromGitter | <raydf> split the string as you said |
04:14:34 | alexday | ok |
04:18:21 | * | BitPuffin|osx joined #nim |
04:26:19 | alexday | the % 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:41 | alexday | I will use a JsonNode for now |
05:52:57 | * | Amrykid2 quit (Quit: Leaving) |
06:31:36 | alexday | where 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:20 | alexday | how to import local files men! I don't want to have a single .nim file with the world's code :P |
07:21:32 | alexday | https://github.com/nim-lang/nimble#configuration this possibly |
07:42:58 | alexday | I don't see a nimble.ini in my ~/.config/nimble :( on macosx |
07:44:26 | alexday | I 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:43 | FromGitter | <mratsim> @alexday can't you use a case statement with code < 200: |
07:49:24 | alexday | response.status is a string. cant use comparision other than == |
07:49:49 | alexday | I split it anyway. I am stuck with making my code importable locally :P |
07:53:01 | alexday | I 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:59 | alexday | I 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:51 | alexday | `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:43 | Araq | alexday: you don't, all you need to do is to learn about --path and nim's config system |
08:25:25 | alexday | got 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:18 | euantor | alexday: 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:48 | FromGitter | <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:04 | alexday | hey |
10:17:53 | * | vlad1777d quit (Ping timeout: 276 seconds) |
10:19:22 | couven92 | alexday, hello there! :) |
10:19:45 | alexday | I 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:26 | FromGitter | <mratsim> @alexday probably the best resource is there: https://nimyaml.org/schema.html or ping NimYAML dev. He hangs there as well. |
10:29:23 | FromGitter | <mratsim> Or this: https://nimyaml.org/index.html |
10:30:05 | alexday | ok |
10:30:24 | FromGitter | <mratsim> Btw that's quite the nice documentation, seems to integrate nim docgen + some kind of menu. |
10:30:56 | alexday | I did check their docs page. things are pretty simple there. predictiable things :P |
10:31:15 | alexday | there should really be something for Table types :P |
10:31:24 | alexday | oh its there |
10:31:36 | alexday | in 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:15 | flyx | alexday: did you manage to load your YAML? |
10:49:28 | flyx | alexday: targets should be seq[string] |
10:50:01 | alexday | targets I know. trying the map with Table |
10:50:52 | flyx | alexday: 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:59 | flyx | s/use/know |
10:51:03 | flyx | brain what are you doing |
10:51:42 | alexday | whose brain? |
10:51:49 | flyx | mine |
10:51:52 | alexday | oh :D |
10:52:26 | alexday | in my case inside the upstreams: each key can be user defined. So I guess table is the correct choice |
10:53:16 | flyx | okay, reasonable. hopefully, the values are fixed objects |
10:54:37 | flyx | btw, mentioning yaml in this channel automatically pings me ;) |
10:58:07 | alexday | oh 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:55 | alexday | @flyx . is this not correct? |
11:27:57 | alexday | type |
11:27:59 | alexday | Targets = seq[string] |
11:28:01 | alexday | Upstream = object |
11:28:03 | alexday | targets: Targets |
11:28:05 | alexday | Upstreams = Table[string, Upstream] |
11:29:01 | alexday | oh sorry |
11:29:03 | alexday | my bad |
11:29:05 | alexday | nvm |
11:31:02 | alexday | done. Upstreams = object upstreams: Table[blablabla] |
11:31:12 | flyx | alexday: I was about to mention that |
11:31:20 | alexday | :)) |
11:31:32 | flyx | will be afk for a while |
11:44:09 | * | Ven joined #nim |
11:44:33 | * | Ven is now known as Guest37997 |
11:44:50 | alexday | Anchor 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:02 | FromGitter | <krux02> I know it's off topic, but I am officially a dad now. |
12:00:10 | FromGitter | <mratsim> Congrats ! |
12:00:39 | FromGitter | <mratsim> Now you have a reason other than Travis failing to wake up at night ;) |
12:01:08 | FromGitter | <raydf> congrats @krux02 |
12:01:09 | FromGitter | <krux02> haha |
12:01:31 | FromGitter | <krux02> Probably |
12:01:36 | FromGitter | <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:26 | Araq | krux02: 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:12 | livcd | Is 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:01 | Araq | livcd: I think some people wrote Windows Services via COM but I doubt there is a nimble package for it |
12:27:52 | Araq | I 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:59 | FromGitter | <andreaferretti> Congratulations! |
12:35:26 | euantor | Just use NSSM - it's called "Non Sucking Service Manager" for a reaosn :P |
12:35:34 | euantor | https://nssm.cc/ |
12:37:00 | PMunch | Congrats krux02! |
12:37:23 | PMunch | Noticed any degredation of joke quality yet? |
12:38:46 | alexday | awesome |
12:46:56 | alexday | @flyx ntk yet? |
12:51:13 | Araq | euantor: seems a nice piece of software |
12:52:30 | * | Snircle joined #nim |
12:52:31 | euantor | Araq: 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:49 | alexday | why 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:50 | dom96 | congrats 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:40 | FromGitter | <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:24 | alexday | after 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:25 | Araq | alexday: deref it, object_name[] |
14:16:32 | alexday | oh cool. thanks |
14:16:49 | Araq | raydf: I don't use jsffi :-) |
14:16:50 | * | voidspacexyz joined #nim |
14:17:11 | Araq | you can do import x except y, z to resolve ambiguities |
14:21:32 | alexday | :( 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:39 | Araq | speaking 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:02 | FromGitter | <raydf> @Araq, i'm really trying to see how to do a simple proc callback with karax to a cordova plugin |
14:31:13 | FromGitter | <raydf> in mediaplayer.nim you use a importc but i can't understand an example with a callback |
14:32:27 | FromGitter | <raydf> 1) i can't find an example |
14:32:37 | FromGitter | <raydf> \* i can't |
14:34:21 | Araq | I 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:50 | Araq | proc takesCallback(x: proc()) {.importc.} |
14:34:59 | Araq | takesCallback proc = |
14:35:03 | Araq | echo "my code here" |
14:38:15 | * | endragor joined #nim |
14:42:32 | dom96 | Araq: That's the body field in request. |
14:42:35 | * | endragor quit (Ping timeout: 255 seconds) |
14:42:51 | Araq | yes, that's what I guessed |
14:49:57 | * | jjido quit (Ping timeout: 240 seconds) |
14:53:21 | FromGitter | <alehander42> Araq: why don't you use jsffi ? |
14:54:20 | Araq | it overloads '.' |
14:54:41 | Araq | weakens the type system too much |
14:55:08 | Araq | I like my typos to be detected at compile-time and I'm willing to type more to get that benefit |
14:55:31 | dom96 | hrm, that's pretty bad |
14:55:37 | dom96 | Maybe we should rename this module? |
14:55:41 | dom96 | jsffi sounds too official |
14:57:15 | FromGitter | <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:29 | Araq | dom96: maybe we can fix it or introduce a --define:strict variant? |
15:08:26 | dom96 | if we can fix it then sure |
15:08:32 | dom96 | No clue how we can do that though |
15:08:40 | * | Jesin joined #nim |
15:11:47 | * | PMunch quit (Ping timeout: 260 seconds) |
15:21:30 | Araq | main.js:3776 OPTIONS http://localhost:8080/mykey 500 (Internal Server Error) |
15:21:45 | Araq | now 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:16 | FromGitter | <andreaferretti> to be fair, it overloads `.` only for objects of type `JsAssoc` |
15:34:34 | FromGitter | <andreaferretti> which are meant to be used as dynamic containers anyway |
15:35:16 | FromGitter | <andreaferretti> much like Scala `Dynamic` (which I think comes from C#) |
15:35:34 | FromGitter | <andreaferretti> it does not overload `.` for other types |
15:35:57 | Araq | oh that's good to know :-9 |
15:36:48 | Araq | the other reason why I don't jsffi is that I don't need it ;-) |
15:37:12 | * | Snircle_ joined #nim |
15:37:33 | Araq | I 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:33 | dom96 | Araq: Can we please rename runnableExamples to runnableExample? |
15:47:04 | dom96 | or meh |
15:47:12 | dom96 | I guess we can have multiple runnableExamples blocks too |
15:49:42 | Araq | actually we can't right now :-) |
15:50:11 | Araq | well you can, but the doc comment between them is silently ignored, yay |
15:50:28 | dom96 | oh, so that's how you'll determine the positioning of it |
15:50:37 | dom96 | That's better than my ID idea |
15:50:40 | dom96 | how do I run these btw? |
15:50:53 | Araq | 'nim doc' |
15:51:00 | FromGitter | <andreaferretti> do we have runnable examples in documentation now? |
15:51:08 | Araq | yep. |
15:51:12 | FromGitter | <andreaferretti> great! |
15:51:20 | Araq | also ... I thought about renaming 'doAssert' to 'ensure' |
15:51:28 | Araq | what do you think? |
15:51:40 | dom96 | they're not being run |
15:51:46 | FromGitter | <andreaferretti> well, `doAssert` vs `assert` is more clear |
15:52:00 | dom96 | yeah, let's not rename it |
15:52:01 | FromGitter | <andreaferretti> `ensure` vs `assert` I know I would mix them up |
15:52:20 | Araq | dom96: I ensured that they are. 'koch boot -d:release' perhaps? |
15:52:26 | dom96 | are system.nim runnableexamples ignored perhaps? |
15:53:33 | dom96 | for strutils they are executed |
15:53:37 | dom96 | but not for system.nim |
15:54:50 | Araq | system.nim declares runnableExamples at the very bottom, how could it work? |
15:55:22 | dom96 | oh |
15:55:30 | Araq | you can move up that declaration though. however, that should cause an error at compile-time |
15:55:48 | dom96 | yeah, it sould |
15:57:35 | dom96 | moved my code down |
15:57:39 | dom96 | still not running the examples |
15:58:09 | Araq | oh yeah, it's probably a bug |
15:58:28 | Araq | what are you adding to system.nim anyway |
15:58:31 | Araq | :P |
15:59:20 | dom96 | https://github.com/nim-lang/Nim/pull/6819 |
15:59:49 | Araq | I don't want them in system. |
15:59:57 | dom96 | why? |
16:00:01 | dom96 | doAssert is in system |
16:00:17 | floppydh | https://bpaste.net/show/da7f925792a9 this makes the compiler throw c error-messages and hang / never exit |
16:00:38 | dom96 | floppydh: report it, it's a bug |
16:00:45 | floppydh | dom96: yes sir |
16:00:57 | Araq | yeah, I dunno how to fix the hang |
16:01:02 | Araq | it doesn't hang on Windows fwiw |
16:01:18 | Araq | it hangs in the streaming read of osproc |
16:02:24 | FromGitter | <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:00 | dom96 | andreaferretti: Pretty sure that's not runnable examples. |
16:03:08 | dom96 | Those docs are for 0.17.2 |
16:06:46 | * | floppydh quit (Quit: WeeChat 1.9.1) |
16:09:30 | FromGitter | <andreaferretti> ah ok |
16:10:22 | Araq | so ... any posix experts up to the challenge? |
16:10:41 | Araq | fix osproc.execProcesses as the compiler uses it |
16:10:49 | dom96 | I don't think you need an expert, just someone who has time on their hands :) |
16:14:44 | Araq | hahahaha |
16:14:51 | Araq | we're talking about osproc here |
16:15:13 | Araq | the module that I only touch when drunk. |
16:21:03 | * | alpha joined #nim |
16:21:25 | * | alpha is now known as Guest82301 |
16:23:36 | Guest82301 | hello, 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:16 | dom96 | Right now you'll have to do it manually by looking at the cookie headers |
16:32:47 | Guest82301 | So 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:44 | Araq | dom96, I don't want it in system.nim, it smells too much of a unittest feature anyway |
16:51:45 | Araq | we can move assert/doAssert out of system.nim perhaps but meh, yet another import I always end up using |
16:52:10 | Araq | in fact, we should move the io procs into an io.nim module |
16:52:24 | dom96 | Araq: it's very useful for runnable examples too |
16:52:49 | Araq | why so? exceptions are documented in the .raises section |
16:53:07 | dom96 | if you want to explain the circumstances under which the exception is raised |
16:53:15 | Araq | what kind of "example" is "ensure this raises KeyError"? |
16:54:12 | FromGitter | <Varriount> Araq: Would this io module still be implicitly imported? |
16:54:21 | Araq | I dunno |
16:54:51 | dom96 | if we really want a small system.nim then we should move a lot of stuff out of it |
16:55:00 | dom96 | one thing that comes into my mind is the FFI types |
16:56:02 | Araq | well everything is tradeoff |
16:57:10 | FromGitter | <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:24 | euantor | I'd love to see an `io` module personally |
17:00:00 | FromGitter | <andreaferretti> I'd love to see a module with the ffi types :-) |
17:02:13 | * | couven92 quit (Quit: Client disconnecting) |
17:06:40 | FromGitter | <Varriount> @dom96 Do we have raw irc logs anywhere? |
17:06:54 | dom96 | yes, s/.html/.json/ to the irclogs url |
17:07:57 | dom96 | okay, so looks like there is plenty of demand to split system up |
17:08:07 | dom96 | yet another thing to do to improve the stdlib, help welcome :) |
17:08:54 | dom96 | Araq: Anyway, for now let's please just include this in system |
17:09:42 | FromGitter | <alehander42> can I have backend dependent exportc |
17:09:53 | FromGitter | <alehander42> I want to fix programResult so it compiles to `process.exitCode` in nodejs |
17:10:03 | FromGitter | <alehander42> hm I can just define it with `when` |
17:10:48 | Araq | dom96, -.- |
17:11:15 | dom96 | alehander42: precisely |
17:11:26 | dom96 | Araq: Pretty please? :) |
17:12:20 | * | Guest82301 quit (Ping timeout: 260 seconds) |
17:12:23 | * | PMunch quit (Quit: Leaving) |
17:12:39 | FromGitter | <Varriount> What's so bad about splitting system.nim up? |
17:13:23 | dom96 | It's a lot of work :) |
17:14:50 | * | Trustable joined #nim |
17:15:06 | FromGitter | <alehander42> can I somehow make nim not generate initialization for `var` ? |
17:15:25 | FromGitter | <alehander42> e.g. not generate `var <programResult> = 0` for var programResult* in js |
17:15:45 | dom96 | noinit pragma or something |
17:15:49 | dom96 | look in manual |
17:15:58 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
17:16:02 | FromGitter | <alehander42> I tried it, it didn't seem to affect it |
17:17:04 | FromGitter | <mratsim> It might be JS limitation. in C/C++ it works |
17:18:16 | FromGitter | <Varriount> @alehander42 Why don't you want an integer to be initialized? |
17:18:49 | FromGitter | <mratsim> It’s the poor man random number generator ;) |
17:18:58 | FromGitter | <Varriount> Eew, no |
17:19:19 | FromGitter | <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:55 | FromGitter | <Varriount> JS isn't strongly typed |
17:19:56 | FromGitter | <alehander42> :D because I am trying to map `programResult` to `process.exitCode` in js |
17:20:04 | FromGitter | <alehander42> but I don't need process.exitCode to be initialized |
17:20:15 | FromGitter | <alehander42> because node will return 0 by default anyway |
17:20:33 | FromGitter | <alehander42> and if nim generates the init, it does "var process.exitCode = 0" which is wrong js |
17:20:46 | FromGitter | <alehander42> so that seemed as a quick wrokaround |
17:21:43 | FromGitter | <Varriount> Are you using emit, or the ffi pragmas? |
17:21:44 | dom96 | You should define a Process type with an exitCode field I guess |
17:23:58 | FromGitter | <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:42 | FromGitter | <alehander42> @dom96 that seems to work, I hope it's not too heavyhanded for system.nim |
17:27:35 | dom96 | Araq: 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:35 | FromGitter | <mratsim> Meeeh >_> |
17:44:40 | FromGitter | <mratsim> (https://files.gitter.im/nim-lang/Nim/n1Mp/2017-11-27_18-44-11.png) |
17:45:12 | dom96 | Araq: btw, running `nim doc2 lib/pure/strutils.nim` results in an empty html file |
17:46:06 | dom96 | mratsim: oh yeah, that's annoying. If you can isolate it, that would make a good issue |
17:46:16 | dom96 | cool to see you're using Nimble :) |
17:47:14 | FromGitter | <mratsim> My nimble file is 170 lines ;) |
17:47:27 | FromGitter | <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:40 | FromGitter | <alehander42> where is the definition of `noInit` ? I can't seem to grep it |
17:49:54 | FromGitter | <mratsim> I wonder if it’s because I am now using forward declaration of CudaStorage |
17:52:10 | dom96 | alehander42: 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:43 | FromGitter | <alehander42> ugh I am an idiot, much simpler solution |
18:09:48 | * | tefter quit (Read error: Connection reset by peer) |
18:15:51 | Araq | programResult is in system |
18:17:10 | FromGitter | <alehander42> I know, I wondered about `noInit`, but I don't need it obvsly |
18:17:25 | FromGitter | <alehander42> I made the pr about programResult |
18:24:45 | Araq | programResult shouldn't be in system.nim at all |
18:24:59 | Araq | unittest.nim requires it iirc |
18:26:57 | FromGitter | <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:55 | FromGitter | <alehander42> maybe other code depends on programResult, not sure |
18:38:20 | Araq | the CI will tell you. |
18:39:39 | Araq | what's process.exitCode? |
18:39:59 | Araq | JS != NodeJS |
18:40:29 | Araq | in fact, Nim's JS targets browser-side JS. |
18:41:26 | FromGitter | <alehander42> well the CI result depends on the exit code of my nim-compiled-to-js test |
18:41:43 | FromGitter | <alehander42> ok then what's the symbol for node ? defined(nodejs) ? |
18:44:20 | Araq | yes |
18:44:30 | FromGitter | <alehander42> ah ok |
18:46:23 | FromGitter | <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:47 | FromGitter | <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:29 | FromGitter | <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:40 | sendell | I'm trying to post on the forum but have: "input(10, 11) Error: '*' expected" |
20:16:00 | * | crashgord joined #nim |
20:16:16 | sendell | looks like my post... isn't compiling ? :D |
20:18:29 | sendell | oh 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:40 | crem | Nim error messages are misleading sometimes, but still much better than ones of Borland C++. :) |
20:41:52 | crem | (unrelated comment) |
20:42:35 | crem | It was pretty usual for Borland C++ to fail compilation with "syntax error" error at EOF. |
20:44:36 | Araq | maybe but Nim is always compared to the few that do better |
20:45:00 | Araq | not the plethora of compilers/runtimes/language implementation that did far worse things |
20:45:49 | Araq | plus 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:57 | sendell | Elm 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:42 | PMunch | sendell, yeah Elm errors are really good when you're first learning the language |
21:43:38 | sendell | yeah probably the best way to learn functional programming nowadays, they did an awesome job |
21:47:55 | PMunch | Well the concept will still be just as foreign for the uninitiated :P |
21:50:01 | * | skrylar joined #nim |
21:59:15 | subsetpark | what's the idiomatic way to provide default values for optional fields in JSON |
21:59:17 | subsetpark | ? |
22:07:24 | skrylar | there is a default value field in the getters |
22:07:32 | skrylar | ex. foo.getNum(32) # 32 is the default |
22:08:26 | skrylar | if you mean denote to the user, there is no official schema system. although Khronos has one they use for glTF |
22:09:24 | subsetpark | 32 is only the default if `foo` exists, though - i'm talking about `foo.getOrDefault("field_name").getNum(32)` |
22:09:34 | subsetpark | but shorter... |
22:11:23 | skrylar | could always template it? |
22:12:46 | dom96 | foo{"field_name"}.getNum(32) |
22:14:26 | skrylar | i did notice something weird happens if you try to do a typecast and nim finds it ambiguous |
22:14:30 | subsetpark | ah -- is that what that weird template at the bottom means?? |
22:14:46 | skrylar | ex. Courier.Font # compiler complains about "enumerations.Font or blah.Font" and you can't do Courier.fl.Font) |
22:14:55 | skrylar | Didn't try `fl.Font` but i ended up replacing it with a cast |
22:15:29 | subsetpark | dom96: can you unpack that syntax for me? I can't tell exactly how it gets from simpleGetOrDefault to your usage example |
22:16:04 | dom96 | foo{"field_name"} returns nil if field_name doesn't exist |
22:16:15 | dom96 | getNum returns 32 if its argument is 'nil' |
22:16:22 | subsetpark | no, i can see what it does - i literally can't read the definition |
22:16:31 | subsetpark | template simpleGetOrDefault*{`{}`(node, [key])}(node: JsonNode, key: string): JsonNode = node.getOrDefault(key) |
22:17:00 | dom96 | https://github.com/nim-lang/Nim/blob/master/lib/pure/json.nim#L927 ? |
22:17:34 | subsetpark | oh i thought it was simpleGetOrDefault |
22:17:43 | subsetpark | which has these weird curly braces in the definition |
22:27:42 | FromGitter | <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:58 | subsetpark | D: basic2d was removed from stdlib! |
22:51:36 | * | marenz__ joined #nim |
22:52:52 | dom96 | there should be a nimble package for it |
22:54:52 | skrylar | i have some code for that around somewhere |
22:54:59 | skrylar | i 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:51 | Araq | do we want 'multiMatch' in re.nim? |
23:43:20 | Araq | I still have the code lying around and noticed it's not even version controlled |
23:43:59 | skrylar | what does it do |
23:44:20 | Araq | it's a shitty lexer generator |
23:44:44 | Araq | multiMatch input: |
23:45:00 | Araq | of re"[a-z]*": echo "identifier" |
23:45:12 | Araq | of re"[0-9]+": echo "Int like" |
23:45:18 | Araq | you get the idea ;-) |
23:49:39 | * | sz0 quit (Quit: Connection closed for inactivity) |
23:50:04 | Araq | we have multiReplace, we should have multiMatch |
23:52:55 | skrylar | so basically re2c |
23:52:58 | skrylar | seems neat |
23:53:43 | * | skrylar quit (Remote host closed the connection) |