00:00:01 | a5i | I am functioning correctly thank you very much :) |
00:00:26 | Araq | onionhammer: well it ran and ran and ran and always produced output |
00:00:50 | onionhammer | ah good |
00:01:11 | onionhammer | what os? |
00:15:49 | Araq | win |
00:16:48 | a5i | dows |
00:17:24 | reactormonk | so I put an echo("foobar") into suggestWriteln - and it isn't called by def tests/caas/main.nim:5:18 - any ideas? |
00:17:54 | reactormonk | any other code paths that that output nimsuggest stuff? |
00:21:05 | reactormonk | huh. Isn't ln supposed to hardlink. |
00:30:31 | reactormonk | any 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:36 | fowlmouth | reactormonk, strutils.parseEnum |
01:13:43 | reactormonk | fowlmouth, ah fuck. Thanks. |
01:14:23 | * | Demon_Fox quit (Ping timeout: 250 seconds) |
01:25:42 | onionhammer | araq fyi i just tested it and reproduced it pretty quickly |
01:27:19 | onionhammer | araq actually it's slightly different, when i went further down my file the same types weren't getting responses |
01:27:34 | onionhammer | i.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:45 | reactormonk | pigmej, put some more stuff in. put epc code at discard, use suggestionResultHook |
02:11:58 | * | a5i joined #nim |
02:12:11 | reactormonk | also don't forget writelnHook for for messages/errors |
02:15:23 | * | filwit quit (Read error: Connection reset by peer) |
02:33:09 | a5i | .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:59 | MagusOTB | how would I do something like the ##paste## operator from the C preprocessor? |
03:05:20 | MagusOTB | I'm trying to easily create a bunch of types that are enums that are subranges of GLenum |
03:05:56 | MagusOTB | (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:14 | HakanD___ | 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:07 | gokr | Good morning! |
07:34:26 | dtscode | gokr! |
07:34:33 | dtscode | gokr, gokr gokr !!!! |
07:34:48 | dtscode | oh 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:57 | coffeepot | Good morning :) |
08:17:13 | * | bjz joined #nim |
08:17:22 | gokr | ldlework: 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:36 | Araq | def-: can you work on https://github.com/Araq/Nim/pull/1960 please? |
10:06:53 | Araq | it would be nice to have this in 0.10.4 |
10:09:32 | BlaXpirit | have u considered 0.11.0? |
10:10:09 | BlaXpirit | breaking ^change and whatnot |
10:11:46 | antranigv | nice programming language! :) |
10:12:02 | * | milosn joined #nim |
10:12:08 | Araq | hi antranigv thanks |
10:12:35 | Araq | BlaXpirit: hrm ... well I dunno. having this meaningless 0. in the version annoys me |
10:12:47 | antranigv | I always wanted something like a mix of oberon and python. I think i found it (: |
10:12:48 | BlaXpirit | that is unrelated |
10:13:10 | BlaXpirit | (in reply to Araq) |
10:14:34 | Araq | BlaXpirit: but I will break code again after that ... |
10:14:47 | BlaXpirit | make 0.12, who cares |
10:15:21 | * | milosn quit (Read error: Connection reset by peer) |
10:15:37 | BlaXpirit | to me the point of minor version change is "there is no reason you would ever want to use the previous minor release" |
10:15:58 | Araq | yeah I guess that makes sense |
10:16:59 | * | milosn joined #nim |
10:17:29 | Araq | I updated the todo btw ... this is like a hydra |
10:18:12 | BlaXpirit | :> |
10:18:54 | BlaXpirit | at some point you gotta realize that even if it is not perfect, it is so much better than 0.10.2 |
10:19:48 | BlaXpirit | this could've been 0.11.2 already |
10:20:09 | * | Trustable joined #nim |
10:23:15 | * | a5i joined #nim |
10:23:56 | def- | Araq: work on the existing PR? What should be done? |
10:24:25 | Araq | def-: fix it so that it doesn't need 2 case stmts at least |
10:24:47 | Araq | also 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:55 | Araq | btw I added ..< and ..^ operators |
10:33:05 | Araq | one gotcha less for newcomers, I hope |
10:35:23 | * | johnsoft quit (Ping timeout: 245 seconds) |
10:35:30 | * | johnsoft joined #nim |
10:35:30 | coffeepot | Araq, "..<" is the same as ".. <"? What does ^ do, is power of or deref? |
10:35:53 | Araq | coffeepot: s[0..^1] |
10:36:04 | Araq | it's used for "negative" slicing |
10:36:43 | coffeepot | so that'd mean s[0.. -1]? |
10:37:31 | Araq | yes 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:03 | coffeepot | so s[0..^1] returns is 1st element from the right-hand side of the list? |
10:41:24 | BlaXpirit | this returns everything |
10:41:39 | coffeepot | ah right i see |
10:42:06 | coffeepot | out of interest why was "^" chosen and not "-", easier to parse? |
10:43:01 | coffeepot | forgive my queries, but does that mean s[0..^2] is everything but the last char? |
10:43:13 | coffeepot | item I mean, not char :) |
10:43:27 | Araq | coffeepot: 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:45 | Araq | I never liked this runtime decision |
10:43:57 | BlaXpirit | next operator on the list: ..<^ |
10:44:27 | Araq | (yes, for Nim's case there were other reasons which had to do with inclusive upper bounds yada yada yada) |
10:45:21 | Araq | so ... for lots of reason ;-) |
10:49:18 | coffeepot | cool :) |
10:49:28 | fowlmouth | can we have a ... iterator |
10:49:54 | Araq | fowlmouth: ..< is the same and sexier |
10:50:14 | fowlmouth | oh i see |
10:50:49 | coffeepot | personally i quite like ..< but ^ for negative indexing is unusual for me but don't read too much into that :P |
10:53:15 | coffeepot | assuming for i in 0..<10 is effectively sidestepping around the inclusive upper bound? |
10:53:17 | * | elbow_jason joined #nim |
10:53:40 | coffeepot | btw i quite like the IUB :3 |
10:54:01 | Araq | pfff sidestepping, it's a great feature which makes things explicit |
10:54:04 | coffeepot | but it's nice to have the ability to structure loops differently |
10:55:20 | coffeepot | yeah after the discussion the other day I found myself quite liking the IUB tbh |
10:56:34 | coffeepot | i 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:13 | coffeepot | so var s = "abcd"; echo s[^1] == "d"? |
10:58:35 | BlaXpirit | yes |
10:59:12 | coffeepot | :) cool |
10:59:23 | Araq | hrm looks like I broke bootstrapping ... ? |
10:59:31 | Araq | oh well bbs |
11:17:22 | ekarlso | so what's going on with nim these days ? :p |
11:21:05 | * | untitaker joined #nim |
11:26:51 | repax | It's nefarious tentacles deviously wriggle their way through the dim passages of the web |
11:30:26 | federico2 | obligatory "SOON" quote |
11:30:42 | * | milosn joined #nim |
11:30:55 | federico2 | *Its |
11:31:03 | * | milosn quit (Read error: Connection reset by peer) |
11:31:25 | * | wb joined #nim |
11:34:08 | repax | Thanks, the shame is unspeakable |
11:38:48 | * | yglukhov joined #nim |
11:39:40 | yglukhov | hello, nim channel ;) |
11:40:07 | yglukhov | does anyone know, how do we boot nim after lates changes in devel? |
11:40:24 | yglukhov | koch boot complains |
11:40:29 | yglukhov | lib/system.nim(3269, 5) Error: implementation of 'system.xlen(x: string)' expected |
11:40:42 | yglukhov | can 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:10 | repax | yglukhov: oh? have you tried koch clean? |
11:47:29 | yglukhov | yep |
11:47:48 | yglukhov | actually, I've got evidence in IRC logs now =) |
11:48:01 | * | milosn__ is now known as milosn |
11:48:51 | yglukhov | Araq has confesseв ;) |
11:49:14 | repax | I see |
11:49:35 | repax | So 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:58 | yglukhov | yay! 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:21 | yglukhov | Araq, it seems like add() doesn't work for nil seqs with C backend. |
12:45:29 | yglukhov | it works with JS though |
12:47:11 | yglukhov | hm... JS code is also incorrect. |
12:47:15 | yglukhov | in another way. |
12:47:39 | yglukhov | guess, i'll better file a ticket. |
12:49:23 | Araq | yglukhov: add for nil and C backend has not been implemented yet |
12:50:28 | BlaXpirit | wait what |
12:50:35 | BlaXpirit | isn't it supposed to be invalid |
12:51:40 | Araq | BlaXpirit: yes but it will be valid soon |
12:52:02 | BlaXpirit | what the |
12:52:12 | Araq | var s: seq[int] |
12:52:17 | yglukhov | I just found this commit |
12:52:18 | yglukhov | https://github.com/Araq/Nim/commit/4be0d16520ce89a8590090b4216d626f445abff1 |
12:52:21 | Araq | s.add 45 # will work |
12:52:32 | yglukhov | and thought it's done for C also. but nevermind. |
12:52:32 | yglukhov | and thought it's done for C also. but nevermind. |
12:52:52 | yglukhov | Araq, sorry to break your snippet =) |
12:53:33 | yglukhov | Araq, what about nil.add() in JS? Is it "done"? |
12:53:51 | Araq | yglukhov: implemented but untested |
12:54:10 | yglukhov | Ok, there's a bug for you =) |
12:55:07 | Araq | btw somebody else should take over the jsgen, I prefer to work on harder stuff :P |
12:56:43 | Araq | yglukhov: var s: seq[int] |
12:56:44 | Araq | s.add 89 |
12:56:46 | Araq | echo s |
12:56:50 | Araq | works for me for the JS target |
12:57:12 | yglukhov | ok, give me a second, ill craft a sample |
12:57:14 | Araq | oh never mind, it doesn't |
12:57:19 | yglukhov | ok |
12:57:20 | yglukhov | =) |
12:57:48 | yglukhov | the fix is pretty trivial i guess. |
12:58:04 | fowlmouth | nimx is a cool project |
12:58:21 | federico2 | nimx? |
12:58:24 | yglukhov | what? how do you know about it? =))) |
12:58:41 | fowlmouth | i stalk you :p |
12:58:44 | yglukhov | its not listed anywhere, it has no single line of doc |
12:58:44 | yglukhov | =) |
12:59:17 | fowlmouth | i am porting nanovg right now |
12:59:30 | * | mpthrapp joined #nim |
13:00:07 | fowlmouth | https://github.com/memononen/nanovg#screenshot |
13:00:10 | ingsoc | nim for arduino would be nice |
13:01:21 | Araq | ingsoc: doesn't it work already for that? |
13:03:26 | ingsoc | Araq: 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:21 | dom96 | fowlmouth: Why not just write a wrapper? |
13:08:38 | * | pregressive joined #nim |
13:08:41 | * | pregressive quit (Remote host closed the connection) |
13:13:07 | federico2 | should the Feature-suggestions page items be opened as issues instead? |
13:17:08 | yglukhov | fowlmouth, that's cool. does it use shaders for vector drawing? |
13:17:11 | Araq | federico2: I prefer the other route |
13:17:30 | Araq | add feature requests to the wiki page and close some issues instead |
13:17:51 | Araq | out of 450 issues we have like 100 feature requests |
13:18:25 | federico2 | do they bother you? At least on GH they can be discussed, prioritized, closed :) |
13:19:19 | yglukhov | fowlmouth, 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:55 | yglukhov | the native part. webgl uses canvas fonts. |
13:21:06 | Araq | ingsoc: iirc somebody uses nim for that, check out our "embedded" target |
13:22:22 | yglukhov | Nim works just fine for arduino. I've done that a while ago. |
13:22:51 | yglukhov | requires a bit of toolchain setup, can't remember exact steps, but nothing fancy |
13:25:30 | yglukhov | nim works pretty much for everything =) |
13:37:54 | * | thotypous joined #nim |
13:40:19 | Araq | federico2: not really, I rarely look at the list of issues without any applied filter |
13:41:19 | federico2 | gh bug tracker is not exactly the best at managing bugs |
13:41:20 | yglukhov | Araq, mind adding "author:yglukhov" to your filter? ;)) |
13:42:07 | Araq | federico2: actually I like it very much, most other bug trackers are worse IMHO |
13:43:42 | Araq | yglukhov: 2 open bugs? lucky dude |
13:45:30 | Araq | yglukhov: speaking of which ... can you make --app:gui work on macosx? |
13:45:57 | yglukhov | errr... with any test file? |
13:48:33 | yglukhov | clang: error: unknown argument: '-mwindows' |
13:50:46 | Araq | we know about that error |
13:50:51 | Araq | I want you to fix it |
13:52:59 | thotypous | https://github.com/Araq/Nim/blob/devel/compiler/extccomp.nim#L74 |
13:53:02 | yglukhov | ahhh |
13:53:04 | yglukhov | =) |
13:53:33 | yglukhov | but why would anyone want do --app:gui on macos? |
13:53:35 | repax | Do you need to target objective-c in order to make --app:gui work on osx? (in order to access NSApplicationMain for example) |
13:54:00 | Araq | yglukhov: to get rid of the popping up terminal window? |
13:54:24 | Araq | repax: i wouldn't be surprised if that's the case -.- |
13:54:33 | yglukhov | Araq, afaik, that's not the case. |
13:55:10 | yglukhov | MacOS gui apps require different approach in packing them to be gui apps. |
13:55:22 | yglukhov | I mean, there's a notion of bundle on mac os. |
13:55:35 | yglukhov | essentially it's a folder with a specific layout |
13:55:57 | repax | Would that be the compiler's job? I don't think so |
13:56:17 | repax | (i.e. to set up the folder structure) |
13:56:19 | yglukhov | of course not. the compiler should not do it. |
13:56:30 | yglukhov | some other tooling should. |
13:57:12 | repax | Whereas in Windows, the only thing that's special for gui-apps is a special Main-function |
13:57:23 | yglukhov | but what i mean is that gui binary does not differ from CLI binary |
13:58:20 | * | TEttinger quit (Ping timeout: 256 seconds) |
13:58:39 | yglukhov | so 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:55 | repax | So the only problem then, is the console window that pops up |
14:03:37 | yglukhov | I 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:48 | yglukhov | but bundling is not compilers job |
14:04:51 | repax | Why 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:36 | Araq | "standard C" means nothing |
14:05:39 | repax | Perhaps there is some linking that's needed |
14:05:48 | gokr | Araq: meeting |
14:05:58 | Araq | oh so you are here |
14:06:01 | gokr | :) |
14:06:28 | yglukhov | repax, well it's obvious for windows. gui requires WinMain instead of main. |
14:06:58 | repax | yglukhov: One could argue that it's up to the programmer to define the WinMain, manually |
14:07:15 | repax | i.e. take full responsibililty |
14:07:20 | yglukhov | and i would definitely be in that camp! |
14:07:59 | repax | I'm not picking sides, just wondering |
14:08:01 | yglukhov | actually i did need to define custom main to work with sdl |
14:08:36 | yglukhov | thanx Araq, nim allows that =) |
14:09:08 | repax | If I remember correctly, SDL has a WinMain that you can link? |
14:09:58 | repax | Nevermind, I cannot help. |
14:10:50 | yglukhov | can't say anything about windows. my project works on linux, mac, android, ios, webgl, God knows what else. but not windows =))) |
14:11:26 | repax | no loss :) |
14:11:56 | * | darkf quit (Quit: Leaving) |
14:12:33 | pigmej | reactormonk: 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:26 | Araq | yglukhov: how anybody can design a library, cross-platform etc, that requires a custom main is beyond me |
14:20:47 | yglukhov | thats SDL =)) |
14:21:41 | repax | Perhaps it should be considered a framework then |
14:22:19 | yglukhov | well, 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:42 | fowlmouth | lol |
14:31:13 | * | shodan45 quit (Quit: Konversation terminated!) |
14:31:58 | yglukhov | Ok, here's what I've found about mwindows. |
14:32:03 | yglukhov | https://gcc.gnu.org/ml/gcc-help/2004-01/msg00225.html |
14:32:18 | yglukhov | this option looks really obscure to me. |
14:32:49 | yglukhov | does anyone know why is mwindows present in nim? |
14:35:42 | thotypous | I 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:54 | thotypous | which don't open* |
14:36:19 | thotypous | Dev-C++ used to call the mingw compiler with this option if i remember well |
14:37:03 | yglukhov | so... it looks like this option is only needed when targeting windows platform, right? |
14:37:22 | thotypous | and 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:40 | thotypous | yes, IMHO it should produce an error or be ignored if targetOS != Windows |
14:38:35 | thotypous | it only makes sense when generating PE binaries |
14:38:51 | * | milosn joined #nim |
14:40:00 | thotypous | https://code.google.com/p/corkami/wiki/PE#Subsystem |
14:40:07 | thotypous | also https://msdn.microsoft.com/en-us/library/windows/desktop/ms680339%28v=vs.85%29.aspx |
14:40:52 | thotypous | it sets IMAGE_SUBSYSTEM_WINDOWS_GUI |
14:41:56 | yglukhov | ok, now the only thing remains is to figure out how nim configures compilers platform-wise =) |
14:43:09 | yglukhov | does anyone use clang on windows? |
14:43:38 | yglukhov | can I assume that -mwindows is an invalid option for clang regardless of platform? |
14:44:08 | thotypous | you would need to test it, but there is a good chance that it is not -mwindows in clang |
14:44:13 | thotypous | http://sourceforge.net/projects/clangonwin/ |
14:45:29 | repax | Will cross-compilation be possible? |
14:45:36 | thotypous | http://reviews.llvm.org/file/data/zhjdctgd5hykho43fvwk/PHID-FILE-n4rvz4xkb6w2cq2tket2/203017.diff |
14:46:13 | thotypous | if you check targetOS == osWindows, then mingw crosscompiler should work painlessly |
14:46:22 | Araq | well it's hardly win specific if macosx has the same issue |
14:46:51 | Araq | and imho that's an inherent distinction that has to be made |
14:47:02 | Araq | it's either a terminal app or a ui app |
14:47:28 | repax | Araq: except it seems that the console window that can appear on osx is due to lack of bundling |
14:47:42 | thotypous | http://lld.llvm.org/windows_support.html |
14:47:48 | thotypous | "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:30 | yglukhov | Will anyone object, if we just remove -mwindows from clang invocation for now? Anyway clang is a rear beast on windows. |
14:50:35 | thotypous | Araq: 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:02 | thotypous | like repax said, probably it is a matter of bundling |
14:53:38 | repax | Of course, a minimalistic bundle could be generated. But it's kind of ugly |
14:53:53 | yglukhov | please no. =) |
14:54:08 | yglukhov | ios has slightly-different bundle layout =) |
14:55:08 | yglukhov | by the way, how does linux handle that? |
14:55:55 | thotypous | in linux it depends on the desktop environment |
14:56:12 | repax | iOS bundles require: executable and Info.plist. All else seems optional |
14:56:19 | thotypous | it is a convention that the file manager will ask if you want to run an executable in the terminal or not |
14:57:24 | yglukhov | the 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:51 | yglukhov | thotypous, ok so not an issue for linux either. |
14:58:13 | repax | yglukhov: So, one would have to specify osx vs ios |
14:58:19 | * | Ven joined #nim |
14:58:51 | yglukhov | it's funny how we discuss gui apps having no little to no gui frameworks in nim =) |
14:58:59 | repax | Perhaps osx would be default on a mac. And ios target if specified |
14:59:34 | repax | Well, getting this right is kind of a prerequisite? |
15:00:05 | repax | :) |
15:01:12 | yglukhov | but instead of moving in the wrong direction we could just stay and wait untill we see what is right. |
15:01:28 | yglukhov | e.g. --app:gui option doesn't work at all macos. |
15:01:45 | yglukhov | so ignoring it will not make things worse. |
15:02:03 | yglukhov | and imho, ignoring it is actually the right way. |
15:02:06 | repax | Agreed. |
15:02:30 | repax | You might want to apply bundling tools post-build |
15:03:14 | yglukhov | yes. there's a lot to do after linkage. bundle, copy resources, codesign, strip framework headers, etc. |
15:04:17 | yglukhov | and it would be right to have it all in some packaging-tooling |
15:04:28 | yglukhov | actually i was about to write some |
15:05:00 | bougyman | anywhere to get usage examples of http://nim-lang.org/postgres.html ? |
15:05:29 | repax | Can the PE configuration on Windows be done afterwards as well? |
15:05:47 | * | Trixar_za joined #nim |
15:05:52 | Araq | yeah qzite sure |
15:06:06 | Araq | you need to modify some bit in the PE header |
15:07:39 | Araq | bougyman: nimforum used to use it, it's just import db_sqlite vs import db_postgres |
15:08:37 | yglukhov | repax, please note, that -mwindows is not just about PE header. it also adds some libs to link with. |
15:08:47 | repax | Rah.. |
15:10:31 | yglukhov | so... 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:34 | repax | It doesn't make the situation any worse |
15:11:47 | Araq | soo ... --app:lib is valid because unix requires it, but --app:ui makes no sense because windows requires it? double standards, hrm? |
15:12:03 | yglukhov | =)) |
15:12:08 | yglukhov | oh come on... |
15:12:21 | repax | It's a valid point |
15:12:43 | yglukhov | ok, but i'm not proposing to remove --app:gui |
15:13:07 | yglukhov | all i want is remove -mwindows from (specifically) clang compiler invocation |
15:13:30 | yglukhov | it will still work with gcc, mingw, msvc, etc |
15:13:40 | yglukhov | just clang will ignore it. |
15:13:55 | yglukhov | i doubt clang supports it anyway. |
15:14:26 | yglukhov | and i don't have windows to check it out. |
15:14:54 | yglukhov | i mean i can spend a couple of hours to test it, but i'm not going to. sorry. |
15:16:25 | Araq | yglukhov: I don't mind, but I really do mind the double standards developers have. |
15:17:24 | repax | I actually think that GUI-apps themselves are a special case not to be a concern for the compiler. |
15:17:43 | repax | I actually think that GUI-apps themselves are a special case not to be a concern for the compiler. |
15:17:45 | repax | sorry |
15:17:49 | repax | What is needed is a cross-platform tool that packages/links/bundles apps - all done after compilation. |
15:17:51 | yglukhov | actually, there are no double standards here. what I'm trying to say is that clang configuration in extccomp.nim is just wrong. |
15:18:09 | yglukhov | but i can't prove it without a windows machine =) |
15:18:17 | Araq | but *why* do you think that? for library building it's a special case for the compiler too |
15:18:47 | yglukhov | because clang knows nothing about -mwindows flag |
15:19:18 | * | endragor quit (Ping timeout: 272 seconds) |
15:19:52 | repax | From a usability pov the best thing for simple apps would be autogenerated, minimalistic bundles on mac/ios |
15:20:20 | repax | But it's ugly, and imo, so is PE fiddling by the compiler |
15:21:00 | yglukhov | on windows, GUIness is a property of a binary. on linux and mac it is not. |
15:21:10 | yglukhov | compiler is responsible only for the binary |
15:21:20 | repax | ideally, yes! |
15:22:19 | yglukhov | minimalistic binary is not so easy to do properly. |
15:22:27 | yglukhov | it has to be codesigned. |
15:22:33 | yglukhov | it has to have resources. |
15:22:51 | yglukhov | it has to be codesigned after the resources are in it. |
15:23:26 | repax | Only if it should be published, right? |
15:23:40 | yglukhov | sure |
15:23:54 | yglukhov | or... no... |
15:23:55 | repax | Or deployed on a device, other than the dev computer |
15:23:58 | yglukhov | not only... |
15:24:39 | yglukhov | most of the time you want to sign it with dev certificates even for testing. |
15:24:58 | yglukhov | i mean, technically it would work without them. |
15:25:05 | repax | Sorry, I must leave now. |
15:25:07 | * | Trixar_za left #nim ("Leaving") |
15:25:11 | repax | to catch a bus. bbl |
15:25:17 | yglukhov | ok, c u |
15:26:55 | * | brson joined #nim |
15:31:59 | * | Ven joined #nim |
15:38:09 | coffeepot | is 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:41 | Araq | coffeepot: yes, but I am not gonna show how cause it's stupid |
15:38:59 | coffeepot | haha well I somehow thought you might say that :) |
15:40:25 | coffeepot | the 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:34 | coffeepot | mainly because I don't want to have to copy a load of arguments to call the same func twice |
15:47:54 | coffeepot | i mean, look at this :/ https://gist.github.com/anonymous/e36ece2062e6e3c2882c |
15:51:18 | fowlmouth | coffeepot, a tuple maybe would be used like this while(; let (has,item) = returnsMaybe(); has): #use item |
15:52:44 | fowlmouth | in your case (;retval = ..; retval != SQL_no_data) |
15:56:37 | coffeepot | thanks 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:24 | coffeepot | though it does look better than having a call with a huge load of params twice on adjacent lines |
16:04:01 | Araq | coffeepot: seriously? you don't know about 'while true:'? |
16:04:08 | Araq | while true: |
16:04:17 | Araq | let retval = longcode(...) |
16:04:26 | Araq | if retVal == NO_DATA: break |
16:04:51 | coffeepot | huh... i didn't think of that. I suppose that is a better approach |
16:05:19 | coffeepot | :) |
16:05:40 | Araq | that's an idiom taken from python |
16:06:09 | Araq | so it fortunately it cannot be criticized |
16:06:14 | coffeepot | haha |
16:06:29 | Araq | if it was my invention everybody in #nim would oppose it heavily |
16:06:35 | emilsp | hey, but I hate the whole true loop thing |
16:06:58 | Araq | I disagree, I actually dislike 'while cond' loops, so inflexible |
16:06:58 | emilsp | Araq, if people truly despised everything you created, there wouldn't be any people in #nim |
16:07:14 | Araq | emilsp: nevertheless it surely feels this way |
16:08:24 | Araq | emilsp: Oberon or maybe Modula 2 has a general 'loop' keyword which is just 'while true' for this reason |
16:08:28 | coffeepot | it'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:49 | coffeepot | i 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:55 | Araq | iirc Eiffel also has a nice looping construct |
16:10:20 | Araq | "there should be only one loop construct in the language" |
16:10:36 | * | justicefries joined #nim |
16:10:43 | Araq | "that's why we have 'retry' too for exception handling ... " err ... what? |
16:12:29 | Araq | coffeepot: actually from a formal point of view you're right, 'while true: break' is bad ;-) |
16:12:32 | emilsp | where did you read that ? |
16:13:27 | Araq | emilsp: maybe I read Bertrand Meyer |
16:13:59 | gokr | In 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:15 | Araq | coffeepot: the invariant after 'while cond' without a break statement is 'not cond'. and with a 'break' statement it's harder to determine |
16:16:40 | Araq | I think that's what you feel is wrong with it |
16:17:37 | coffeepot | hmm that's true. Plus you could have multiple break conditions |
16:17:50 | coffeepot | which would just seem hard to read |
16:18:09 | Araq | but it's not so bad unless your control flow analysis algorithm is right from the 60ies ;-) |
16:19:11 | Araq | (which is actually what Nim implements ...) |
16:19:41 | * | gokr_ joined #nim |
16:19:42 | coffeepot | nim's flow analysis is from the 60s? :) |
16:20:00 | Araq | yup, pretty much |
16:20:48 | * | yglukhov quit (Ping timeout: 276 seconds) |
16:21:01 | Araq | but my excuse is that I don't construct any control flow graph |
16:21:18 | coffeepot | fair enough, if it ain't broke, and all that :) |
16:22:26 | Araq | it is broken, but not broken enough to worry me |
16:22:50 | coffeepot | what would a "more modern" flow analysis bring to the table? |
16:22:58 | coffeepot | just out of interest |
16:23:10 | * | jfchevrette joined #nim |
16:23:17 | coffeepot | i'm assuming it might slow down compilation...? |
16:23:24 | emilsp | coffeepot, a massive graph which represents all paths |
16:26:47 | coffeepot | hmm control flow graphs, further reading for another day :) |
16:26:57 | coffeepot | right 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:25 | repax | That's why I like templates |
17:07:36 | repax | template loop(s:stmt): stmt {.immediate.} = |
17:07:41 | repax | 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:32 | Araq | repax: template loop(s: untyped) = ... with the upcoming changes |
17:20:07 | repax | Araq: it's hard to keep track with changes (in general) |
17:20:37 | repax | Perhaps one should just read the commitlog, but.. |
17:20:49 | Araq | well we keep news.txt up to date |
17:20:57 | Araq | and that's what you should read after a release |
17:21:05 | Araq | of course we haven't released yet |
17:22:13 | * | Strikecarl joined #nim |
17:22:28 | Strikecarl | Currently working on a "math" import for myself. |
17:22:41 | Strikecarl | Already added Pythagoras |
17:22:44 | Strikecarl | What else to add? |
17:23:02 | Strikecarl | Current stuff: http://i.imgur.com/GqSBFCa.png |
17:23:43 | repax | Strikecarl: Well, what's the goal? |
17:24:19 | Strikecarl | Gonna use it for a calculator for private use later, or release it idk. |
17:24:31 | Strikecarl | Just adding stuff that isn't in math import. |
17:24:36 | repax | Strikecarl: you could generalise the pythagorian function to any number of inputs |
17:25:07 | Strikecarl | What you mean? |
17:25:16 | Strikecarl | I already made it so i can choose what numbers to input |
17:25:45 | repax | sqrt(a*a + b*b + c*c + d*d ...) |
17:25:54 | Strikecarl | oh. |
17:26:29 | Araq | Strikecarl: implement this please: http://www.plover.com/~mjd/cftalk/ |
17:26:44 | Araq | it's really cool. and useful for a calculator I think |
17:27:07 | Strikecarl | shit |
17:27:07 | Strikecarl | lol |
17:27:24 | repax | Strikecarl: proc pyth*(x: openArray[float]): float {.noSideEffect.} = |
17:27:57 | Strikecarl | I'll just stick to math i am going to use the next 3-4 years lmao. |
17:28:03 | Strikecarl | I'll look at it tho, Araq. |
17:28:13 | Strikecarl | repax - I'll look at it. |
17:29:04 | * | ingsoc quit (Ping timeout: 255 seconds) |
17:31:42 | Araq | Strikecarl: what kind of math doesn't involve pi or e? ;-) |
17:31:44 | repax | Strikecarl: 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:31 | Strikecarl | Araq what are you making me read. http://i.imgur.com/4nmnm0Q.png |
17:32:44 | repax | Araq: Well, rational trigonometry doesn't need pi to work with triangles and generall geometry over any type of field |
17:33:29 | repax | Strikecarl: how about rational trigonometry, would that be interesting? |
17:33:37 | Araq | repax: fair enough ;-) |
17:34:17 | Strikecarl | Sure, repax |
17:34:21 | Strikecarl | also, if i wan't so like. |
17:34:25 | Strikecarl | without importing "math" |
17:34:32 | Strikecarl | just importing private "stuff.nim" |
17:34:47 | Strikecarl | i will get the pi const |
17:34:52 | Strikecarl | "PI = 3.141592653589793" |
17:35:05 | Strikecarl | do i have to recreate them? |
17:35:11 | federico2 | it's missing some digits |
17:35:19 | repax | :) |
17:35:34 | Strikecarl | Just copy pasted it <.< |
17:35:34 | Strikecarl | http://i.imgur.com/JYXkMFv.png |
17:35:38 | Strikecarl | I know it's alot longer. |
17:39:38 | gokr_ | Crlibm |
17:44:16 | * | ingsoc joined #nim |
17:44:55 | BlaXpirit | Strikecarl, calculate pi at compile time :p |
17:45:06 | Strikecarl | How c: |
17:45:23 | BlaXpirit | make a function to calculate pi and assign its result to constant |
17:45:46 | Strikecarl | Example? :c |
17:46:39 | Strikecarl | π = (4/1) - (4/3) + (4/5) - (4/7) + (4/9) - (4/11) + (4/13) - (4/15) |
17:46:45 | Strikecarl | how can i make it just go on |
17:46:57 | BlaXpirit | with a loop |
17:47:09 | Strikecarl | Can't i use arcsin? |
17:47:13 | Strikecarl | is that a function in math |
17:47:19 | Strikecarl | yus it is |
17:47:43 | BlaXpirit | doubt it would work at compile time. but it may |
17:47:55 | Strikecarl | mk. |
17:48:07 | Strikecarl | Not the best at math ho. |
17:52:16 | thotypous | 8 |
17:53:10 | repax | thotypous: 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:33 | Strikecarl | I love when they just come in, type something that makes no sense and goes out. |
17:53:45 | thotypous | sorry, cat at the keyboard |
17:55:49 | Araq | BlaXpirit: should work at compile-time these days |
17:57:23 | * | yglukhov joined #nim |
17:58:00 | Araq | Strikecarl: we need this http://www.sympy.org/en/features.html in Nim |
17:58:11 | BlaXpirit | very funny |
18:00:06 | Strikecarl | I'll look at it. |
18:00:12 | Strikecarl | gotta finish this stuff first. |
18:02:01 | repax | A symbolic math library could easily take a lifetime to implement. |
18:02:19 | emilsp | there's julia |
18:02:32 | repax | nih |
18:03:06 | * | Strikecarl left #nim (#nim) |
18:04:13 | * | Strikecarl joined #nim |
18:07:17 | thotypous | julia is so similar to nim.. metalanguage stuff, multiple dispatch |
18:07:45 | thotypous | the most striking difference is perhaps nim is more focused in compiling, and julia is focused on interpreting (with a JIT) |
18:09:15 | Strikecarl | Is memory reading possible in NIM? |
18:09:17 | Strikecarl | (windows) |
18:10:10 | repax | Strikecarl: The language wouldn't be a limitation. |
18:10:20 | Strikecarl | mk. |
18:10:27 | Strikecarl | proc calradius*(x): int = |
18:10:27 | Strikecarl | echo 2 * x * PI |
18:10:32 | Araq | thotypous: well Nim also has an effect system |
18:10:33 | Strikecarl | What did i do wrong? |
18:11:26 | thotypous | that's true, the effect system is pretty nice |
18:13:35 | repax | With the effect system you can require no effects: [ ] |
18:13:48 | * | Trustable_2 joined #nim |
18:14:30 | repax | is it/would it be possible to say specifically "not foo". i.e: [ -foo ] |
18:14:57 | repax | That is, any effect is ok, except foo |
18:15:14 | * | Trustable quit (Ping timeout: 244 seconds) |
18:15:31 | Araq | it's on the roadmap, repax |
18:15:41 | repax | Goodie :) |
18:17:59 | thotypous | [ -destroy_system ] |
18:18:11 | repax | good luck ;) |
18:18:32 | repax | [ -bug ] |
18:18:39 | thotypous | lol |
18:19:43 | Strikecarl | [ -spiterrors ] |
18:19:54 | Strikecarl | aka -app:gui |
18:19:55 | Strikecarl | c: |
18:20:10 | repax | One could ponder the expressiveness and syntax. An effect could be one of the following: required, required-negative, undecided |
18:21:07 | repax | Currently, leaving out effect identifiers mean requiring them not to be present. |
18:21:50 | Strikecarl | Can anyone help me |
18:21:50 | Strikecarl | lol |
18:21:55 | Strikecarl | http://pastebin.com/raw.php?i=hFbDJMz3 |
18:22:08 | Strikecarl | I tried everything cri |
18:22:36 | Araq | Strikecarl: type your params, don't be lazy |
18:22:46 | Araq | proc calradius*(x: float) = ... |
18:23:05 | Araq | otherwise it's inferred to be 'int' and float * int is not supported |
18:23:09 | * | phira quit (Excess Flood) |
18:23:36 | Strikecarl | I t tried doing calradius*(x): float = |
18:23:39 | Strikecarl | Mk, 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:27 | Strikecarl | Phira having problems. |
18:26:27 | Strikecarl | <.< |
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:56 | Araq | hi smodo welcome |
18:38:04 | thotypous | https://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:07 | Strikecarl | Ty thotypous |
18:39:21 | * | phira joined #nim |
18:39:21 | * | phira quit (Excess Flood) |
18:39:24 | Araq | er ... do we need the fallback to the old 'nimrod.exe' in koch? |
18:39:48 | Araq | I 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:37 | dom96 | In regards to Nim's version numbers: |
18:41:51 | * | phira joined #nim |
18:41:51 | dom96 | From 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:21 | Araq | dom96: yeah 0.11.0 feels a bit chaotic |
18:45:40 | Araq | but 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:46 | dom96 | indeed |
19:05:47 | dom96 | bbl |
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:36 | flaviu | MagusOTB: 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:14 | Araq | hi flaviu welcome back |
20:23:19 | * | a5i quit (Quit: Connection closed for inactivity) |
20:23:44 | BlaXpirit | wb indeed |
20:24:00 | flaviu | o/ |
20:25:58 | Araq | yglukhov: er what? clang is unstable on windows? how come |
20:32:47 | yglukhov | well thats what I've found from different blogs and posts. |
20:34:00 | yglukhov | http://clang.llvm.org/docs/MSVCCompatibility.html |
20:35:30 | yglukhov | i must admit, I havent studied the topic thoroughly. but clang is far from mainstream on windows, isn't it? |
20:39:27 | Araq | dunno, I used to use it years ago on windows |
20:39:41 | Araq | and it was stable back then already |
20:39:46 | Araq | at least for Nim |
20:45:59 | fowlmouth | Araq, can i use the plugin magic to make an unsafeNew that lets you pass a finalizer? |
20:46:53 | Araq | fowlmouth: you don't need a plugin for that, that's just a single line in system declaring it properly I think |
20:49:23 | fowlmouth | doesnt it need to be in code gens to |
20:49:25 | fowlmouth | too |
20:51:06 | * | Kingsquee joined #nim |
20:51:46 | Araq | I think the codegen already supports it |
20:53:13 | * | HakanD joined #nim |
20:59:42 | * | HakanD quit (Quit: Be back later ...) |
21:00:16 | fowlmouth | not working for me |
21:00:38 | Araq | then patch the codegen :P |
21:01:15 | Araq | the 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:13 | fowlmouth | can this just be a pragma addf(p.module.s[cfsTypeInit3], "$1->finalizer = (void*)$2;$n", [ti, rdLoc(f)]) |
21:16:06 | BlaXpirit | wat |
21:16:29 | fowlmouth | it always bugged me that you have to pass a finalizer with new() |
21:19:14 | Araq | well the proper way is to use proc `=finalize` now |
21:19:25 | Araq | if only it were implemented :P |
21:19:39 | BlaXpirit | what is this |
21:19:49 | BlaXpirit | anything related to destructors? |
21:20:08 | Araq | well finalizers are related to destructors, somewhat, yes |
21:20:15 | fowlmouth | how is =finalize invoked |
21:21:00 | Araq | well it isn't. we still need to attach it via the codegen of 'new' |
21:28:38 | * | gokr joined #nim |
21:37:29 | BlaXpirit | i 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:09 | Araq | BlaXpirit: destructors are at scope exit, finalizers when the GC collects the object |
21:41:16 | Araq | how can they be the same thing? |
21:41:40 | Araq | one approximates lifetimes with scoping rules, the other is nondeterministic |
21:41:46 | BlaXpirit | Araq, ok so why are finalizers so inconvenient to use? |
21:42:02 | Araq | are they? |
21:42:38 | BlaXpirit | now i get it |
21:42:40 | BlaXpirit | ok so |
21:43:06 | BlaXpirit | should it be possible to tell GC to take care of ptr objects? |
21:43:43 | BlaXpirit | by 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:15 | Araq | well finalizers predate the other type bound ops by ~5 years |
21:44:40 | BlaXpirit | because personally I don't see much use for destructors |
21:44:53 | Araq | and when I wrote these things the problem to solve was "how to do it", not "how will people like it" |
21:44:57 | BlaXpirit | and now I see that I had no idea what I was doing when I employed destructors in nim-csfml |
21:46:11 | BlaXpirit | so currently ref objects must be created using new - it is what tells the GC about them |
21:46:25 | BlaXpirit | and only through new can you add a finalizer |
21:47:29 | BlaXpirit | but then there are C libraries which require you to manually destroy an object by calling a function |
21:48:12 | BlaXpirit | what 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:40 | BlaXpirit | and not destructors which limit everything |
21:49:07 | BlaXpirit | I understand that this is possible to make by wrapping the ptr object in a ref object |
21:49:17 | BlaXpirit | but where's the fun in that |
21:51:11 | Araq | BlaXpirit: well how to design destructors properly is still a mystery to me |
21:51:30 | BlaXpirit | let's not talk about them, and forget everything i told you about them |
21:51:49 | BlaXpirit | but please do consider what I just said |
21:51:53 | Araq | er nope, but I know how to figure it out anyway |
21:52:37 | Araq | well passing a 'ptr' directly to the GC is hard. but once we have that, we can pass ownership around between threads too |
21:53:23 | BlaXpirit | I want Nim's GC to accpet ptr (or whatever else) objects after they've been created somewhere else, and call a finalizer |
21:53:49 | fowlmouth | that would be ncie |
21:54:09 | Araq | BlaXpirit: yes I got it |
21:54:12 | * | xet7 quit (Ping timeout: 252 seconds) |
21:54:26 | BlaXpirit | ok, thanks for listening. |
21:54:32 | Araq | lol |
21:55:22 | fowlmouth | so 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:46 | BlaXpirit | strange name though o.o |
21:55:50 | Araq | fowlmouth: yeah |
21:55:58 | Araq | BlaXpirit: it's consistent. |
21:55:58 | BlaXpirit | maybe that's how destructors should be named as well |
21:56:06 | Araq | they are now. |
21:56:09 | BlaXpirit | right. |
21:56:14 | Araq | proc `=destroy` |
21:56:14 | BlaXpirit | that's consistent then :p |
21:56:20 | BlaXpirit | good |
21:56:21 | Araq | proc `=deepcopy` |
21:56:28 | Araq | proc `=` # assignment |
21:56:37 | BlaXpirit | don't know why i haven't heard of these |
21:56:59 | Araq | onionhammer: disliked the .override pragma |
21:57:15 | Araq | and came up with this solution but he used ~ instead of = |
21:57:34 | Araq | I think = makes more sense because then every type bound op starts with = |
21:57:45 | BlaXpirit | pretty nice |
21:57:50 | Araq | and `[]=` is already special in the language |
21:57:51 | fowlmouth | Araq, what about `=finalizer`[T](ref My[T]), this wouldnt exist unless it was used because of deadcodeelim |
21:59:28 | BlaXpirit | (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:28 | Araq | BlaXpirit: you can do that without any new language features |
22:02:41 | Araq | fowlmouth: that's a solved problem in the compiler |
22:02:59 | BlaXpirit | Araq, i don't mean a function that just transforms ptr into ref |
22:03:14 | BlaXpirit | one that also attaches a finalizer to it |
22:03:43 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:09:08 | flaviu | BlaXpirit: I don't think that's possible. |
22:09:18 | BlaXpirit | why not |
22:09:44 | * | xet7 joined #nim |
22:10:08 | thotypous | luajit has ffi.gc which does just that |
22:10:23 | flaviu | object layout is [pointer_metadata*][data ... ...] |
22:10:23 | flaviu | ^ |
22:10:37 | flaviu | iirc, where the ^ signifies the location that the pointer points. |
22:10:55 | BlaXpirit | wut |
22:11:09 | thotypous | http://luajit.org/ext_ffi_api.html#ffi_gc |
22:11:14 | thotypous | would be nice to have that in nim |
22:11:23 | BlaXpirit | i don't know these semantics, but i'm almost positive that simply adding a finalizer to a ptr object is possile |
22:11:47 | BlaXpirit | thx, thotypous |
22:12:59 | BlaXpirit | dont know why it took me so many months to properly formulate the thoughts |
22:13:06 | flaviu | BlaXpirit: How are you going to tell the GC what the finalizer is? |
22:13:13 | BlaXpirit | well, actually I do know. it's because i was deceived about destructors |
22:13:20 | BlaXpirit | flaviu, pass a function pointer?? |
22:13:28 | flaviu | BlaXpirit: Where will the GC store that? |
22:13:41 | BlaXpirit | in RAM |
22:13:42 | flaviu | The ptr is allocated by outside malloc, which does not know to create that header where Nim stores type info. |
22:14:01 | BlaXpirit | why does it have to be inside the object |
22:14:03 | Araq | flaviu: well you only need to detach the header from the object |
22:14:22 | Araq | but it kinda sucks |
22:14:34 | BlaXpirit | now i can just say lua does it |
22:14:34 | flaviu | Yep, although I'd say that its a little unusual to do that. |
22:14:35 | thotypous | luajit does this by creating a box with the foreign pointer inside |
22:14:57 | Araq | especially if you have a write barrier |
22:15:08 | flaviu | thotypous: Yep, I was getting to that, but I needed to make sure I understood the docs. |
22:15:53 | BlaXpirit | well... if this "sucks" maybe it can be separate from the part of the GC that does ref objects |
22:16:29 | flaviu | BlaXpirit: IMO that's exactly the sort of complexity that needs to be avoided. |
22:16:42 | BlaXpirit | it is an essential feature. |
22:17:34 | flaviu | Not necessarily. The pointer can be boxed and the standard mechanisms for finalization reused. |
22:17:34 | BlaXpirit | the ffi system is so good mainly because it allows making convenient bindings without making stupid wrappers |
22:17:44 | BlaXpirit | or it would, if this feature was supported |
22:18:10 | thotypous | flaviu: yes, that is exactly what luajit did ;D |
22:18:31 | BlaXpirit | uhh |
22:18:35 | BlaXpirit | ref ptr object? anyone? |
22:18:58 | BlaXpirit | i should sleep |
22:19:26 | flaviu | BlaXpirit: I don't see it as being a major issue, C apis tend to be more responsible with their allocation. |
22:19:37 | BlaXpirit | wut |
22:19:48 | BlaXpirit | I don't see any meaning behind this sentence |
22:20:10 | flaviu | Big objects are likely to be the ones to need this, as smaller things are allocated on the stack. |
22:20:39 | BlaXpirit | aaand? |
22:21:29 | thotypous | that is exactly the problem we have in luajit |
22:21:42 | * | vendethiel quit (Ping timeout: 252 seconds) |
22:21:44 | thotypous | the pointer is never freed automatically because it doesn't produce pressure in the gc |
22:22:02 | flaviu | BlaXpirit: The overhead from boxing the pointer is likely to be small as it will be frequently used. |
22:22:11 | BlaXpirit | flaviu, aaaand? |
22:22:44 | BlaXpirit | so you're telling me to make stupid wrappers, duplicating every procedure? |
22:22:47 | thotypous | a good implementation would need to have a "gc backdoor" for allowing to control the pressure of the pointer |
22:23:30 | BlaXpirit | or maybe this boxing should be automatic? |
22:23:35 | thotypous | unless the gc in nim is refcounting |
22:23:44 | thotypous | i don't know which kind of gc nim uses |
22:24:22 | * | BlaXpirit quit (Quit: Quit Konversation) |
22:24:26 | flaviu | BlaXpirit: Ah, you mean that usage is a little hard. |
22:24:49 | Araq | thotypous: deferred reference counting |
22:25:06 | thotypous | Araq: thanks for not telling me to RTFM :D |
22:25:17 | thotypous | i had just opened http://nim-lang.org/gc.html |
22:25:36 | Araq | yeah a little hard if you completely ignore we have a macro system for these things |
22:26:04 | Araq | thotypous: I never tell people that. I accepted nobody reads anything. |
22:26:06 | flaviu | BlaXpirit: Well, I don't believe that "torture the implementor on behalf of the user" is completely right. |
22:26:51 | thotypous | Araq: 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:36 | thotypous | 48K stdlib_mimetypes.o |
22:43:13 | thotypous | I'm so glad httpclient only uses mimetypes if you use addFiles*(p: var MultipartData, xs: openarray[tuple[name, file: string]]) |
22:54:02 | flaviu | thotypous: What are you doing that 48k is significant? |
22:55:07 | flaviu | That sounds a bit snide, but I'm asking out of curiosity. |
22:55:15 | thotypous | flaviu: 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:34 | transfuturist | ENCODING_MS_SYMBOL = ((uint32('s') shl 24) or (uint32('y') shl 16) or (uint32('m') shl 8) or uint32('b')) |
22:59:42 | transfuturist | Hint: unsigned [Processing] |
22:59:42 | transfuturist | freetype2.nim(24, 15) Error: internal error: getInt |
23:00:01 | transfuturist | how can i cast a char to an int? |
23:00:20 | transfuturist | (this is for a freetype wrapper) |
23:00:36 | Araq | not at compile-time apparently |
23:00:46 | transfuturist | ha |
23:01:00 | Araq | btw bug reports are better done with the issue tracker |
23:01:10 | * | vendethiel quit (Ping timeout: 255 seconds) |
23:01:22 | transfuturist | i'll make one |
23:01:26 | fowlmouth | thought someone has a freetype wrapper already? |
23:01:38 | transfuturist | paulina, or something like that |
23:01:46 | transfuturist | it's not actually a thing |
23:01:56 | transfuturist | abandoned |
23:02:02 | fowlmouth | oh |
23:03:36 | * | noob joined #nim |
23:04:05 | noob | How 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:21 | noobie_ | sorry had to change names, what is the correct way of making a sequence of objets? |
23:05:24 | noobie_ | objects*? |
23:06:07 | Araq | like you did but with fewer stars |
23:06:34 | transfuturist | https://github.com/Araq/Nim/issues/2589 |
23:06:40 | onionhammer | Araq i dont mind =destroy as long as it's not {.prgama.} magic :) |
23:07:11 | transfuturist | also, araq, i want to ask you something |
23:07:14 | noobie_ | Sweet thank you |
23:07:20 | onionhammer | Araq 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:42 | transfuturist | when 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:06 | transfuturist | or is seq not equivalent to a dynamic array? |
23:08:54 | onionhammer | a seq has an underlying buffer that it stores things in |
23:09:25 | * | flyx quit (Ping timeout: 264 seconds) |
23:09:52 | transfuturist | is there a way to pass c the sequence's buffer pointer? |
23:10:49 | onionhammer | yeah, you can pass that iirc, it's the same address as the sequence |
23:11:10 | def- | addr mySeq[0] |
23:11:21 | onionhammer | http://nim-lang.org/manual.html#reference-and-pointer-types |
23:11:42 | onionhammer | but if the seq gets resized that address my be invalidated |
23:12:34 | * | vendethiel joined #nim |
23:13:27 | transfuturist | not an issue for just calling out to a C api |
23:13:46 | onionhammer | if the C api doesnt store the address |
23:13:55 | transfuturist | i 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:13 | transfuturist | anything else is an unfriendly design |
23:30:48 | * | a5i joined #nim |
23:35:12 | * | vendethiel quit (Ping timeout: 256 seconds) |
23:38:08 | transfuturist | why 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 |