<< 22-04-2015 >>

00:00:01a5iI am functioning correctly thank you very much :)
00:00:26Araqonionhammer: well it ran and ran and ran and always produced output
00:00:50onionhammerah good
00:01:11onionhammerwhat os?
00:15:49Araqwin
00:16:48a5idows
00:17:24reactormonkso I put an echo("foobar") into suggestWriteln - and it isn't called by def tests/caas/main.nim:5:18 - any ideas?
00:17:54reactormonkany other code paths that that output nimsuggest stuff?
00:21:05reactormonkhuh. Isn't ln supposed to hardlink.
00:30:31reactormonkany neat way to parse a string into an enum without writing all the cases out?
00:32:15*Kingsquee joined #nim
01:04:08*Senketsu quit (Ping timeout: 245 seconds)
01:06:51*Senketsu joined #nim
01:13:36fowlmouthreactormonk, strutils.parseEnum
01:13:43reactormonkfowlmouth, ah fuck. Thanks.
01:14:23*Demon_Fox quit (Ping timeout: 250 seconds)
01:25:42onionhammeraraq fyi i just tested it and reproduced it pretty quickly
01:27:19onionhammeraraq actually it's slightly different, when i went further down my file the same types weren't getting responses
01:27:34onionhammeri.e. Future[JsonNode] at line 20 works but not like 50
01:29:49*mrkishi joined #nim
01:36:43*mrkishi quit ()
01:44:56*filwit joined #nim
01:47:05*nande joined #nim
01:53:03*gsingh93 joined #nim
01:58:32*egrep quit (Quit: Restarting weechat for mousey reasons.)
01:59:10*egrep joined #nim
02:08:37*a5i quit ()
02:11:45reactormonkpigmej, put some more stuff in. put epc code at discard, use suggestionResultHook
02:11:58*a5i joined #nim
02:12:11reactormonkalso don't forget writelnHook for for messages/errors
02:15:23*filwit quit (Read error: Connection reset by peer)
02:33:09a5i.exec var i; echo i
02:38:25*darkf joined #nim
02:46:47*antranigv joined #nim
03:04:29*MagusOTB joined #nim
03:04:59MagusOTBhow would I do something like the ##paste## operator from the C preprocessor?
03:05:20MagusOTBI'm trying to easily create a bunch of types that are enums that are subranges of GLenum
03:05:56MagusOTB(not ranges, subsets)
03:14:25*nande quit (Remote host closed the connection)
03:17:30*nande joined #nim
03:37:44*TheManiac quit (Ping timeout: 245 seconds)
03:38:01*TheManiac joined #nim
03:55:41*mtj_ joined #nim
03:56:02*mtj_ quit (Remote host closed the connection)
03:56:41*mtj_ joined #nim
03:57:03*mtj quit (Ping timeout: 244 seconds)
03:58:56*renesac joined #nim
04:11:37*johnsoft quit (Ping timeout: 250 seconds)
04:12:16*johnsoft joined #nim
04:15:14*MagusOTB quit (Remote host closed the connection)
04:21:45*saml_ quit (Remote host closed the connection)
04:53:19*a5i quit (Quit: Connection closed for inactivity)
05:00:17*endragor joined #nim
05:43:09*gsingh93 quit (Ping timeout: 276 seconds)
05:57:59*HakanD___ joined #nim
06:15:14HakanD___gmorning nim
06:15:42*HakanD___ is now known as HakanD
06:26:10*pregressive quit (Remote host closed the connection)
06:37:42*HakanD_ joined #nim
06:37:42*HakanD quit (Read error: Connection reset by peer)
06:40:19*HakanD__ joined #nim
06:43:36*HakanD_ quit (Ping timeout: 240 seconds)
06:45:35*nande quit (Remote host closed the connection)
06:49:52*cmk_zzz_ joined #nim
06:51:58*ingsoc joined #nim
06:57:38*Ven joined #nim
07:01:48*BlaXpirit joined #nim
07:09:55*endragor_ joined #nim
07:12:36*endragor quit (Ping timeout: 256 seconds)
07:26:46*endragor_ quit (Remote host closed the connection)
07:34:07gokrGood morning!
07:34:26dtscodegokr!
07:34:33dtscodegokr, gokr gokr !!!!
07:34:48dtscodeoh wait i thought this was -offtopic
07:35:54*HakanD__ is now known as HakanD
07:37:44*sarat joined #nim
07:38:07*sarat is now known as Guest32664
07:46:01*Guest32664 quit (Ping timeout: 246 seconds)
07:48:16*bjz joined #nim
07:58:47*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:05:40*coffeepot joined #nim
08:08:21*coffeepot quit (Client Quit)
08:08:36*coffeepot joined #nim
08:08:57coffeepotGood morning :)
08:17:13*bjz joined #nim
08:17:22gokrldlework: Well, regarding Vala, search forum for Gtk3 - Stefan Salewski basically has it working AFAIK: http://forum.nim-lang.org/t/423/3
08:25:42*bjz quit (Ping timeout: 256 seconds)
08:26:49*[CBR]Unspoken quit (Ping timeout: 252 seconds)
08:27:19*[CBR]Unspoken joined #nim
08:31:34*bogen quit (Ping timeout: 252 seconds)
08:32:05*johnsoft quit (Ping timeout: 256 seconds)
08:32:45*johnsoft joined #nim
08:33:50*endragor joined #nim
08:34:04*bogen joined #nim
08:34:44*wan joined #nim
08:47:31*milosn quit (Ping timeout: 255 seconds)
08:55:26*endragor_ joined #nim
08:56:21*endragor_ quit (Remote host closed the connection)
08:56:54*bjz joined #nim
08:57:01*elbow_jason quit (Ping timeout: 256 seconds)
08:57:14*Ettore joined #nim
08:59:13*endragor quit (Ping timeout: 264 seconds)
09:01:12*endragor joined #nim
09:08:51*BlaXpirit_ joined #nim
09:09:48*Kingsquee quit (Read error: Connection reset by peer)
09:13:28*Pisuke quit (Ping timeout: 250 seconds)
09:14:00*MyMind joined #nim
09:19:37*MyMind quit (Ping timeout: 264 seconds)
09:23:15*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:26:50*pregressive joined #nim
09:29:27*MyMind joined #nim
09:31:13*pregressive quit (Ping timeout: 245 seconds)
09:45:45*BlaXpirit_ quit (Ping timeout: 256 seconds)
09:47:50*endragor quit (Remote host closed the connection)
09:48:16*endragor joined #nim
10:06:36Araqdef-: can you work on https://github.com/Araq/Nim/pull/1960 please?
10:06:53Araqit would be nice to have this in 0.10.4
10:09:32BlaXpirithave u considered 0.11.0?
10:10:09BlaXpiritbreaking ^change and whatnot
10:11:46antranigvnice programming language! :)
10:12:02*milosn joined #nim
10:12:08Araqhi antranigv thanks
10:12:35AraqBlaXpirit: hrm ... well I dunno. having this meaningless 0. in the version annoys me
10:12:47antranigvI always wanted something like a mix of oberon and python. I think i found it (:
10:12:48BlaXpiritthat is unrelated
10:13:10BlaXpirit(in reply to Araq)
10:14:34AraqBlaXpirit: but I will break code again after that ...
10:14:47BlaXpiritmake 0.12, who cares
10:15:21*milosn quit (Read error: Connection reset by peer)
10:15:37BlaXpiritto me the point of minor version change is "there is no reason you would ever want to use the previous minor release"
10:15:58Araqyeah I guess that makes sense
10:16:59*milosn joined #nim
10:17:29AraqI updated the todo btw ... this is like a hydra
10:18:12BlaXpirit:>
10:18:54BlaXpiritat some point you gotta realize that even if it is not perfect, it is so much better than 0.10.2
10:19:48BlaXpiritthis could've been 0.11.2 already
10:20:09*Trustable joined #nim
10:23:15*a5i joined #nim
10:23:56def-Araq: work on the existing PR? What should be done?
10:24:25Araqdef-: fix it so that it doesn't need 2 case stmts at least
10:24:47Araqalso there is some other related bug where we parse 0xffzbx as a number or something
10:25:00*milosn quit (Read error: Connection reset by peer)
10:25:41*milosn joined #nim
10:27:19*jm116__ joined #nim
10:30:44*Tennis quit (Ping timeout: 252 seconds)
10:32:55Araqbtw I added ..< and ..^ operators
10:33:05Araqone gotcha less for newcomers, I hope
10:35:23*johnsoft quit (Ping timeout: 245 seconds)
10:35:30*johnsoft joined #nim
10:35:30coffeepotAraq, "..<" is the same as ".. <"? What does ^ do, is power of or deref?
10:35:53Araqcoffeepot: s[0..^1]
10:36:04Araqit's used for "negative" slicing
10:36:43coffeepotso that'd mean s[0.. -1]?
10:37:31Araqyes but it's better :P since it doesn't require a runtime check for negative indexes
10:39:56*milosn quit (Read error: Connection reset by peer)
10:40:22*milosn joined #nim
10:41:03coffeepotso s[0..^1] returns is 1st element from the right-hand side of the list?
10:41:24BlaXpiritthis returns everything
10:41:39coffeepotah right i see
10:42:06coffeepotout of interest why was "^" chosen and not "-", easier to parse?
10:43:01coffeepotforgive my queries, but does that mean s[0..^2] is everything but the last char?
10:43:13coffeepotitem I mean, not char :)
10:43:27Araqcoffeepot: var x = stdin.readLine.parseInt; echo foo[0..x] # returns the whole foo when x == -1 ?
10:43:35*milosn quit (Read error: Connection reset by peer)
10:43:45AraqI never liked this runtime decision
10:43:57BlaXpiritnext operator on the list: ..<^
10:44:27Araq(yes, for Nim's case there were other reasons which had to do with inclusive upper bounds yada yada yada)
10:45:21Araqso ... for lots of reason ;-)
10:49:18coffeepotcool :)
10:49:28fowlmouthcan we have a ... iterator
10:49:54Araqfowlmouth: ..< is the same and sexier
10:50:14fowlmouthoh i see
10:50:49coffeepotpersonally i quite like ..< but ^ for negative indexing is unusual for me but don't read too much into that :P
10:53:15coffeepotassuming for i in 0..<10 is effectively sidestepping around the inclusive upper bound?
10:53:17*elbow_jason joined #nim
10:53:40coffeepotbtw i quite like the IUB :3
10:54:01Araqpfff sidestepping, it's a great feature which makes things explicit
10:54:04coffeepotbut it's nice to have the ability to structure loops differently
10:55:20coffeepotyeah after the discussion the other day I found myself quite liking the IUB tbh
10:56:34coffeepoti can see novist's point that it may be unexpected for people used to other languages, so it's great to have ..< too
10:58:13coffeepotso var s = "abcd"; echo s[^1] == "d"?
10:58:35BlaXpirityes
10:59:12coffeepot:) cool
10:59:23Araqhrm looks like I broke bootstrapping ... ?
10:59:31Araqoh well bbs
11:17:22ekarlsoso what's going on with nim these days ? :p
11:21:05*untitaker joined #nim
11:26:51repaxIt's nefarious tentacles deviously wriggle their way through the dim passages of the web
11:30:26federico2obligatory "SOON" quote
11:30:42*milosn joined #nim
11:30:55federico2*Its
11:31:03*milosn quit (Read error: Connection reset by peer)
11:31:25*wb joined #nim
11:34:08repaxThanks, the shame is unspeakable
11:38:48*yglukhov joined #nim
11:39:40yglukhovhello, nim channel ;)
11:40:07yglukhovdoes anyone know, how do we boot nim after lates changes in devel?
11:40:24yglukhovkoch boot complains
11:40:29yglukhovlib/system.nim(3269, 5) Error: implementation of 'system.xlen(x: string)' expected
11:40:42yglukhovcan anyone help please? =)
11:40:53*milosn_ joined #nim
11:43:28*Pisuke joined #nim
11:44:46*milosn_ quit (Client Quit)
11:44:51*milosn__ joined #nim
11:46:11*MyMind quit (Ping timeout: 250 seconds)
11:47:10repaxyglukhov: oh? have you tried koch clean?
11:47:29yglukhovyep
11:47:48yglukhovactually, I've got evidence in IRC logs now =)
11:48:01*milosn__ is now known as milosn
11:48:51yglukhovAraq has confesseв ;)
11:49:14repaxI see
11:49:35repaxSo it will soon be fixed, then
11:56:39*milosn quit (Ping timeout: 256 seconds)
12:02:57*HakanD quit (Quit: Be back later ...)
12:03:58yglukhovyay! my toy is fixed again! back to play! ;)
12:23:52*cmk_zzz_ quit (Ping timeout: 272 seconds)
12:33:43*Ven joined #nim
12:45:21yglukhovAraq, it seems like add() doesn't work for nil seqs with C backend.
12:45:29yglukhovit works with JS though
12:47:11yglukhovhm... JS code is also incorrect.
12:47:15yglukhovin another way.
12:47:39yglukhovguess, i'll better file a ticket.
12:49:23Araqyglukhov: add for nil and C backend has not been implemented yet
12:50:28BlaXpiritwait what
12:50:35BlaXpiritisn't it supposed to be invalid
12:51:40AraqBlaXpirit: yes but it will be valid soon
12:52:02BlaXpiritwhat the
12:52:12Araqvar s: seq[int]
12:52:17yglukhovI just found this commit
12:52:18yglukhovhttps://github.com/Araq/Nim/commit/4be0d16520ce89a8590090b4216d626f445abff1
12:52:21Araqs.add 45 # will work
12:52:32yglukhovand thought it's done for C also. but nevermind.
12:52:32yglukhovand thought it's done for C also. but nevermind.
12:52:52yglukhovAraq, sorry to break your snippet =)
12:53:33yglukhovAraq, what about nil.add() in JS? Is it "done"?
12:53:51Araqyglukhov: implemented but untested
12:54:10yglukhovOk, there's a bug for you =)
12:55:07Araqbtw somebody else should take over the jsgen, I prefer to work on harder stuff :P
12:56:43Araqyglukhov: var s: seq[int]
12:56:44Araqs.add 89
12:56:46Araqecho s
12:56:50Araqworks for me for the JS target
12:57:12yglukhovok, give me a second, ill craft a sample
12:57:14Araqoh never mind, it doesn't
12:57:19yglukhovok
12:57:20yglukhov=)
12:57:48yglukhovthe fix is pretty trivial i guess.
12:58:04fowlmouthnimx is a cool project
12:58:21federico2nimx?
12:58:24yglukhovwhat? how do you know about it? =)))
12:58:41fowlmouthi stalk you :p
12:58:44yglukhovits not listed anywhere, it has no single line of doc
12:58:44yglukhov=)
12:59:17fowlmouthi am porting nanovg right now
12:59:30*mpthrapp joined #nim
13:00:07fowlmouthhttps://github.com/memononen/nanovg#screenshot
13:00:10ingsocnim for arduino would be nice
13:01:21Araqingsoc: doesn't it work already for that?
13:03:26ingsocAraq: i am not sure, I couldn't find any definitive info unless you know otherwise. I have only been playing with arduino recently and this was with the notebook tool that complies and uploads to arduino board. I am not that experienced with it to know whther things would just be compatible
13:07:21dom96fowlmouth: Why not just write a wrapper?
13:08:38*pregressive joined #nim
13:08:41*pregressive quit (Remote host closed the connection)
13:13:07federico2should the Feature-suggestions page items be opened as issues instead?
13:17:08yglukhovfowlmouth, that's cool. does it use shaders for vector drawing?
13:17:11Araqfederico2: I prefer the other route
13:17:30Araqadd feature requests to the wiki page and close some issues instead
13:17:51Araqout of 450 issues we have like 100 feature requests
13:18:25federico2do they bother you? At least on GH they can be discussed, prioritized, closed :)
13:19:19yglukhovfowlmouth, I can see, nanovg uses stb ttf. Have you already ported that? I've started porting my own. actually, nimx depends on it
13:19:55yglukhovthe native part. webgl uses canvas fonts.
13:21:06Araqingsoc: iirc somebody uses nim for that, check out our "embedded" target
13:22:22yglukhovNim works just fine for arduino. I've done that a while ago.
13:22:51yglukhovrequires a bit of toolchain setup, can't remember exact steps, but nothing fancy
13:25:30yglukhovnim works pretty much for everything =)
13:37:54*thotypous joined #nim
13:40:19Araqfederico2: not really, I rarely look at the list of issues without any applied filter
13:41:19federico2gh bug tracker is not exactly the best at managing bugs
13:41:20yglukhovAraq, mind adding "author:yglukhov" to your filter? ;))
13:42:07Araqfederico2: actually I like it very much, most other bug trackers are worse IMHO
13:43:42Araqyglukhov: 2 open bugs? lucky dude
13:45:30Araqyglukhov: speaking of which ... can you make --app:gui work on macosx?
13:45:57yglukhoverrr... with any test file?
13:48:33yglukhovclang: error: unknown argument: '-mwindows'
13:50:46Araqwe know about that error
13:50:51AraqI want you to fix it
13:52:59thotypoushttps://github.com/Araq/Nim/blob/devel/compiler/extccomp.nim#L74
13:53:02yglukhovahhh
13:53:04yglukhov=)
13:53:33yglukhovbut why would anyone want do --app:gui on macos?
13:53:35repaxDo you need to target objective-c in order to make --app:gui work on osx? (in order to access NSApplicationMain for example)
13:54:00Araqyglukhov: to get rid of the popping up terminal window?
13:54:24Araqrepax: i wouldn't be surprised if that's the case -.-
13:54:33yglukhovAraq, afaik, that's not the case.
13:55:10yglukhovMacOS gui apps require different approach in packing them to be gui apps.
13:55:22yglukhovI mean, there's a notion of bundle on mac os.
13:55:35yglukhovessentially it's a folder with a specific layout
13:55:57repaxWould that be the compiler's job? I don't think so
13:56:17repax(i.e. to set up the folder structure)
13:56:19yglukhovof course not. the compiler should not do it.
13:56:30yglukhovsome other tooling should.
13:57:12repaxWhereas in Windows, the only thing that's special for gui-apps is a special Main-function
13:57:23yglukhovbut what i mean is that gui binary does not differ from CLI binary
13:58:20*TEttinger quit (Ping timeout: 256 seconds)
13:58:39yglukhovso as far as i'm concerned --app:gui and --app:cli should be exactly equivalent on macos.
14:01:38*Ettore quit (Quit: Leaving.)
14:02:55repaxSo the only problem then, is the console window that pops up
14:03:37yglukhovI don't think there would be any console window if the binary is bundled properly.
14:03:38*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:03:48yglukhovbut bundling is not compilers job
14:04:51repaxWhy is there a --gui option for other platforms? A standard C compiler doesn't care if the program is run as terminal app or gui app in, say, Windows
14:05:36Araq"standard C" means nothing
14:05:39repaxPerhaps there is some linking that's needed
14:05:48gokrAraq: meeting
14:05:58Araqoh so you are here
14:06:01gokr:)
14:06:28yglukhovrepax, well it's obvious for windows. gui requires WinMain instead of main.
14:06:58repaxyglukhov: One could argue that it's up to the programmer to define the WinMain, manually
14:07:15repaxi.e. take full responsibililty
14:07:20yglukhovand i would definitely be in that camp!
14:07:59repaxI'm not picking sides, just wondering
14:08:01yglukhovactually i did need to define custom main to work with sdl
14:08:36yglukhovthanx Araq, nim allows that =)
14:09:08repaxIf I remember correctly, SDL has a WinMain that you can link?
14:09:58repaxNevermind, I cannot help.
14:10:50yglukhovcan't say anything about windows. my project works on linux, mac, android, ios, webgl, God knows what else. but not windows =)))
14:11:26repaxno loss :)
14:11:56*darkf quit (Quit: Leaving)
14:12:33pigmejreactormonk: I have currently overflow in work so I had to 'stop' my nim plays, but I should have some time next week (or maybe this weekend) ;/
14:20:26Araqyglukhov: how anybody can design a library, cross-platform etc, that requires a custom main is beyond me
14:20:47yglukhovthats SDL =))
14:21:41repaxPerhaps it should be considered a framework then
14:22:19yglukhovwell, as far as i understood, there is a way to get away with default main, but I gave up trying when I wasted 2 hours on that =)
14:22:40*HakanD joined #nim
14:27:42fowlmouthlol
14:31:13*shodan45 quit (Quit: Konversation terminated!)
14:31:58yglukhovOk, here's what I've found about mwindows.
14:32:03yglukhovhttps://gcc.gnu.org/ml/gcc-help/2004-01/msg00225.html
14:32:18yglukhovthis option looks really obscure to me.
14:32:49yglukhovdoes anyone know why is mwindows present in nim?
14:35:42thotypousI have always used -mwindows with mingw to produce windows binaries with don't open the cmd window, it's a pretty known option, not sure why it is so hard to find its documentation nowadays
14:35:54thotypouswhich don't open*
14:36:19thotypousDev-C++ used to call the mingw compiler with this option if i remember well
14:37:03yglukhovso... it looks like this option is only needed when targeting windows platform, right?
14:37:22thotypousand yes, the mailing list message is right, it passes an option to the linker which instructs it to set a flag in the PE header indicating the executable pertains to the "windows subsystem"
14:37:40thotypousyes, IMHO it should produce an error or be ignored if targetOS != Windows
14:38:35thotypousit only makes sense when generating PE binaries
14:38:51*milosn joined #nim
14:40:00thotypoushttps://code.google.com/p/corkami/wiki/PE#Subsystem
14:40:07thotypousalso https://msdn.microsoft.com/en-us/library/windows/desktop/ms680339%28v=vs.85%29.aspx
14:40:52thotypousit sets IMAGE_SUBSYSTEM_WINDOWS_GUI
14:41:56yglukhovok, now the only thing remains is to figure out how nim configures compilers platform-wise =)
14:43:09yglukhovdoes anyone use clang on windows?
14:43:38yglukhovcan I assume that -mwindows is an invalid option for clang regardless of platform?
14:44:08thotypousyou would need to test it, but there is a good chance that it is not -mwindows in clang
14:44:13thotypoushttp://sourceforge.net/projects/clangonwin/
14:45:29repaxWill cross-compilation be possible?
14:45:36thotypoushttp://reviews.llvm.org/file/data/zhjdctgd5hykho43fvwk/PHID-FILE-n4rvz4xkb6w2cq2tket2/203017.diff
14:46:13thotypousif you check targetOS == osWindows, then mingw crosscompiler should work painlessly
14:46:22Araqwell it's hardly win specific if macosx has the same issue
14:46:51Araqand imho that's an inherent distinction that has to be made
14:47:02Araqit's either a terminal app or a ui app
14:47:28repaxAraq: except it seems that the console window that can appear on osx is due to lack of bundling
14:47:42thotypoushttp://lld.llvm.org/windows_support.html
14:47:48thotypous"Subsystem inference is not very reliable. Linker is supposed to set subsystem field in the PE/COFF header according to entry function name, but LLD sometimes ended up with unknown subsystem type. You need to give /SUBSYSTEM option if it fails to infer it."
14:50:30yglukhovWill anyone object, if we just remove -mwindows from clang invocation for now? Anyway clang is a rear beast on windows.
14:50:35thotypousAraq: i don't know much about macosx, but it seems that the Mach-O format doesn't have a field for specifying if an executable pertains to the "GUI subsystem" like it happens in PE binaries
14:51:02thotypouslike repax said, probably it is a matter of bundling
14:53:38repaxOf course, a minimalistic bundle could be generated. But it's kind of ugly
14:53:53yglukhovplease no. =)
14:54:08yglukhovios has slightly-different bundle layout =)
14:55:08yglukhovby the way, how does linux handle that?
14:55:55thotypousin linux it depends on the desktop environment
14:56:12repaxiOS bundles require: executable and Info.plist. All else seems optional
14:56:19thotypousit is a convention that the file manager will ask if you want to run an executable in the terminal or not
14:57:24yglukhovthe same for mac os bundles. but in ios both binary and info.plist are located in the root of the bundle. and in macos the binary is located in MacOS subfolder =)
14:57:51yglukhovthotypous, ok so not an issue for linux either.
14:58:13repaxyglukhov: So, one would have to specify osx vs ios
14:58:19*Ven joined #nim
14:58:51yglukhovit's funny how we discuss gui apps having no little to no gui frameworks in nim =)
14:58:59repaxPerhaps osx would be default on a mac. And ios target if specified
14:59:34repaxWell, getting this right is kind of a prerequisite?
15:00:05repax:)
15:01:12yglukhovbut instead of moving in the wrong direction we could just stay and wait untill we see what is right.
15:01:28yglukhove.g. --app:gui option doesn't work at all macos.
15:01:45yglukhovso ignoring it will not make things worse.
15:02:03yglukhovand imho, ignoring it is actually the right way.
15:02:06repaxAgreed.
15:02:30repaxYou might want to apply bundling tools post-build
15:03:14yglukhovyes. there's a lot to do after linkage. bundle, copy resources, codesign, strip framework headers, etc.
15:04:17yglukhovand it would be right to have it all in some packaging-tooling
15:04:28yglukhovactually i was about to write some
15:05:00bougymananywhere to get usage examples of http://nim-lang.org/postgres.html ?
15:05:29repaxCan the PE configuration on Windows be done afterwards as well?
15:05:47*Trixar_za joined #nim
15:05:52Araqyeah qzite sure
15:06:06Araqyou need to modify some bit in the PE header
15:07:39Araqbougyman: nimforum used to use it, it's just import db_sqlite vs import db_postgres
15:08:37yglukhovrepax, please note, that -mwindows is not just about PE header. it also adds some libs to link with.
15:08:47repaxRah..
15:10:31yglukhovso... let me summarize it again. I propose to remove -mwindows from clang invocation regardless of the platform. does this sound reasonable?
15:11:09*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:11:34repaxIt doesn't make the situation any worse
15:11:47Araqsoo ... --app:lib is valid because unix requires it, but --app:ui makes no sense because windows requires it? double standards, hrm?
15:12:03yglukhov=))
15:12:08yglukhovoh come on...
15:12:21repaxIt's a valid point
15:12:43yglukhovok, but i'm not proposing to remove --app:gui
15:13:07yglukhovall i want is remove -mwindows from (specifically) clang compiler invocation
15:13:30yglukhovit will still work with gcc, mingw, msvc, etc
15:13:40yglukhovjust clang will ignore it.
15:13:55yglukhovi doubt clang supports it anyway.
15:14:26yglukhovand i don't have windows to check it out.
15:14:54yglukhovi mean i can spend a couple of hours to test it, but i'm not going to. sorry.
15:16:25Araqyglukhov: I don't mind, but I really do mind the double standards developers have.
15:17:24repaxI actually think that GUI-apps themselves are a special case not to be a concern for the compiler.
15:17:43repaxI actually think that GUI-apps themselves are a special case not to be a concern for the compiler.
15:17:45repaxsorry
15:17:49repaxWhat is needed is a cross-platform tool that packages/links/bundles apps - all done after compilation.
15:17:51yglukhovactually, there are no double standards here. what I'm trying to say is that clang configuration in extccomp.nim is just wrong.
15:18:09yglukhovbut i can't prove it without a windows machine =)
15:18:17Araqbut *why* do you think that? for library building it's a special case for the compiler too
15:18:47yglukhovbecause clang knows nothing about -mwindows flag
15:19:18*endragor quit (Ping timeout: 272 seconds)
15:19:52repaxFrom a usability pov the best thing for simple apps would be autogenerated, minimalistic bundles on mac/ios
15:20:20repaxBut it's ugly, and imo, so is PE fiddling by the compiler
15:21:00yglukhovon windows, GUIness is a property of a binary. on linux and mac it is not.
15:21:10yglukhovcompiler is responsible only for the binary
15:21:20repaxideally, yes!
15:22:19yglukhovminimalistic binary is not so easy to do properly.
15:22:27yglukhovit has to be codesigned.
15:22:33yglukhovit has to have resources.
15:22:51yglukhovit has to be codesigned after the resources are in it.
15:23:26repaxOnly if it should be published, right?
15:23:40yglukhovsure
15:23:54yglukhovor... no...
15:23:55repaxOr deployed on a device, other than the dev computer
15:23:58yglukhovnot only...
15:24:39yglukhovmost of the time you want to sign it with dev certificates even for testing.
15:24:58yglukhovi mean, technically it would work without them.
15:25:05repaxSorry, I must leave now.
15:25:07*Trixar_za left #nim ("Leaving")
15:25:11repaxto catch a bus. bbl
15:25:17yglukhovok, c u
15:26:55*brson joined #nim
15:31:59*Ven joined #nim
15:38:09coffeepotis there a nim way of assigning a variable whilst also testing that var? I'm thinking something like... while (x = someFunc()) == 1: echo x
15:38:41Araqcoffeepot: yes, but I am not gonna show how cause it's stupid
15:38:59coffeepothaha well I somehow thought you might say that :)
15:40:25coffeepotthe reason i'm asking is say if you need to get a status variable, then do something in a loop until that variable is in a different state. I mean, it's fine just doing the call outside the loop of course, just wondering if there's a more elegant way to do it that isn't stupid
15:41:34coffeepotmainly because I don't want to have to copy a load of arguments to call the same func twice
15:47:54coffeepoti mean, look at this :/ https://gist.github.com/anonymous/e36ece2062e6e3c2882c
15:51:18fowlmouthcoffeepot, a tuple maybe would be used like this while(; let (has,item) = returnsMaybe(); has): #use item
15:52:44fowlmouthin your case (;retval = ..; retval != SQL_no_data)
15:56:37coffeepotthanks fowl, that works. Not sure if it's a good idea, readability-wise though. Perhaps I should just suck it up and refactor the SQLGetDiagRec into a func
15:57:24coffeepotthough it does look better than having a call with a huge load of params twice on adjacent lines
16:04:01Araqcoffeepot: seriously? you don't know about 'while true:'?
16:04:08Araqwhile true:
16:04:17Araq let retval = longcode(...)
16:04:26Araq if retVal == NO_DATA: break
16:04:51coffeepothuh... i didn't think of that. I suppose that is a better approach
16:05:19coffeepot:)
16:05:40Araqthat's an idiom taken from python
16:06:09Araqso it fortunately it cannot be criticized
16:06:14coffeepothaha
16:06:29Araqif it was my invention everybody in #nim would oppose it heavily
16:06:35emilsphey, but I hate the whole true loop thing
16:06:58AraqI disagree, I actually dislike 'while cond' loops, so inflexible
16:06:58emilspAraq, if people truly despised everything you created, there wouldn't be any people in #nim
16:07:14Araqemilsp: nevertheless it surely feels this way
16:08:24Araqemilsp: Oberon or maybe Modula 2 has a general 'loop' keyword which is just 'while true' for this reason
16:08:28coffeepotit's funny i have dim memories of break being a bad idiom, in that it forces you to need to pay closer attention to the control flow. I guess ultimately it's all swings and roundabouts, I tend to prefer not breaking unless it's at the start of a proc
16:09:49coffeepoti must say while true: ... break seems odd to me but i can't put a finger on it. It does look nicer than assignments in the while condition tho
16:09:55Araqiirc Eiffel also has a nice looping construct
16:10:20Araq"there should be only one loop construct in the language"
16:10:36*justicefries joined #nim
16:10:43Araq"that's why we have 'retry' too for exception handling ... " err ... what?
16:12:29Araqcoffeepot: actually from a formal point of view you're right, 'while true: break' is bad ;-)
16:12:32emilspwhere did you read that ?
16:13:27Araqemilsp: maybe I read Bertrand Meyer
16:13:59gokrIn Smalltalk whileTrue: is a behavior on Closures taking another closure as argument. "[ x < 10 ] whileTrue: [ x := x + 1]"
16:14:26*gokr crawls back under stone
16:16:15Araqcoffeepot: the invariant after 'while cond' without a break statement is 'not cond'. and with a 'break' statement it's harder to determine
16:16:40AraqI think that's what you feel is wrong with it
16:17:37coffeepothmm that's true. Plus you could have multiple break conditions
16:17:50coffeepotwhich would just seem hard to read
16:18:09Araqbut it's not so bad unless your control flow analysis algorithm is right from the 60ies ;-)
16:19:11Araq(which is actually what Nim implements ...)
16:19:41*gokr_ joined #nim
16:19:42coffeepotnim's flow analysis is from the 60s? :)
16:20:00Araqyup, pretty much
16:20:48*yglukhov quit (Ping timeout: 276 seconds)
16:21:01Araqbut my excuse is that I don't construct any control flow graph
16:21:18coffeepotfair enough, if it ain't broke, and all that :)
16:22:26Araqit is broken, but not broken enough to worry me
16:22:50coffeepotwhat would a "more modern" flow analysis bring to the table?
16:22:58coffeepotjust out of interest
16:23:10*jfchevrette joined #nim
16:23:17coffeepoti'm assuming it might slow down compilation...?
16:23:24emilspcoffeepot, a massive graph which represents all paths
16:26:47coffeepothmm control flow graphs, further reading for another day :)
16:26:57coffeepotright i must go, goodnight everyone :)
16:28:55*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:37:49*Pisuke quit (Ping timeout: 250 seconds)
16:39:38*Pisuke joined #nim
16:47:31*gsingh93 joined #nim
16:54:27*Pisuke quit (Read error: Connection reset by peer)
16:55:51*Pisuke joined #nim
17:03:06*gokr quit (Read error: Connection reset by peer)
17:03:12*BlaXpirit_ joined #nim
17:05:58*BlaXpirit quit (Ping timeout: 265 seconds)
17:07:25repaxThat's why I like templates
17:07:36repaxtemplate loop(s:stmt): stmt {.immediate.} =
17:07:41repax while true: s
17:10:01*Pisuke quit (Ping timeout: 256 seconds)
17:15:09*BlaXpirit_ quit (Quit: Quit Konversation)
17:15:29*BlaXpirit joined #nim
17:18:59*HakanD quit (Quit: Be back later ...)
17:19:32Araqrepax: template loop(s: untyped) = ... with the upcoming changes
17:20:07repaxAraq: it's hard to keep track with changes (in general)
17:20:37repaxPerhaps one should just read the commitlog, but..
17:20:49Araqwell we keep news.txt up to date
17:20:57Araqand that's what you should read after a release
17:21:05Araqof course we haven't released yet
17:22:13*Strikecarl joined #nim
17:22:28StrikecarlCurrently working on a "math" import for myself.
17:22:41StrikecarlAlready added Pythagoras
17:22:44StrikecarlWhat else to add?
17:23:02StrikecarlCurrent stuff: http://i.imgur.com/GqSBFCa.png
17:23:43repaxStrikecarl: Well, what's the goal?
17:24:19StrikecarlGonna use it for a calculator for private use later, or release it idk.
17:24:31StrikecarlJust adding stuff that isn't in math import.
17:24:36repaxStrikecarl: you could generalise the pythagorian function to any number of inputs
17:25:07StrikecarlWhat you mean?
17:25:16StrikecarlI already made it so i can choose what numbers to input
17:25:45repaxsqrt(a*a + b*b + c*c + d*d ...)
17:25:54Strikecarloh.
17:26:29AraqStrikecarl: implement this please: http://www.plover.com/~mjd/cftalk/
17:26:44Araqit's really cool. and useful for a calculator I think
17:27:07Strikecarlshit
17:27:07Strikecarllol
17:27:24repaxStrikecarl: proc pyth*(x: openArray[float]): float {.noSideEffect.} =
17:27:57StrikecarlI'll just stick to math i am going to use the next 3-4 years lmao.
17:28:03StrikecarlI'll look at it tho, Araq.
17:28:13Strikecarlrepax - I'll look at it.
17:29:04*ingsoc quit (Ping timeout: 255 seconds)
17:31:42AraqStrikecarl: what kind of math doesn't involve pi or e? ;-)
17:31:44repaxStrikecarl: Also, while on the topic of pyth: the square root operation is sometimes too costly. Perhaps you'd want to make a proc that omits that. If you have multiple results, they share the same order even without that last operation.. common optimisation
17:32:31StrikecarlAraq what are you making me read. http://i.imgur.com/4nmnm0Q.png
17:32:44repaxAraq: Well, rational trigonometry doesn't need pi to work with triangles and generall geometry over any type of field
17:33:29repaxStrikecarl: how about rational trigonometry, would that be interesting?
17:33:37Araqrepax: fair enough ;-)
17:34:17StrikecarlSure, repax
17:34:21Strikecarlalso, if i wan't so like.
17:34:25Strikecarlwithout importing "math"
17:34:32Strikecarljust importing private "stuff.nim"
17:34:47Strikecarli will get the pi const
17:34:52Strikecarl"PI = 3.141592653589793"
17:35:05Strikecarldo i have to recreate them?
17:35:11federico2it's missing some digits
17:35:19repax:)
17:35:34StrikecarlJust copy pasted it <.<
17:35:34Strikecarlhttp://i.imgur.com/JYXkMFv.png
17:35:38StrikecarlI know it's alot longer.
17:39:38gokr_Crlibm
17:44:16*ingsoc joined #nim
17:44:55BlaXpiritStrikecarl, calculate pi at compile time :p
17:45:06StrikecarlHow c:
17:45:23BlaXpiritmake a function to calculate pi and assign its result to constant
17:45:46StrikecarlExample? :c
17:46:39Strikecarlπ = (4/1) - (4/3) + (4/5) - (4/7) + (4/9) - (4/11) + (4/13) - (4/15)
17:46:45Strikecarlhow can i make it just go on
17:46:57BlaXpiritwith a loop
17:47:09StrikecarlCan't i use arcsin?
17:47:13Strikecarlis that a function in math
17:47:19Strikecarlyus it is
17:47:43BlaXpiritdoubt it would work at compile time. but it may
17:47:55Strikecarlmk.
17:48:07StrikecarlNot the best at math ho.
17:52:16thotypous8
17:53:10repaxthotypous: That's a fine number, but not very close to pi.
17:53:32*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:53:33StrikecarlI love when they just come in, type something that makes no sense and goes out.
17:53:45thotypoussorry, cat at the keyboard
17:55:49AraqBlaXpirit: should work at compile-time these days
17:57:23*yglukhov joined #nim
17:58:00AraqStrikecarl: we need this http://www.sympy.org/en/features.html in Nim
17:58:11BlaXpiritvery funny
18:00:06StrikecarlI'll look at it.
18:00:12Strikecarlgotta finish this stuff first.
18:02:01repaxA symbolic math library could easily take a lifetime to implement.
18:02:19emilspthere's julia
18:02:32repaxnih
18:03:06*Strikecarl left #nim (#nim)
18:04:13*Strikecarl joined #nim
18:07:17thotypousjulia is so similar to nim.. metalanguage stuff, multiple dispatch
18:07:45thotypousthe most striking difference is perhaps nim is more focused in compiling, and julia is focused on interpreting (with a JIT)
18:09:15StrikecarlIs memory reading possible in NIM?
18:09:17Strikecarl(windows)
18:10:10repaxStrikecarl: The language wouldn't be a limitation.
18:10:20Strikecarlmk.
18:10:27Strikecarlproc calradius*(x): int =
18:10:27Strikecarl echo 2 * x * PI
18:10:32Araqthotypous: well Nim also has an effect system
18:10:33StrikecarlWhat did i do wrong?
18:11:26thotypousthat's true, the effect system is pretty nice
18:13:35repaxWith the effect system you can require no effects: [ ]
18:13:48*Trustable_2 joined #nim
18:14:30repaxis it/would it be possible to say specifically "not foo". i.e: [ -foo ]
18:14:57repaxThat is, any effect is ok, except foo
18:15:14*Trustable quit (Ping timeout: 244 seconds)
18:15:31Araqit's on the roadmap, repax
18:15:41repaxGoodie :)
18:17:59thotypous[ -destroy_system ]
18:18:11repaxgood luck ;)
18:18:32repax[ -bug ]
18:18:39thotypouslol
18:19:43Strikecarl[ -spiterrors ]
18:19:54Strikecarlaka -app:gui
18:19:55Strikecarlc:
18:20:10repaxOne could ponder the expressiveness and syntax. An effect could be one of the following: required, required-negative, undecided
18:21:07repaxCurrently, leaving out effect identifiers mean requiring them not to be present.
18:21:50StrikecarlCan anyone help me
18:21:50Strikecarllol
18:21:55Strikecarlhttp://pastebin.com/raw.php?i=hFbDJMz3
18:22:08StrikecarlI tried everything cri
18:22:36AraqStrikecarl: type your params, don't be lazy
18:22:46Araqproc calradius*(x: float) = ...
18:23:05Araqotherwise it's inferred to be 'int' and float * int is not supported
18:23:09*phira quit (Excess Flood)
18:23:36StrikecarlI t tried doing calradius*(x): float =
18:23:39StrikecarlMk, ty.
18:23:51*phira joined #nim
18:23:51*phira quit (Excess Flood)
18:24:20*phira joined #nim
18:24:21*phira quit (Excess Flood)
18:24:49*phira joined #nim
18:24:51*phira quit (Excess Flood)
18:25:23*phira joined #nim
18:25:24*phira quit (Excess Flood)
18:25:48*jfchevrette quit (Quit: Textual IRC Client: www.textualapp.com)
18:26:21*phira joined #nim
18:26:21*phira quit (Excess Flood)
18:26:27StrikecarlPhira having problems.
18:26:27Strikecarl<.<
18:26:49*phira joined #nim
18:26:51*phira quit (Excess Flood)
18:27:51*phira joined #nim
18:27:51*phira quit (Excess Flood)
18:28:21*phira joined #nim
18:28:24*phira quit (Excess Flood)
18:29:50*phira joined #nim
18:29:51*phira quit (Excess Flood)
18:30:49*phira joined #nim
18:30:51*phira quit (Excess Flood)
18:31:19*phira joined #nim
18:31:21*phira quit (Excess Flood)
18:32:19*phira joined #nim
18:32:21*phira quit (Excess Flood)
18:32:24*smodo joined #nim
18:33:49*phira joined #nim
18:33:51*phira quit (Excess Flood)
18:34:20*phira joined #nim
18:34:21*phira quit (Excess Flood)
18:34:49*phira joined #nim
18:34:51*phira quit (Excess Flood)
18:35:20*phira joined #nim
18:35:21*phira quit (Excess Flood)
18:36:20*phira joined #nim
18:36:21*phira quit (Excess Flood)
18:36:51*phira joined #nim
18:36:51*phira quit (Excess Flood)
18:37:19*phira joined #nim
18:37:21*phira quit (Excess Flood)
18:37:49*phira joined #nim
18:37:51*phira quit (Excess Flood)
18:37:56Araqhi smodo welcome
18:38:04thotypoushttps://weechat.org/files/doc/weechat_faq.en.html#filter_irc_join_part_quit
18:38:25*phira joined #nim
18:38:27*phira quit (Excess Flood)
18:39:07StrikecarlTy thotypous
18:39:21*phira joined #nim
18:39:21*phira quit (Excess Flood)
18:39:24Araqer ... do we need the fallback to the old 'nimrod.exe' in koch?
18:39:48AraqI doubt that can compile anything even if it exists
18:39:49*phira joined #nim
18:39:51*phira quit (Excess Flood)
18:40:18*phira joined #nim
18:40:21*phira quit (Excess Flood)
18:40:49*phira joined #nim
18:40:51*phira quit (Excess Flood)
18:41:21*phira joined #nim
18:41:21*phira quit (Excess Flood)
18:41:37dom96In regards to Nim's version numbers:
18:41:51*phira joined #nim
18:41:51dom96From semver.org "Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable."
18:41:51*phira quit (Excess Flood)
18:42:19*phira joined #nim
18:42:21*phira quit (Excess Flood)
18:42:51*phira joined #nim
18:42:53*phira quit (Excess Flood)
18:43:23*phira joined #nim
18:44:56*filcuc joined #nim
18:45:21Araqdom96: yeah 0.11.0 feels a bit chaotic
18:45:40Araqbut then 0.9.x to 0.10.2 was kinda weird already
18:46:50*shodan45 joined #nim
18:59:40*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
19:05:46dom96indeed
19:05:47dom96bbl
19:10:00*filwit joined #nim
19:18:22*justicefries left #nim ("Leaving")
19:19:21*Matthias247 joined #nim
19:25:36*TEttinger joined #nim
19:27:43*smodo quit (Ping timeout: 256 seconds)
19:54:35*HakanD joined #nim
19:56:25*Trustable_3 joined #nim
19:57:24*Trustable_2 quit (Ping timeout: 250 seconds)
20:00:33*HakanD quit (Quit: Be back later ...)
20:01:09*HakanD joined #nim
20:01:37*ingsoc quit (Ping timeout: 255 seconds)
20:02:40*flaviu joined #nim
20:04:36flaviuMagusOTB: If you read the logs, the answer is macros. You can do all the string munging you want there.
20:07:59*untitaker quit (Ping timeout: 250 seconds)
20:09:09*HakanD quit (Quit: Be back later ...)
20:15:21*untitaker joined #nim
20:23:14Araqhi flaviu welcome back
20:23:19*a5i quit (Quit: Connection closed for inactivity)
20:23:44BlaXpiritwb indeed
20:24:00flaviuo/
20:25:58Araqyglukhov: er what? clang is unstable on windows? how come
20:32:47yglukhovwell thats what I've found from different blogs and posts.
20:34:00yglukhovhttp://clang.llvm.org/docs/MSVCCompatibility.html
20:35:30yglukhovi must admit, I havent studied the topic thoroughly. but clang is far from mainstream on windows, isn't it?
20:39:27Araqdunno, I used to use it years ago on windows
20:39:41Araqand it was stable back then already
20:39:46Araqat least for Nim
20:45:59fowlmouthAraq, can i use the plugin magic to make an unsafeNew that lets you pass a finalizer?
20:46:53Araqfowlmouth: you don't need a plugin for that, that's just a single line in system declaring it properly I think
20:49:23fowlmouthdoesnt it need to be in code gens to
20:49:25fowlmouthtoo
20:51:06*Kingsquee joined #nim
20:51:46AraqI think the codegen already supports it
20:53:13*HakanD joined #nim
20:59:42*HakanD quit (Quit: Be back later ...)
21:00:16fowlmouthnot working for me
21:00:38Araqthen patch the codegen :P
21:01:15Araqthe plugin system is mostly for ... I dunno, alternative code generation stuff
21:01:37*Matthias247 quit (Read error: Connection reset by peer)
21:03:00*milosn quit (Read error: Connection reset by peer)
21:08:59*yglukhov quit (Quit: Be back later ...)
21:10:01*milosn joined #nim
21:10:28*Demon_Fox joined #nim
21:11:23*mpthrapp quit (Remote host closed the connection)
21:11:30*xet7 quit (Ping timeout: 265 seconds)
21:14:15*filcuc quit (Quit: Konversation terminated!)
21:15:13fowlmouthcan this just be a pragma addf(p.module.s[cfsTypeInit3], "$1->finalizer = (void*)$2;$n", [ti, rdLoc(f)])
21:16:06BlaXpiritwat
21:16:29fowlmouthit always bugged me that you have to pass a finalizer with new()
21:19:14Araqwell the proper way is to use proc `=finalize` now
21:19:25Araqif only it were implemented :P
21:19:39BlaXpiritwhat is this
21:19:49BlaXpiritanything related to destructors?
21:20:08Araqwell finalizers are related to destructors, somewhat, yes
21:20:15fowlmouthhow is =finalize invoked
21:21:00Araqwell it isn't. we still need to attach it via the codegen of 'new'
21:28:38*gokr joined #nim
21:37:29BlaXpiriti have no idea why these aren't the same thing
21:38:32*Trustable_3 quit (Remote host closed the connection)
21:39:41*xet7 joined #nim
21:41:09AraqBlaXpirit: destructors are at scope exit, finalizers when the GC collects the object
21:41:16Araqhow can they be the same thing?
21:41:40Araqone approximates lifetimes with scoping rules, the other is nondeterministic
21:41:46BlaXpiritAraq, ok so why are finalizers so inconvenient to use?
21:42:02Araqare they?
21:42:38BlaXpiritnow i get it
21:42:40BlaXpiritok so
21:43:06BlaXpiritshould it be possible to tell GC to take care of ptr objects?
21:43:43BlaXpiritby inconvenient I mean passing an argument to new - why is it made this way? why is it not a proc like for destructors?
21:44:15Araqwell finalizers predate the other type bound ops by ~5 years
21:44:40BlaXpiritbecause personally I don't see much use for destructors
21:44:53Araqand when I wrote these things the problem to solve was "how to do it", not "how will people like it"
21:44:57BlaXpiritand now I see that I had no idea what I was doing when I employed destructors in nim-csfml
21:46:11BlaXpiritso currently ref objects must be created using new - it is what tells the GC about them
21:46:25BlaXpiritand only through new can you add a finalizer
21:47:29BlaXpiritbut then there are C libraries which require you to manually destroy an object by calling a function
21:48:12BlaXpiritwhat I want is to tell GC "hey, remember this ptr object for me and call this function when there is no reference to it"
21:48:40BlaXpiritand not destructors which limit everything
21:49:07BlaXpiritI understand that this is possible to make by wrapping the ptr object in a ref object
21:49:17BlaXpiritbut where's the fun in that
21:51:11AraqBlaXpirit: well how to design destructors properly is still a mystery to me
21:51:30BlaXpiritlet's not talk about them, and forget everything i told you about them
21:51:49BlaXpiritbut please do consider what I just said
21:51:53Araqer nope, but I know how to figure it out anyway
21:52:37Araqwell passing a 'ptr' directly to the GC is hard. but once we have that, we can pass ownership around between threads too
21:53:23BlaXpiritI want Nim's GC to accpet ptr (or whatever else) objects after they've been created somewhere else, and call a finalizer
21:53:49fowlmouththat would be ncie
21:54:09AraqBlaXpirit: yes I got it
21:54:12*xet7 quit (Ping timeout: 252 seconds)
21:54:26BlaXpiritok, thanks for listening.
21:54:32Araqlol
21:55:22fowlmouthso is the plan that implementing `=finalizer` for ref T assigns it as the finalizer
21:55:39*vendethiel quit (Ping timeout: 246 seconds)
21:55:46BlaXpiritstrange name though o.o
21:55:50Araqfowlmouth: yeah
21:55:58AraqBlaXpirit: it's consistent.
21:55:58BlaXpiritmaybe that's how destructors should be named as well
21:56:06Araqthey are now.
21:56:09BlaXpiritright.
21:56:14Araqproc `=destroy`
21:56:14BlaXpiritthat's consistent then :p
21:56:20BlaXpiritgood
21:56:21Araqproc `=deepcopy`
21:56:28Araqproc `=` # assignment
21:56:37BlaXpiritdon't know why i haven't heard of these
21:56:59Araqonionhammer: disliked the .override pragma
21:57:15Araqand came up with this solution but he used ~ instead of =
21:57:34AraqI think = makes more sense because then every type bound op starts with =
21:57:45BlaXpiritpretty nice
21:57:50Araqand `[]=` is already special in the language
21:57:51fowlmouthAraq, what about `=finalizer`[T](ref My[T]), this wouldnt exist unless it was used because of deadcodeelim
21:59:28BlaXpirit(returning to my previous topic) if it is undesired to attach special behavior to ptr object, maybe such a function would accept ptr object and return ref object :o
21:59:38*vendethiel joined #nim
22:02:28AraqBlaXpirit: you can do that without any new language features
22:02:41Araqfowlmouth: that's a solved problem in the compiler
22:02:59BlaXpiritAraq, i don't mean a function that just transforms ptr into ref
22:03:14BlaXpiritone that also attaches a finalizer to it
22:03:43*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:09:08flaviuBlaXpirit: I don't think that's possible.
22:09:18BlaXpiritwhy not
22:09:44*xet7 joined #nim
22:10:08thotypousluajit has ffi.gc which does just that
22:10:23flaviuobject layout is [pointer_metadata*][data ... ...]
22:10:23flaviu ^
22:10:37flaviuiirc, where the ^ signifies the location that the pointer points.
22:10:55BlaXpiritwut
22:11:09thotypoushttp://luajit.org/ext_ffi_api.html#ffi_gc
22:11:14thotypouswould be nice to have that in nim
22:11:23BlaXpiriti don't know these semantics, but i'm almost positive that simply adding a finalizer to a ptr object is possile
22:11:47BlaXpiritthx, thotypous
22:12:59BlaXpiritdont know why it took me so many months to properly formulate the thoughts
22:13:06flaviuBlaXpirit: How are you going to tell the GC what the finalizer is?
22:13:13BlaXpiritwell, actually I do know. it's because i was deceived about destructors
22:13:20BlaXpiritflaviu, pass a function pointer??
22:13:28flaviuBlaXpirit: Where will the GC store that?
22:13:41BlaXpiritin RAM
22:13:42flaviuThe ptr is allocated by outside malloc, which does not know to create that header where Nim stores type info.
22:14:01BlaXpiritwhy does it have to be inside the object
22:14:03Araqflaviu: well you only need to detach the header from the object
22:14:22Araqbut it kinda sucks
22:14:34BlaXpiritnow i can just say lua does it
22:14:34flaviuYep, although I'd say that its a little unusual to do that.
22:14:35thotypousluajit does this by creating a box with the foreign pointer inside
22:14:57Araqespecially if you have a write barrier
22:15:08flaviuthotypous: Yep, I was getting to that, but I needed to make sure I understood the docs.
22:15:53BlaXpiritwell... if this "sucks" maybe it can be separate from the part of the GC that does ref objects
22:16:29flaviuBlaXpirit: IMO that's exactly the sort of complexity that needs to be avoided.
22:16:42BlaXpiritit is an essential feature.
22:17:34flaviuNot necessarily. The pointer can be boxed and the standard mechanisms for finalization reused.
22:17:34BlaXpiritthe ffi system is so good mainly because it allows making convenient bindings without making stupid wrappers
22:17:44BlaXpiritor it would, if this feature was supported
22:18:10thotypousflaviu: yes, that is exactly what luajit did ;D
22:18:31BlaXpirituhh
22:18:35BlaXpiritref ptr object? anyone?
22:18:58BlaXpiriti should sleep
22:19:26flaviuBlaXpirit: I don't see it as being a major issue, C apis tend to be more responsible with their allocation.
22:19:37BlaXpiritwut
22:19:48BlaXpiritI don't see any meaning behind this sentence
22:20:10flaviuBig objects are likely to be the ones to need this, as smaller things are allocated on the stack.
22:20:39BlaXpiritaaand?
22:21:29thotypousthat is exactly the problem we have in luajit
22:21:42*vendethiel quit (Ping timeout: 252 seconds)
22:21:44thotypousthe pointer is never freed automatically because it doesn't produce pressure in the gc
22:22:02flaviuBlaXpirit: The overhead from boxing the pointer is likely to be small as it will be frequently used.
22:22:11BlaXpiritflaviu, aaaand?
22:22:44BlaXpiritso you're telling me to make stupid wrappers, duplicating every procedure?
22:22:47thotypousa good implementation would need to have a "gc backdoor" for allowing to control the pressure of the pointer
22:23:30BlaXpiritor maybe this boxing should be automatic?
22:23:35thotypousunless the gc in nim is refcounting
22:23:44thotypousi don't know which kind of gc nim uses
22:24:22*BlaXpirit quit (Quit: Quit Konversation)
22:24:26flaviuBlaXpirit: Ah, you mean that usage is a little hard.
22:24:49Araqthotypous: deferred reference counting
22:25:06thotypousAraq: thanks for not telling me to RTFM :D
22:25:17thotypousi had just opened http://nim-lang.org/gc.html
22:25:36Araqyeah a little hard if you completely ignore we have a macro system for these things
22:26:04Araqthotypous: I never tell people that. I accepted nobody reads anything.
22:26:06flaviuBlaXpirit: Well, I don't believe that "torture the implementor on behalf of the user" is completely right.
22:26:51thotypousAraq: you are the most patient language designer ever :D
22:36:21*vendethiel joined #nim
22:40:48*Kingsquee quit (Ping timeout: 256 seconds)
22:42:36thotypous48K stdlib_mimetypes.o
22:43:13thotypousI'm so glad httpclient only uses mimetypes if you use addFiles*(p: var MultipartData, xs: openarray[tuple[name, file: string]])
22:54:02flaviuthotypous: What are you doing that 48k is significant?
22:55:07flaviuThat sounds a bit snide, but I'm asking out of curiosity.
22:55:15thotypousflaviu: a network client which will run in a small openwrt router
22:55:40*Kingsquee joined #nim
22:58:36*transfuturist joined #nim
22:59:34transfuturistENCODING_MS_SYMBOL = ((uint32('s') shl 24) or (uint32('y') shl 16) or (uint32('m') shl 8) or uint32('b'))
22:59:42transfuturistHint: unsigned [Processing]
22:59:42transfuturistfreetype2.nim(24, 15) Error: internal error: getInt
23:00:01transfuturisthow can i cast a char to an int?
23:00:20transfuturist(this is for a freetype wrapper)
23:00:36Araqnot at compile-time apparently
23:00:46transfuturistha
23:01:00Araqbtw bug reports are better done with the issue tracker
23:01:10*vendethiel quit (Ping timeout: 255 seconds)
23:01:22transfuturisti'll make one
23:01:26fowlmouththought someone has a freetype wrapper already?
23:01:38transfuturistpaulina, or something like that
23:01:46transfuturistit's not actually a thing
23:01:56transfuturistabandoned
23:02:02fowlmouthoh
23:03:36*noob joined #nim
23:04:05noobHow do I do a sequence of objects? var pTable*: seq[ panel* ] = @[]
23:04:08*noob is now known as Guest82298
23:04:38*Guest82298 quit (Client Quit)
23:04:59*noobie_ joined #nim
23:05:21noobie_sorry had to change names, what is the correct way of making a sequence of objets?
23:05:24noobie_objects*?
23:06:07Araqlike you did but with fewer stars
23:06:34transfuturisthttps://github.com/Araq/Nim/issues/2589
23:06:40onionhammerAraq i dont mind =destroy as long as it's not {.prgama.} magic :)
23:07:11transfuturistalso, araq, i want to ask you something
23:07:14noobie_Sweet thank you
23:07:20onionhammerAraq I it'd still be gerat to prevent people from creating types outside of a module
23:07:37*mal``` quit (Ping timeout: 264 seconds)
23:07:42transfuturistwhen a c function expects a buffer of a type via a pointer to that type, you can pass it a sequence of that type, right?
23:08:06transfuturistor is seq not equivalent to a dynamic array?
23:08:54onionhammera seq has an underlying buffer that it stores things in
23:09:25*flyx quit (Ping timeout: 264 seconds)
23:09:52transfuturistis there a way to pass c the sequence's buffer pointer?
23:10:49onionhammeryeah, you can pass that iirc, it's the same address as the sequence
23:11:10def-addr mySeq[0]
23:11:21onionhammerhttp://nim-lang.org/manual.html#reference-and-pointer-types
23:11:42onionhammerbut if the seq gets resized that address my be invalidated
23:12:34*vendethiel joined #nim
23:13:27transfuturistnot an issue for just calling out to a C api
23:13:46onionhammerif the C api doesnt store the address
23:13:55transfuturisti don't think C is likely to do anything except read it with the length you give it
23:14:08*mal`` joined #nim
23:14:13transfuturistanything else is an unfriendly design
23:30:48*a5i joined #nim
23:35:12*vendethiel quit (Ping timeout: 256 seconds)
23:38:08transfuturistwhy can't you create enums out of order?
23:47:04*vendethiel joined #nim
23:52:17*brson quit (Quit: leaving)
23:53:15*brson joined #nim
23:58:59*perturbation joined #nim