00:00:44 | ekarlso | anything revolutionizing in nim as of late flaviu ? |
00:02:26 | flaviu | I haven't been keeping up lately either. |
00:02:39 | flaviu | From what I can tell, lots of small improvements. |
00:03:25 | flaviu | There's been an absurd amount of bikshedding on these two PRs: https://github.com/Araq/Nim/pull/2515 https://github.com/Araq/Nim/pull/2762 |
00:06:37 | lll | is there a way to {.push hint[XDeclaredButNotUsed]: off.} , for stuff declared inside macros? |
00:06:53 | lll | witouth removing it program wide |
00:07:47 | lll | i tried inside the macro declaration, at the call site combination of both, even inside the parsestmt itself lol |
00:08:40 | flaviu | lll: Export the thing? |
00:08:41 | * | Ven joined #nim |
00:09:04 | lll | export what? |
00:09:14 | lll | the macro? |
00:09:24 | flaviu | whatever is giving you the "declared but not used" warning. |
00:09:41 | flaviu | So if you generate a proc, make it public. |
00:14:22 | lll | mmmm but its a library, i didnt want to have to export those symbols, whatever that will work for now, ill rethink my solution later |
00:15:04 | lll | thx |
00:15:06 | * | dddddd quit (Ping timeout: 272 seconds) |
00:17:34 | * | Trustable quit (Remote host closed the connection) |
00:19:04 | * | flaviu quit (Remote host closed the connection) |
00:19:21 | * | flaviu joined #nim |
00:19:44 | * | jbomo joined #nim |
00:26:47 | * | epichero quit () |
00:27:02 | * | epichero joined #nim |
00:28:00 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:33:48 | * | taesoo joined #nim |
01:05:07 | * | flaviu quit (Read error: Connection reset by peer) |
01:09:43 | * | flaviu joined #nim |
01:11:04 | * | key_ joined #nim |
01:11:52 | * | Kingsqueee joined #nim |
01:12:05 | * | Matthias247 quit (Read error: Connection reset by peer) |
01:14:00 | * | epichero_ joined #nim |
01:14:30 | * | keypusher quit (Read error: Connection reset by peer) |
01:14:31 | * | Kingsquee quit (Read error: Connection reset by peer) |
01:14:31 | * | epichero quit (Ping timeout: 264 seconds) |
01:18:10 | * | flaviu quit (Ping timeout: 265 seconds) |
01:22:25 | * | Roin_ joined #nim |
01:28:41 | * | Roin quit (*.net *.split) |
01:36:29 | * | darkf joined #nim |
01:42:02 | * | adu joined #nim |
01:53:47 | * | epichero_ quit () |
01:54:03 | * | epichero joined #nim |
02:10:12 | * | adu quit (Ping timeout: 256 seconds) |
02:21:55 | * | strcmp2 quit (Quit: sleep like a boss) |
02:22:14 | * | notfowl is now known as fowl |
02:22:14 | * | fowl is now known as 16WAA1160 |
02:24:06 | * | 16WAA1160 is now known as fowlmouth |
02:24:52 | * | fowlmouth is now known as fowl |
02:32:13 | * | cyraxjoe_ joined #nim |
02:33:48 | * | cyraxjoe quit (Ping timeout: 252 seconds) |
02:35:01 | * | jrenner1 joined #nim |
02:35:32 | jrenner1 | is there a way to get the size (number of items) in an enum? |
02:54:50 | * | boydgreenfield joined #nim |
02:55:36 | * | johnsoft joined #nim |
03:12:29 | reactormonk | jrenner1, high(type) -1 might work, but only if it's continuous |
03:36:46 | ggVGc | how can I make c2nim add importc directives to each function without also using dynlib? |
03:39:14 | jackv | ggVGc why do you need to? |
03:40:07 | * | vikaton joined #nim |
03:40:23 | vikaton | Hi |
03:40:35 | * | epichero quit () |
03:40:50 | * | epichero joined #nim |
03:45:42 | ggVGc | jackv: well, firstly I don't know why I would need the dynlib directive for my use case, but more importantly the current c2nim seems to output an incorrect dynlib directive without quotes, which chokes on my current nim version |
03:46:56 | jackv | hmm, idk, I'll let someone who knows something answer this one |
03:48:52 | fowl | ggVGc: it expect dynlib to be a symbol |
03:49:25 | jrenner1 | is there a way to make an object run code on construction (other than writing a proc to create it)? |
03:49:32 | fowl | Ie libname. Then at the top you have a diff libname set for each platform |
03:49:41 | ggVGc | fowl: okay. but all I actually want is the importc directive for all my headers. can I do that? I don't need dynlib at all actually |
03:49:53 | Varriount | jrenner1: Not really. Nim objects are fairly similar to C structs. |
03:49:54 | fowl | ggVGc: pass header |
03:50:01 | jrenner1 | Varriount: ok I just wanted to check |
03:50:05 | fowl | To c2nim |
03:51:20 | fowl | jrenner1: len(enum.low .. Enum.high) maybe or high - low + 1. Length only makes sense if its contiguous though |
03:52:21 | * | vendethiel- quit (Ping timeout: 250 seconds) |
03:57:44 | * | BitPuffin|osx quit (Ping timeout: 245 seconds) |
03:57:59 | ggVGc | fowl: I don't want the header directive either though. I just want the importc. am I doing something very weird? this seems like pretty normal usage |
03:58:10 | * | johnsoft quit (Ping timeout: 265 seconds) |
03:58:26 | * | johnsoft joined #nim |
03:59:00 | fowl | ggVGc: weird from c2nim, where is the function if not in a header or dynlib |
03:59:45 | ggVGc | fowl: it will be statically linked in later when the final executable is built |
04:01:00 | ggVGc | fowl: I have some existing C code, and I am writing a nim module to use with it. I want to compile this nim module to C, and then build everything using gcc(since that is the current project workflow). So I just want some nim stubs of existing C functions so I can use it in the nim module. |
04:01:19 | ggVGc | fowl: it all works fine if I add importc directives manually. But I'd like c2nim to do it for me |
04:05:51 | vikaton | can we c2nim the linux operating system? |
04:06:13 | Varriount | vikaton: Could you clarify your question? |
04:06:54 | fowl | ggVGc: its weird to have neither header or dynlib. Esp coming from c2nim. What are you translating if not a header |
04:07:01 | Varriount | ggVGc: If I recall correctly, there's a c2nim specific pragma that allows you to 'inject' nim code, as well as a predefined macro for detecting if c2nim is scanning the file. |
04:07:08 | * | jrenner1 quit (Quit: WeeChat 0.4.2) |
04:07:20 | vikaton | it was more of a joke than a serious question :P |
04:07:44 | ggVGc | fowl: I am translating a header. But there is no dynamic library since the implementations are linked statically in the final build. |
04:08:32 | Varriount | vikaton: c2nim can be used with regular C files, however it's ability to translate C idioms to Nim are... limited. |
04:08:32 | ggVGc | fowl: and the header directive just complicates things since then nim tries to find the original header, which it shouldn't care about. I just want nim to know the signatures of my C functions. |
04:08:47 | Varriount | ggVGc: importc? |
04:09:33 | Varriount | http://nim-lang.org/docs/manual.html#foreign-function-interface-importc-pragma |
04:09:45 | Varriount | The header pragma isn't *required*, I don't think. |
04:12:20 | ggVGc | Varriount: right, that's what I'm asking about. How to get c2nim to only add importc and nothing else. But I am patching c2nin to do that now |
04:12:27 | ggVGc | since it apparently is not a common use case |
04:12:29 | ggVGc | which is weird to me |
04:12:45 | Varriount | ggVGc: Most people use shared libaries, or modify the generated output. |
04:13:09 | Varriount | ggVGc: By the way, what editor are you using? |
04:13:19 | ggVGc | Varriount: vim, why? |
04:13:24 | ggVGc | pretty obvious I would reckon |
04:13:54 | Varriount | How would it be obvious to me? You could be using emacs... or eclipse ;D |
04:14:36 | Varriount | I ask, since I recommend to anyone using Sublime Text to download the NimLime plugin (which onionhammer and I develop) |
04:14:39 | fowl | ggVGc: c2nim output always requires massaging |
04:14:52 | Varriount | ^ Or the input |
04:15:22 | Varriount | You usually need to get rid of all the ifdefs (module_name) |
04:15:54 | ggVGc | Varriount: well, my nickname is a vim command. thought that was why you were asking |
04:16:30 | Varriount | ggVGc: Neat! |
04:18:52 | * | vikaton quit () |
04:19:32 | * | ddl_smurf quit (Quit: ddl_smurf) |
04:19:54 | * | vikaton joined #nim |
04:20:05 | * | vikaton quit (Client Quit) |
04:36:58 | * | intra joined #nim |
04:40:18 | * | taesoo quit (Ping timeout: 252 seconds) |
05:02:14 | * | taesoo joined #nim |
05:21:57 | * | dtscode quit (Remote host closed the connection) |
05:57:42 | * | dtscode joined #nim |
06:05:11 | Varriount | onionhammer: Any idea why, in sublime text, Settings.add_on_change would appear to do nothing? |
06:15:20 | * | taesoo quit (Ping timeout: 272 seconds) |
06:29:22 | * | TEttinger quit (Ping timeout: 255 seconds) |
06:32:54 | * | boydgreenfield quit (Quit: boydgreenfield) |
06:35:12 | * | kumool joined #nim |
06:37:53 | * | kumul quit (Ping timeout: 246 seconds) |
06:38:20 | fowl | Varriount: there's a new version of nimline out? |
06:38:26 | * | sepisoad_ joined #nim |
06:38:45 | * | superfunc quit (Quit: Page closed) |
06:42:31 | * | dtscode is now known as charmander |
06:51:39 | * | kumool quit (Quit: Leaving) |
06:58:26 | * | charmander is now known as bulbasaur |
07:02:12 | * | jbomo quit (Ping timeout: 272 seconds) |
07:04:17 | * | vendethiel joined #nim |
07:10:39 | * | pregressive quit (Remote host closed the connection) |
07:12:45 | Varriount | fowl: I'm trying to get it out the door, but keep finding things to refactor. |
07:19:37 | * | nande quit (Remote host closed the connection) |
07:23:55 | * | MyMind joined #nim |
07:27:35 | * | vendethiel quit (Ping timeout: 246 seconds) |
07:42:54 | * | MyMind quit (Ping timeout: 252 seconds) |
07:55:10 | * | xcombelle joined #nim |
07:56:57 | ggVGc | how do I correctly create this Camera object and get a pointer to it? https://gist.github.com/3f8f14e20ca8f8d42715 |
08:02:18 | * | gmpreussner|work quit (Read error: Connection reset by peer) |
08:03:18 | * | epichero quit (Remote host closed the connection) |
08:12:04 | * | BlaXpirit joined #nim |
08:14:31 | * | cyraxjoe_ is now known as cyraxjoe |
08:22:07 | reactormonk | ggVGc, I don't think you need all of the importc statements btw |
08:22:16 | ggVGc | reactormonk: output from c2nim |
08:22:25 | reactormonk | ggVGc, ok, then just keep it |
08:22:39 | reactormonk | for allocating new stuff, go via new(cam) |
08:22:44 | reactormonk | then you can assign the single fields |
08:23:39 | ggVGc | reactormonk: well, I need to pass a ptr to a wrapped C function. I used cast[ptr Camera](cam) |
08:23:42 | ggVGc | seems to do what I want |
08:24:07 | reactormonk | no need to cast from what I see |
08:24:48 | ggVGc | reactormonk: because you don't have the call site where I need a ptr |
08:25:13 | ggVGc | reactormonk: I misstated my question I guess. I needed to make a ref into a ptr |
08:25:37 | reactormonk | ggVGc, ah ok. addr gives you the address |
08:26:14 | ggVGc | yeah, that doesn't help either |
08:26:25 | ggVGc | a ref is already an address |
08:26:26 | reactormonk | I know :-/ |
08:26:36 | reactormonk | a ref is a managed address |
08:26:37 | ggVGc | anyway, the cast is what I was looking for |
08:26:39 | ggVGc | right |
08:26:41 | reactormonk | nope, it's not |
08:26:44 | ggVGc | hence why I needed the cast syntax |
08:26:55 | ggVGc | I just started with Nim a few hours ago |
08:26:56 | reactormonk | because the memory is still managed by the GC and might get cleaned up |
08:27:17 | ggVGc | reactormonk: it won't get cleaned up while the ref is still in scope |
08:27:31 | reactormonk | ggVGc, that's true, but still a rather flanky assumption |
08:27:36 | ggVGc | reactormonk: I am not passing the ownership to the C function. I am merely letting it interact with my reference |
08:28:09 | ggVGc | I don't think it's a bad assumption. Pretty sure I know exactly how this is all happening, and the generated C is what I wanted. If Nim removes my reference while I am still using it, that's a major bug |
08:28:19 | ggVGc | and the C function I am calling takes no ownership |
08:28:30 | reactormonk | ggVGc, anyway, http://nim-lang.org/docs/manual.html#types-reference-and-pointer-types |
08:28:36 | ggVGc | the calling code owns the ref, so it's fine for Nim to GC it when I'm done |
08:29:44 | ggVGc | reactormonk: I don't see how it can be unsafe to pass a GC-managed reference to a C function that assumes no ownership of it. Am I missing something fundamental? |
08:31:25 | reactormonk | ggVGc, ah, new can only be used for traced memory (e.g. ref) |
08:32:47 | ggVGc | reactormonk: I am not following you. Is there a problem with this or not? https://gist.github.com/5b5f2c38b0eb97dca93f |
08:33:58 | reactormonk | ggVGc, might be, if cam goes out of scope but the function returns something with a reference to cam and you return that. |
08:37:15 | ggVGc | reactormonk: well, that would be dumb. I am very aware of how to deal with memory and scope and garbage collectors. All I asked initially was how to get a raw pointer from a ref. I am fully aware I am now writing unsafe code, but I am very certain of where the scope for cam starts and ends, and that the C functions do not assume ownership. |
08:37:37 | ggVGc | reactormonk: if there isn't something very special with Nim, I don't think you're telling me much news |
08:38:19 | * | silven_ is now known as silven |
08:38:31 | ggVGc | reactormonk: how could cam go out of scope in the pasted example? |
08:39:16 | reactormonk | ggVGc, I would assume you modify some global variable via camSetActive? seems to have some side effects |
08:40:27 | ggVGc | reactormonk: as I said I am quite aware of how to deal with scopes and memory ownership, and that these C functions do not assume ownership, but here you go, https://gist.github.com/c3b8ccbbba31b882a627 |
08:41:01 | reactormonk | ggVGc, perfect. |
08:41:18 | reactormonk | nuff said. But if you need something outside the GC, the alloc0 is the way to go |
08:49:14 | * | Matthias247 joined #nim |
09:01:14 | * | MyMind joined #nim |
09:05:10 | * | cyraxjoe_ joined #nim |
09:06:30 | * | cyraxjoe quit (Ping timeout: 252 seconds) |
09:09:23 | * | vendethiel joined #nim |
09:10:53 | * | JinShil joined #nim |
09:15:29 | * | Senketsu joined #nim |
09:33:38 | * | vendethiel quit (Ping timeout: 252 seconds) |
09:34:18 | * | OnO joined #nim |
09:35:17 | Araq | ggVGc: reactormonk is wrong, your code is fine. well I didn't look at it, but from the conversation it's obvious you know what you're doing |
09:35:44 | reactormonk | Araq, meh, ok. |
09:35:53 | Araq | ;-) |
09:36:02 | Araq | how's the nimsuggest bug hunt? |
09:36:11 | * | Kingsqueee quit (Quit: Konversation terminated!) |
09:36:54 | reactormonk | ugly |
09:37:08 | reactormonk | I honestly don't know where to look right now :-/ |
09:37:54 | * | boopisaway is now known as boop |
09:39:25 | Araq | msgs.nim implements the filename->index mapping |
09:39:41 | Araq | and you said the file index is not re-used |
09:39:55 | Araq | so ... it's pretty obvious where to look? |
09:42:48 | * | Ven joined #nim |
09:43:04 | * | vendethiel joined #nim |
09:48:25 | * | milosn quit (Ping timeout: 258 seconds) |
09:48:39 | reactormonk | I still need to figure out how it should look like |
09:49:09 | reactormonk | because the situation where it's called the second time is not really easily inferrable from how to the compiler works, because the compiler never gets a second compile instruction |
09:50:00 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:56:00 | * | sepisoad_ quit (Ping timeout: 256 seconds) |
09:59:50 | * | ddl_smurf joined #nim |
10:01:32 | * | ddl_smurf quit (Client Quit) |
10:10:57 | * | MyMind quit (Ping timeout: 240 seconds) |
10:11:31 | * | pregressive joined #nim |
10:15:51 | * | pregressive quit (Ping timeout: 250 seconds) |
10:16:31 | ggVGc | Araq: Why can't variants be compile time checked? |
10:20:57 | Araq | reactormonk: so inject some writeStackTrace() calls |
10:21:17 | Araq | ggVGc: they can and are but it's hidden under some switch |
10:28:04 | ggVGc | Araq: hm, I have fieldChecks on, and --experimental. Still don't get a compile error on code that crashes in runtime with FieldError |
10:30:16 | Araq | it's warning[proveField]:on, I think |
10:31:16 | ggVGc | Araq: oh, thanks. That does give me warnings at least. Where is this documented? |
10:31:31 | Araq | iirc in the compiler guide |
10:32:44 | Araq | er ... no it is not. yay |
10:32:48 | Araq | also wtf |
10:32:58 | Araq | http://nim-lang.org/docs/nimc.html#nim-idetools-integration |
10:33:05 | Araq | why does this still exist? |
10:34:01 | ggVGc | Araq: why is that warning not made into a standard error? |
10:34:27 | ggVGc | compile time check of variant types is the difference between being usable or not at all for me |
10:34:38 | Araq | it would break too much code |
10:35:18 | Araq | and it's more expressive this way, I often have something like: |
10:35:46 | Araq | for i in 0 ..< safeLen(n): access n.kids[i] |
10:36:01 | Araq | where safeLen returns 0 when n.kids cannot be accessed |
10:36:16 | Araq | so it's safe but the compiler is too stupid to realize |
10:43:13 | ggVGc | Araq: should be able to solve cases like that in compile time too though, but I guess that's a feature for the future |
10:43:38 | Araq | indeed. |
10:46:56 | * | ingsoc joined #nim |
10:51:26 | ggVGc | Araq: hm, I think that warning is too strict. Shouldn't this be all good? https://gist.github.com/0da22145e6b2efc62712 |
10:51:37 | ggVGc | I get Warning: cannot prove that field 'n.intVal' is accessible [ProveField] |
10:51:59 | Araq | lol |
10:52:28 | Araq | there is hardly any dataflow analysis involved |
10:53:07 | Araq | you should compare it to what a FP language requires you to write: |
10:53:17 | Araq | case n.kind |
10:53:27 | Araq | of nkInt: n.intVal = 3 |
10:53:32 | Araq | else: discard |
10:53:53 | ggVGc | yeah, I see. So they're not actually compile checked yet then |
10:54:08 | ggVGc | I was looking for what haXe has with enums |
10:54:22 | Araq | they are checked as good as Haxe does it. |
10:54:24 | ggVGc | anyway, all good. just wanted to know how it was |
10:54:32 | ggVGc | alright |
10:55:07 | Araq | in fact, the checking already is better |
10:55:37 | Araq | if n.kind != nkString: n.intVal = 3 # works, irrc |
10:57:55 | ggVGc | Araq: so, should this work? https://gist.github.com/34e84fd80fff37096295 |
10:58:00 | ggVGc | because it still errors for me |
10:58:38 | Araq | no, it shouldn't. cause 'n' is a global variable. |
10:59:57 | Araq | you have to use less toy'ish toy examples to see if it works for you |
10:59:59 | ggVGc | ah, with a let binding it works |
11:00:32 | ggVGc | I just want to know what I can assume to be checked |
11:00:47 | Araq | you can treat the warning as an error. |
11:01:32 | Araq | you need to adapt your coding style slightly to make the prover happy, but it should work out just like in FP languages |
11:06:04 | * | dddddd joined #nim |
11:06:51 | * | banister joined #nim |
11:18:35 | * | ingsoc quit (Ping timeout: 246 seconds) |
11:21:42 | Araq | dom96: what do you think of versioning in the language? |
11:21:43 | * | stefantalpalaru joined #nim |
11:21:55 | dom96 | Araq: what do you mean? |
11:22:10 | Araq | proc toUpper(s: string): string {.version: "0.11.4".} # in unicode.nim |
11:22:31 | Araq | import unicode {.version: "0.11.2".} # doesn't import toUpper |
11:23:32 | Araq | however, this doesn't mean we have multiple versions of unicode.nim in the stdlib |
11:24:00 | Araq | it's only a means to freeze imports |
11:25:35 | Araq | but then it shouldn't be done via the import statement |
11:27:17 | stefantalpalaru | Hi. How are libraries specified with dynlib located? I'd like to move the path outside of the code, but -p:"..." is ignored for this purpose and I can't use gorge in this particular file to determine the path (the file is lib/system/mmdisp.nim because I'm messing with a new GC) |
11:28:07 | Araq | stefantalpalaru: sounds like you confused everything :P |
11:28:34 | Araq | dynlib uses dlopen, so the OS does the path handling |
11:28:47 | Araq | -p is for Nim's import/include statements |
11:29:44 | Araq | and lib/system/mmdisp can **include** (not import) external Nim code |
11:29:49 | * | ddl_smurf joined #nim |
11:30:28 | Araq | so ... -p:path_to_my_new_gc_stuff should work |
11:31:02 | Araq | you can also override where the compiler looks for system.nim via --lib |
11:31:15 | dom96 | Araq: meh |
11:31:18 | dom96 | I don't like it |
11:31:22 | Araq | good. |
11:39:41 | Araq | lol |
11:39:57 | Araq | flaviui replaced CRC with SHA1 in the compiler. |
11:40:07 | Araq | *flaviu |
11:42:04 | Araq | dom96: is the optionals module ready for review? |
11:42:27 | dom96 | I believe so |
11:53:09 | * | banister quit (Read error: Connection reset by peer) |
12:04:21 | * | banister joined #nim |
12:09:15 | * | strcmp1 joined #nim |
12:11:05 | * | filcuc joined #nim |
12:29:02 | * | HakanD joined #nim |
12:30:31 | * | HakanD_ joined #nim |
12:30:55 | * | strcmp1 quit (Quit: Leaving) |
12:31:23 | * | strcmp1 joined #nim |
12:33:45 | * | HakanD quit (Ping timeout: 240 seconds) |
12:59:45 | * | filcuc quit (Ping timeout: 256 seconds) |
13:07:51 | * | Matias joined #nim |
13:08:24 | * | thotypous quit (Disconnected by services) |
13:08:26 | * | Matias is now known as thotypous |
13:15:19 | * | ingsoc joined #nim |
13:15:19 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:17:59 | * | MyMind joined #nim |
13:24:50 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:31:14 | * | bjz quit (Quit: Textual IRC Client: www.textualapp.com) |
13:31:35 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
13:32:04 | * | BlaXpirit quit (Remote host closed the connection) |
13:32:29 | * | filcuc joined #nim |
13:33:57 | * | BlaXpirit joined #nim |
13:34:36 | * | OnO joined #nim |
13:35:31 | Araq | ggVGc: just read some logs, use #header instead of #dynlib for c2nim |
13:35:44 | * | OnO quit (Client Quit) |
13:40:27 | * | HakanD_ quit (Quit: Be back later ...) |
13:40:54 | * | HakanD_ joined #nim |
13:43:47 | * | BlaXpirit_ joined #nim |
13:43:47 | * | BlaXpirit is now known as Guest71244 |
13:43:47 | * | Guest71244 quit (Killed (card.freenode.net (Nickname regained by services))) |
13:43:47 | * | BlaXpirit_ is now known as BlaXpirit |
13:45:54 | * | HakanD_ quit (Ping timeout: 276 seconds) |
13:47:36 | * | Sembei quit (Max SendQ exceeded) |
13:47:58 | * | MyMind quit (Ping timeout: 264 seconds) |
13:48:48 | * | Sembei joined #nim |
14:00:54 | * | flaviu joined #nim |
14:04:15 | * | gmpreussner|work joined #nim |
14:04:24 | * | MyMind joined #nim |
14:06:40 | * | Sembei quit (Ping timeout: 272 seconds) |
14:14:02 | * | milosn joined #nim |
14:17:45 | * | ozra joined #nim |
14:19:58 | * | HakanD_ joined #nim |
14:20:26 | * | xcombelle quit (Remote host closed the connection) |
14:20:38 | * | HakanD__ joined #nim |
14:22:49 | * | Siecje joined #nim |
14:23:35 | federico3 | Araq: I just ran into http://forum.nim-lang.org/t/602 on a 64-bit unix |
14:23:50 | * | darkf quit (Quit: Leaving) |
14:23:55 | ozra | Hi. Anyone in here who can help me fill in some blanks in my understanding? What does `[PType * PType]` mean in `proc TypeEqualsAux(a, b: PType, s: var set[PType * Ptype]): bool` ? |
14:24:21 | Araq | ozra: it's pseudo code, a set of tuples |
14:24:38 | * | HakanD_ quit (Ping timeout: 265 seconds) |
14:25:02 | Araq | nowadays written as HashSet[(PType, PType)] |
14:25:09 | ozra | Aha, it's not nim syntax? |
14:25:15 | Araq | nah |
14:25:30 | Araq | and this description is a bit too low level |
14:25:34 | ozra | ah, ok, I felt like I totally had missed something.. |
14:26:48 | Araq | federico3: Nim can disagree with GCC on how wide a pointer is on any OS. |
14:28:44 | federico3 | hm, I have gcc-4.9-base:i386 but running a 64-bit kernel |
14:29:31 | ozra | The I guess the `{| ... |}` notation regarding the If statments blocks are manual pseudo also? I wasn't certain when reading it. |
14:29:54 | federico3 | and build.sh uses uname |
14:30:14 | Araq | ozra: indeed. |
14:30:31 | ozra | ok, good, I'm on the right page still then :) |
14:30:51 | * | filcuc quit (Quit: Konversation terminated!) |
14:31:48 | * | Pisuke joined #nim |
14:32:34 | ozra | When reading through the man, I saw several examples where a `do ... while` loop would have been the obvious choice for DRY, is that missing (because of do-notation, or other reason)? |
14:32:36 | federico3 | ok, patched |
14:37:12 | Araq | ozra: not sure what you mean, 'while true + break' is as DRY |
14:38:12 | ozra | Mmm, not when a var is init from an expression, placed before while, and then in the loop again.. |
14:38:42 | ozra | I'll see if I can find a concrete example... |
14:39:03 | Araq | no need. 'while true + break' is always DRY |
14:39:33 | Araq | var foo = x() |
14:39:43 | Araq | while foo != nil: foo = x() |
14:39:57 | Araq | can always be rewritten: |
14:39:58 | Araq | while true. |
14:40:03 | Araq | var foo = x() |
14:40:12 | Araq | if foo == nil: break |
14:41:11 | ozra | Yeah, you're right. But, arguably, it could be cleaner with do-while? Or, what's the rationale behind it if I may ask? |
14:43:07 | ozra | Simply limiting the amount of looping constructs? |
14:43:10 | Araq | the rationale is that these looping constructs are misdesigned. both while and do-while suck |
14:43:47 | Araq | what should be done is to have a general 'loop' + break. |
14:43:52 | ozra | Haha, well that has some truth to it, and still we use them ;) |
14:43:55 | ozra | I like, that. |
14:44:20 | ozra | I was gonna propse an issue regarding a 'loop' or 'for ever' statement. Loop's better. Is there one? |
14:44:31 | ozra | issue, I mean. |
14:44:33 | Araq | ha, I considered introducing 'loop' as a shortcut for 'while true' |
14:44:48 | Araq | but it's easily done with a template |
14:45:02 | Araq | template loop(cond, body: untyped) = while true: body |
14:45:09 | Araq | er, without the 'cond' lol. |
14:45:12 | ozra | Yeah. It feels more obvious. Perhaps it should be a stdlib tpl? |
14:45:38 | Araq | yeah but 'while true' is the official Python idiom too, so *shrug* |
14:45:39 | ozra | Even though we all know "while true" by heart.. but you know.. |
14:45:45 | ozra | haha. yeah |
14:46:50 | Araq | Python's rationale is that the indentation based syntax leads to 'while' but not to 'do-while' |
14:47:05 | Araq | I'm not sure I agree, but there is some logic in the statement |
14:47:11 | ozra | Man , I gotta say, just reading through the man, I'm even more impressed with Nim. I'm trying to keep cool headed, because I really have to work on an actual project, but Nim is pulling me in, haha. |
14:48:59 | Araq | I'm pleased that we finally documented overloading resolution for 0.11.0. It always felt like a big hole in the spec. |
14:49:30 | ozra | The man, is it generated from source, or mixture? |
14:49:48 | Araq | from Nim's docgen, via the rst2html command |
14:50:05 | Araq | so yes, from source but the source has the ending .txt |
14:51:21 | ozra | I figured, perhaps I should make a stab at editing it a bit and make a PR, while I'm still new, so that the things I found unclear could be worded just a bit different to clarify, and fix some (english) grammars.. |
14:51:45 | ozra | One so quickly forgets what was unclear, when it's groked and self evident.. |
14:54:12 | ozra | I saw a lot of "iff" in the non code parts - is this intentional? What up? |
14:54:31 | ozra | "Iff this is true then that works like so" |
14:54:43 | Araq | "iff" means "if and only if" |
14:54:50 | Araq | it's common in math |
14:55:01 | Araq | not a typo :P |
14:55:13 | Araq | but yeah please go ahead and make a PR |
14:55:27 | ozra | Aha, totally did not know that. No, it was consequent, so I realized there must be something to it :) |
14:56:27 | * | JinShil quit (Quit: Konversation terminated!) |
14:57:35 | ozra | I'm also curious as to the rationale regarding "command invocation syntax", in Haskell, LS, even coffees, etc. juxtaposition call syntax is the norm, in LS/CS parens are still allowed (which I find important). But, why the artificial 1-arg limitation? |
14:58:14 | ozra | (I was first pleased to read it, it's often a problem in LS with the greedy arg grabbing) |
14:58:25 | ozra | (for conciseness) |
14:58:49 | Araq | so that echo f x, g x does the "obvious" thing. |
14:59:02 | Araq | which is echo(f(x), g(x)) |
15:00:11 | * | pregressive joined #nim |
15:00:39 | Araq | well there is a distinction between command statement vs command expression here |
15:01:04 | ozra | "Obviously wrong" in those langs, but I see what you mean. Just thinking loud here, because I find merits to both, only this feels a bit ad-hoc. But forcing one-args could be done w. `echo x.f, x.g`.. |
15:01:11 | federico3 | Araq: sound like you prefer RST over asciidoc. Any reason why? |
15:01:43 | Araq | the command statement takes an arbitrary number of args separated by ",", the command expression only allows for 1 argument |
15:02:08 | ozra | Yes, I'm refering to the expressions.. |
15:02:37 | Araq | federico3: I have an RST parser in Nim and no asciidoc parser. |
15:03:17 | federico3 | I'd be happy to try to add an asciidoc parser |
15:03:49 | * | ingsoc quit (Quit: Leaving.) |
15:04:50 | Araq | what's the difference to RST? |
15:05:03 | Araq | any TL;DR of the differences? |
15:05:40 | ozra | Functional programming can benefit a lot from n-ary args in juxtaposition syntax, but then again, often parens are needed to make the intent clear anyway, so it's not a real issue. |
15:07:27 | federico3 | asciidoc is as readable as markdown but scales up to book-sized documents where latex-like features are required (indexes, glossary, links to figures, footnotes) |
15:08:04 | * | kumul joined #nim |
15:08:56 | * | Matthias247 quit (Read error: Connection reset by peer) |
15:08:57 | federico3 | (and the toolchain generates html, pdf, epub straight away) |
15:11:43 | Araq | does it generate PDF directly or via LaTeX? |
15:13:40 | ozra | Araq: I jotted down some test code of constructs I often use, and I realize that nim-command-syntax actually is more obvious when utilizing the dot-notation. Almost all calls I use are un- or binary. I file this in the "great 'ad-hoc' (from my frame of reference...) rule" department. |
15:15:19 | ozra | I read in man: "return is allowed in a closure iterator". But what does it do? I couldn't figure out. "Breaks"? |
15:15:34 | Araq | ozra: justaposition really was introduced for 'spawn' and 'await' to further blur the distinction of keyword vs macro |
15:16:06 | ozra | ok. I like it in any event :) |
15:16:34 | * | jbomo joined #nim |
15:16:48 | Araq | ozra: 'return' returns from the closure iterator causing the iteration to stop |
15:17:03 | ozra | alright, got it. |
15:19:45 | federico3 | Araq: without, unless you are using LaTeX syntax inside the asciidoc document (e.g. to embed formulas) |
15:19:54 | ozra | Regardin exception hierarchy: probably obvious, but just so I have no doubts: "ArithmeticError" regards only integer numbers? |
15:20:17 | Araq | I think so, not sure |
15:21:04 | strcmp1 | is this page suppose to be unstyled? http://nim-lang.org/docs/documentation.html |
15:21:30 | Araq | strcmp1: this page should not even exist |
15:24:50 | * | sepisoad_ joined #nim |
15:28:07 | strcmp1 | ah okay im not sure how i ended up there then |
15:28:13 | * | BitPuffin|osx joined #nim |
15:28:56 | ozra | strcmp1: cause google sees everything ;) |
15:29:05 | * | TEttinger joined #nim |
15:30:27 | * | gokr_ joined #nim |
15:31:00 | * | vikaton joined #nim |
15:32:57 | ozra | Araq: or any one else, knowing: I might be totally off in my understanding here, but, regarding `static[T]`: why is it not expressed `T{static}`, or then, by extension, `T{const}`, along with `T{lit}` and the others? In C++ that would ofc be a part of the template, and then it could be filled by any const_expr code at compile-time, thus respresenting what nim classifies 'const'. What am I missing here? |
15:34:22 | vikaton | Does nim have a playpen |
15:36:21 | * | dhasenan joined #nim |
15:36:34 | Araq | ozra: static[T] is not an AST constraint, it's a semantic constraint |
15:37:09 | Araq | but it's true that in practice the distinction is kind of weird |
15:37:29 | * | Arrrrr joined #nim |
15:37:56 | dhasenan | It looks like there's no builtin wrapper for fork(2). A bit unexpected. |
15:38:23 | ozra | Yeah, I mean, what differs to the programmer and to the compiler could be separated, in favour of the coders reasonable expectation.. |
15:38:50 | ozra | As long as it doesn't complicate compilation to hell |
15:39:16 | ozra | It seems like a reasonable syntax unification.. |
15:39:33 | * | BitPuffin|osx quit (Remote host closed the connection) |
15:39:47 | * | BitPuffin|osx joined #nim |
15:40:47 | Arrrrr | What are you talking about? |
15:40:56 | ozra | I'll study it more so I understand it better - I like the idea of being able to make a param comp-time, instead of expressing it in the typevars-region, like in C++. I have it like this in a DSL I made for LS. Haven't got enough use-cases to get a real feel of pros and cons yet though... |
15:43:42 | ozra | Arrrrr: Eh, who? Generally? |
15:44:17 | * | Siecje1 joined #nim |
15:44:50 | Arrrrr | You said "[17:39] <ozra> It seems like a reasonable syntax unification.." |
15:45:27 | ozra | Refering to static[T] -> T{static}, or T{const} |
15:45:32 | Araq | Arrrrr: read the logs please |
15:45:52 | * | Siecje quit (Ping timeout: 244 seconds) |
15:46:02 | Araq | dhasenan: at one point I stopped wrapping posix stuff, add it to posix.nim please if it's missing |
15:46:41 | dhasenan | Araq: acknowledged. |
15:47:04 | ozra | Thanks for filling out some blanks for me, I'm in a meta-groked state now. Time to go out walk the dog. |
15:48:50 | dhasenan | I need a cross-platform thing anyway, and Windows doesn't provide fork(), so I guess I shouldn't use it after all. |
15:49:42 | * | xcombelle joined #nim |
15:50:08 | * | filcuc joined #nim |
15:51:06 | * | epichero joined #nim |
15:52:33 | vikaton | what important role does nimbase.h have in the output of C code? |
15:55:16 | Araq | vikaton: it's the only hand written C code in Nim. |
15:55:24 | Araq | dhasenan: osproc module? |
15:56:33 | * | kumul quit (Ping timeout: 256 seconds) |
15:57:24 | * | BlaXpirit quit (Quit: Quit Konversation) |
15:58:07 | vikaton | Araq: That's impressive, is it basically the set of rules that makes the compiled C code what it is? |
15:58:51 | dhasenan | Araq: yes, it's got what I need. |
15:59:02 | dhasenan | It just would have been convenient if all the world were Posix. |
16:00:20 | * | epichero quit () |
16:00:36 | * | epichero joined #nim |
16:01:49 | * | BlaXpirit joined #nim |
16:03:09 | * | johnsoft quit (Ping timeout: 245 seconds) |
16:03:49 | * | johnsoft joined #nim |
16:05:41 | Araq | vikaton: it's only a set of macros to unify the C compilers a bit, there is not much in it and the codegen could easily not use it |
16:09:10 | * | Jesin quit (Quit: Leaving) |
16:29:12 | vikaton | o |
16:32:45 | * | Jesin joined #nim |
16:34:32 | * | kumul joined #nim |
16:41:13 | * | Noobulator joined #nim |
16:41:55 | Noobulator | Hey all, does anybody know if I can use nimble to build a program with -threads:on? |
16:42:09 | * | johnsoft quit (Ping timeout: 240 seconds) |
16:43:09 | * | johnsoft joined #nim |
16:43:37 | Noobulator | nevermind figured it out |
16:43:38 | dom96 | Noobulator: add --threads:on to a file.nim.cfg file |
16:43:45 | Noobulator | oh that works better |
16:45:25 | Noobulator | Way easier, cheers |
16:45:43 | Araq | dom96: are we happy with people using nimble for building software? |
16:45:56 | dom96 | Araq: of course |
16:46:03 | Araq | and if so, should we merge Nake and Nimble? |
16:46:11 | Araq | somehow? |
16:46:21 | dom96 | no |
16:46:36 | Araq | why not? |
16:46:49 | dom96 | Because Nimble must remain simple. |
16:47:00 | dom96 | It will support the execution of the likes of nake files |
16:49:02 | Araq | people don't want simple, people want 1 program to learn to build their Nim based software |
16:49:39 | dom96 | There are more important things to implement at the minute |
16:51:44 | reactormonk | Araq, rake + gem or sbt? Gotta say sbt is a fucking complex tool |
16:53:28 | reactormonk | and it's already a running joke that there's no good documentation for sbt. |
16:56:29 | vikaton | whats the deal with Nim and wikipedia? |
16:57:03 | strcmp1 | https://en.wikipedia.org/wiki/Nim_%28programming_language%29 ? |
16:57:49 | strcmp1 | i see https://en.wikipedia.org/wiki/Nim too but thats not unusual |
16:58:43 | * | wb quit (Ping timeout: 244 seconds) |
16:58:53 | reactormonk | strcmp1, yeah, we have som guy leading a vendetta |
16:58:59 | vikaton | lol |
16:59:30 | vikaton | we should add the crown for Nim |
17:00:26 | reactormonk | sure, go ahead |
17:00:36 | * | wb joined #nim |
17:00:38 | Arrrrr | hah |
17:01:29 | reactormonk | I mean https://en.wikipedia.org/wiki/Rust_(programming_language) also has the "too many primary sources" |
17:01:41 | * | stefan__ joined #nim |
17:02:25 | Araq | one problem is that journals all try to save money, so they let the primary authors write the articles |
17:02:48 | reactormonk | but they don't have like 4 contested deletions - check the talk page |
17:05:21 | dom96 | We should be happy. We won that last fight. |
17:06:50 | * | filcuc quit (Ping timeout: 252 seconds) |
17:09:01 | vikaton | reactormonk: I can't, im not confirmed |
17:09:15 | vikaton | nor can I think of any wikipedia pages to edit to be confirmed |
17:09:32 | vikaton | I think the logo needs to be uploaded to wikipedia itself https://en.wikipedia.org/w/index.php?title=Nim_(programming_language)&action=edit |
17:09:59 | vikaton | if someone has a confirmed account, they should upload the image and add the logo |
17:10:01 | * | xcombelle quit (Ping timeout: 264 seconds) |
17:10:23 | * | BitPuffin|osx quit (Ping timeout: 258 seconds) |
17:11:54 | ozra | @Araq @dom96 - I thought Nimble was a package manager? Am I missing something? |
17:11:56 | vikaton | Never knew Nim came out in 2008, seems like people are just starting to learn of it now |
17:12:47 | reactormonk | vikaton, yeah, was here 3 (?) years ago, with 20 people idiling here... just checked again, 157 O.o |
17:13:24 | vikaton | lol |
17:13:25 | Araq | vikaton: well it turned out that "bootstraps itself!" is not sufficient for "can develop real software in it" ;-) |
17:13:25 | * | Trustable joined #nim |
17:13:46 | vikaton | haha |
17:13:58 | vikaton | better noticed now than never I guess |
17:13:59 | Araq | ozra: when people use it for building, it's pretty much a build tool |
17:15:38 | reactormonk | Araq, but for executing nim code you gotta invoke the compiler etc. |
17:16:17 | ozra | Ok. Haven't gotten that far.. I use make to wrap a nim line atm.. |
17:17:41 | wb | Does "export X except Y" work? Or does "except" only work for imports? |
17:17:54 | * | Noobulator quit (Quit: Page closed) |
17:17:57 | * | boydgreenfield joined #nim |
17:18:07 | reactormonk | wb, if it doesn't, sounds like something that should be fixed |
17:19:02 | Araq | wb: not been implemented |
17:19:08 | Araq | and it's a bit dubious IMO |
17:19:19 | reactormonk | ... that's true |
17:19:23 | Araq | in fact, you shouldn't export whole modules |
17:19:53 | Araq | why is it a module then and not an include file? |
17:21:38 | lll | is there a list of warnings and hints available somewhere? i just learned about warning[proveField] which isnt enabled with -w:on and -hints:on |
17:22:07 | * | taesoo joined #nim |
17:22:46 | * | stefan__ quit (Ping timeout: 246 seconds) |
17:23:17 | Araq | lll: I thought nimc.html had it but I was wrong, so the answer is: no. |
17:24:45 | lll | is there many warnings and hints that arent enabled with -w:on and --hints:on? |
17:24:58 | * | boydgreenfield quit (Quit: boydgreenfield) |
17:26:16 | Araq | 5 |
17:26:50 | Araq | var gNotes*: TNoteKinds = {low(TNoteKind)..high(TNoteKind)} - |
17:26:52 | Araq | {warnShadowIdent, warnUninit, |
17:26:53 | Araq | warnProveField, warnProveIndex, warnGcUnsafe} |
17:29:26 | lll | Araq: thx! |
17:29:59 | lll | 1 more question: "--patterns:on|off turn pattern matching on|off" i found this in the doc, is there any info on what that is? |
17:30:44 | * | wb quit (Read error: Connection reset by peer) |
17:33:13 | * | xcombelle joined #nim |
17:35:28 | * | wb joined #nim |
17:36:46 | dom96 | http://www.reddit.com/r/nim/comments/373x6a/nims_future/ |
17:37:49 | Quora | I'm having a strange issue with a form posting to jester |
17:38:32 | Quora | one sec while I get the stuff gisted |
17:39:38 | wb | yeah, i see why "export x except y" could be iffy. It should be an include, but the module in question is 'math' (ie trying to include it throws "cannot importc variable at compile time" and such), so i'm using import/export. Problem is, apparently the math module acquired `^` in an update and it conflicts with the `^` i've defined. |
17:41:09 | * | alphawaffle joined #nim |
17:41:25 | * | alphawaffle quit (Remote host closed the connection) |
17:41:42 | Quora | https://gist.github.com/Heartmender/8200676604eecf58ea4a |
17:42:00 | Quora | if i post "FOO BAR" with this form, the "FOO BAR" never is visible to nim |
17:43:21 | dom96 | Quora: your textarea needs a 'name' attribute |
17:43:50 | dom96 | Here is an example https://github.com/dom96/jester/blob/master/tests/alltest.nim#L73 |
17:44:08 | Quora | i hate webdev |
17:44:11 | * | HakanD__ quit (Ping timeout: 265 seconds) |
17:44:11 | Quora | thanks |
17:44:22 | lll | Quora: lol |
17:45:07 | Quora | http://puu.sh/hYTxo/87c5d82443.png |
17:45:08 | * | Siecje1 quit (Quit: Leaving.) |
17:45:09 | Quora | :D |
17:45:32 | dom96 | Quora: cool. Are you writing a forum? |
17:45:49 | Quora | dom96: yeah, I want to do it with material design and the like |
17:45:57 | * | Siecje joined #nim |
17:46:43 | dom96 | Quora: Nice. You could reuse Nim Forum's code base, but I will understand if you want to start from scratch. |
17:47:00 | Quora | I did actually start with the nim forum's code |
17:47:18 | Quora | it didn't work very well |
17:47:44 | Quora | so I'm going to dick around a little and maybe PR back with some improvements if I end up fixing things |
17:51:44 | * | Siecje quit (Read error: Connection reset by peer) |
17:53:03 | * | Ven joined #nim |
18:02:21 | * | Arrrrr quit (Quit: Page closed) |
18:04:54 | * | Sornaensis quit (Excess Flood) |
18:05:32 | * | Sornaensis joined #nim |
18:05:46 | dom96 | Quora: What's your goal? Just to learn and play with Nim? |
18:08:39 | Quora | dom96: I want to deploy and use things that are not php |
18:09:09 | dom96 | Quora: What issues did you run into with nim forum? |
18:09:29 | Quora | theming |
18:09:43 | lll | hey dont hate on php! |
18:10:17 | * | vikaton quit () |
18:10:22 | dom96 | Quora: It would be nice if you could improve the theming in Nim Forum. |
18:11:21 | Quora | lll: I can and I will |
18:12:56 | lll | Quora: lol, i mostly hate it too, i work with it almost everyday T_T |
18:13:08 | lll | and not by choice |
18:13:31 | reactormonk | lll, oh, I'm currently trying to get some apache + java stuff running |
18:13:43 | sepisoad_ | I'm quiet confused with asyncdispatch, it is said that it can act as an event loop, but i found it so hard to find a way to use it as an event loop, i wish there was a simpler way to do that |
18:14:11 | dom96 | sepisoad_: What are you trying to use an event loop for? |
18:14:53 | sepisoad_ | something like a timeout mechanism where we define a callback function for it |
18:15:02 | lll | reactormonk: i try to not start anything new in php, but clients with existing codebase, i cant ask them to rewrite it ;P |
18:15:20 | reactormonk | lll, yup, I see the problem |
18:15:29 | sepisoad_ | i want to have a loop that can wait for various user defined events |
18:15:38 | sepisoad_ | like timeout |
18:16:06 | dom96 | sepisoad_: Have you tried using sleepAsync? |
18:16:14 | * | egrep quit (Quit: Error -38: Black hole has swalled this client.) |
18:16:24 | sepisoad_ | how sleepAsync can help |
18:16:42 | dom96 | sepisoad_: It returns a Future which finishes after a set amount of time. |
18:16:49 | * | egrep joined #nim |
18:17:22 | dom96 | var fut = sleepAsync(1000); fut.callback = proc () = echo("Called after 1 second") |
18:17:42 | Araq | reactormonk: er ... what? java and apache? how come you don't live for nimsuggest now? |
18:18:00 | lll | nim + nginx |
18:18:01 | * | OnO joined #nim |
18:18:40 | reactormonk | Araq, I'll take a look again as soon as I get enough motivation not to bang my head against the wall because I have no idea wahere to look |
18:19:00 | Araq | I told you what to do :P |
18:19:05 | sepisoad_ | i tried using sleepAsync but maybe i'm a little confused, maybe a sample code can help more |
18:19:11 | dom96 | lll: That is indeed the superior combo. |
18:19:18 | Araq | that should be your motivation |
18:20:08 | dom96 | reactormonk: What are you trying to fix in nimsuggest? |
18:20:41 | sepisoad_ | can you comment on this piece of code? https://gist.github.com/sepisoad/b80ee84517f4146ba73d |
18:20:57 | flaviu | I see there's a postgresql module in the stdlib, but has anyone actually worked with postgresql and Nim? |
18:21:29 | dom96 | sepisoad_: What do you want that code to do? |
18:21:41 | dom96 | sepisoad_: vs. what it is doing now? |
18:21:55 | Quora | dom96: one of the major things I wanted to do was use mysql instead of sqlite |
18:22:23 | dom96 | Quora: That should be a ~5 line change |
18:22:31 | sepisoad_ | first of all the code wont wait for callbacks to be called |
18:22:40 | reactormonk | dom96, https://github.com/Araq/Nim/issues/2694 |
18:22:50 | sepisoad_ | and if I call runForever() app will crash |
18:23:12 | sepisoad_ | I know i need a valid dispatcher |
18:23:19 | dom96 | reactormonk: ahh. Fixing that would be awesome. |
18:23:31 | * | Matthias247 joined #nim |
18:23:50 | ozra | lll: I rewrote a whole code base from php to nodejs just to get rid of php. Regrets. Yeah, I do hate php. |
18:23:52 | reactormonk | dom96, taking another look |
18:24:22 | lll | ozra: lol i work with millions of line of code projects, its not possible to rewrite |
18:24:57 | reactormonk | Btw, are the concepts ready enough that we (or I) can start sprinkle the stdlib with it? |
18:25:47 | dom96 | sepisoad_: I see what you mean |
18:25:55 | ozra | lll: no, and don't do it ;) I learned the hard way.. Though, I was happy to not having to touch php again ;) |
18:26:38 | ozra | lll: why nginx + nim, and not just nim? Plus varnish as reverse proxy.. |
18:26:42 | dom96 | lll: A million lines of PHP code... *shudders* |
18:26:48 | lll | ozra: im not quite sure i would call php-> javascript a big stepup tho |
18:27:05 | lll | dom96: not a million, 10+ million |
18:27:15 | * | dom96 dies |
18:27:19 | lll | lol |
18:27:19 | sepisoad_ | dom96, the only i know I can have a dispatcher is to call newAsyncRawSocket, but i dont need a socket at all |
18:27:38 | dom96 | sepisoad_: hrm |
18:27:39 | flaviu | lll: What sort of program was this? |
18:27:41 | ozra | lll: 10+ million PHP app? Arggh.. I'd quit! ;) |
18:28:02 | sepisoad_ | or maybe i'm wrong!!! |
18:28:06 | ozra | ...or kill my self |
18:28:21 | ozra | and don't do that either. I hear it's permanent |
18:29:46 | ozra | lll: No, you're right about the js. ofc. I coded it in "jytron" my own transpiler, then switched to livescript, cause it looked like my lang but kept me from changing syntax all the time, not very productive or safe.. I made some really bad choices at that time. |
18:29:59 | lll | lol |
18:30:12 | lll | i tried livescript, but it was messy |
18:30:26 | ozra | Nah, it's clean. You miss types though. |
18:30:34 | lll | if you use javascript you should use typescript |
18:30:42 | dom96 | sepisoad_: You could just catch the error that runForever raises, I know it's not ideal... |
18:31:12 | ozra | I hate brace-syntax. Which is a nightmare since I code mostly in C++ (but then again, homebrew hideous transpiler ;) |
18:31:46 | ozra | But now I hope to be able to ditch "everything" for nim for future projects.. Still investigating. |
18:32:19 | sepisoad_ | dom: yup, you're right, BTW is there any plan to introduce a simpler event loop like mechanism? |
18:33:00 | dom96 | sepisoad_: Not at the minute. Asyncdispatch was designed for asynchronous IO. You could probably write your own event loop pretty easily. |
18:33:29 | ozra | lll: curious, once again: why nginx with nim? And not just a reverse-proxy like varnish? |
18:33:54 | dom96 | ozra: The nim forum runs on top of nginx. |
18:34:14 | ozra | dom96: what's nginx used for? |
18:34:21 | pigmej | ozra: proper HTTP support, better static file serving by nginx etc |
18:34:45 | dom96 | ozra: It serves nim-lang.org's static files and passes requests onto the forum. |
18:35:01 | strcmp1 | is nim-lang.org running jester? |
18:35:16 | dom96 | strcmp1: nim-lang.org is not |
18:35:22 | dom96 | only forum.nim-lang.org is |
18:35:42 | strcmp1 | ah okay, is nginx a frontend for the forum too? |
18:35:47 | dom96 | yeah |
18:35:50 | strcmp1 | nice |
18:35:53 | ozra | pigmej: alright, is jester missing something in the http department. I was about to roll out two old sites I have with a jester-brew - they seem to work no probs... Then I can ditch node for those and scale down the vps ram a bit.. |
18:36:06 | ozra | department_?_ |
18:36:40 | federico3 | 10M of php SLOC? Sounds like facebook... |
18:37:05 | * | BlaXpirit quit (Quit: Quit Konversation) |
18:37:07 | lll | magento + ilias combo |
18:37:15 | ozra | dom96: pigmej: I serve static files from the nim app now, varnish caches and serves them then on.. Arguments against such practise? |
18:37:17 | lll | federico3: ^ |
18:37:25 | dom96 | sepisoad_: tbh, if you don't need asyncio you can just use os.sleep() |
18:37:40 | reactormonk | ozra, why not just use nginx for static stuff |
18:37:44 | lll | flavius: magento + ilias combo |
18:37:50 | pigmej | ozra: if you need ram, then don't go for varnish ;) |
18:38:02 | ozra | reactormonk: but then... why? ;) |
18:38:12 | pigmej | ozra: because nginx can do it better |
18:38:15 | lll | ozra: its what its for |
18:39:03 | ozra | pigmej: haha, ok, well these sites don't server movies or so, so cache is low. I'll look at nginx :) |
18:39:08 | * | BlaXpirit joined #nim |
18:39:30 | pigmej | obviously you can choose any other web server, like nxweb |
18:39:31 | lll | you dont need to cache static files ;P |
18:39:58 | reactormonk | Araq, btw, https://github.com/Araq/Nim/issues/2759 |
18:40:02 | federico3 | +1 for nginx |
18:40:10 | ozra | lll: in that case, why not serve from jester? |
18:40:21 | strcmp1 | federico3, yeah indeed. |
18:40:29 | lll | ozra: why not from nginx |
18:40:33 | strcmp1 | thats how ruby/rails websites usually roll, too |
18:40:39 | sepisoad_ | dom96, if by asyncIO you mean asynchronous input/output then it's not what i'm interested to use ATM |
18:40:54 | ozra | lll: one more component to care about and configure. |
18:41:10 | sepisoad_ | dom96, what i need is a simple event mechanism along with callback functions |
18:41:15 | dom96 | sepisoad_: Why do you need that? |
18:41:20 | lll | why overload your logic program with static files? |
18:41:21 | dom96 | sepisoad_: What are you going to be using that for? |
18:41:39 | pigmej | or if you really care about resouces (but you probably shouldn't) then you can use lwan but preoptimization is usually a failure |
18:41:57 | lll | plus ddosing prevention etc would be easier on nginx |
18:42:20 | lll | thats pretty standard setup to run nginx or whatever in front of your dynamic app |
18:42:29 | lll | apache or whatever |
18:42:42 | pigmej | lll: just not apache, please :) |
18:42:58 | lll | pigmej: :) |
18:42:59 | sepisoad_ | dom96, i want to handle keyboard events withot using SDL or smilar libs |
18:43:31 | ozra | lll: well, I mean, it's no additional work what so ever. one line and it server. Ddos: varnish... I still need a reverse proxy. |
18:43:50 | sepisoad_ | dom96, you see that async sockets or files are not helpful in this situation |
18:43:59 | dom96 | sepisoad_: how are you planning on handling keyboard events without those libs? |
18:44:32 | ozra | pigmej: I guess for me it comes down to using as few parts as possible and using what I know, unless there is something wrong. |
18:44:36 | lll | sepisoad_: you would have to recode sdl |
18:44:37 | reactormonk | found some cases where nimsuggest actually works twice, but not anymore afterwards ^^ |
18:44:50 | sepisoad_ | dom96, hahaha, i don't know, that's what im about to find |
18:45:00 | dom96 | sepisoad_: I think on Linux you would need to use GTK anyway |
18:45:08 | dom96 | sepisoad_: And GTK already provides its own event loop |
18:45:58 | ozra | pigmej: lll: what would be the reason for serving with nginx, instead of jester through varnish, I still don't find a reason. (I really do like to know - so I don't roll it out and shit hits the fan..) |
18:46:15 | sepisoad_ | dom96, on a lower level, on linux we would use epoll on console based apps |
18:46:34 | pigmej | ozra: just replace varnish with nginx, it will be better and it will allow you more in 99% cases |
18:46:48 | dom96 | sepisoad_: that's precisely what asyncdispatch uses |
18:46:48 | sepisoad_ | dom96, i would be nice if we had a similar thing in nim, but portable |
18:46:50 | pigmej | for that 1% it's preoptimization, which is usually a problem |
18:47:01 | dom96 | sepisoad_: To check whether a socket/file is readable |
18:47:26 | pigmej | reactormonk: I sometimes from aporia got also twice, but I think it's cached, because results were the same as before |
18:47:27 | ozra | pigmej: alright. I haven't used nginx more than once for some customer, otherwise uses varnish. What are the improvements? Varnish compiles my conf through c++, so it's fuuucking fast.. |
18:48:24 | sepisoad_ | dom96, sorry, i mean poll() not epoll() |
18:48:51 | reactormonk | pigmej, nope, it's not cached, because some others I get a different result |
18:49:20 | reactormonk | also, that wouldn't explain why exactly it doesn't work anymore after the second time |
18:49:55 | pigmej | hmm |
18:52:42 | * | filcuc joined #nim |
18:52:44 | * | gokr_ quit (Read error: Connection reset by peer) |
18:52:46 | ozra | pigmej: Never heard so much nginx promotion before, so I had to google.. Found a nginx vs varnish test on a blog, I'll sum it up with a quote: "Results for the Small VPS: Varnish wins in a Landslide." |
18:53:30 | * | boydgreenfield joined #nim |
18:53:30 | reactormonk | ozra, varnish is a cache, nginx is a front server |
18:53:39 | ozra | And in fairness: "Results for the Medium-Sized Linode VPS: Nginx wins by a Nose." |
18:55:33 | ozra | reactormonk: yes, I've only used it as reverse-proxy and cache, and always served statics from the apps them selves (self serving) the last five years and haven't had a problem. That's why I'm curious about why it seems the opinion here is that lifting static serving out is imperative. Is there some specific reason? Static serving has never crashed my apps.. |
18:56:32 | reactormonk | ozra, it's easier to mess with imo if it's in nginx. Also, setting up ssl via nginx is easier because more documentation |
18:56:48 | pigmej | ozra: in case of web server benchmarks => there is no valid test there, you can probably easily do a test and show that webserver A is better than B |
18:56:51 | lll | ive never seen varnish used ever |
18:56:56 | pigmej | maybe except apache |
18:58:03 | pigmej | ozra: the whole thing is, varnish is not a webserver it's a cache |
18:58:08 | lll | exactly |
18:58:20 | lll | aka givemeallyourram |
18:59:02 | ozra | pigmej: definitely. I'm just trying to figure out here if there's a legit reason why I should switch my 5+ years of serving strategy. |
18:59:27 | lll | ozra, i just wouldnt even have my aplication bother with static files |
18:59:41 | lll | less attack vectors too |
18:59:54 | ozra | lll: haha, ok. Well, I have tight limits on cache size, so if that's it, I'm good. As long as I'm not doing something potentially dangerous I haven't considered :) |
19:00:13 | ozra | lll: yes, I try to catch that in varnish. Might be holes though. |
19:01:19 | lll | all i know is that i never used varnish, and associate it with "webscale mongodb" type of stuff |
19:01:28 | lll | aka useless for 99% of sites |
19:01:48 | ozra | Thanks for discussing it a bit. I will have a look at nginx just to widen the horizon and re-evalute my use-cases just in case. Always good to brush of some dust.. |
19:02:11 | ozra | lll: I just associate it with reverse-proxying real fucking fast ;) |
19:02:16 | pigmej | ozra: the biggest idea => nginx has vhosts, in varnish you have to write several ifs |
19:02:23 | Araq | reactormonk: doesn't look hard to fix |
19:02:32 | pigmej | also, http rev proxy is not a best protocol ;-) |
19:02:34 | lll | nginx does that as fast as varnish |
19:03:01 | lll | if you dont need the cache, imo dont use varnish |
19:03:05 | ozra | pigmej: I've written a script that generates it automatically from my sites, so that's a no-brainer. And writing it manually is a no-brainer too.. |
19:04:05 | reactormonk | stuff I've found out: the dirtyIdx is always 5, so file number 5 is the one suggested on. But the projectFile is 5 the first time and 4 (!= 5) everytime afterwards... maybe that one sucks? |
19:04:23 | ozra | Maybe it's just me, but I find that clearer than abstracting it out as vhosts like in apache and apparently nginx. Well, what ever makes your clock tick :) |
19:04:30 | dom96 | Personally, I have never actually considered varnish but I will look into it. |
19:05:20 | ozra | lll: nginx acts as cache - kif kif - no? Or do you rely on serving files each time, no etags checks, letting the OS cache disk accesses?? |
19:05:40 | pigmej | ozra: nginx got recently quite recent cache |
19:05:56 | lll | what i mean, is varnish caches in memory |
19:06:22 | ozra | Ok, perhaps we should stop polluting nim irc with this, I realize we've strayed quite OT - thanks for your input. |
19:06:23 | lll | its what its for |
19:06:47 | lll | plus debian -> sudo apt-get install nginx |
19:07:00 | reactormonk | ozra, we have #nim-offtopic |
19:07:37 | ozra | lll: sudo apt-get install varnish? Well, in ubuntu, sorry, don't know about debian straight.. |
19:08:00 | ozra | reactormonk: ah, thanks, sorry for polluting here.. |
19:08:08 | reactormonk | go to #nim-offtopic with anything about nginx or varnish plz |
19:08:13 | reactormonk | I'm getting giddy on the banhammer |
19:09:20 | reactormonk | nope, the file index doesn't matter. I tossed the logic that changes the main project file, no change :-/ |
19:10:27 | pigmej | reactormonk: ;D |
19:11:27 | * | lll left #nim (#nim) |
19:11:31 | * | jbomo left #nim (#nim) |
19:12:18 | dom96 | nah guys. |
19:12:21 | dom96 | OT stuff is fine |
19:12:36 | dom96 | unless there is a lot of Nim discussion happening at the same time :) |
19:12:39 | reactormonk | :-( |
19:12:53 | reactormonk | But but but I wanted to ban someone |
19:13:38 | * | Crocodick joined #nim |
19:14:00 | pigmej | reactormonk: rotfl ;d |
19:18:56 | reactormonk | hrm, the second time it actually seems to compile towards the project main file, not the file I'm asking for (in sug mode) |
19:19:43 | reactormonk | Araq, another problem is that sug and use want different compile patterns - use wants the full project compiled, sug only the ones imported - or should I just make it compile the full project in both cases? |
19:21:55 | ozra | reactormonk: put on your ray-bans and be cool about it ;) |
19:23:55 | * | filcuc quit (Quit: Konversation terminated!) |
19:23:58 | * | sepisoad_ quit (Ping timeout: 264 seconds) |
19:25:49 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
19:26:15 | Araq | reactormonk: that logic already exists |
19:27:25 | * | OnO joined #nim |
19:27:32 | reactormonk | Araq, I haven't seen it |
19:27:53 | reactormonk | well, wait |
19:27:57 | Araq | reactormonk: in the nimsuggest module |
19:28:01 | flaviu | reactormonk: A ban for off-topic discussion is a little harsh. kicking might be more reasonable. |
19:28:30 | reactormonk | flaviu, yeah, sure. I just call it banhammer because it's more idiomatic than kickhammer |
19:28:58 | reactormonk | Araq, oh, right. Just not sure if it would work as expected. |
19:29:10 | * | kumul quit (Ping timeout: 258 seconds) |
19:32:29 | * | xcombelle quit (Quit: Leaving) |
19:36:23 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
19:38:29 | * | OnO joined #nim |
19:42:37 | * | kumul joined #nim |
19:45:38 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
19:51:51 | * | pregressive quit (Remote host closed the connection) |
19:51:52 | reactormonk | Araq, ok, the fix was easier than expected... |
19:59:03 | reactormonk | now it works everytime BUT the first one :D |
20:03:56 | Araq | yay |
20:04:01 | Araq | that's cool |
20:08:42 | reactormonk | https://gist.github.com/d88b6c930c85fbc53442 <- any idea why the compiler bails here? |
20:08:47 | reactormonk | Error: type expected |
20:09:05 | Araq | : vs = |
20:09:17 | Araq | execute(cmd = ideSug, "", "", 1, 0) |
20:11:49 | reactormonk | huh. But it still just exists. |
20:12:28 | Araq | you mean nimsuggest doesn't continue after this error? |
20:13:01 | reactormonk | no, I correct that, I'm running this proc before serve, but serve never hits |
20:13:31 | reactormonk | ah ok, doesn't like the empty string. |
20:14:00 | Araq | there are globalErrors and localErrors; globalErrors raise an exception, this is later handled but often by then it's too late, since the node with the line info we're interested in has been skipped |
20:14:41 | Araq | this is the problem number 1 for 'nimsuggest' |
20:15:19 | dom96 | reactormonk: We don't ban or kick around here anyway :P |
20:15:37 | Araq | and the reason why we try to avoid globalError() |
20:16:16 | reactormonk | Araq, I see. I'm currently trying to make nimsuggest compile the project |
20:17:17 | reactormonk | ah ok, gotta set the whole error max stuff |
20:17:59 | * | boydgreenfield quit (Quit: boydgreenfield) |
20:22:37 | * | jbomo joined #nim |
20:23:50 | reactormonk | Araq, https://github.com/Araq/Nim/pull/2782 |
20:24:16 | reactormonk | take a look at the first commit |
20:27:49 | strcmp1 | im new to nim, and trying to write my first macro. i think i must be doing something weird, because keepIf() doesn't seem to return control to the caller... https://gist.github.com/strcmp/d5399c7e66ce13078b5a - any ideas? |
20:28:31 | reactormonk | strcmp1, does it get to the beginning of the macro? |
20:29:03 | strcmp1 | yeah, it works fine until i call keepIf |
20:30:20 | * | gsingh93 joined #nim |
20:30:24 | reactormonk | does the code work outside the vm e.g. when not in a macro? |
20:30:32 | strcmp1 | not sure ill try |
20:31:14 | reactormonk | the code in the macro is executed by the VM, which might be buggy here |
20:31:27 | dom96 | indeed |
20:31:43 | dom96 | possibly a bug in the VM's implementation of anonymous procs. |
20:32:23 | strcmp1 | this works fine https://gist.github.com/strcmp/d92f424c6c1ec01146ac it prints "hi" and "oh" |
20:34:40 | reactormonk | time for a bug report? |
20:37:32 | * | boydgreenfield joined #nim |
20:38:20 | strcmp1 | sure ill file one, im a few commits behind so ill update first and then open an issue if its still a problem |
20:47:55 | * | intra quit (Ping timeout: 265 seconds) |
20:48:34 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:02:52 | * | shevy joined #nim |
21:11:54 | * | kumul quit (Ping timeout: 245 seconds) |
21:19:58 | * | kumul joined #nim |
21:20:28 | * | boydgreenfield quit (Quit: boydgreenfield) |
21:22:28 | wtw | bsirius: you're welcome :) |
21:32:19 | * | gsingh93 quit (Ping timeout: 265 seconds) |
21:33:43 | Araq | reactormonk: you left the debug code quitCalled() active and the patch makes no sense |
21:34:26 | reactormonk | Araq, yup, and I think the debug code is helpful in case stuff goes wrong, because quit will probably never be called unless something goes wrong |
21:35:05 | Araq | so the idea is that compileProject() without any file recompiles the project |
21:35:29 | Araq | and the recompilation logic sees the dirty file and acts accordingly |
21:35:40 | ozra | From manual: "complex statements always have to be intended" -> "indented" I assume? |
21:35:52 | Araq | ozra: yep |
21:35:58 | ozra | cool |
21:36:58 | reactormonk | Araq, that's for new files added to the project. Any files included by the main file at startup are compiled and following that they should be known |
21:37:04 | reactormonk | ozra, feel free to correct it by PR |
21:38:04 | * | banister joined #nim |
21:38:49 | Araq | resetModule dirtyIdx |
21:38:50 | Araq | if dirtyIdx != gProjectMainIdx: |
21:38:52 | Araq | resetModule gProjectMainIdx |
21:38:54 | Araq | so it is reset, it should be recompiled |
21:40:25 | reactormonk | it isn't :-/ |
21:40:29 | reactormonk | test with https://github.com/Araq/Nim/issues/2694 |
21:40:58 | Araq | so let's continue, resetModule does this: |
21:41:18 | * | Amun_Ra joined #nim |
21:41:20 | Araq | if fileIdx <% gCompiledModules.len: |
21:41:22 | Araq | gCompiledModules[fileIdx] = nil |
21:41:23 | Amun_Ra | hi |
21:41:44 | Araq | and also this: |
21:41:46 | reactormonk | so it removes all the knowledge of the module from the cache. |
21:41:47 | Araq | if fileIdx <% gMemCacheData.len: |
21:41:49 | Araq | gMemCacheData[fileIdx].needsRecompile = Yes |
21:42:25 | reactormonk | So how do I make it work for new files too? |
21:42:30 | reactormonk | Amun_Ra, sup |
21:43:11 | Araq | compileModule then calls getModule which just looks at gCompiledModules |
21:44:27 | Amun_Ra | reactormonk: I just found out nim and started "evaluating"… ;> |
21:44:28 | reactormonk | which makes it recompile. |
21:44:38 | dom96 | Amun_Ra: Witam :) |
21:44:42 | reactormonk | Amun_Ra, currently in the process of fixing the idetools |
21:44:44 | * | BitPuffin|osx joined #nim |
21:44:47 | Amun_Ra | dom96: cześć :> |
21:45:09 | Araq | but maybe checkDepMem() is wrong, this part looks suspicious: |
21:45:17 | Araq | if gMemCacheData[fileIdx].needsRecompile != Maybe: |
21:45:19 | Araq | return gMemCacheData[fileIdx].needsRecompile |
21:45:25 | reactormonk | Araq, the isKnownFile is only false if the file hasn't been seen before |
21:45:38 | Araq | how can we know this for sure here already without checking its dependencies? |
21:45:39 | reactormonk | even if you call resetModule, it will still be true |
21:46:48 | reactormonk | Araq, Maybe apparently marks it might be needed because of dependencies |
21:47:29 | reactormonk | Yes -> go for it No -> nope Probing -> recursing Recompiled -> ... |
21:47:36 | Amun_Ra | ;150R |
21:48:05 | ozra | Araq: Does the docgen handle Unicode? Could be better to use a disambigous char-combo for '{| ... |}' |
21:51:10 | ozra | reactormonk: I'm on it :) |
21:51:29 | reactormonk | dom96, https://github.com/Araq/Nim/pull/2543 *poke* |
21:56:34 | * | Ven joined #nim |
21:57:10 | dom96 | reactormonk: thanks, re-reviewed. |
21:57:30 | dom96 | Github really needs to notify when a PR changes |
21:59:08 | reactormonk | I assigned you, maybe that helps |
21:59:33 | dom96 | hrm, perhaps |
22:05:55 | * | ozra quit (Ping timeout: 246 seconds) |
22:06:59 | reactormonk | Araq, probably ugly, but it works in the cases I tested it |
22:08:11 | Araq | reactormonk: what do you mean? your PR makes no sense as it doesn't fix the bug, it circumvents it |
22:09:55 | reactormonk | Araq, ok, kicked that part. With the current commit, it works everytime except for the first one. |
22:10:40 | Araq | ha ok let's see |
22:10:56 | BlaXpirit | reactormonk, what was the close about https://github.com/Araq/Nim/pull/2515#event-312663366 |
22:11:13 | BlaXpirit | oh yeah.. |
22:11:23 | Araq | wtf? but if it's already known it's ... oh hrm |
22:11:37 | reactormonk | BlaXpirit, https://github.com/Araq/Nim/pull/2762#issuecomment-105064625 |
22:12:35 | Araq | reactormonk: the point of this test is "if the module belongs to the project" |
22:12:48 | Araq | but that's only true for the first time |
22:13:04 | Araq | afterwards it's a known file and yet not part of the dependency graph ... |
22:13:13 | Araq | so yeah ... we need to change this |
22:13:35 | Araq | the dep graph should have multiple "entry" points |
22:15:33 | reactormonk | after the first compileProject(), isKnownFile should be true for all files in the dependency graph |
22:15:36 | * | kumool joined #nim |
22:15:57 | Araq | reactormonk: exactly |
22:17:05 | dom96 | reactormonk: You might want to comment why you closed BlaXpirit's PR |
22:17:05 | * | stefantalpalaru quit (Quit: Leaving) |
22:17:14 | reactormonk | dom96, can do |
22:17:31 | BlaXpirit | good that someone took over. i had no idea though. |
22:18:02 | dom96 | reactormonk: thanks |
22:18:03 | reactormonk | BlaXpirit, sorry :-/ |
22:18:32 | * | kumul quit (Ping timeout: 244 seconds) |
22:19:14 | Araq | so ... should I merge this? |
22:19:20 | * | Kingsquee joined #nim |
22:19:47 | BlaXpirit | what exactly |
22:19:51 | reactormonk | BlaXpirit, I see your view, and I also see why dom96 doesn't want to add more functionality. |
22:20:04 | BlaXpirit | well i expressed the same view, but not to such extent |
22:20:06 | reactormonk | Personally, I hope I can add some more functionality on it in terms of concepts |
22:20:13 | dom96 | Araq: The Optionals PR? |
22:20:45 | Araq | yes |
22:21:04 | BlaXpirit | i don't mind, except i'm not really the author :p |
22:21:48 | reactormonk | BlaXpirit, https://github.com/flaviut/Nim/commit/d3ab60c8310328b2838b42f0998515ddbb8a6ac4 solved |
22:22:14 | BlaXpirit | great |
22:22:19 | dom96 | Araq: I think so |
22:22:38 | Araq | hrm so it now misses the super cool ?= template. |
22:22:45 | BlaXpirit | i know, right?? |
22:23:16 | Araq | oh well I'll add it later when I use the module |
22:23:22 | * | taesoo quit (Ping timeout: 255 seconds) |
22:23:28 | Araq | too sexy to miss. |
22:23:34 | * | Pisuke quit (Ping timeout: 245 seconds) |
22:23:44 | BlaXpirit | with the direction the module has moved to, such a template would have to be named with words |
22:23:54 | Crocodick | why is the 'option' type isnt using a case object? |
22:24:15 | Araq | Crocodick: no point it's all hidden anyway |
22:25:18 | fowl | What is the official use case for option[t] |
22:25:36 | fowl | Async procs could use it instead of exceptions I guess |
22:25:37 | Araq | fowl: new regex module needs it |
22:25:56 | flaviu | My objective with #2762 is to be as minimal as possible to reduce bikeshedding. |
22:26:12 | reactormonk | bikeshedding? |
22:26:14 | flaviu | It doesn't seem to be working :P |
22:26:22 | BlaXpirit | went too far |
22:26:24 | reactormonk | Araq, so why do you want multiple entry points to the dependency graph? |
22:26:27 | * | boop is now known as boopisaway |
22:26:30 | flaviu | reactormonk: http://bikeshed.com/ |
22:28:12 | Araq | reactormonk: cause that models reality? |
22:28:51 | reactormonk | Araq, hm. Ok. But how come that would be a problem with the current system? You're only gonna have one entry point per compile |
22:29:59 | * | epichero quit () |
22:30:09 | Araq | flaviu: your goals are good and so is this module. I'd simply export a single 'case object' type with every field public, but that's just me |
22:30:38 | reactormonk | Araq, hm. Anything you export is gonna stick. |
22:30:48 | Crocodick | whats the compilet param "--patterns:on|off turn pattern matching on|off" ? |
22:30:49 | reactormonk | I would rather start with concepts and then think about the API |
22:30:56 | Crocodick | compiler* |
22:31:18 | Araq | Crocodick: a misnamed feature. "patterns" here refers to TR macros |
22:31:20 | * | kumool quit (Ping timeout: 252 seconds) |
22:31:26 | Crocodick | ok thx |
22:31:39 | * | boopisaway is now known as boop |
22:32:22 | Crocodick | i dont see why the Maybe case object isnt just exposed, and let everyone use it as they please |
22:32:42 | Crocodick | that way there is no bikeshedding lol |
22:32:50 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:33:13 | reactormonk | Crocodick, we might want to extend the API at some point |
22:33:27 | reactormonk | but I still think a case object would be cleaner |
22:33:35 | Araq | reactormonk: meh, I don't see the point in the abstraction. |
22:34:12 | Araq | more likely is we get more support for pattern matching in the language and then the 'case object' will get the new features out of the box and the hidden impl won't. |
22:34:25 | Crocodick | yes please! |
22:34:34 | flaviu | Araq: It's always possible to change it to a case object. |
22:34:38 | reactormonk | Crocodick, just comment on the PR |
22:34:47 | Crocodick | ok sure |
22:34:50 | flaviu | But it'd never be possible to change if *from* a case object. |
22:34:51 | reactormonk | Araq, sooo for now can we go ahead with the nimsuggest fix? |
22:34:55 | Araq | but enough time has been spent on this. and flaviu is right. |
22:35:08 | Araq | so just merge it now and be done with it |
22:36:17 | dom96 | Araq: Can we get ADTs too? |
22:36:19 | Araq | reactormonk: I guess. |
22:36:43 | Araq | dom96: we already have them but the syntax is a bit ugly. |
22:36:48 | flaviu | dom96: Make a macro! |
22:37:34 | dom96 | Araq: Should we just use macro to make it nicer then? |
22:37:38 | dom96 | *macros |
22:38:03 | Araq | I don't think this can be done yet, but yes. |
22:38:13 | * | ozra joined #nim |
22:38:39 | dom96 | flaviu: Oh. I agree with BlaXpirit. I think we need `$`. |
22:38:51 | reactormonk | flaviu, no `$`? O.o we need that |
22:38:52 | Araq | and 'hash' |
22:38:58 | Araq | lol |
22:39:10 | reactormonk | ^ yup |
22:39:20 | Araq | no no no, it's good the way it is. merge it, I say. |
22:39:32 | flaviu | I'll send another PR in 30 minutes to fix all that. |
22:39:37 | dom96 | and 'makeMeMillions' |
22:40:05 | BlaXpirit | next day: new pull request "add useful features" where the bikeshedding will continue |
22:40:05 | dom96 | Araq: You can merge it now if you want. |
22:40:20 | reactormonk | `$` and hash, then go I say |
22:40:51 | flaviu | BlaXpirit: Exactly! But I can safely create APIs that depend on it in the mean time. |
22:41:00 | BlaXpirit | right |
22:41:12 | Araq | when defined(sex): template `?=` ... # any chance for this? |
22:41:13 | * | dgym joined #nim |
22:41:23 | reactormonk | what does ?= do? |
22:41:35 | BlaXpirit | see the awesome tutorial |
22:41:39 | Araq | it unpacks |
22:41:55 | BlaXpirit | http://blaxpirit.com/f/nim/optionals.html |
22:42:24 | Araq | reactormonk: ok, so I guess your original patch was fine, let's merge that instead |
22:43:12 | dom96 | I don't like it. |
22:43:14 | dom96 | Looks like a comparison |
22:43:17 | reactormonk | Araq, https://github.com/Araq/Nim/pull/2784 |
22:43:18 | BlaXpirit | Araq, you may notice that not a single operator is used in flaviu's vision of the module |
22:43:19 | dom96 | when it's not actually comparing |
22:43:30 | BlaXpirit | the `?=` name doesn't make any sense now |
22:43:31 | reactormonk | yeah, I don't think chaining right now is good |
22:43:57 | BlaXpirit | especially now that option is not convertible to bool |
22:44:09 | BlaXpirit | opt.unpackInto(var) |
22:44:12 | BlaXpirit | or somethin |
22:44:18 | dom96 | BlaXpirit: bleh |
22:44:22 | dom96 | we need pattern matching instead |
22:44:31 | * | Jesin quit (Quit: Leaving) |
22:44:44 | dom96 | perhaps even pattern matching in the language |
22:44:46 | dom96 | not via macros |
22:44:53 | BlaXpirit | whatever, have fun |
22:45:03 | dom96 | if result == some(x): echo x |
22:45:28 | dom96 | nvm, that's ambiguous as hell. |
22:45:40 | Araq | ppfff that's blasphemy, I'm working on macro based pattern matching |
22:45:48 | dom96 | Araq: I've already had one written. |
22:45:53 | Araq | :O |
22:46:02 | Araq | where? |
22:46:07 | * | BlaXpirit quit (Quit: Quit Konversation) |
22:46:32 | dom96 | it's in one of my issues |
22:46:40 | dom96 | because I hit a bug before I could finish it |
22:46:45 | Quora | has anyone made an "ORM" in nim? |
22:47:16 | Araq | Quora: yes, OnO has stuff that works already I think |
22:47:26 | Araq | but he's actively working on it |
22:47:29 | Quora | OnO is an acronym? |
22:47:32 | Quora | ah |
22:47:46 | ozra | I'm used to the v: ?T meaning a maybe, and 'x ?= y' meaning "if x is null, set it to y" |
22:48:09 | reactormonk | Araq, done. |
22:49:30 | reactormonk | pigmej, ok, ready to go. |
22:50:22 | Quora | how would a mutable global work in a jester application? |
22:50:39 | Quora | would requests be processed in order they are recieved? |
22:50:39 | reactormonk | Quora, sounds bad |
22:52:32 | * | pregressive joined #nim |
22:52:39 | flaviu | Quora: Sounds like you should use a database instead. |
22:52:52 | Quora | yeah |
22:53:08 | Quora | I'm wondering how I would do that without having the template code do sql queries |
22:53:20 | * | Jesin joined #nim |
22:53:46 | flaviu | I'm having trouble understanding "template code do sql queries" |
22:54:38 | dgym | hello, I'm trying to port a tiny stack based VM to nim, but it seems to be spending 90% of its time in genericAssign while transfering 16 byte Object variants (Cells) to and from its stack (seq[Cell] or array[..., Cell]) |
22:54:46 | Quora | https://github.com/nim-lang/nimforum/blob/master/main.tmpl#L179-L225 |
22:55:01 | dgym | any tips on speeding up copying of small objects? |
22:55:59 | flaviu | Quora: I'm not too familiar with webapp architecture, but I think MVC is what you're looking for. |
22:56:05 | Quora | yeah |
22:57:18 | * | pregressive quit (Ping timeout: 258 seconds) |
23:00:11 | Araq | dgym: ha, now that's a good question. there are a couple of options: |
23:00:45 | Araq | * make your object variants not use any GC'ed data, this way the compiler will emit memcpy instead |
23:01:20 | Araq | * switch over to a register based VM which doesn't have these copies in the first place |
23:01:42 | reactormonk | Araq, GC'ed data are strings and seqs? |
23:02:02 | Araq | * get rid of the 'case' and have an object with a handful of fields, this should trigger a faster assignment operation |
23:02:08 | Araq | reactormonk: and closures and refs |
23:02:14 | dgym | interesting, but unfortunate, I'm only porting to nim because I want its GC :) |
23:02:41 | Araq | try to mark the object .shallow but I don't think this has any effect |
23:03:11 | Araq | dgym: btw Nim's own VM uses a register based VM |
23:03:18 | * | taesoo joined #nim |
23:03:25 | Araq | but not only for this reason |
23:03:27 | dgym | yes I tried that, it then spent 90% of its time in genericShallowAssign instead |
23:03:36 | Araq | lol |
23:03:54 | dgym | well it was worth a try :) |
23:04:14 | Araq | you can also use the GC, but don't use GC'ed *types* in your core object |
23:04:34 | Araq | and instead have a couple of GC_ref and GC_unref calls to keep stuff from being collected |
23:05:24 | Araq | but you should really use a register based VM anyway |
23:05:43 | Araq | IME it's the *simpler* VM design |
23:06:08 | dgym | ok, the manual GC_ref might be doable |
23:07:15 | dgym | I'm not convinced I could make a register based vm in my time constraints but I'll have a little look into it |
23:07:35 | dgym | many thanks for the tips |
23:08:39 | * | bulbasaur is now known as dtscode |
23:08:48 | dom96 | Quora: The templates are inside procedures, if you look at the top of the .tmpl. You can pass state to them. |
23:09:03 | Quora | yeah |
23:09:08 | Quora | I was hoping not to do that though |
23:09:11 | Quora | er |
23:09:13 | Quora | too much of that* |
23:09:48 | Quora | I'm not making sense, I should go nap |
23:11:43 | Araq | dgym: you can always steals from the compiler/vm*.nim modules |
23:12:14 | Araq | which is a big VM, but you can just copy the instruction encodings etc. and trim it down |
23:12:17 | dom96 | Quora: You're making plenty of sense. Doing that is not so bad I think. |
23:12:30 | dgym | what is the nim vm used for? |
23:12:48 | Araq | compile time evaluation, in particular macro evaluation |
23:14:32 | reactormonk | Araq, nice PR streak :-) |
23:14:44 | Araq | the bytecode instructions lead to pretty good code sequences, much better than what you get out of the box for any stack based VM |
23:16:08 | Araq | but on-the-fly common subexpression elimination would help quite a bit. (which you cannot really do with a stack based VM) |
23:17:01 | dgym | if you had to benchmark it against standard Lua and Python what sort of outcome would you be hoping for? |
23:17:10 | dom96 | Araq: Just to remind ourselves: https://github.com/Araq/Nim/issues/2785 :) |
23:17:40 | Araq | I benchmarked it against Python and won |
23:18:06 | ozra | Are semicolons and commas interchangeable in parameter lists, or are there any devils in the details? |
23:18:08 | dgym | nice |
23:19:17 | flaviu | (a, b: int), a and b are ints. |
23:19:33 | flaviu | (a; b: int). b is an int, I have no idea what a is. |
23:20:07 | ozra | alright. thanks |
23:21:37 | Crocodick | http://pastebin.com/raw.php?i=NLTbqvZM would a PR that push these warning off around those lines be welcome? |
23:22:52 | Araq | Crocodick: not around those lines, but for system.nim. |
23:24:42 | Crocodick | what about? gc.nim, sysstr.nim, widestrs.nim, repr.nim |
23:24:52 | Araq | all part of system.nim |
23:24:56 | Crocodick | ok |
23:28:18 | * | Trustable quit (Remote host closed the connection) |
23:30:40 | ozra | flaviu: what is the point of the two, why not just ',' - do you know? |
23:31:07 | Araq | ozra: you can use just ',' |
23:31:10 | flaviu | ozra: Well, I recently used it for generic parameters. |
23:31:17 | flaviu | [A, B; C: Foo] |
23:31:29 | flaviu | A and B can be whatever, but C must be a Foo. |
23:31:58 | * | boydgreenfield joined #nim |
23:32:17 | ozra | Arag: flaviu: Is it fair to say that it is pointless in procs (since untyped pars are depreceated), and so only serves a purpose in generics? |
23:32:31 | Araq | flaviu: that was possible before we had ';' too: [A, B: typedesc, C: Foo] |
23:32:54 | flaviu | Araq: Good to know. |
23:33:08 | Araq | but yes, ozra you can say that |
23:33:21 | ozra | Araq: what was the reason for its introduction, of curiosity? |
23:33:41 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:33:48 | Araq | people requested proc foo(a, b: char; x, y: int) as it's more readable than proc foo(a, b: char, x, y: int) |
23:34:25 | ozra | That is so fucking reasonable! It does serve a purpose :-) |
23:34:52 | Araq | yeah, even I had to agree eventually and add it to the language. |
23:35:46 | * | Strikecarl joined #nim |
23:35:53 | ozra | Rightly so, languages with id:type has always annoyed me _when it comes to params_ - this solves it and I hadn't even thought of it. haha. |
23:36:23 | Strikecarl | Aight so, i've been trying to make a program that downloads an .exe, really basic yes i know. |
23:36:27 | Strikecarl | But i get a SSL error |
23:36:29 | Strikecarl | when i do so |
23:36:37 | ozra | I jot down some notes about it in the man proc intro, since it has bugged me.. |
23:36:53 | ozra | the commas vs semis that is.. |
23:37:16 | Strikecarl | "Error: unhandled exception: SSL support is not available. Cannot connect over SSL. [HttpRequestError]" |
23:37:20 | Strikecarl | How do i fix this. |
23:37:31 | Quora | -d:ssl |
23:37:31 | Araq | Strikecarl: compile with -d:ssl |
23:40:48 | Strikecarl | Araq |
23:40:58 | Strikecarl | http://i.imgur.com/RI30fZy.png |
23:41:12 | Quora | install that dll file? |
23:41:24 | Strikecarl | I ran it on my VM |
23:41:32 | Strikecarl | Do i install .dll on vm or ? |
23:41:39 | flaviu | well, you have to have a copy of openssl laying around to use -d:ssl |
23:41:53 | Strikecarl | kk |
23:41:59 | Quora | Strikecarl: google that dll file name or something |
23:42:39 | Strikecarl | I just place in Aporia folder? |
23:43:11 | Quora | you place it anywhere in your windows PATH |
23:43:14 | Strikecarl | kk |
23:43:17 | Araq | no, next to the produced .exe |
23:43:29 | Quora | Araq: it also looks in %PATH% on windows IIRC |
23:43:43 | Quora | windows dynamic library security is odd |
23:43:50 | Araq | please don't explain to me how windows works |
23:44:02 | Quora | okay |
23:44:14 | Araq | chances are high I know better than you :P |
23:44:46 | Araq | (yes, you're right about the %PATH% but next to the .exe is how you should do it for deployment) |
23:45:05 | dtscode | Araq: Windows works by first invoking the kernel |
23:45:14 | dtscode | Bet you didn't know that |
23:45:28 | flaviu | dtscode: nah, I'm pretty sure that the bootloader comes before the kernel. |
23:45:50 | dtscode | Thats not a part of windows though |
23:46:09 | dtscode | Otherwise we would have to factor in the magic elves at the beginning of the boot phase |
23:47:09 | TEttinger | windows works using the power of imagination and children's tears |
23:48:29 | TEttinger | DID YOU KNOW that Bill Gates is really an incarnation of Tlaloc, Aztec god of rain, who the tears of children would be offered to ensure that drought would not befall their people? |
23:49:06 | TEttinger | why do you think he cares about malaria so much? |
23:50:07 | * | boop is now known as boopisaway |
23:50:42 | ozra | TEttinger: It, and IE, are also powered by the tears of developers. Don't forget those poor bastards! |
23:51:06 | TEttinger | heh |
23:51:37 | Crocodick | Araq: https://github.com/Araq/Nim/pull/2786 |
23:52:20 | Araq | holycowbatman? |
23:52:25 | Crocodick | ye? |
23:52:33 | * | bjz joined #nim |
23:52:37 | Araq | did you know you're a scientist? |
23:52:43 | Crocodick | what lol |
23:53:25 | Araq | https://www.youtube.com/watch?v=AcMEckOyoaM |
23:54:13 | Crocodick | lol |
23:54:23 | Strikecarl | great |
23:54:30 | Strikecarl | now everything 404's <.< |
23:54:46 | Strikecarl | we're all good that this doesnt 404 aight? also dont open the file https://docs.google.com/uc?authuser=0&id=0B4MlHB8bp9rvVmtwRzIyWFRXWEE&export=download |
23:55:03 | Strikecarl | Maybe its cause i am logged into the drive account i can download it? :/ |
23:58:32 | Strikecarl | Does it follow redirects? |
23:58:38 | Strikecarl | so if i shorten the link it won't work? |