<< 30-06-2017 >>

00:05:23Araqthere 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:50PMunchAraq?
00:57:43AraqI said "you are right"
00:59:40PMunchAh, so there is no way..
00:59:43PMunchThat's unfortunate
01:00:17PMunchI could image something like & having a convert[string, `$`] for example
01:01:08ftsfPMunch, can you put the proc and a converter in a block?
01:01:50PMunchWait, that works?
01:01:59PMunchAs in "block:"?
01:02:01ftsfi haven't tried
01:02:05PMunchAnd then exported?
01:04:10PMunchOh well, I'm off to bed
01:04:11*PMunch quit (Quit: leaving)
01:10:52FromGitter<barcharcraz> update on msvc boot issues
01:11:52FromGitter<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:00def-pri-pubAraq: sorry for taking a week to reply on that issue on Karax regarding the `#` symbol
02:19:20*pilne quit (Quit: Quitting!)
02:33:01ftsfshmup, Maximum resident set size (kbytes): 52572
02:57:43*libman quit (Quit: Connection closed for inactivity)
03:21:04*n0xff joined #nim
03:27:56shashlickAraq, 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:56shashlickthanks 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:09FromGitter<Varriount> shashlick: Python doesn't have to deal with pointers on the stack.
03:33:29shashlickdoes readFile() use pointers internally?
03:33:54*n0xff left #nim (#nim)
03:34:50FromGitter<Varriount> shashlick: I don't think the issue is with readfile, it's with your recursion.
03:35:20FromGitter<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:22FromGitter<Varriount> The garbage collector runs on function returns too, if I recall correctly.
03:39:33FromGitter<Varriount> Python uses a standard reference counting scheme, while Nim uses a deferred reference counting scheme.
03:39:58shashlickbut i don't have any pointers in my readFile() version
03:40:26shashlickin 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:54FromGitter<Varriount> yes, but you have pointers to the file contents?
03:41:17FromGitter<Varriount> shashlick: Do you have a version of the old code I could look at?
03:42:13*sz0 joined #nim
03:49:21shashlickVarriount: 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:58FromGitter<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:33shashlickbut doread() returns without returning p and that stack should no longer be in scope right
03:55:52*chemist69 joined #nim
03:57:27FromGitter<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:49FromGitter<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:15FromGitter<Varriount> shashlick: You there?
04:45:11shashlicksorry, ya it only causes problems if you point it to a directory with large files, like videos
04:45:47shashlicknim manages fine with many small files
04:47:02FromGitter<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:44FromGitter<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:21Vladaryo
06:16:29Vladaroh, wrong channel
06:21:56*skrylar joined #nim
06:24:18skrylarmorning
06:31:28FromGitter<ephja> gm
06:46:03*v17d joined #nim
06:48:42*tankfeeder joined #nim
06:50:28*tankfeeder left #nim (#nim)
06:57:49FromGitter<Varriount> Night.
07:27:59*vlad1777d joined #nim
07:28:21*v17d quit (Ping timeout: 240 seconds)
07:34:34skrylarwell textsoap is neat.
07:34:44skrylarplaying around with it to see if it would make doing some of these nim bindings easier
07:47:23FromGitter<andreaferretti> @dom96 A colleague of mine also had trouble with nim 0.1.6
07:47:27FromGitter<andreaferretti> using choosenim
07:47:48FromGitter<andreaferretti> by the way, the reason for using 0.16 was again the fact that nimYAML borke on 0.17
07:48:27FromGitter<andreaferretti> I think the right way to go is to fecth csources with the same tag
07:49:37FromGitter<andreaferretti> (by the way, the solution was to use this (https://gist.github.com/andreaferretti/d40af6a276fb3275d97d0f9585d8197e) script of mine instead of choosenim)
07:50:23FromGitter<ephja> skrylar: will regex not do the job?
07:50:43skrylarephja yeah that's all textsoap does.
07:50:53skrylarit's just a nice gui for running them :b
07:51:37skrylari 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:35FromGitter<ephja> did you use macros?
07:55:51skrylari do
08:02:24FromGitter<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:19dave24Can I pass closures to C functions as callbacks?
09:18:05FromGitter<evacchi> hey guys, any plans or pointers to libs for something like cpp's std::atomic ?
09:18:50skrylarmy 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:37skrylaryou 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:23FromGitter<evacchi> (uh there's `atomics.nim`)
09:21:39dave24skrylar: 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:18skrylara 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:47FromGitter<ephja> rawProc (https://nim-lang.org/docs/system.html#rawProc,T) and rawEnv (https://nim-lang.org/docs/system.html#rawEnv,T) ?
09:22:52dom96|wandreaferretti: c sources aren't tagged on GitHub
09:23:00dom96|wThey are too large.
09:26:04dave24skrylar: I'm using IUP(http://webserver2.tecgraf.puc-rio.br/iup/), it does not have a context to pass around.
09:27:05FromGitter<andreaferretti> @dom96 https://github.com/nim-lang/csources/tree/v0.16.0
09:27:19FromGitter<andreaferretti> https://github.com/nim-lang/csources/tree/v0.17.0
09:27:38FromGitter<andreaferretti> and so on
09:28:23dom96|whah, TIL.
09:28:56dom96|wThat should solve the issue nicely
09:29:01*whimsical-frost joined #nim
09:29:15dom96|wBut I fear that the C sources repo's history may be truncated at some point.
09:30:03FromGitter<andreaferretti> well, one can decide when
09:30:15FromGitter<andreaferretti> for instance, choosenim only supports nim >= 0.16
09:30:33FromGitter<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:31gokrWas thinking of possibly writing a service (API, JSON, file serving) and contemplating Nim (Jester or Nawak).
10:15:08gokrNawak is based on Mongrel2 - so might be more "stable" on the actual HTTP parts?
10:16:25nivgokr: check out https://github.com/andreaferretti/rosencrantz
10:16:46enthus1astjester cannot byte range which is needet for streaming etc
10:18:38dom96|wYou should run Jester behind nginx anyway
10:18:42*krux02 joined #nim
10:18:46dom96|w(or another reverse proxy)
10:19:15enthus1astdom96|w: then the webserver has to distribute the fiels
10:19:17enthus1astfiles
10:19:45dom96|wbut yes, Jester needs some fixes for large file requests.
10:20:06enthus1astbut 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:22enthus1astso its not working :)
10:23:56*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
10:24:30enthus1astit looks like its not that much work to patch jester to also deliver byte ranges
10:25:27gokrHmmm, I wrote streaming of large files in Smalltalk years ago ;)
10:25:49gokrSo yeah, rosencrantz is also a contender I guess.
10:26:51gokrNawak 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:13gokrI just would like to NOT drop down to nodejs for this one.
10:28:09*PMunch joined #nim
10:28:13gokrBtw, running that jesterleak test with 5 concurrent tabs - it's up to 2Gb now but I think it has levelled out.
10:28:15FromGitter<andreaferretti> rosencrantz is mantained
10:28:21FromGitter<andreaferretti> but no guarantee
10:28:31gokrAny good hints on differences here?
10:28:45FromGitter<andreaferretti> I mean, for me it is mostly done, so I have no big plans
10:28:54FromGitter<andreaferretti> and I make sure that it keeps working
10:29:13FromGitter<andreaferretti> but I cannot guarantee anything if you find something goes wrong
10:30:00gokrOf course
10:31:47gokrI am curious on why Rosencrantz was made. Nawak I suppose wanted to ride on Mongrel2, so that's logical.
10:32:26FromGitter<andreaferretti> the reason is that I wanted something composable
10:32:43FromGitter<andreaferretti> I like very much the way routes in spray/akka http can be composed
10:32:52FromGitter<andreaferretti> and are first class entities on their own
10:33:15FromGitter<andreaferretti> you can - say - make a handler that checks/adds CORS headers
10:33:23FromGitter<andreaferretti> and wrap it around another route
10:33:34FromGitter<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:09FromGitter<andreaferretti> moreover jester has some strange defaults
10:34:19FromGitter<andreaferretti> like text/html content type
10:34:47FromGitter<andreaferretti> and it mixes POST form parameters with querystring parameters
10:34:57FromGitter<andreaferretti> I am not sure it handles CORS
10:35:18FromGitter<andreaferretti> you cannot split the route definition between files
10:35:19FromGitter<andreaferretti> and so on
10:35:38*gokr lunch time, but sounds good
10:37:06enthus1astdom96|w andreaferretti one thing is websocket support
10:37:31enthus1astatm i'm useing jester + niv/websocket but on different ports
10:38:26enthus1astthink it was just me but both behaved strangely when used in conjunction with niv/websocket
10:40:36enthus1asti 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:55enthus1asthttp+ws
11:15:28*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
11:20:28PMunchWhy is it that Apple products always announces themselves?
11:20:37PMunch"* dom96|w has quit (Quit: My Mac has gone to sleep. ZZZzzz…)"
11:20:46PMunch"Sent from my iPhone"
11:23:40euantorTextual 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:06euantor"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:29PMunchOh yeah, I realise that. But it's still interesting to see how even the third-party developers add it in
11:24:36couven92euantor, Yeah, me too... Or, I rather write down my own footer :P
11:24:58euantorI have a footer for work, but I've never had a personal email footer
11:25:28PMunchI 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:41couven92PMunch, the default footer in the Windows Mail app, or the default Mail app on HTC also add "Sent from {app}"
11:26:10couven92PMunch, my mail apps all append the footer when creating a new mail, not when sending...
11:26:19PMunchYeah, I've seen "Sent from my Samsung Galaxy" as well
11:26:27PMunchBut I think iPhone were the first to do it
11:27:28couven92The 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:46FromGitter<andreaferretti> @enthusiast yes, it would be nice to add ws support for rosencrantz
11:37:00FromGitter<andreaferretti> in fact I had plans to make it a separate project called guildenstern
11:37:02FromGitter<andreaferretti> :-)
11:37:14FromGitter<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:02couven92How do I allocate a cstring to be filled by a C API?
12:07:51*gokr quit (Ping timeout: 240 seconds)
12:14:24FromGitter<andreaferretti> alloc?
12:14:45euantorcouven92: You can use `alloc` or you can use `newString()`
12:15:22couven92euantor, okay... I though these were for string not cstring?
12:15:45euantorThere'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:46dom96|waddr 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:54FromGitter<Varriount> dom96: Actually, one can just use cstring(stringValue)
13:27:37dom96|whrm, 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:45FromGitter<ephja> didn't it copy?
13:47:08FromGitter<ephja> I guess not
14:02:26FromGitter<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:37PMunch"SIGFPE: Arithmetic error."
14:17:48PMunchTrying to do a `div` between two uint32s
14:18:08PMunchAh, /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:52couven92I 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:23couven92(because Android doesn't have /tmp)
14:36:55AraqI would simply throw away temp-path usage in nimble
14:37:28couven92Araq, just for android or in general?
14:37:30Araqand maybe mark the os API as .deprecated, causes more problems than it solves. it's also a notorious security problem
14:37:48Araqin general.
14:38:15couven92Araq, should I do that for the Android PR? Or do you want another PR just for that?
14:38:27couven92Ah, probably a new PR just for that is better...
14:38:41Araqno, you shouldn't do anything.
14:38:50Araqthat's just my opinion.
14:39:06Araqit would require a real discussion before doing that
14:40:18couven92Hmm... okay...
14:41:19couven92what's the appropiate function to call to do a `free` C-stdlib call?
14:42:26FromGitter<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:32FromGitter<zacharycarter> \o/
14:50:42flyxwell 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:10FromGitter<andreaferretti> @flyx great to know!
15:00:49*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
15:02:23Araqflyx: yay!
15:02:47Araqthanks!
15:03:05FromGitter<ephja> trying to fix the codegen bug. here we go!
15:12:43FromGitter<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:21Araqephja: not as far as I know
15:22:28couven92Araq, in nim.cfg `define:"tempDir:$HOME/../tmp"` does not expand. Howto?
15:37:41*xet7 joined #nim
15:43:22dom96flyx: 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:01FromGitter<Varriount> I really wish Python had a templating engine like Nim does.
16:19:44*svara joined #nim
16:20:56FromGitter<ephja> what's wrong with the existing template engines?
16:30:09demi-flyx: yay! thank you
16:36:01*xet7 quit (Quit: Leaving)
16:38:20FromGitter<Varriount> ephja: They don't support full python syntax.
16:39:41federico3andreaferretti: 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:10couven92Uhm... 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:24Araqno, then let it be
17:37:27*krux02 quit (Ping timeout: 260 seconds)
17:37:54couven92What if I manage to hack all I need from jquery and bootstrap into the HTML? :P
17:41:18AraqI don't write JS, I generate JS.
17:41:39Araqand you need to do the same to be accepted ;-)
17:42:27AraqI 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:26FromGitter<ephja> CSS is a little nicer now with flexbox and other 21st century mechanisms
17:51:38shashlickany chance fixing the CTRL-C crash in Windows? it's so annoying when having to stop execution
17:53:10FromGitter<ephja> going through the compiler code is actually starting to get interesting
17:57:12FromGitter<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:34FromGitter<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:32FromGitter<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:34FromGitter<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:10PMunchUhm, doesn't {.this: self.} work with generics?
18:36:56*libman joined #nim
18:40:45PMunchhttp://ix.io/y8U
18:40:49PMunchStrange
18:41:09PMunchUndeclared identifier "mintest" on line 9
18:41:27*Jehan_ joined #nim
18:41:41PMunchThe initialisation on line 11 works fine
18:42:51PMunchAh, both of them are undeclared. min was just assumed to be proc min(x,y: int)
18:46:10PMunchRemove the generic and change mintest to a type and everything works fine
18:46:29shashlickdoes moveFile() work on directories too? don't see an equivalent for directories
18:47:33shashlicknever mind, worked great :)
18:49:39*Jesin joined #nim
18:52:13FromGitter<TiberiumN> https://nimtestapp.azurewebsites.net/ ⏎ ⏎ The code: ⏎ ⏎ ```code paste, see link``` ... [https://gitter.im/nim-lang/Nim?at=59569ddd4bcd78af5661970c]
18:54:12FromGitter<TiberiumN> btw any student can host a simple web app for free
18:54:19FromGitter<TiberiumN> using DreamSpark subscription
18:54:30FromGitter<TiberiumN> but I think the performance wouldn't be so good :)
19:01:35*sz0 joined #nim
19:01:35FromGitter<RSDuck> What exactly is the stack gc? I can't find any real documentation about it
19:03:23libmanSpeaking of GC, could someone answer https://www.reddit.com/r/programming/comments/6jyk34/nim_intro_talk_a_young_systems_programming/djjbu7k/
19:04:23libmanIt'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:50FromGitter<TiberiumN> as I tested: stdlib works without GC, but memory is not freed :)
19:04:56FromGitter<TiberiumN> so it's like memory leak
19:05:20FromGitter<TiberiumN> and nim will show warnings for every use of gc (if you're compiling without it)
19:05:33FromGitter<TiberiumN> but ask Araq or dom96 for better answer
19:05:48FromGitter<RSDuck> BTW shouldn't the stack gc be a (semi-)replacement for gc:none?
19:11:13*aerx joined #nim
19:14:24libmanI don't mean answer here, I mean on Reddit. ;)
19:15:55FromGitter<RSDuck> I don't have reddit and it doesn't answer the question either
19:17:02PMunchRSDuck, I think he was talking to TiberiumN
19:17:11FromGitter<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:39Jehan_As far as I know, --gc:stack is about region based memory management: https://en.wikipedia.org/wiki/Region-based_memory_management
19:51:54Jehan_But I haven't actually looked it, just going by what was said elsewhere.
19:53:35Jehan_*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:16FromGitter<indy9000_twitter> how to return two seq of float from a proc ? what should the signature be?
20:24:02FromGitter<indy9000_twitter> `proc blah():({float},{float}) = ` ?
20:25:09FromGitter<ephja> (seq[float], seq[float])?
20:25:30FromGitter<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:44Xewhat characters does nim allow in type names?
21:28:06FromGitter<RSDuck> Xe: see here: https://nim-lang.org/docs/manual.html#lexical-analysis-identifiers-keywords
21:31:27FromGitter<RSDuck> Jehan_: that makes sense, thanks
21:33:10*Matthias247 quit (Read error: Connection reset by peer)
21:33:43Xehttps://gist.github.com/Xe/629589bf46eb45e2e8b4e7fdacfd5c6d
21:34:04Xeshould this code compile?
21:35:20dom96Xe: hah, I love it.
21:35:37dom96Looks like a bug to me :)
21:35:53Xei hope this ends up in the compiler test suite
21:38:04dom96Needs more 
21:38:27Xedom96: https://github.com/nim-lang/Nim/issues/6040
21:39:10Xedom96: thank you for making choosenim
21:39:12Xethank you so much
21:39:20dom96:D
21:39:36Xei'm testing devel compiler
21:40:06Xewe need some kind of regression bot to run code fragments against multiple versions of the nim compiler
21:40:41dom96You could probably write a quick script that does that :)
21:40:51*yglukhov quit (Remote host closed the connection)
21:42:38Xedom96: it fails on devel too
21:44:14PMunch:S
21:44:25dom96hrm, I have a hunch that the first character of a type ident has to be {a..z, A..Z}
21:44:48PMunchI think so yeah
21:45:00Xehuh
21:45:05Xei guess that would make sense
21:45:21Xebut the spec would be wrong
21:45:23PMunchThat should of course throw an error much earlier
21:45:29Araqno the problem is that Unicode chars are also operators
21:45:42Araqso :U is parsed a single token
21:45:45Araq: U works
21:45:50Araqnothing to do with types
21:45:53PMunchAah
21:46:01Araqand no bug here, maybe the spec could be clearer
21:46:07Xeoh
21:46:56Araqand eventually we should use more of unicode's rules.
21:47:32Araqlike range 0xffe4 .. 0xfff4 are "operators", the others part of identifiers
21:48:43dom96or we could just enforce the space because it irks me when people omit it :P
21:49:02Araqoh yeah
21:49:05Araq:D
21:49:09Araqme too
21:49:30*Sentreen quit (Ping timeout: 240 seconds)
21:49:39dom96In general we just need nimfmt ala gofmt
21:49:42Xe^
21:49:52Xeso much ^
21:49:57dom96and make sure it works by running it on every source file
21:54:06Araqmeh, much work, little gain
21:54:44Araqjust make my editor render the stuff the way I like it
21:54:50dom96aww, I was hoping it wouldn't be that much work.
21:55:01dom96Why is it so much work?
21:55:15FromGitter<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:17Araqmostly because it needs MUCH testing
21:55:48Xeis there a common concept defined for things that have the `$` operator defined?
21:55:49dom96Well we have plenty of test data.
21:55:58dom96It's just a matter of reviewing everything carefully
21:56:10*Kingsquee joined #nim
21:56:11Araqno, you need to ensure it keeps working
21:56:23Araqit's a matter of writing a large test suite
21:56:42dom96I'm sure it's doable
21:56:45Araqor at least a test suite that covers everything of Nim's largish grammar
21:57:02dom96People expect this tool nowadays
21:57:09dom96Pretty sure Go, Rust and D have it.
21:57:19Xego's gofmt saves me a lot of time
21:57:26Xeit has made me kinda lazy though
21:57:29AraqI expect my editor to do it and I keep getting disappointed
21:57:48Xei will just type out things like `if err != nil { return nil, err }` and it fixes the formatting for me
21:58:20FromGitter<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:25dom96I wonder how many times you have to type that when writing Go :P
21:58:37Xeway too fucking maney
21:58:40Xemany*
21:58:40FromGitter<ephja> 3 times
21:58:45Araqfor every function call.
21:58:58Araqwith the nice benefit that you cannot nest function calls at all.
21:59:10dom96whaaatttt
21:59:13Araqthe ultimate language feature that doesn't fucking compose at all
21:59:15dom96How do people find this usable?
21:59:24Xedom96: snippet managers tbh
21:59:54Xethere's a reason i suggest nim to people
22:00:06Xego just has a critical mass of existing libraries
22:01:27*vlad1777d quit (Ping timeout: 255 seconds)
22:02:03Araqat least Rust has macros and monads to deal with the error handling :-)
22:02:19*nsf quit (Quit: WeeChat 1.7.1)
22:02:20AraqJacob: PFN_vkVoidFunction* = proc () {.cdecl.}
22:02:36Araqall 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:19FromGitter<JacobMG55> Araq: Thanks I'll try that
22:03:25dom96There is something to the simplicity of it all though.
22:05:08dom96It's incredibly frustrating how subjective these things are.
22:06:09Araqno, 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:25Araqthere is also a difference between "simple specification" and "simple to use" and "simple to implement"
22:07:41Araqsimplicity is an overloaded term.
22:09:20*yglukhov joined #nim
22:11:17Araqit'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:36Araqbecause by then programmers learned about these features.
22:12:45Araqwhen Windows XP was released, it was a bloated OS. now it isn't.
22:13:16dom96hrm, true
22:14:17dom96I 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:59FromGitter<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:07FromGitter<ephja> kind: nkSym, flags: {nfSem}. how do I know if it's a compile time var?
22:16:23Araqephja, uh mmm sfCompileTime iirc
22:16:36Araqin n.sym.flags
22:17:14FromGitter<ephja> dammit. of course I don't check the sym field
22:17:40Araqvarriount: yeah, and a Python without default parameters would be even simpler. it would also be a worse language.
22:18:09Araqfeatures are not bad, bad features are bad. ;-)
22:18:42Araqalso some features interact with everything, some features stay isolated
22:18:56FromGitter<ephja> there it is. thanks
22:19:41FromGitter<ephja> it takes time to navigate through this jungle. patience is a virtue
22:21:11shashlickAraq, 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:12FromGitter<Varriount> Araq: Ugh, Python without default parameters, varargs, and kwargs sounds horrible.
22:21:30shashlickfunny thing is that my laptop has 32GB of RAM and even then Nim runs out around 1.6GB
22:21:33FromGitter<Varriount> shashlick: Have you tried memory mapped files?
22:21:54shashlickno I didn't yet do that since it was mostly working
22:22:08FromGitter<Varriount> Memory map + hashData
22:22:36FromGitter<Varriount> Araq: Btw, I like the simplicity of the hash module.
22:22:49shashlicki'm using fread() + hashData() and it's working great
22:23:12FromGitter<Varriount> shashlick: But you're still running out of memory?
22:23:13Araqshashlick ok, looking into it now
22:24:45shashlickhere's a link to my main code: https://pastebin.com/G03nbHB7
22:25:21shashlickgeneral feedback appreciated, still relatively new to Nim, not sure how much longer I can claim that though
22:28:06PMunchAraq, while you're here: http://ix.io/y8U
22:28:39PMunchDoes {.this: self.} not work with generics?
22:28:51AraqPMunch: no, known issue. and hard to solve.
22:29:03AraqI think we should remove .this again :-)
22:29:19*FromGitter * Varriount never liked .this
22:30:04FromGitter<ephja> I often use short names like 'o'
22:30:53PMunchBut it's so practical :(
22:31:09FromGitter<ephja> transformVarSection shouldn't be far from the destination :-)
22:31:32FromGitter<Varriount> ephja: Hopefully not in the compiler code.
22:32:08FromGitter<ephja> it doesn't end up there. I dunno if it should
22:32:47FromGitter<Varriount> ephja: I mean, I hope you don't use short names in the compiler code.
22:32:49PMunchOh well, I'm off
22:33:02PMunchHope this: self isn't gone when I get back :P
22:33:09*PMunch quit (Quit: leaving)
22:33:28FromGitter<ephja> @Varriount doesn't our BDFL? :p
22:33:44FromGitter<Varriount> ephja: Yes, but I can't boss him around.
22:34:08FromGitter<ephja> I see
22:35:03AraqI don't use 'o', relax
22:35:42AraqI only use i, j, k for loop vars, n for PNode, t for PType, it for PNode and c for Context
22:36:16Araqand 'sem' for "semantic checking", "gen" for "generate code" and that's pretty much it. now sue me :P
22:37:22FromGitter<ephja> nimsuggest at 2gb
22:37:44Araqyeah, nimsuggest still leaks, not sure why
22:37:55FromGitter<ephja> oh
22:39:09Araqwell I have some theories
22:42:10Araqshashlick memory occupied 6_705_152 freed 1_158_225_920 total 1_164_931_072
22:42:33Araqthe GC works, only 6MB occupied.
22:42:49Araqbut omg the allocator doesn't use 1GB of free space
22:43:00Araqso it keeps leaking.
22:43:16Araqand you alloc/dealloc uses the same allocator, so you get the same problems -.-
22:43:38FromGitter<Varriount> Is this Nim's built-in allocator?
22:43:50FromGitter<ephja> I'll just apply the Rasmus Lerdorf technique
22:44:10FromGitter<ephja> restart at regular intervals and all will be well
22:44:53Araqvarriount: yes.
22:45:54FromGitter<ephja> I see no references to sfCompileTime in transf or semfold for example. makes sense
22:49:09FromGitter<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:04shashlickAraq: I'm not quite sure I understand :P
22:53:49Araqplease use a hashing algorithm that can stream through the file with a fixed sized buffer
22:54:13Araqand all problems are gone, GC'ed code or not makes no difference otherwise
22:54:34Araqyou'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:32Araq(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:31shashlickbut with so much RAM free why does it exit at 1.6GB?
23:02:01Araqfor some reason it's unable to use the free RAM
23:03:18Araqalternatively, try to import malloc/free from C and see if it behaves better
23:03:52shashlickI can do that or perhaps use Varriount's method of using mmap'd files
23:05:46FromGitter<ephja> 'sfCompileTime sym -> const' perhaps
23:06:41*shashlick_ joined #nim
23:06:47Araqephja, 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:53FromGitter<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:51FromGitter<ephja> wait. I hope it doesn't matter whether or not you use a const
23:15:38Araqwell otherwise just make the codegen emit sfCompileTime vars
23:15:48Araqproblem solved?
23:22:35FromGitter<ephja> probably :D
23:34:47*gokr quit (Ping timeout: 268 seconds)
23:35:09dom96oooh, 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:23FromGitter<Varriount> shashlick: :ghost:
23:48:51FromGitter<Varriount>
23:53:52*Sentreen joined #nim