00:05:23 | Araq | there is no proc something(thing: convert[string, `$`]) |
00:30:10 | * | bahtiyar quit (Ping timeout: 240 seconds) |
00:45:15 | * | SusWombat_ joined #nim |
00:47:51 | * | SusWombat quit (Ping timeout: 240 seconds) |
00:56:50 | PMunch | Araq? |
00:57:43 | Araq | I said "you are right" |
00:59:40 | PMunch | Ah, so there is no way.. |
00:59:43 | PMunch | That's unfortunate |
01:00:17 | PMunch | I could image something like & having a convert[string, `$`] for example |
01:01:08 | ftsf | PMunch, can you put the proc and a converter in a block? |
01:01:50 | PMunch | Wait, that works? |
01:01:59 | PMunch | As in "block:"? |
01:02:01 | ftsf | i haven't tried |
01:02:05 | PMunch | And then exported? |
01:04:10 | PMunch | Oh well, I'm off to bed |
01:04:11 | * | PMunch quit (Quit: leaving) |
01:10:52 | FromGitter | <barcharcraz> update on msvc boot issues |
01:11:52 | FromGitter | <barcharcraz> it works using clang-cl as the compiler and cl as the linker (sidenote: why use the compiler to invoke the linker instead of invoking lld/ld/link directly) |
01:23:07 | * | Jesin quit (Read error: Connection reset by peer) |
01:23:15 | * | Jessin joined #nim |
01:23:37 | * | Jessin quit (Remote host closed the connection) |
01:46:58 | * | chemist69 quit (Disconnected by services) |
01:47:03 | * | chemist69_ joined #nim |
02:04:53 | * | Jesin joined #nim |
02:06:28 | * | def-pri-pub joined #nim |
02:07:00 | def-pri-pub | Araq: sorry for taking a week to reply on that issue on Karax regarding the `#` symbol |
02:19:20 | * | pilne quit (Quit: Quitting!) |
02:33:01 | ftsf | shmup, Maximum resident set size (kbytes): 52572 |
02:57:43 | * | libman quit (Quit: Connection closed for inactivity) |
03:21:04 | * | n0xff joined #nim |
03:27:56 | shashlick | Araq, Varriount: worked around the memory issue by using fopen/fread/fclose and alloc/dealloc along with hashData() to calculate hashes of the files |
03:28:56 | shashlick | thanks for all the help, ideally we can fix this readFile() in Nim somehow, i don't see the same issue in Python with recursion, but it might be a special case with limited impact |
03:33:09 | FromGitter | <Varriount> shashlick: Python doesn't have to deal with pointers on the stack. |
03:33:29 | shashlick | does readFile() use pointers internally? |
03:33:54 | * | n0xff left #nim (#nim) |
03:34:50 | FromGitter | <Varriount> shashlick: I don't think the issue is with readfile, it's with your recursion. |
03:35:20 | FromGitter | <Varriount> The garbage collector scans the stack. If it sees anything on the stack that looks like a pointer to a 'live' object, it won't collect that object. |
03:36:22 | FromGitter | <Varriount> The garbage collector runs on function returns too, if I recall correctly. |
03:39:33 | FromGitter | <Varriount> Python uses a standard reference counting scheme, while Nim uses a deferred reference counting scheme. |
03:39:58 | shashlick | but i don't have any pointers in my readFile() version |
03:40:26 | shashlick | in fact, readFile() is called and consumed in a child function, i don't get the string back into my main loop that recurses |
03:40:54 | FromGitter | <Varriount> yes, but you have pointers to the file contents? |
03:41:17 | FromGitter | <Varriount> shashlick: Do you have a version of the old code I could look at? |
03:42:13 | * | sz0 joined #nim |
03:49:21 | shashlick | Varriount: I've uploaded test2.txt(nim) to the issue that demonstrates the problem: https://github.com/nim-lang/Nim/issues/6031 |
03:51:34 | * | chemist69_ quit (Ping timeout: 276 seconds) |
03:51:58 | FromGitter | <Varriount> shashlick: The variable 'p' is on the stack. It will either be null (at the start of the function) or contain the contents of the last file read before recursion. |
03:54:33 | shashlick | but doread() returns without returning p and that stack should no longer be in scope right |
03:55:52 | * | chemist69 joined #nim |
03:57:27 | FromGitter | <Varriount> shashlick: What happens if the C compiler inlines that procedure? |
04:02:35 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
04:08:05 | * | xet7 quit (Remote host closed the connection) |
04:15:49 | FromGitter | <Varriount> shashlick: Oddly enough, I don't have any huge memory leak. Some large memory consumption, yes, however that's probably due to having a couple huge strings (files) on the stack. |
04:16:13 | * | Vladar joined #nim |
04:34:45 | * | def-pri-pub quit (Quit: leaving) |
04:35:15 | FromGitter | <Varriount> shashlick: You there? |
04:45:11 | shashlick | sorry, ya it only causes problems if you point it to a directory with large files, like videos |
04:45:47 | shashlick | nim manages fine with many small files |
04:47:02 | FromGitter | <Varriount> Now, there might be some extra memory being consumed. My process appears to consume an amount of memory twice the size of the largest file it's read. |
04:47:44 | FromGitter | <Varriount> That might be a buffer or something though. |
04:51:26 | * | shashlick quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
05:31:52 | * | Tanger joined #nim |
05:33:04 | * | nohusuro joined #nim |
05:57:20 | * | nsf joined #nim |
06:16:21 | Vladar | yo |
06:16:29 | Vladar | oh, wrong channel |
06:21:56 | * | skrylar joined #nim |
06:24:18 | skrylar | morning |
06:31:28 | FromGitter | <ephja> gm |
06:46:03 | * | v17d joined #nim |
06:48:42 | * | tankfeeder joined #nim |
06:50:28 | * | tankfeeder left #nim (#nim) |
06:57:49 | FromGitter | <Varriount> Night. |
07:27:59 | * | vlad1777d joined #nim |
07:28:21 | * | v17d quit (Ping timeout: 240 seconds) |
07:34:34 | skrylar | well textsoap is neat. |
07:34:44 | skrylar | playing around with it to see if it would make doing some of these nim bindings easier |
07:47:23 | FromGitter | <andreaferretti> @dom96 A colleague of mine also had trouble with nim 0.1.6 |
07:47:27 | FromGitter | <andreaferretti> using choosenim |
07:47:48 | FromGitter | <andreaferretti> by the way, the reason for using 0.16 was again the fact that nimYAML borke on 0.17 |
07:48:27 | FromGitter | <andreaferretti> I think the right way to go is to fecth csources with the same tag |
07:49:37 | FromGitter | <andreaferretti> (by the way, the solution was to use this (https://gist.github.com/andreaferretti/d40af6a276fb3275d97d0f9585d8197e) script of mine instead of choosenim) |
07:50:23 | FromGitter | <ephja> skrylar: will regex not do the job? |
07:50:43 | skrylar | ephja yeah that's all textsoap does. |
07:50:53 | skrylar | it's just a nice gui for running them :b |
07:51:37 | skrylar | i was doing it by hand in vim. just running the same exprs. although this one makes it really easy to run what i was already doing on stuff. so dunno. was working on glib (although there seem to be a few stranded glib.nims around but none in nimble?) |
07:55:35 | FromGitter | <ephja> did you use macros? |
07:55:51 | skrylar | i do |
08:02:24 | FromGitter | <ephja> alright |
08:12:21 | * | yglukhov joined #nim |
08:12:49 | * | Kingsquee joined #nim |
08:16:50 | * | yglukhov quit (Remote host closed the connection) |
08:17:07 | * | yglukhov joined #nim |
08:27:19 | * | dom96|w joined #nim |
08:27:31 | * | yeeve quit (Remote host closed the connection) |
08:30:53 | * | couven92 joined #nim |
08:34:13 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
08:53:14 | * | dom96|w joined #nim |
08:53:14 | * | yeeve joined #nim |
09:16:10 | * | bjz joined #nim |
09:17:19 | dave24 | Can I pass closures to C functions as callbacks? |
09:18:05 | FromGitter | <evacchi> hey guys, any plans or pointers to libs for something like cpp's std::atomic ? |
09:18:50 | skrylar | my intuition says you can't give closures to c callbacks, because a closure in nim has an extra struct attached and c wouldn't know about it |
09:19:37 | skrylar | you could possibly use a cdecl function that accepts a userdata pointer (most c libs do this) and have userdata be the closure, if you're willing to either deal with GC roots or play chicken with the garbage collector |
09:19:58 | * | aerx quit (Quit: WeeChat 1.9) |
09:20:23 | FromGitter | <evacchi> (uh there's `atomics.nim`) |
09:21:39 | dave24 | skrylar: that is what I suspected. My problem is that the c lib does not take any userdata so I thought to use closures. But thats ok, I'll just have some globals. |
09:22:18 | skrylar | a c lib which does not have userdata is highly unfortunate. are you doubly sure it isn't hidden somewhere? some libs will hide userdata inside a context object instead of a callback parameter. |
09:22:47 | FromGitter | <ephja> rawProc (https://nim-lang.org/docs/system.html#rawProc,T) and rawEnv (https://nim-lang.org/docs/system.html#rawEnv,T) ? |
09:22:52 | dom96|w | andreaferretti: c sources aren't tagged on GitHub |
09:23:00 | dom96|w | They are too large. |
09:26:04 | dave24 | skrylar: I'm using IUP(http://webserver2.tecgraf.puc-rio.br/iup/), it does not have a context to pass around. |
09:27:05 | FromGitter | <andreaferretti> @dom96 https://github.com/nim-lang/csources/tree/v0.16.0 |
09:27:19 | FromGitter | <andreaferretti> https://github.com/nim-lang/csources/tree/v0.17.0 |
09:27:38 | FromGitter | <andreaferretti> and so on |
09:28:23 | dom96|w | hah, TIL. |
09:28:56 | dom96|w | That should solve the issue nicely |
09:29:01 | * | whimsical-frost joined #nim |
09:29:15 | dom96|w | But I fear that the C sources repo's history may be truncated at some point. |
09:30:03 | FromGitter | <andreaferretti> well, one can decide when |
09:30:15 | FromGitter | <andreaferretti> for instance, choosenim only supports nim >= 0.16 |
09:30:33 | FromGitter | <andreaferretti> so there's no need for the history before that (at least for choosenim) |
09:32:27 | * | whimsical-frost left #nim ("WeeChat 1.9") |
09:53:47 | * | bjz quit (Read error: Connection reset by peer) |
09:55:32 | * | bjz joined #nim |
09:56:24 | * | arnetheduck joined #nim |
10:04:29 | * | arnetheduck quit (Ping timeout: 268 seconds) |
10:09:46 | * | gokr joined #nim |
10:14:31 | gokr | Was thinking of possibly writing a service (API, JSON, file serving) and contemplating Nim (Jester or Nawak). |
10:15:08 | gokr | Nawak is based on Mongrel2 - so might be more "stable" on the actual HTTP parts? |
10:16:25 | niv | gokr: check out https://github.com/andreaferretti/rosencrantz |
10:16:46 | enthus1ast | jester cannot byte range which is needet for streaming etc |
10:18:38 | dom96|w | You should run Jester behind nginx anyway |
10:18:42 | * | krux02 joined #nim |
10:18:46 | dom96|w | (or another reverse proxy) |
10:19:15 | enthus1ast | dom96|w: then the webserver has to distribute the fiels |
10:19:17 | enthus1ast | files |
10:19:45 | dom96|w | but yes, Jester needs some fixes for large file requests. |
10:20:06 | enthus1ast | but its not possible to just reverse proxy to jester and let it stream cause nginx is tunneling the byte ranges but jester cannot deliver the requested ranges |
10:20:22 | enthus1ast | so its not working :) |
10:23:56 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
10:24:30 | enthus1ast | it looks like its not that much work to patch jester to also deliver byte ranges |
10:25:27 | gokr | Hmmm, I wrote streaming of large files in Smalltalk years ago ;) |
10:25:49 | gokr | So yeah, rosencrantz is also a contender I guess. |
10:26:51 | gokr | Nawak hasn't seen updates in a while I think, and is not "Nim only" (better or worse), Jester is obviously maintained I would argue, Rosencrantz ... dunno. |
10:27:13 | gokr | I just would like to NOT drop down to nodejs for this one. |
10:28:09 | * | PMunch joined #nim |
10:28:13 | gokr | Btw, running that jesterleak test with 5 concurrent tabs - it's up to 2Gb now but I think it has levelled out. |
10:28:15 | FromGitter | <andreaferretti> rosencrantz is mantained |
10:28:21 | FromGitter | <andreaferretti> but no guarantee |
10:28:31 | gokr | Any good hints on differences here? |
10:28:45 | FromGitter | <andreaferretti> I mean, for me it is mostly done, so I have no big plans |
10:28:54 | FromGitter | <andreaferretti> and I make sure that it keeps working |
10:29:13 | FromGitter | <andreaferretti> but I cannot guarantee anything if you find something goes wrong |
10:30:00 | gokr | Of course |
10:31:47 | gokr | I am curious on why Rosencrantz was made. Nawak I suppose wanted to ride on Mongrel2, so that's logical. |
10:32:26 | FromGitter | <andreaferretti> the reason is that I wanted something composable |
10:32:43 | FromGitter | <andreaferretti> I like very much the way routes in spray/akka http can be composed |
10:32:52 | FromGitter | <andreaferretti> and are first class entities on their own |
10:33:15 | FromGitter | <andreaferretti> you can - say - make a handler that checks/adds CORS headers |
10:33:23 | FromGitter | <andreaferretti> and wrap it around another route |
10:33:34 | FromGitter | <ephja> the dynlib pragma can almost be implemented with user code, but there are currently two issues: 1. it's necessary to initialize each library explicitly since you cannot define procs that are run before everything else, and 2. you currently have to access static vars through consts since you get a codegen error otherwise |
10:34:09 | FromGitter | <andreaferretti> moreover jester has some strange defaults |
10:34:19 | FromGitter | <andreaferretti> like text/html content type |
10:34:47 | FromGitter | <andreaferretti> and it mixes POST form parameters with querystring parameters |
10:34:57 | FromGitter | <andreaferretti> I am not sure it handles CORS |
10:35:18 | FromGitter | <andreaferretti> you cannot split the route definition between files |
10:35:19 | FromGitter | <andreaferretti> and so on |
10:35:38 | * | gokr lunch time, but sounds good |
10:37:06 | enthus1ast | dom96|w andreaferretti one thing is websocket support |
10:37:31 | enthus1ast | atm i'm useing jester + niv/websocket but on different ports |
10:38:26 | enthus1ast | think it was just me but both behaved strangely when used in conjunction with niv/websocket |
10:40:36 | enthus1ast | i was thinking maybe it is a good idea to provide something like a skeleton for html+ws to easily make a state of the art website, something to copy and paste for new users :) |
10:42:39 | * | skrylar quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
10:42:55 | enthus1ast | http+ws |
11:15:28 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
11:20:28 | PMunch | Why is it that Apple products always announces themselves? |
11:20:37 | PMunch | "* dom96|w has quit (Quit: My Mac has gone to sleep. ZZZzzz…)" |
11:20:46 | PMunch | "Sent from my iPhone" |
11:23:40 | euantor | Textual isn't built into mac, it'll be a third party app that does it |
11:23:52 | * | gokr quit (Ping timeout: 246 seconds) |
11:24:06 | euantor | "Sent from my iPhone" is the default email footer, never understood why people don't remove that - it's always been the first thing I do on a new phone |
11:24:29 | PMunch | Oh yeah, I realise that. But it's still interesting to see how even the third-party developers add it in |
11:24:36 | couven92 | euantor, Yeah, me too... Or, I rather write down my own footer :P |
11:24:58 | euantor | I have a footer for work, but I've never had a personal email footer |
11:25:28 | PMunch | I just have my name. But then I'm always unsure if it actually gets added or not so I end up writing it in manually as well :P |
11:25:41 | couven92 | PMunch, the default footer in the Windows Mail app, or the default Mail app on HTC also add "Sent from {app}" |
11:26:10 | couven92 | PMunch, my mail apps all append the footer when creating a new mail, not when sending... |
11:26:19 | PMunch | Yeah, I've seen "Sent from my Samsung Galaxy" as well |
11:26:27 | PMunch | But I think iPhone were the first to do it |
11:27:28 | couven92 | The Windows Mail footer is actually annoying as hell, since I don't want a random line of Norwegian slipping into my perfectly internationalized footer text! :P |
11:27:47 | * | vlad1777d_ joined #nim |
11:28:51 | * | vlad1777d quit (Ping timeout: 240 seconds) |
11:36:46 | FromGitter | <andreaferretti> @enthusiast yes, it would be nice to add ws support for rosencrantz |
11:37:00 | FromGitter | <andreaferretti> in fact I had plans to make it a separate project called guildenstern |
11:37:02 | FromGitter | <andreaferretti> :-) |
11:37:14 | FromGitter | <andreaferretti> but I never managed to find the time |
11:41:53 | * | gokr joined #nim |
11:49:54 | * | dom96|w joined #nim |
11:53:30 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
11:57:30 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
11:59:05 | * | dom96|w joined #nim |
12:02:30 | * | Snircle joined #nim |
12:07:02 | couven92 | How do I allocate a cstring to be filled by a C API? |
12:07:51 | * | gokr quit (Ping timeout: 240 seconds) |
12:14:24 | FromGitter | <andreaferretti> alloc? |
12:14:45 | euantor | couven92: You can use `alloc` or you can use `newString()` |
12:15:22 | couven92 | euantor, okay... I though these were for string not cstring? |
12:15:45 | euantor | There's not much difference between the two as far as I know |
12:30:55 | * | chemist69 quit (Ping timeout: 276 seconds) |
12:34:49 | * | chemist69 joined #nim |
12:40:46 | dom96|w | addr myString[0] # gives you a cstring |
12:42:33 | * | nsf quit (Quit: WeeChat 1.7.1) |
12:54:27 | * | vlad1777d joined #nim |
12:55:28 | * | vlad1777d_ quit (Ping timeout: 240 seconds) |
12:57:41 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
12:59:33 | * | dom96|w joined #nim |
13:03:48 | * | Arrrr joined #nim |
13:03:48 | * | Arrrr quit (Changing host) |
13:03:48 | * | Arrrr joined #nim |
13:26:54 | FromGitter | <Varriount> dom96: Actually, one can just use cstring(stringValue) |
13:27:37 | dom96|w | hrm, I wonder if that just does 'addr stringValue[0]' behind the scenes. |
13:38:33 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
13:41:13 | * | dom96|w joined #nim |
13:42:45 | FromGitter | <ephja> didn't it copy? |
13:47:08 | FromGitter | <ephja> I guess not |
14:02:26 | FromGitter | <Varriount> dom96: Yes, it does |
14:06:17 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
14:16:18 | * | gangstacat quit (Quit: Ĝis!) |
14:16:37 | PMunch | "SIGFPE: Arithmetic error." |
14:17:48 | PMunch | Trying to do a `div` between two uint32s |
14:18:08 | PMunch | Ah, /0 |
14:22:43 | * | gangstacat joined #nim |
14:25:01 | * | bjz joined #nim |
14:33:38 | * | krux02 quit (Remote host closed the connection) |
14:34:52 | * | gokr joined #nim |
14:34:58 | * | krux02 joined #nim |
14:35:52 | couven92 | I have another ungly hack for the temp-path problem on Android: Get the OS to create a new temporary file, get the filename for that file, delete the file and create a new directory in its place... |
14:36:23 | couven92 | (because Android doesn't have /tmp) |
14:36:55 | Araq | I would simply throw away temp-path usage in nimble |
14:37:28 | couven92 | Araq, just for android or in general? |
14:37:30 | Araq | and maybe mark the os API as .deprecated, causes more problems than it solves. it's also a notorious security problem |
14:37:48 | Araq | in general. |
14:38:15 | couven92 | Araq, should I do that for the Android PR? Or do you want another PR just for that? |
14:38:27 | couven92 | Ah, probably a new PR just for that is better... |
14:38:41 | Araq | no, you shouldn't do anything. |
14:38:50 | Araq | that's just my opinion. |
14:39:06 | Araq | it would require a real discussion before doing that |
14:40:18 | couven92 | Hmm... okay... |
14:41:19 | couven92 | what's the appropiate function to call to do a `free` C-stdlib call? |
14:42:26 | FromGitter | <ephja> so --debugger:native shows the offending nim line when the C code doesn't compile. neat |
14:47:22 | * | flyx just released NimYAML 0.10.0 which works with Nim 0.17.0, thanks to zahary |
14:47:50 | * | Matthias247 joined #nim |
14:49:13 | * | sz0 quit (Quit: Connection closed for inactivity) |
14:49:32 | FromGitter | <zacharycarter> \o/ |
14:50:42 | flyx | well travis is currently broken since the yaml-test-suite is evolving and I don't have NimYAML's adapter fixed yet, but it should be usable nevertheless :) |
14:51:10 | FromGitter | <andreaferretti> @flyx great to know! |
15:00:49 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
15:02:23 | Araq | flyx: yay! |
15:02:47 | Araq | thanks! |
15:03:05 | FromGitter | <ephja> trying to fix the codegen bug. here we go! |
15:12:43 | FromGitter | <ephja> do any of the template engines use the VM API? |
15:20:50 | * | Arrrr quit (Ping timeout: 255 seconds) |
15:22:17 | * | shashlick joined #nim |
15:22:21 | Araq | ephja: not as far as I know |
15:22:28 | couven92 | Araq, in nim.cfg `define:"tempDir:$HOME/../tmp"` does not expand. Howto? |
15:37:41 | * | xet7 joined #nim |
15:43:22 | dom96 | flyx: Awesome :D |
15:50:05 | * | byte512 quit (Ping timeout: 240 seconds) |
15:50:36 | * | yglukhov quit (Remote host closed the connection) |
15:51:45 | * | nsf joined #nim |
15:53:21 | * | yglukhov joined #nim |
15:57:41 | * | yglukhov quit (Ping timeout: 246 seconds) |
15:58:48 | * | Trustable joined #nim |
16:00:01 | FromGitter | <Varriount> I really wish Python had a templating engine like Nim does. |
16:19:44 | * | svara joined #nim |
16:20:56 | FromGitter | <ephja> what's wrong with the existing template engines? |
16:30:09 | demi- | flyx: yay! thank you |
16:36:01 | * | xet7 quit (Quit: Leaving) |
16:38:20 | FromGitter | <Varriount> ephja: They don't support full python syntax. |
16:39:41 | federico3 | andreaferretti: regarding #5704 I found another corner case |
16:43:11 | * | yglukhov joined #nim |
16:47:27 | * | yglukhov quit (Ping timeout: 240 seconds) |
16:51:19 | * | dexterk_ quit (Quit: Konversation terminated!) |
16:51:31 | * | dexterk_ joined #nim |
16:55:01 | * | krux02 quit (Remote host closed the connection) |
16:55:14 | * | krux02 joined #nim |
16:55:28 | * | Matthias247 quit (Read error: Connection reset by peer) |
17:10:16 | * | yglukhov joined #nim |
17:14:56 | * | yglukhov quit (Ping timeout: 260 seconds) |
17:21:18 | * | pilne joined #nim |
17:35:10 | couven92 | Uhm... Araq, you wanted a PR for testament HTML output... But the HTML i made made use of bootstrap and jQuery... okay, if I do that for the testament htmlgen as well? Even though this will require bootstrap to be available when displaying the HTML? |
17:37:24 | Araq | no, then let it be |
17:37:27 | * | krux02 quit (Ping timeout: 260 seconds) |
17:37:54 | couven92 | What if I manage to hack all I need from jquery and bootstrap into the HTML? :P |
17:41:18 | Araq | I don't write JS, I generate JS. |
17:41:39 | Araq | and you need to do the same to be accepted ;-) |
17:42:27 | Araq | I also don't write Bash code, batch files or HTML or CSS. programming is more about what to avoid than what to use these days. |
17:43:17 | * | krux02 joined #nim |
17:43:32 | * | krux02 quit (Remote host closed the connection) |
17:46:26 | FromGitter | <ephja> CSS is a little nicer now with flexbox and other 21st century mechanisms |
17:51:38 | shashlick | any chance fixing the CTRL-C crash in Windows? it's so annoying when having to stop execution |
17:53:10 | FromGitter | <ephja> going through the compiler code is actually starting to get interesting |
17:57:12 | FromGitter | <ephja> Araq: I don't recall any discussions about using debuggers, but you can't just dump stack traces in arbitrary places in many languages so that does make them more necessary I suppose |
17:59:30 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
18:06:05 | * | bjz joined #nim |
18:08:36 | * | yglukhov joined #nim |
18:09:08 | * | vlad1777d quit (Ping timeout: 240 seconds) |
18:20:34 | FromGitter | <ephja> ```let ct {.compileTime.} = 1 ⏎ let a = ct``` ⏎ ⏎ I assume I just need to copy the value node from 'ct' to 'a'. right now it tries to reference the C symbol for 'ct' which doesn't exist [https://gitter.im/nim-lang/Nim?at=59569672bf7e6af22c8e8c22] |
18:23:32 | FromGitter | <TiberiumN> a bit offtopic: I didn't knew that you can use any compiled language to create web app on azure, it seems that you actually can, and I'll try to do it :D |
18:23:34 | FromGitter | <ephja> this should allow for some cool things. 'const a = ct' works, but then it's order-dependent |
18:27:37 | * | Jesin quit (Quit: Leaving) |
18:30:10 | PMunch | Uhm, doesn't {.this: self.} work with generics? |
18:36:56 | * | libman joined #nim |
18:40:45 | PMunch | http://ix.io/y8U |
18:40:49 | PMunch | Strange |
18:41:09 | PMunch | Undeclared identifier "mintest" on line 9 |
18:41:27 | * | Jehan_ joined #nim |
18:41:41 | PMunch | The initialisation on line 11 works fine |
18:42:51 | PMunch | Ah, both of them are undeclared. min was just assumed to be proc min(x,y: int) |
18:46:10 | PMunch | Remove the generic and change mintest to a type and everything works fine |
18:46:29 | shashlick | does moveFile() work on directories too? don't see an equivalent for directories |
18:47:33 | shashlick | never mind, worked great :) |
18:49:39 | * | Jesin joined #nim |
18:52:13 | FromGitter | <TiberiumN> https://nimtestapp.azurewebsites.net/ ⏎ ⏎ The code: ⏎ ⏎ ```code paste, see link``` ... [https://gitter.im/nim-lang/Nim?at=59569ddd4bcd78af5661970c] |
18:54:12 | FromGitter | <TiberiumN> btw any student can host a simple web app for free |
18:54:19 | FromGitter | <TiberiumN> using DreamSpark subscription |
18:54:30 | FromGitter | <TiberiumN> but I think the performance wouldn't be so good :) |
19:01:35 | * | sz0 joined #nim |
19:01:35 | FromGitter | <RSDuck> What exactly is the stack gc? I can't find any real documentation about it |
19:03:23 | libman | Speaking of GC, could someone answer https://www.reddit.com/r/programming/comments/6jyk34/nim_intro_talk_a_young_systems_programming/djjbu7k/ |
19:04:23 | libman | It's about how much of stdlib depends on GC (vs working fine with --gc:none). Having insight into future development goals might make for a more conclusive answer. |
19:04:50 | FromGitter | <TiberiumN> as I tested: stdlib works without GC, but memory is not freed :) |
19:04:56 | FromGitter | <TiberiumN> so it's like memory leak |
19:05:20 | FromGitter | <TiberiumN> and nim will show warnings for every use of gc (if you're compiling without it) |
19:05:33 | FromGitter | <TiberiumN> but ask Araq or dom96 for better answer |
19:05:48 | FromGitter | <RSDuck> BTW shouldn't the stack gc be a (semi-)replacement for gc:none? |
19:11:13 | * | aerx joined #nim |
19:14:24 | libman | I don't mean answer here, I mean on Reddit. ;) |
19:15:55 | FromGitter | <RSDuck> I don't have reddit and it doesn't answer the question either |
19:17:02 | PMunch | RSDuck, I think he was talking to TiberiumN |
19:17:11 | FromGitter | <RSDuck> ah, sorry |
19:19:32 | * | user__ joined #nim |
19:22:18 | * | Trustable quit (Remote host closed the connection) |
19:22:18 | * | niv quit (Quit: Ping timeout (120 seconds)) |
19:22:18 | * | benoliver999 quit (Ping timeout: 255 seconds) |
19:22:18 | * | mwbrown quit (Ping timeout: 255 seconds) |
19:23:01 | * | mwbrown joined #nim |
19:24:18 | * | benoliver999 joined #nim |
19:26:10 | * | skrylar joined #nim |
19:28:29 | * | shashlick quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
19:31:57 | * | shashlick joined #nim |
19:32:21 | * | Snircle joined #nim |
19:44:20 | * | niv joined #nim |
19:47:29 | * | dom96|w joined #nim |
19:51:39 | Jehan_ | As far as I know, --gc:stack is about region based memory management: https://en.wikipedia.org/wiki/Region-based_memory_management |
19:51:54 | Jehan_ | But I haven't actually looked it, just going by what was said elsewhere. |
19:53:35 | Jehan_ | *at it |
19:58:27 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
19:58:53 | * | shashlick quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
20:01:42 | * | shashlick joined #nim |
20:02:10 | * | shashlick quit (Remote host closed the connection) |
20:02:37 | * | shashlick joined #nim |
20:04:44 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:08:16 | * | shashlick quit (Remote host closed the connection) |
20:13:31 | * | Sentreen quit (Quit: WeeChat 1.4) |
20:17:23 | * | yglukhov quit (Read error: Connection reset by peer) |
20:17:49 | * | yglukhov joined #nim |
20:18:25 | * | Sentreen joined #nim |
20:23:16 | FromGitter | <indy9000_twitter> how to return two seq of float from a proc ? what should the signature be? |
20:24:02 | FromGitter | <indy9000_twitter> `proc blah():({float},{float}) = ` ? |
20:25:09 | FromGitter | <ephja> (seq[float], seq[float])? |
20:25:30 | FromGitter | <indy9000_twitter> ah ta! |
20:25:56 | * | madmalik joined #nim |
20:26:24 | * | shashlick joined #nim |
20:28:35 | * | skrylar quit (Quit: Textual IRC Client: www.textualapp.com) |
20:46:25 | * | Vladar quit (Quit: Leaving) |
20:50:52 | * | Matthias247 joined #nim |
20:55:30 | * | vlad1777d joined #nim |
21:04:57 | * | Jehan_ quit (Quit: Leaving) |
21:25:44 | Xe | what characters does nim allow in type names? |
21:28:06 | FromGitter | <RSDuck> Xe: see here: https://nim-lang.org/docs/manual.html#lexical-analysis-identifiers-keywords |
21:31:27 | FromGitter | <RSDuck> Jehan_: that makes sense, thanks |
21:33:10 | * | Matthias247 quit (Read error: Connection reset by peer) |
21:33:43 | Xe | https://gist.github.com/Xe/629589bf46eb45e2e8b4e7fdacfd5c6d |
21:34:04 | Xe | should this code compile? |
21:35:20 | dom96 | Xe: hah, I love it. |
21:35:37 | dom96 | Looks like a bug to me :) |
21:35:53 | Xe | i hope this ends up in the compiler test suite |
21:38:04 | dom96 | Needs more |
21:38:27 | Xe | dom96: https://github.com/nim-lang/Nim/issues/6040 |
21:39:10 | Xe | dom96: thank you for making choosenim |
21:39:12 | Xe | thank you so much |
21:39:20 | dom96 | :D |
21:39:36 | Xe | i'm testing devel compiler |
21:40:06 | Xe | we need some kind of regression bot to run code fragments against multiple versions of the nim compiler |
21:40:41 | dom96 | You could probably write a quick script that does that :) |
21:40:51 | * | yglukhov quit (Remote host closed the connection) |
21:42:38 | Xe | dom96: it fails on devel too |
21:44:14 | PMunch | :S |
21:44:25 | dom96 | hrm, I have a hunch that the first character of a type ident has to be {a..z, A..Z} |
21:44:48 | PMunch | I think so yeah |
21:45:00 | Xe | huh |
21:45:05 | Xe | i guess that would make sense |
21:45:21 | Xe | but the spec would be wrong |
21:45:23 | PMunch | That should of course throw an error much earlier |
21:45:29 | Araq | no the problem is that Unicode chars are also operators |
21:45:42 | Araq | so :U is parsed a single token |
21:45:45 | Araq | : U works |
21:45:50 | Araq | nothing to do with types |
21:45:53 | PMunch | Aah |
21:46:01 | Araq | and no bug here, maybe the spec could be clearer |
21:46:07 | Xe | oh |
21:46:56 | Araq | and eventually we should use more of unicode's rules. |
21:47:32 | Araq | like range 0xffe4 .. 0xfff4 are "operators", the others part of identifiers |
21:48:43 | dom96 | or we could just enforce the space because it irks me when people omit it :P |
21:49:02 | Araq | oh yeah |
21:49:05 | Araq | :D |
21:49:09 | Araq | me too |
21:49:30 | * | Sentreen quit (Ping timeout: 240 seconds) |
21:49:39 | dom96 | In general we just need nimfmt ala gofmt |
21:49:42 | Xe | ^ |
21:49:52 | Xe | so much ^ |
21:49:57 | dom96 | and make sure it works by running it on every source file |
21:54:06 | Araq | meh, much work, little gain |
21:54:44 | Araq | just make my editor render the stuff the way I like it |
21:54:50 | dom96 | aww, I was hoping it wouldn't be that much work. |
21:55:01 | dom96 | Why is it so much work? |
21:55:15 | FromGitter | <ephja> ```let ct {.compileTime.} = 1 ⏎ let a = ct``` ⏎ ⏎ Araq: where should I copy nodes from 'ct' to 'a'? [https://gitter.im/nim-lang/Nim?at=5956c8c3c101bc4e3a3b12e6] |
21:55:17 | Araq | mostly because it needs MUCH testing |
21:55:48 | Xe | is there a common concept defined for things that have the `$` operator defined? |
21:55:49 | dom96 | Well we have plenty of test data. |
21:55:58 | dom96 | It's just a matter of reviewing everything carefully |
21:56:10 | * | Kingsquee joined #nim |
21:56:11 | Araq | no, you need to ensure it keeps working |
21:56:23 | Araq | it's a matter of writing a large test suite |
21:56:42 | dom96 | I'm sure it's doable |
21:56:45 | Araq | or at least a test suite that covers everything of Nim's largish grammar |
21:57:02 | dom96 | People expect this tool nowadays |
21:57:09 | dom96 | Pretty sure Go, Rust and D have it. |
21:57:19 | Xe | go's gofmt saves me a lot of time |
21:57:26 | Xe | it has made me kinda lazy though |
21:57:29 | Araq | I expect my editor to do it and I keep getting disappointed |
21:57:48 | Xe | i will just type out things like `if err != nil { return nil, err }` and it fixes the formatting for me |
21:58:20 | FromGitter | <JacobMG55> (newb Q): How would I call a proc pointer returned by a c/vulkan function? My setup: ⏎ ⏎ example.nim: ⏎ ⏎ ```code paste, see link``` ... [https://gitter.im/nim-lang/Nim?at=5956c97c329651f46e3e5867] |
21:58:25 | dom96 | I wonder how many times you have to type that when writing Go :P |
21:58:37 | Xe | way too fucking maney |
21:58:40 | Xe | many* |
21:58:40 | FromGitter | <ephja> 3 times |
21:58:45 | Araq | for every function call. |
21:58:58 | Araq | with the nice benefit that you cannot nest function calls at all. |
21:59:10 | dom96 | whaaatttt |
21:59:13 | Araq | the ultimate language feature that doesn't fucking compose at all |
21:59:15 | dom96 | How do people find this usable? |
21:59:24 | Xe | dom96: snippet managers tbh |
21:59:54 | Xe | there's a reason i suggest nim to people |
22:00:06 | Xe | go just has a critical mass of existing libraries |
22:01:27 | * | vlad1777d quit (Ping timeout: 255 seconds) |
22:02:03 | Araq | at least Rust has macros and monads to deal with the error handling :-) |
22:02:19 | * | nsf quit (Quit: WeeChat 1.7.1) |
22:02:20 | Araq | Jacob: PFN_vkVoidFunction* = proc () {.cdecl.} |
22:02:36 | Araq | all your proc types need .cdecl for Vulkan (educated guess) |
22:02:46 | * | Sentreen joined #nim |
22:03:03 | * | couven92 quit (Read error: Connection reset by peer) |
22:03:19 | FromGitter | <JacobMG55> Araq: Thanks I'll try that |
22:03:25 | dom96 | There is something to the simplicity of it all though. |
22:05:08 | dom96 | It's incredibly frustrating how subjective these things are. |
22:06:09 | Araq | no, bloating your codebase by a factor of 2 is not subjective, it's an objective misdesign. and Go is hype based programming like node.js |
22:07:25 | Araq | there is also a difference between "simple specification" and "simple to use" and "simple to implement" |
22:07:41 | Araq | simplicity is an overloaded term. |
22:09:20 | * | yglukhov joined #nim |
22:11:17 | Araq | it's also time dependent. when C++ came along, it was complex because of overloading and exception handling. then Java came along, got these too and was declared a small and simple language. |
22:11:36 | Araq | because by then programmers learned about these features. |
22:12:45 | Araq | when Windows XP was released, it was a bloated OS. now it isn't. |
22:13:16 | dom96 | hrm, true |
22:14:17 | dom96 | I also didn't realise it, but in Go non-exported types/funcs are visible in the whole package, not just the file they are in. |
22:15:59 | FromGitter | <Varriount> Araq: People seem to think Python is simple. Then they learn about the object model (things like descriptors, magic methods, metaclasses, etc) |
22:16:07 | FromGitter | <ephja> kind: nkSym, flags: {nfSem}. how do I know if it's a compile time var? |
22:16:23 | Araq | ephja, uh mmm sfCompileTime iirc |
22:16:36 | Araq | in n.sym.flags |
22:17:14 | FromGitter | <ephja> dammit. of course I don't check the sym field |
22:17:40 | Araq | varriount: yeah, and a Python without default parameters would be even simpler. it would also be a worse language. |
22:18:09 | Araq | features are not bad, bad features are bad. ;-) |
22:18:42 | Araq | also some features interact with everything, some features stay isolated |
22:18:56 | FromGitter | <ephja> there it is. thanks |
22:19:41 | FromGitter | <ephja> it takes time to navigate through this jungle. patience is a virtue |
22:21:11 | shashlick | Araq, varriount: regarding issue #6031, I am now using alloc/dealloc and even now, I eventually run out of memory. If I go through a lot of files, eventually it runs out |
22:21:12 | FromGitter | <Varriount> Araq: Ugh, Python without default parameters, varargs, and kwargs sounds horrible. |
22:21:30 | shashlick | funny thing is that my laptop has 32GB of RAM and even then Nim runs out around 1.6GB |
22:21:33 | FromGitter | <Varriount> shashlick: Have you tried memory mapped files? |
22:21:54 | shashlick | no I didn't yet do that since it was mostly working |
22:22:08 | FromGitter | <Varriount> Memory map + hashData |
22:22:36 | FromGitter | <Varriount> Araq: Btw, I like the simplicity of the hash module. |
22:22:49 | shashlick | i'm using fread() + hashData() and it's working great |
22:23:12 | FromGitter | <Varriount> shashlick: But you're still running out of memory? |
22:23:13 | Araq | shashlick ok, looking into it now |
22:24:45 | shashlick | here's a link to my main code: https://pastebin.com/G03nbHB7 |
22:25:21 | shashlick | general feedback appreciated, still relatively new to Nim, not sure how much longer I can claim that though |
22:28:06 | PMunch | Araq, while you're here: http://ix.io/y8U |
22:28:39 | PMunch | Does {.this: self.} not work with generics? |
22:28:51 | Araq | PMunch: no, known issue. and hard to solve. |
22:29:03 | Araq | I think we should remove .this again :-) |
22:29:19 | * | FromGitter * Varriount never liked .this |
22:30:04 | FromGitter | <ephja> I often use short names like 'o' |
22:30:53 | PMunch | But it's so practical :( |
22:31:09 | FromGitter | <ephja> transformVarSection shouldn't be far from the destination :-) |
22:31:32 | FromGitter | <Varriount> ephja: Hopefully not in the compiler code. |
22:32:08 | FromGitter | <ephja> it doesn't end up there. I dunno if it should |
22:32:47 | FromGitter | <Varriount> ephja: I mean, I hope you don't use short names in the compiler code. |
22:32:49 | PMunch | Oh well, I'm off |
22:33:02 | PMunch | Hope this: self isn't gone when I get back :P |
22:33:09 | * | PMunch quit (Quit: leaving) |
22:33:28 | FromGitter | <ephja> @Varriount doesn't our BDFL? :p |
22:33:44 | FromGitter | <Varriount> ephja: Yes, but I can't boss him around. |
22:34:08 | FromGitter | <ephja> I see |
22:35:03 | Araq | I don't use 'o', relax |
22:35:42 | Araq | I only use i, j, k for loop vars, n for PNode, t for PType, it for PNode and c for Context |
22:36:16 | Araq | and 'sem' for "semantic checking", "gen" for "generate code" and that's pretty much it. now sue me :P |
22:37:22 | FromGitter | <ephja> nimsuggest at 2gb |
22:37:44 | Araq | yeah, nimsuggest still leaks, not sure why |
22:37:55 | FromGitter | <ephja> oh |
22:39:09 | Araq | well I have some theories |
22:42:10 | Araq | shashlick memory occupied 6_705_152 freed 1_158_225_920 total 1_164_931_072 |
22:42:33 | Araq | the GC works, only 6MB occupied. |
22:42:49 | Araq | but omg the allocator doesn't use 1GB of free space |
22:43:00 | Araq | so it keeps leaking. |
22:43:16 | Araq | and you alloc/dealloc uses the same allocator, so you get the same problems -.- |
22:43:38 | FromGitter | <Varriount> Is this Nim's built-in allocator? |
22:43:50 | FromGitter | <ephja> I'll just apply the Rasmus Lerdorf technique |
22:44:10 | FromGitter | <ephja> restart at regular intervals and all will be well |
22:44:53 | Araq | varriount: yes. |
22:45:54 | FromGitter | <ephja> I see no references to sfCompileTime in transf or semfold for example. makes sense |
22:49:09 | FromGitter | <ephja> some applications use a ton of modules but it still takes some time to process each module. I wonder if that can be made faster |
22:50:09 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
22:52:04 | shashlick | Araq: I'm not quite sure I understand :P |
22:53:49 | Araq | please use a hashing algorithm that can stream through the file with a fixed sized buffer |
22:54:13 | Araq | and all problems are gone, GC'ed code or not makes no difference otherwise |
22:54:34 | Araq | you're guaranteed to trigger the worst case with the allocator with your program otherwise |
22:54:55 | * | chemist69 quit (Ping timeout: 276 seconds) |
22:55:32 | Araq | (still trying to fix it, but I'm not really sure it can be fixed. large files eventually get processed and require large buffers) |
22:57:00 | * | chemist69 joined #nim |
22:58:31 | shashlick | but with so much RAM free why does it exit at 1.6GB? |
23:02:01 | Araq | for some reason it's unable to use the free RAM |
23:03:18 | Araq | alternatively, try to import malloc/free from C and see if it behaves better |
23:03:52 | shashlick | I can do that or perhaps use Varriount's method of using mmap'd files |
23:05:46 | FromGitter | <ephja> 'sfCompileTime sym -> const' perhaps |
23:06:41 | * | shashlick_ joined #nim |
23:06:47 | Araq | ephja, the C codegen should just reject this code, I think |
23:10:07 | * | shashlick quit (Ping timeout: 268 seconds) |
23:10:14 | * | shashlick_ is now known as shashlick |
23:13:53 | FromGitter | <ephja> Araq: Why? It is possible to use such a variable at run time by introducing a bridge in the form of a const, but the issue I ran into was that the compile time variable could be written to after introducing the const, which might result in ordering issues. Is it perhaps something else that should be fixed instead? |
23:14:51 | FromGitter | <ephja> wait. I hope it doesn't matter whether or not you use a const |
23:15:38 | Araq | well otherwise just make the codegen emit sfCompileTime vars |
23:15:48 | Araq | problem solved? |
23:22:35 | FromGitter | <ephja> probably :D |
23:34:47 | * | gokr quit (Ping timeout: 268 seconds) |
23:35:09 | dom96 | oooh, Nim mentioned in this article https://redditblog.com/2017/06/30/why-we-chose-typescript/ :) |
23:38:44 | * | madmalik quit (Quit: Connection closed for inactivity) |
23:40:17 | * | Sentreen quit (Ping timeout: 248 seconds) |
23:48:23 | FromGitter | <Varriount> shashlick: :ghost: |
23:48:51 | FromGitter | <Varriount> |
23:53:52 | * | Sentreen joined #nim |