00:16:40 | * | polkm quit (Ping timeout: 246 seconds) |
00:18:21 | BlaXpirit | gee, negative indices are totally gone instantly |
00:24:54 | * | reem quit (Remote host closed the connection) |
00:24:59 | * | jholland quit (Quit: Connection closed for inactivity) |
00:26:49 | * | Trustable quit (Read error: Connection reset by peer) |
00:27:52 | * | polkm joined #nim |
00:28:03 | EXetoC | yay |
00:28:39 | BlaXpirit | trying to fight "method has lock level <unknown>, but another method has 0" here |
00:28:56 | BlaXpirit | i assume it's because one of overloaded methods uses regex and one doesn't |
00:29:02 | BlaXpirit | not sure what to do |
00:29:08 | BlaXpirit | put a dud regex? -_- |
00:29:41 | polkm | is nil zero? |
00:29:51 | BlaXpirit | no |
00:29:53 | def- | BlaXpirit: there should be a nicer way |
00:30:47 | BlaXpirit | how to do {.locks: unknown.} |
00:31:50 | BlaXpirit | impossible, i assume |
00:33:16 | BlaXpirit | Araq, this is lame |
00:33:42 | polkm | how do I make an int* offset = 0; but in nim? |
00:34:07 | def- | var offset: ptr int |
00:34:16 | def- | if you want a raw pointer |
00:35:04 | * | qwr . o O ( that asyncdispatch thing looks pretty cool... ) |
00:35:08 | polkm | cool, yeah I'm just trying to do opengl stuff |
00:39:16 | * | fizzbooze quit (Quit: WeeChat 1.1.1) |
00:43:32 | * | reem joined #nim |
00:44:48 | * | reem quit (Remote host closed the connection) |
00:52:22 | * | reem joined #nim |
00:57:24 | * | Purrkode joined #nim |
00:58:15 | * | reem quit (Remote host closed the connection) |
00:58:24 | * | BlaXpirit quit (Quit: Quit Konversation) |
01:02:00 | * | girvo joined #nim |
01:02:08 | * | reem joined #nim |
01:02:21 | * | irrequietus quit () |
01:02:32 | * | saml_ joined #nim |
01:06:29 | * | girvo quit (Ping timeout: 245 seconds) |
01:13:03 | * | reem quit (Remote host closed the connection) |
01:14:16 | * | dashed quit (Quit: Connection closed for inactivity) |
01:16:30 | * | reem joined #nim |
01:24:22 | * | reem quit (Remote host closed the connection) |
01:27:13 | * | reem joined #nim |
01:29:29 | * | reem quit (Remote host closed the connection) |
01:30:57 | * | Purrkode left #nim ("Textual IRC Client: www.textualapp.com") |
01:34:18 | * | reem joined #nim |
01:36:53 | * | reem quit (Remote host closed the connection) |
01:37:34 | * | reem joined #nim |
01:47:01 | * | darkf joined #nim |
01:49:28 | * | goob joined #nim |
01:58:05 | * | a5i joined #nim |
02:19:23 | * | reem quit (Remote host closed the connection) |
02:19:55 | * | reem joined #nim |
02:24:26 | * | wink-s joined #nim |
02:39:25 | * | johnsoft quit (Ping timeout: 264 seconds) |
02:49:54 | * | wink-s quit (Remote host closed the connection) |
02:50:45 | * | girvo joined #nim |
02:55:39 | * | girvo quit (Ping timeout: 264 seconds) |
03:11:55 | * | reem quit (Remote host closed the connection) |
03:17:18 | * | reem joined #nim |
03:21:28 | * | johnsoft joined #nim |
03:27:14 | * | reem quit (Remote host closed the connection) |
03:27:55 | * | banister joined #nim |
03:28:43 | * | reem joined #nim |
03:40:43 | * | sampwing joined #nim |
03:46:37 | * | reem quit (Remote host closed the connection) |
03:47:40 | * | reem joined #nim |
03:53:47 | * | sampwing quit (Ping timeout: 252 seconds) |
04:06:31 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
04:06:33 | * | girvo joined #nim |
04:11:09 | * | girvo quit (Ping timeout: 250 seconds) |
04:14:20 | * | jefus_ quit (Read error: Connection reset by peer) |
04:15:41 | * | reem quit (Remote host closed the connection) |
04:17:12 | * | reem joined #nim |
04:19:22 | * | reem quit (Remote host closed the connection) |
04:22:28 | * | jefus joined #nim |
04:28:39 | * | saml_ quit (Quit: Leaving) |
04:33:11 | * | a5i quit (Quit: Connection closed for inactivity) |
04:33:18 | * | reem joined #nim |
04:48:21 | * | gsingh93 quit (Quit: WeeChat 1.1.1) |
04:48:47 | * | gsingh93 joined #nim |
05:00:03 | * | goob quit (Quit: Page closed) |
05:02:05 | * | Sembei quit (Read error: Connection reset by peer) |
05:02:59 | * | Sembei joined #nim |
05:06:01 | * | vbtt joined #nim |
05:09:09 | vbtt | Araq: `f -1` parsing as `f(-1)` isn't that great, but that's how coffeescript (and moonscript) do it. See http://coffeescript.org/#try:f%20-1%0Af-1%0Af%20-%201 |
05:09:35 | vbtt | both of them do `f -1` -> `f(-1)` and also `f - 1` -> `f - 1` |
05:09:48 | vbtt | and they have extensive usage |
05:09:50 | * | Demon_Fox joined #nim |
05:10:00 | vbtt | so it's not that terrible I suppose. |
05:10:17 | vbtt | However, please make this an error: `1 -1` and require `1 - 1` |
05:10:39 | * | johnsoft quit (Ping timeout: 264 seconds) |
05:10:53 | vbtt | because consider `1 -1` vs. `a = 1; a -1` |
05:11:39 | * | johnsoft joined #nim |
05:12:42 | vbtt | (the substitution principle applies) |
05:17:29 | * | reem quit (Remote host closed the connection) |
05:22:03 | * | dashed joined #nim |
05:22:57 | * | reem joined #nim |
05:24:21 | * | reem quit (Remote host closed the connection) |
05:30:20 | * | reem joined #nim |
05:31:23 | * | reem quit (Remote host closed the connection) |
05:32:15 | * | sampwing joined #nim |
05:34:26 | * | reem joined #nim |
05:41:16 | * | sampwing quit (Remote host closed the connection) |
05:51:37 | * | vbtt quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
05:51:59 | * | nande quit (Remote host closed the connection) |
05:52:25 | * | girvo joined #nim |
05:57:24 | * | girvo quit (Ping timeout: 265 seconds) |
06:12:27 | * | reem quit (Remote host closed the connection) |
06:15:24 | * | reem joined #nim |
06:28:08 | * | gsingh93 quit (Ping timeout: 246 seconds) |
06:33:41 | * | reem quit (Remote host closed the connection) |
06:36:07 | * | reem joined #nim |
06:56:53 | * | reem quit (Remote host closed the connection) |
06:58:33 | * | Senketsu quit (Quit: Leaving) |
06:59:54 | * | askatasuna joined #nim |
07:23:46 | * | johnsoft quit (Ping timeout: 272 seconds) |
07:24:06 | * | johnsoft joined #nim |
07:31:29 | * | darkf_ joined #nim |
07:34:33 | * | cazov quit (Ping timeout: 265 seconds) |
07:34:39 | * | cazov joined #nim |
07:35:02 | * | darkf quit (Ping timeout: 265 seconds) |
07:39:50 | * | askatasuna quit (Quit: WeeChat 1.1.1) |
07:41:04 | * | girvo joined #nim |
07:41:49 | * | johnsoft quit (Ping timeout: 255 seconds) |
07:42:49 | * | johnsoft joined #nim |
07:46:01 | * | girvo quit (Ping timeout: 264 seconds) |
07:57:22 | * | reem joined #nim |
08:01:45 | * | replace-bot joined #nim |
08:02:11 | * | replace-bot quit (Remote host closed the connection) |
08:04:16 | * | dashed quit (Quit: Connection closed for inactivity) |
08:07:39 | * | replace-bot joined #nim |
08:09:21 | * | replace-bot quit (Remote host closed the connection) |
08:09:38 | * | replace-bot joined #nim |
08:22:35 | * | replace-bot quit (Remote host closed the connection) |
08:23:08 | * | replace-bot joined #nim |
08:34:50 | * | reem quit (Remote host closed the connection) |
08:42:29 | * | reem joined #nim |
08:42:32 | * | reem quit (Remote host closed the connection) |
09:07:31 | * | replace-bot quit (Remote host closed the connection) |
09:08:14 | * | replace-bot joined #nim |
09:29:52 | * | girvo joined #nim |
09:34:13 | * | girvo quit (Ping timeout: 248 seconds) |
09:51:24 | * | BlaXpirit joined #nim |
09:55:03 | * | Gonzih joined #nim |
09:58:56 | * | Gonzih is now known as gnzh |
09:59:01 | * | gnzh is now known as gonzih |
09:59:17 | * | gonzih quit (Client Quit) |
10:06:56 | * | darkf_ is now known as darkf |
10:08:21 | * | cir0x joined #nim |
10:19:56 | * | singul42 joined #nim |
10:20:02 | singul42 | hi |
10:21:26 | singul42 | does anyone know how to use signal and wait (locks lib) with threads (TThread)? is this maybe not possible with the default gc? |
10:23:16 | singul42 | I am a little bit confused because of the local thread heaps and I was wondering whether calling signal on a global lock and condition var will work. |
10:27:25 | * | polkm quit (Ping timeout: 246 seconds) |
10:37:09 | * | jasondotstar quit (Read error: Connection reset by peer) |
10:38:15 | * | jasondotstar joined #nim |
10:42:40 | * | MyMind joined #nim |
10:58:23 | * | DemonOne quit (Ping timeout: 246 seconds) |
11:17:44 | * | Strikecarl joined #nim |
11:17:51 | Strikecarl | Hey everyone! |
11:18:43 | * | girvo joined #nim |
11:19:36 | * | Strikecarl left #nim (#nim) |
11:20:06 | * | Strikecarl joined #nim |
11:21:24 | Strikecarl | If i want my calculator to be able to parse so i can do 1 + 1 on the same line |
11:21:28 | Strikecarl | what parser should i use? |
11:23:09 | * | girvo quit (Ping timeout: 245 seconds) |
11:26:37 | BlaXpirit | Strikecarl, first of all you can use regex |
11:26:52 | BlaXpirit | but if you're looking for something more serious, then state your question clearly |
11:27:06 | Strikecarl | well |
11:27:12 | Strikecarl | i am not the best to nim |
11:27:24 | Strikecarl | but in c++ you could do cin >> number1 >> action >> number2 |
11:27:30 | BlaXpirit | ok |
11:27:30 | Strikecarl | so every space there was a new int/string |
11:27:37 | Strikecarl | how would i do that in nim? |
11:27:55 | BlaXpirit | readline().split() and u have an array |
11:29:10 | Strikecarl | var a = parseInt(readline().split()) |
11:29:18 | Strikecarl | what do i need to fill in |
11:29:30 | Strikecarl | the ()'s |
11:33:17 | BlaXpirit | hold up, Strikecarl |
11:33:54 | BlaXpirit | Strikecarl, https://bpaste.net/show/10b4c13e0316 |
11:36:28 | BlaXpirit | oh and yeah, you'll probably need parseInt for those numbers |
11:40:24 | Strikecarl | Yeah. |
11:42:15 | dom96 | singul42: you should use a global threadvar |
11:42:26 | dom96 | singul42: I suggest using Channels instead though. |
11:42:54 | dom96 | BlaXpirit: Strikecarl: For a calculator I would suggest doing the parsing manually instead of using regex. |
11:43:07 | BlaXpirit | meh |
11:43:09 | * | reem joined #nim |
11:43:13 | BlaXpirit | regex is great for tokenization |
11:43:25 | BlaXpirit | this guy, however, seems to be looking for something much simpler |
11:43:32 | dom96 | not when you get a dependency on pcre when you use it |
11:48:18 | * | reem quit (Ping timeout: 265 seconds) |
11:49:56 | Strikecarl | How am i supposed to parseInt for this |
11:49:59 | Strikecarl | BlaXpirit |
11:50:00 | Strikecarl | http://pastebin.com/dBsA9b9V |
11:50:27 | BlaXpirit | ok yeah... just forget about that long line |
11:50:37 | BlaXpirit | let number1 = parseInt(arr[0]) |
11:50:38 | BlaXpirit | etf |
11:50:40 | BlaXpirit | etc |
11:50:59 | Strikecarl | this one? let arr = readLineFromStdin("").split() |
11:51:08 | BlaXpirit | #9 |
11:51:15 | Strikecarl | kk |
11:51:16 | BlaXpirit | replace it with 3 lines |
11:51:19 | Strikecarl | Ah! |
11:52:16 | BlaXpirit | you can write let sum = case action |
11:52:49 | BlaXpirit | then don't need all those "sum = " |
11:54:24 | Strikecarl | What did i do wrong? |
11:54:24 | Strikecarl | http://pastebin.com/aJMuF4XN |
11:54:28 | Strikecarl | " Error: undeclared identifier: 'number'" |
11:54:56 | BlaXpirit | you used undeclared identifier: 'number' |
11:54:57 | BlaXpirit | duh |
11:55:06 | BlaXpirit | line 20 |
11:56:00 | Strikecarl | oh lol |
11:56:01 | Strikecarl | wow |
11:56:04 | Strikecarl | maybe i should read it |
11:56:20 | Strikecarl | 14, 16) Error: value of type 'int' has to be discarded |
11:57:27 | * | gokr joined #nim |
11:58:40 | Strikecarl | gotta use the discard function i guess |
11:58:42 | Strikecarl | brb |
11:59:41 | BlaXpirit | "else: nope" wut |
12:00:54 | Strikecarl | yea |
12:00:56 | Strikecarl | fixed it |
12:00:57 | Strikecarl | else: |
12:01:01 | Strikecarl | eco("nope) |
12:01:04 | Strikecarl | ")* |
12:03:40 | Strikecarl | http://pastebin.com/Fmg3dCGc |
12:03:41 | Strikecarl | line 14 |
12:03:45 | Strikecarl | i need to discard. |
12:03:53 | Strikecarl | something. |
12:03:57 | Strikecarl | "value of type 'int' has to be discarded " |
12:04:29 | BlaXpirit | trying to figure it out |
12:04:52 | Araq | don't use a 'case' expression if you cannot handle the logic :P |
12:05:02 | Araq | stick to the 'case' statement |
12:05:07 | BlaXpirit | it's impossible to use it |
12:05:29 | BlaXpirit | statement not allowed after 'continue' is the final bummer |
12:05:59 | Araq | yeah, stupid compiler, using logic |
12:06:32 | BlaXpirit | funny thing is "0" is not a statement |
12:08:12 | BlaXpirit | sorry, Strikecarl, had to go simpler. https://bpaste.net/show/e80fafdd7314 |
12:10:08 | Strikecarl | thats what i did in the beginning. |
12:10:10 | Strikecarl | thanks tho! |
12:11:34 | Strikecarl | It works! |
12:34:59 | * | Trustable joined #nim |
12:41:18 | * | akiradeveloper joined #nim |
12:43:29 | * | banister joined #nim |
13:00:30 | * | singul42 quit (Quit: Page closed) |
13:05:27 | * | milosn quit (Ping timeout: 250 seconds) |
13:06:29 | * | akiradeveloper quit (Remote host closed the connection) |
13:07:26 | * | girvo joined #nim |
13:07:35 | * | milosn joined #nim |
13:08:02 | * | filwit joined #nim |
13:08:42 | filwit | dom96: just uploaded a few more fixes to the Aporia PR.. it's ready to be pulled whenever you get a chance to review it. |
13:08:55 | dom96 | sure, thanks |
13:09:51 | def- | Araq: the cpp compilation issues should finally be fixed |
13:09:56 | filwit | dom96: btw, have you taken a look at my nimforums PR at all yet? Just a reminder since I haven't gotten any feedback yet. |
13:11:02 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:11:22 | dom96 | filwit: not yet. Keep reminding me :P |
13:11:33 | dom96 | on github preferably |
13:11:53 | filwit | dom96: actually, scratch that.. i forgot I started majorly changing the CSS (sharing styles between website and removing my docs styles)... so don't pull the nimforum PR |
13:12:24 | * | girvo quit (Ping timeout: 265 seconds) |
13:16:08 | Araq | dom96: turns out {.push gcsafe.} already works ... :-) |
13:16:17 | Araq | generic programming ftw |
13:16:55 | filwit | Araq: noticed (t:type Foo) works now, thanks. |
13:18:46 | pigmej | hmm, whats recommended emacs setup for nim ? |
13:18:54 | def- | Araq: or not entirely, still have a strange one |
13:18:56 | pigmej | the nim-mode seems to be quite 'limited', isn't it? |
13:22:32 | filwit | Araq, dom96: btw, has there been any updates to Aporia/nimsuggest recently? I tried running it the other day, but Aporia didn't even seem to kick-off nimsuggest at all (no completion displayed, yes i built nimsuggest and enabled suggest features in prefs). |
13:23:10 | dom96 | filwit: you need to press ctrl+space now to invoke it |
13:23:23 | filwit | ah, okay |
13:24:20 | filwit | well i'll try later actually, i'm leaving for a bit.. just dropping by to tell you about the Aporia PR |
13:24:24 | filwit | later |
13:24:29 | * | filwit quit (Quit: Leaving) |
13:26:56 | * | cir0x1 joined #nim |
13:29:36 | * | cir0x quit (Ping timeout: 246 seconds) |
13:39:12 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
13:39:24 | * | TEttinger quit (Ping timeout: 245 seconds) |
13:40:17 | * | rational joined #nim |
13:52:57 | * | singul42 joined #nim |
14:03:23 | def- | Araq: I don't get how to fix the C++ array results |
14:03:32 | singul42 | hi |
14:04:18 | Araq | def-: that's a pretty pervasive codegen change |
14:05:30 | * | darkf quit (Quit: Leaving) |
14:06:35 | Araq | def-: and maybe we should generate c++11's std::array |
14:06:58 | * | akiradeveloper joined #nim |
14:07:13 | def- | Araq: but the C array results also look weird |
14:09:44 | Araq | well the whole code generator needs to be rewritten |
14:10:04 | Araq | it should have been built as an AST to AST transformation |
14:10:12 | * | Strikecarl joined #nim |
14:10:36 | Strikecarl | What should i do without this group |
14:10:39 | Strikecarl | IRC* |
14:11:36 | * | akiradeveloper quit (Ping timeout: 272 seconds) |
14:16:24 | dtscode | Araq, you should definitly be using std::array over regular arrays |
14:26:58 | * | akiradeveloper joined #nim |
14:29:26 | * | replace-bot quit (Remote host closed the connection) |
14:30:31 | Strikecarl | I am a bit of a noob to this nim thing |
14:30:38 | Strikecarl | but i tried to make an precentage calculator |
14:30:46 | Strikecarl | using an proc |
14:30:46 | Strikecarl | http://pastebin.com/ct20NiJa |
14:30:59 | Strikecarl | on line 5 i get an error: type expected |
14:32:19 | * | replace-bot joined #nim |
14:35:04 | flaviu | Strikecarl: Please read your code before asking questions about it. |
14:35:22 | Strikecarl | I did read my code through. |
14:35:25 | Strikecarl | As i said. |
14:35:29 | Strikecarl | i started nim yesterday. |
14:36:17 | Strikecarl | I'm sorry if its a damn stupid question. |
14:36:23 | Strikecarl | but i cant find the error |
14:36:42 | Araq | Strikecarl: proc foo() = # equals instead of : |
14:36:52 | def- | proc calculate(a, c: int): float = a * 100 / c |
14:36:55 | Araq | then your return is not indented properly |
14:37:12 | Araq | and you assign to a global and yet return the value too |
14:37:21 | Araq | which is universally bad style |
14:37:36 | Araq | even in C++ ;-) |
14:37:45 | Strikecarl | I sucked at C++ ;-) |
14:41:00 | Strikecarl | So basicly, this? http://pastebin.com/F6TVnfAu |
14:42:05 | Strikecarl | then when i want to calculate i do |
14:42:16 | Strikecarl | calculate(a, c) |
14:42:18 | Strikecarl | ? |
14:42:26 | * | Ven joined #nim |
14:43:03 | * | untitaker quit (Ping timeout: 264 seconds) |
14:43:05 | flaviu | Strikecarl: That indentation is ... unorthodox. |
14:43:31 | Strikecarl | Meh. |
14:43:55 | Strikecarl | didnt get any errors tho :-/ |
14:45:47 | Araq | Strikecarl: well it's valid |
14:46:48 | flaviu | re. calculate(a, c). That should work. Why don't you try it and see? |
14:46:55 | Strikecarl | cause it doesnt. |
14:46:58 | Strikecarl | I get discard errors. |
14:47:02 | Strikecarl | like i always do <.< |
14:47:23 | Strikecarl | either discard errors or i get the undeclared identifier: 'a' |
14:47:36 | * | untitaker joined #nim |
14:47:41 | flaviu | http://nim-lang.org/tut1.html |
14:47:45 | Strikecarl | depends on the indentation. |
14:49:05 | flaviu | Because instead of having { and }, indentation is scope in nim. |
14:50:27 | Strikecarl | hmm, knew that. |
14:53:34 | Strikecarl | ayee i made it work |
14:54:25 | Strikecarl | Thanks, Araq, flaviu and def- |
14:56:13 | * | girvo joined #nim |
15:01:01 | * | girvo quit (Ping timeout: 264 seconds) |
15:01:11 | singul42 | I am getting a compile error I don't know how to solve when compiling the following code: https://bpaste.net/show/385b95398660 |
15:01:52 | Araq | singul42: don't use 'var T' in a tuple type |
15:02:13 | Araq | 'var T' is not a first class citizen in the type system |
15:02:24 | Araq | use 'ptr' instead |
15:02:29 | singul42 | oh, thanks for the hint |
15:02:55 | Araq | and don't use TThread of TChannel |
15:03:12 | Araq | though I guess TThread of ptr TChannel works fine ... |
15:05:07 | singul42 | if ptr TChannel doesn't work, how am I supposed to pass a TChannel to a thread? using it as a global var? |
15:05:38 | Araq | that's what I prefer yes. much easier to reason about |
15:05:53 | Araq | since there is no aliasing going on then |
15:06:08 | EXetoC | {.global.} too? |
15:06:17 | singul42 | cool, will try that too |
15:06:53 | singul42 | thanks for the help :-) much appreciated. |
15:07:10 | Araq | EXetoC: meh. I don't think .global can work here |
15:07:42 | Araq | EXetoC: .global is when you want global lifetime but local scope. but in this case the global scope is required |
15:08:08 | EXetoC | ok |
15:09:27 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:12:24 | * | akiradeveloper quit () |
15:18:16 | * | Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
15:26:10 | fowl | pass the index to channel, save yourself some headache |
15:42:13 | ggVGc | what is the initialization time for a Nim executable relative a C one? |
15:42:51 | ggVGc | I guess I mean, how long does the nim runtime take to initialize? Is it basically negligible? |
15:43:52 | dtscode | basically yes |
15:44:05 | dtscode | technically, its the same runtime |
15:44:11 | dtscode | in normal compilations |
15:45:38 | ggVGc | cool thanks |
15:46:05 | ggVGc | dtscode: I was thinking about the GC mostly I guess |
15:46:33 | dtscode | its still all compiling to c though |
15:46:45 | dtscode | but i never had an issue with Mimbus having a slow startup |
15:46:53 | dtscode | /s/Mimbus/Nimbus/ |
15:46:53 | replace-bot | dtscode meant: but i never had an issue with Nimbus having a slow startup |
15:47:19 | singul42 | Araq: works like a charm |
15:49:46 | flaviu | ggVGc: Benchmarks are the best source of information! 10k hello world invocations take 0.36s user time for nim, 0.38s for C. |
15:50:01 | flaviu | Overall CPU time is 12.6s for nim, 11.3s for c. |
15:50:14 | flaviu | probably because nim executables are larger. |
15:52:50 | * | banister joined #nim |
15:52:54 | * | banister quit (Max SendQ exceeded) |
16:03:58 | * | banister joined #nim |
16:10:24 | ggVGc | flaviu: thanks |
16:17:33 | def- | flaviu: and printing nothing? |
16:20:13 | * | banister quit (Ping timeout: 264 seconds) |
16:21:18 | * | gsingh93 joined #nim |
16:24:18 | def- | flaviu: ok, seems not to make a difference |
16:32:42 | * | banister joined #nim |
16:36:48 | * | a5i joined #nim |
16:44:59 | * | girvo joined #nim |
16:49:54 | * | girvo quit (Ping timeout: 265 seconds) |
16:58:48 | * | banister_ joined #nim |
16:59:07 | * | banister quit (Read error: Connection reset by peer) |
17:16:13 | * | irrequietus joined #nim |
17:16:15 | * | banister_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:18:33 | * | pafmaf_ joined #nim |
17:55:19 | * | BlaXpirit is making yet another regex implementation |
17:56:59 | EXetoC | another wrapper? |
17:57:08 | BlaXpirit | nope |
17:57:19 | BlaXpirit | that's the point |
18:02:04 | BlaXpirit | mmmm compiletime regex |
18:02:18 | BlaXpirit | but i dont think it's gonna be any advanced |
18:02:32 | BlaXpirit | definitely not gonna mess with unicode :/ |
18:02:47 | def- | no chance of getting C libraries at compile time? |
18:03:01 | BlaXpirit | that would be easiest for everyone |
18:03:07 | BlaXpirit | (except the one implementing it) |
18:03:59 | def- | I also wrote the bigints module so we have bigints at compile time |
18:04:11 | BlaXpirit | oh that's great |
18:04:12 | def- | but it's never going to be as performant as GMP |
18:04:13 | BlaXpirit | i didnt see it |
18:04:45 | * | HakanD joined #nim |
18:06:31 | * | pafmaf_ quit (Quit: Verlassend) |
18:07:48 | EXetoC | BlaXpirit: will you be using thompson's algorithm? |
18:08:03 | BlaXpirit | no, just writing some random shtuff that comes to mind |
18:08:28 | BlaXpirit | just a straightforward match algo is all there is to it |
18:13:15 | HakanD | Nim is still named as nimrod at github: https://github.com/github/linguist/blob/078aff6ee317cb93168b1a79222edfacfa410ce4/lib/linguist/languages.yml#L2011 - should we send a pull request to change it to Nim? |
18:13:34 | def- | HakanD: there is one already |
18:13:51 | def- | https://github.com/github/linguist/pull/1936 |
18:14:07 | HakanD | Oh ok, couldn't find it on my search, my bad |
18:16:49 | * | HakanD quit (Quit: Be back later ...) |
18:19:05 | flaviu | https://sourceware.org/libffi/ ? |
18:21:12 | BlaXpirit | ? |
18:21:23 | BlaXpirit | flaviu, https://github.com/flaviut/nre/blob/master/src/private/util.nim do u really need fget when there is http://nim-lang.org/tables.html#mget,Table%5BA,B%5D,A |
18:22:31 | flaviu | BlaXpirit: They do totally different things, look over that function. |
18:22:58 | flaviu | ah, I see. |
18:23:05 | flaviu | Well, I don't need a var returned. |
18:23:19 | BlaXpirit | but you don't necessarily require non-var |
18:23:25 | BlaXpirit | it can't hurt, unless it can |
18:25:09 | flaviu | Well, the table in this case is var, but I guess my excuse here is that I can't be bothered to change it. |
18:25:43 | flaviu | I don't like that `[]` silently fails when the key isn't found. |
18:26:01 | def- | flaviu: Araq said that should be changed |
18:26:16 | def- | and mget should become an overloaded `[]` |
18:26:19 | flaviu | def-: Let me know when that happens, I'll update my code. |
18:26:33 | BlaXpirit | i'd just do everything exactly the same as python |
18:26:36 | def- | well, i can't do it because there's a bug preventing a nice deprecation message |
18:26:58 | BlaXpirit | [] should do exactly what mget does |
18:27:59 | flaviu | def-: I'm not trying to pressure you or anything, I'm in absolutely no rush. |
18:33:45 | * | girvo joined #nim |
18:38:18 | * | girvo quit (Ping timeout: 246 seconds) |
18:47:38 | * | banister joined #nim |
19:08:53 | * | Senketsu joined #nim |
19:16:08 | * | fizzbooze joined #nim |
19:31:34 | pigmej | hmm, guys what the state of unittest module? |
19:32:16 | BlaXpirit | pigmej, works pretty well |
19:32:41 | BlaXpirit | can u be more specific? |
19:34:06 | pigmej | I have read the discussion about 'going to 1.0 and maybe removing unittest' |
19:34:13 | pigmej | also it's damn hard to find documentation for it |
19:34:14 | BlaXpirit | wuuuut |
19:34:23 | pigmej | it's not even mentioned in lib.html |
19:34:27 | pigmej | (http://nim-lang.org/lib.html) |
19:34:32 | pigmej | so I wonder what the heck :) |
19:34:43 | BlaXpirit | ok now that is strange |
19:34:53 | BlaXpirit | i dunno, people seem to use almost exclusively unittest |
19:35:10 | pigmej | I've just hit the unittest module by accident in fact |
19:35:12 | pigmej | ;d |
19:36:32 | Araq | pigmej: it still has bugs and IF it doesn't work, you never know if that's because of the unittest module failing or your test failing |
19:37:01 | Araq | and at the end of the day it's just a more verbose version of 'when isModule: doAssert ... ' |
19:37:19 | Araq | I would happily remove it, but lots of code uses it already |
19:37:26 | BlaXpirit | Araq pls |
19:37:31 | BlaXpirit | it gives introspection |
19:37:32 | flaviu | Yep, unittest does some interesting stuff with macros to give you more descriptive failure messages, this can cause problems. |
19:37:43 | pigmej | ah, so that's the case |
19:37:53 | pigmej | anyway, I'm new to this world, nim seems pretty cool |
19:38:12 | BlaXpirit | pigmej, https://github.com/flaviut/nre/tree/master/test |
19:38:34 | pigmej | but I have to say this, documentation is hmm... requires a lot patience |
19:38:55 | pigmej | BlaXpirit: yeah, when I found 'unitest' module, then I searched github for it:) |
19:39:25 | flaviu | http://nim-lang.org/unittest.html |
19:39:28 | pigmej | flaviu: yup |
19:39:38 | flaviu | I really use nothing more than what is in that example. |
19:40:03 | pigmej | yeah, seems cool |
19:40:14 | BlaXpirit | so wait... is require just check without introspection? |
19:40:17 | Araq | BlaXpirit: hrm? it does introspection now? |
19:40:19 | EXetoC | BlaXpirit: the output is more helpful, yes. I don't care much for the other stuff |
19:40:24 | pigmej | by documentation I mean "general docs" |
19:40:35 | EXetoC | but I'll make check standalone soon |
19:41:17 | BlaXpirit | Check failed: a == 6 a was 5 |
19:41:23 | flaviu | Araq: Introspection is the reason for the bugs. |
19:41:24 | BlaXpirit | stuff like that, it's great |
19:41:45 | Araq | aha |
19:42:05 | BlaXpirit | don't bash unittest, Araq |
19:42:14 | Araq | I never got any useful error messages from it :P |
19:42:48 | Araq | but *shrug* I guess I only saw when it didn't work |
19:43:26 | BlaXpirit | and yes, of course you do know when it's unittest failing or your module failing |
19:43:41 | BlaXpirit | unittest can only fail at compiletime |
19:44:09 | Araq | fixing bugs all day can make you biased :P |
19:44:42 | EXetoC | no, it can mess up things at run time too. it does generate code via metaprogramming after all |
19:44:51 | BlaXpirit | `check` did cause me trouble a few times, but all it takes to fix it is to simplify the expression |
19:45:15 | BlaXpirit | EXetoC, well even if it does that, it still executes the original code unmodified, doesn't it |
19:45:23 | EXetoC | the biggest issue I had was the lack of information in the stack trace at times, which left me clueless |
19:46:02 | BlaXpirit | i also don't get the "suite" statement |
19:46:08 | BlaXpirit | it seems to do absolutely nothing |
19:46:22 | BlaXpirit | it could at least print the name |
19:47:29 | EXetoC | but doesn't it set some things up so that the results can be collected? which are then printed at the end |
19:47:33 | flaviu | BlaXpirit: I assume there were future plans. |
19:48:24 | EXetoC | zah has been very busy the last year or so |
19:48:42 | flaviu | The suite statements would probably also benefit https://github.com/Araq/Nim/issues/2088 if I ever get around to it. |
19:48:43 | * | irrequietus quit () |
19:49:56 | pigmej | it seems that I accidentially started quite interesting discussion ;D |
19:52:55 | Araq | pigmej: can you elaborate on why our docs suck? |
19:53:05 | EXetoC | I think it should be in system because it's a great replacement for assert. I'll look at it later today |
19:53:29 | Araq | (apart from lack of cross referencing and search by type, of course!) |
19:53:37 | BlaXpirit | Araq, mainly unittest docs suck, because they are completely absent |
19:53:42 | pigmej | Araq: those two for example |
19:54:08 | pigmej | when you click something, then you can't get back, when you open docs in new tabs => troubles etc |
19:54:20 | BlaXpirit | EXetoC, yeah, assert should do check, that would be awesome |
19:54:26 | BlaXpirit | pigmej, click back in browser :| |
19:54:36 | pigmej | BlaXpirit: open in new tab ;-) |
19:54:44 | Araq | so close the tab then? |
19:54:44 | BlaXpirit | close tab then..? |
19:54:48 | Araq | lol |
19:54:49 | pigmej | Araq: yeah sure |
19:55:05 | pigmej | just saying that something like 'where am I currently' would be fine |
19:55:28 | flaviu | The name of the module is in the page title |
19:55:40 | pigmej | let's say http://nim-lang.org/logging.html, a link back to lib or somethign |
19:55:55 | pigmej | flaviu: I mostly meant "go up" |
19:55:57 | pigmej | or something |
19:56:13 | BlaXpirit | that's like the least important detail |
19:56:16 | pigmej | but that's my point of view as new one in this world |
19:56:20 | pigmej | BlaXpirit: sure |
19:56:42 | pigmej | but it influences the experience |
19:57:33 | flaviu | yeah, I'd find a link to /lib.html useful too. |
19:57:56 | EXetoC | yeah in case you didn't start there already |
19:58:07 | pigmej | what I also miss, no search at all (or at lest not one that I'm aware of) |
19:58:22 | BlaXpirit | we have brought up the fact that documentation html sucks |
19:58:25 | flaviu | Some search at http://nim-lang.org/theindex.html, but it's a pretty terrible experience. |
19:59:03 | pigmej | BlaXpirit: http://www.erlang.org/erldoc this one is ok |
19:59:33 | BlaXpirit | should just use sphinx |
19:59:41 | BlaXpirit | nih too strong |
20:00:15 | BlaXpirit | although maybe it wouldn't work, i don't know what i'm talking about |
20:00:36 | flaviu | It'd work fine, just a few minor compiler changes necessary. |
20:01:09 | flaviu | There needs to be a way to tell jsondoc to output the raw, non-processed doccomments. |
20:01:17 | BlaXpirit | i'm talking about representing nim's intricacies |
20:01:37 | BlaXpirit | of course, doc is horribly monolithic and not configurable at all |
20:02:56 | Araq | no, you can actually configure the shit out of it |
20:03:06 | Araq | it's just that nobody does |
20:03:14 | BlaXpirit | by editing code? |
20:03:22 | Araq | no, by editing the config |
20:03:28 | BlaXpirit | which is basically code |
20:03:36 | Araq | well it's in a config file |
20:03:41 | Araq | and "interpreted" |
20:03:47 | flaviu | Araq: But it's impossible to do custom processing on the doc comments. |
20:03:52 | Araq | no need to recompile the compiler |
20:04:20 | Araq | it's the nature of complex configurations to look like code |
20:04:48 | Araq | flaviu: but that's not what BlaXpirit is talking about. |
20:05:25 | BlaXpirit | oh sure, earlier i came to the conclusion that code is the best config |
20:05:31 | Araq | flaviu: also you can patch everything with JS anyway |
20:06:22 | flaviu | Araq: Not really. I want access to the raw comments, which I do not have with javascript. |
20:06:38 | Araq | what is a "raw comment"? |
20:06:59 | flaviu | The doc comment before it's been processed by the RST parser. |
20:07:25 | BlaXpirit | including google spy in all docs is such a great idea -_- |
20:07:40 | BlaXpirit | oh, flaviu, that sucks :| |
20:07:55 | flaviu | BlaXpirit: Google analytics isn't not by default. |
20:08:01 | flaviu | s/not// |
20:08:43 | BlaXpirit | no frickin clue what it has to do with anything |
20:09:20 | BlaXpirit | nim shouldn't have built-in google spy functionality, it should just be an ability to add custom html |
20:10:10 | flaviu | BlaXpirit: Nim's docgen has two uses: for the nim project to generate the website, and for users to generate personal doc pages. |
20:10:46 | BlaXpirit | but i understand that users can use "$analytics" |
20:11:33 | singul42 | has anybody written a windows service in nim yet? |
20:14:11 | * | brson joined #nim |
20:18:01 | BlaXpirit | i, for one, don't know what you mean |
20:19:44 | singul42 | a service that can be started and stopped via the service's control panel |
20:20:12 | BlaXpirit | ok |
20:20:23 | BlaXpirit | is it really specific to nim? |
20:20:49 | BlaXpirit | http://stackoverflow.com/questions/3582108/create-windows-service-from-executable |
20:22:32 | * | girvo joined #nim |
20:23:01 | singul42 | no, just a use case for nim I am trying out and I am having trouble registering the service's main entry point by using StartServiceCtrlDispatcherW .... my service crashes when calling that win32 api function and I can't see the error right now. that's why I asked :-) |
20:23:13 | singul42 | thanks for the URL blaxpirit |
20:24:04 | singul42 | currently I am using this as a template: https://msdn.microsoft.com/en-us/library/windows/desktop/bb540475%28v=vs.85%29.aspx |
20:24:20 | BlaXpirit | scary |
20:25:33 | singul42 | indeed :-) |
20:27:01 | * | girvo quit (Ping timeout: 248 seconds) |
20:28:12 | singul42 | this is my proc to register the service's main entry point (serviceMain): https://bpaste.net/show/5e925154886d |
20:30:49 | * | fizzbooze quit (Ping timeout: 244 seconds) |
20:32:07 | BlaXpirit | is there any reason you can't create-windows-service-from-executable?? |
20:36:46 | singul42 | no reason except that I want tto learn how to write a windows service using win32 api in nim :-) |
20:45:44 | * | irrequietus joined #nim |
20:58:56 | * | fizzbooze joined #nim |
21:03:18 | * | fizzbooze quit (Client Quit) |
21:03:47 | * | fizzbooze joined #nim |
21:17:32 | * | HakanD joined #nim |
21:22:39 | * | HakanD quit (Ping timeout: 264 seconds) |
21:30:22 | * | gokr quit (*.net *.split) |
21:30:22 | * | MyMind quit (*.net *.split) |
21:30:22 | * | xet7 quit (*.net *.split) |
21:30:22 | * | flaviu quit (*.net *.split) |
21:30:23 | * | reactormonk quit (*.net *.split) |
21:30:41 | * | reactormonk joined #nim |
21:31:00 | * | xet7 joined #nim |
21:31:30 | * | MyMind joined #nim |
21:32:40 | * | gokr joined #nim |
21:32:43 | * | flaviu joined #nim |
21:38:19 | * | girvo joined #nim |
21:42:40 | * | girvo quit (Ping timeout: 250 seconds) |
22:06:21 | * | filwit joined #nim |
22:13:20 | * | singul42 quit (Quit: Page closed) |
22:15:34 | * | reem joined #nim |
22:17:05 | k1i | dom96: you wrote asyncdispatch, yea? |
22:52:08 | * | flaviu quit (Read error: Connection reset by peer) |
22:58:19 | * | tghume joined #nim |
22:59:01 | tghume | Hi, I’m a Nim newbie with an interesting challenge: how do I load a large file full of binary 32 bit ints into a seq[int32] without copying? |
22:59:53 | Araq | rely on the Nim compiler to do the move for you? |
23:00:15 | Araq | use shallowCopy? |
23:00:18 | tghume | Currently I use createU() to create an uninitialized buffer, then readBuffer to read into the buffer and then copy it element-by element into a seq with toSeq |
23:00:21 | Araq | use shallow on the seq? |
23:00:59 | tghume | The thing is other than readBuffer there is no way I can tell the nim compiler to read a file as int32s, which leaves me with a pointer. |
23:01:28 | tghume | Are you saying that I can shallowCopy a “ptr int32” to a “seq[int32]” and no copying will go on behind the scenes? |
23:01:47 | Araq | ohh "challenge" ahead: readBuffer( cast[ptr int32](addr(theSeq[0])) ) |
23:02:13 | tghume | My current problem is that near the end of the copy I have my massive binary file in memory twice, which out of memory errors my tiny VPS. I could add more swap but there must be a better way. |
23:02:32 | Araq | theSeq needs to have the proper capacity for my snippet to work |
23:02:33 | * | fizzbooze quit (Ping timeout: 265 seconds) |
23:02:36 | tghume | Ah excellent, that’s exactly what i was looking for |
23:02:49 | Araq | actually |
23:02:57 | Araq | the 'cast' is not necessary |
23:03:05 | Araq | addr returns the proper type |
23:03:05 | tghume | I knew that if I had full control I would get a pointer to the inner contents of the seq and pass that, but I didn’t know how to get the pointer. |
23:03:17 | tghume | Thanks! |
23:03:55 | tghume | I’ll have to endure the overhead of initializing the seq with a bunch of zeroes, but that’s better than what I have now and not a big deal. |
23:04:14 | Araq | you might still call shallow(theSeq) though |
23:04:32 | Araq | to ensure it's not copied around behind your back |
23:05:16 | Araq | oh yeah, getting rid of the zero-ing will be possible soonish |
23:05:25 | def- | Araq: Great, more performance! |
23:06:32 | tghume | Wait I’m a Nim noob, what does shallow(theSeq) do and where exactly would I put that? |
23:06:52 | Araq | do it after newSeq() |
23:07:19 | Araq | normally var x = s would copy 's', but not if 's' is shallow |
23:07:35 | tghume | Ok thanks! |
23:07:59 | Araq | for some reason nobody has yet complained about this rather dubious semantic glitch ... |
23:08:09 | reactormonk | Araq, would var s = @[] {.shallow.} work too? |
23:08:22 | Araq | reactormonk: no. |
23:15:48 | * | fizzbooze joined #nim |
23:17:20 | * | BlaXpirit quit (Quit: Quit Konversation) |
23:17:21 | def- | Araq: What would the alternative be? Switching to ref seqs? |
23:18:11 | Araq | call shallowCopy directly instead of '='? |
23:18:46 | Araq | I've yet to see a case where 'ref seq' is necessary |
23:19:03 | Araq | though in theory it *can* come up |
23:19:34 | Araq | note that a seq is a single indirection, so when you need to resize all the pointers to the old seq cannot be updated |
23:20:12 | pigmej | hm, sorry for nobbish question, how can i write tuple to a file, and then read it back (I suppose to read is just createU + readBuffer, but what then..?) |
23:20:29 | Araq | do not use createU. |
23:20:42 | Araq | it's hardly ever necessary |
23:20:54 | pigmej | ok, so then how ? |
23:21:07 | pigmej | sorry, I'm quite lost for now... ;/ |
23:22:19 | EXetoC | the speedup should be minimal |
23:22:57 | pigmej | I currently wonder how, not even in speedup phase |
23:23:45 | * | Trustable quit (Quit: Leaving) |
23:26:05 | Araq | use addr |
23:26:28 | pigmej | hmm |
23:27:06 | * | girvo joined #nim |
23:27:45 | * | reem quit (Remote host closed the connection) |
23:28:55 | * | reem joined #nim |
23:30:05 | pigmej | Araq: what about reading it back? |
23:30:38 | Araq | pigmej: well depending on what you want to do |
23:30:43 | Araq | you can use |
23:30:49 | Araq | * the marshal module |
23:30:56 | Araq | * the streams module |
23:31:01 | Araq | * some Nimble package |
23:31:10 | pigmej | well, I don't need serializer |
23:31:18 | pigmej | so if it would be possible to read raw data, it would be cool |
23:31:22 | Araq | * low level hacking with 'addr' (beware of endianness issues) |
23:31:55 | Araq | var someTup = (1, 2, 4.0) |
23:31:57 | pigmej | Araq: I need to store some computation details (fixed size / types) |
23:31:59 | reactormonk | pigmej, writing a tuple sounds like a serializer to me |
23:32:06 | * | girvo quit (Ping timeout: 272 seconds) |
23:32:14 | Araq | writeBuffer(f, addr someTup, sizeof someTup) |
23:32:16 | pigmej | and read them back |
23:32:19 | pigmej | reactormonk: yeah, but limited ;-) |
23:32:31 | pigmej | Araq: yeah, write works fine for me :) |
23:32:35 | pigmej | (after your tips) |
23:32:37 | reactormonk | pigmej, still go for a serializer, probably the easiest way |
23:33:29 | Araq | I'd use a Python module that uses string literals to describe low level bytepacking details and then use Nimborg to access that Python module |
23:33:47 | Araq | (just kidding) |
23:33:51 | pigmej | Araq: ;D |
23:34:05 | pigmej | python has struct module in fact... |
23:34:17 | Araq | no. |
23:34:24 | Araq | python *needs* a struct module. |
23:34:29 | Araq | we don't. |
23:34:31 | pigmej | hah :) |
23:35:02 | pigmej | yeah that's quite obvious (even for me) |
23:36:58 | Araq | but seriously people seem to love Nimborg. has that found a new maintainer yet? |
23:37:33 | Araq | also we need to announce really cool Nimble packages somehow |
23:37:54 | filwit | tghume said "I’ll have to endure the overhead of initializing the seq with a bunch of zeroes": You don't actually, just mark the variable as {.noinit.} |
23:38:30 | filwit | tghume: delay that, sorry... misunderstood that |
23:38:52 | tghume | filwit: yah that probably doesn’t work with sequences that require other structural things to be set up and space to be allocated. |
23:41:18 | pigmej | hmm, is there any reason why fmReadWrite makes file position end ? |
23:41:58 | pigmej | and fmReadWriteExisting does not? |
23:42:18 | * | no_name quit (Ping timeout: 252 seconds) |
23:42:19 | * | devzerp quit (Ping timeout: 252 seconds) |
23:46:46 | * | devzerp joined #nim |
23:46:54 | * | no_name joined #nim |
23:47:33 | pigmej | ok my tuple read / write works like a charm, just had to switch from 'non C langs' ;) |
23:47:40 | pigmej | (swich the brain) |
23:51:55 | * | gokr quit (Quit: Leaving.) |
23:52:26 | * | reem quit (Remote host closed the connection) |
23:53:19 | * | reem joined #nim |
23:55:52 | * | reem quit (Remote host closed the connection) |
23:58:35 | * | cir0x1 quit (Quit: Leaving.) |