00:03:25 | * | Trustable quit (Remote host closed the connection) |
00:04:09 | plm | federico3: using what compiller? gcc? |
00:04:18 | federico3 | yep |
00:04:58 | plm | federico3: could you to try LLVM? |
00:05:27 | plm | federico3: just to know if problem with portability of rust is just becouse are using LLMV |
00:05:41 | federico3 | well not at the moment |
00:05:41 | * | couven92 quit (Read error: Connection reset by peer) |
00:15:38 | * | Vladar quit (Quit: Leaving) |
00:21:12 | FromGitter | <philip-wernersbach> Anyone here game jamming? |
00:23:35 | dom96 | sadly no :) |
00:26:54 | * | plm quit (Quit: leaving) |
00:30:55 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
00:32:47 | * | yglukhov joined #nim |
00:33:16 | FromGitter | <zacharycarter> I'm failing hard at setting up the structure of my game project |
00:33:27 | FromGitter | <zacharycarter> I can't figure out how to create a hybrid binary / library project with nimble |
00:33:48 | dom96 | zacharycarter: where are you getting stuck? |
00:33:57 | dom96 | I assume you found the section on it in Nimble's readme? |
00:34:04 | FromGitter | <zacharycarter> I did |
00:34:32 | FromGitter | <zacharycarter> let me try to put together an example repo real quick of what I'm trying to do and maybe you guys can give me some pointers |
00:34:38 | FromGitter | <zacharycarter> be back shortly |
00:34:55 | FromGitter | <zacharycarter> I keep starting over so it's deviated from my original attempt |
00:37:11 | * | yglukhov quit (Ping timeout: 258 seconds) |
00:37:32 | dom96 | If you need an example, Nimble is a hybrid library/binary package |
00:44:30 | FromGitter | <zacharycarter> https://github.com/zacharycarter/derelict |
00:44:36 | FromGitter | <zacharycarter> yeah that's where I started pretty much |
00:44:54 | FromGitter | <zacharycarter> it may be just something wrong in my code - I'm a Nim novice |
00:45:24 | FromGitter | <zacharycarter> the error I get is - derelict.nim(10, 28) Error: undeclared field: 'glfwWindow' |
00:45:54 | FromGitter | <zacharycarter> please ignore the binary in the root - I'll have to take care of that in the gitignore |
00:46:57 | * | nsf joined #nim |
00:49:24 | dom96 | zacharycarter: what glfw wrapper are you using? |
00:50:17 | FromGitter | <zacharycarter> https://github.com/rafaelvasco/nimrod-glfw |
00:52:26 | dom96 | hrm, shouldn't your .nimble file specify `nimrod-glfw` as a requirement instead of `glfw`? |
00:53:10 | dom96 | Your issue is that this needs to be exported: https://github.com/zacharycarter/derelict/blob/master/src/derelictpkg/window.nim#L9 |
00:53:14 | dom96 | Add an asterisk to do that |
00:53:24 | dom96 | glfwWindow*: glfw.Window |
00:53:31 | FromGitter | <zacharycarter> ahh okay thank you |
00:53:55 | FromGitter | <zacharycarter> I'll go read the docu on exporting variables |
00:55:06 | FromGitter | <zacharycarter> makes sense now though - I was wondering how to handle access modifiers |
00:55:33 | dom96 | yeah, everything is private by default |
00:56:11 | FromGitter | <zacharycarter> gotcha |
00:56:48 | kulelu88 | hey dom96 , how do I use the modulo to check for a remainder in a float ? |
00:57:10 | dom96 | zacharycarter: also I'm not sure which glfw library is better but there is also this one https://github.com/ephja/nim-glfw |
00:57:36 | dom96 | kulelu88: x mod 2? |
00:58:35 | kulelu88 | dom96: what if I want to do something like: x = y / 2 ... [check if a remainder exists, if yes, number is odd) |
00:59:08 | kulelu88 | if mod(x) == true ? |
01:00:29 | dom96 | if x mod 2 == 0 |
01:01:32 | cheatfate | kulelu88, there is no reminder in floats division... only integers can have reminder and modulo |
01:01:47 | kulelu88 | wrapping my head around the returns of procs for a static language is quite ... different |
01:02:26 | * | bjz joined #nim |
01:02:32 | kulelu88 | alright, I get it now. gotta use the modulo check before dividing |
01:03:05 | dom96 | 'night |
01:06:21 | kulelu88 | cheatfate: how do I force an int / 2 to return an int ? |
01:06:52 | * | nsf quit (Quit: WeeChat 1.7) |
01:07:11 | cheatfate | a div b |
01:07:21 | cheatfate | kulelu88, a div b |
01:08:19 | kulelu88 | numbers.nim(34, 14) Error: type mismatch: got (int) but expected 'float' |
01:08:48 | kulelu88 | cheatfate: ^^ |
01:08:57 | cheatfate | show me the code |
01:09:08 | cheatfate | gist code please |
01:09:53 | cheatfate | because `proc `div` *(x, y: int): int {.magic: "DivI", noSideEffect.} |
01:09:53 | cheatfate | ` defined in system.nim |
01:12:10 | kulelu88 | cheatfate: https://glot.io/snippets/emeletymcy |
01:13:31 | * | pie_ quit (Ping timeout: 240 seconds) |
01:13:40 | kulelu88 | I added the imports |
01:14:33 | cheatfate | works and compiles for me |
01:14:49 | kulelu88 | yeah but there's an error at the bottom, if you can see it |
01:15:33 | cheatfate | kulelu88, i dont know what is using glot.io, because nim in my pc compiles this program and run it |
01:15:51 | kulelu88 | cheatfate: let me just pastebin it regularly |
01:17:19 | kulelu88 | cheatfate: please try running this: https://www.zerobin.net/?3f14c41ec3ae378d#SQjRzdmKHWaKBUoi25IrCHKkGkH5yPdzAkmpllaIOGc= |
01:18:08 | cheatfate | kulelu88, it runs as expected, what version of nim you are using? |
01:18:15 | kulelu88 | 0.16 |
01:18:51 | cheatfate | OS? |
01:19:37 | kulelu88 | cheatfate: aah yes, it runs now. sorry about that sir |
01:21:11 | FromGitter | <Varriount> federico3: C.H.I.P? |
01:21:23 | kulelu88 | cheatfate: when you run it, does it output a '0' at the end? if yes, why? |
01:24:57 | cheatfate | kulelu88, because default return value of your function is `0`. |
01:25:22 | cheatfate | kulelu88, you have not specified return value, when it is odd |
01:28:24 | Amun_Ra | Varriount: see CHIP8, an arm based sbc |
01:37:37 | * | arnetheduck joined #nim |
01:38:26 | * | dddddd quit (Quit: Hasta otra..) |
01:39:42 | * | brson joined #nim |
01:47:30 | * | chemist69 quit (Ping timeout: 252 seconds) |
01:52:11 | * | chemist69 joined #nim |
02:14:03 | * | Ven joined #nim |
02:19:52 | * | aaaaa joined #nim |
02:20:13 | * | def-pri-pub joined #nim |
02:20:50 | def-pri-pub | Araq: I know you've already commented on my forum post regarding the `interfaces`. Is there anything else you can think of? I do want to get some more input on them before I go any further. |
02:21:50 | * | aaaaa quit (Read error: Connection reset by peer) |
02:22:13 | * | aaaaa joined #nim |
02:23:14 | * | aaaaa quit (Read error: Connection reset by peer) |
02:23:31 | * | aaaaa joined #nim |
02:24:04 | * | aaaaa left #nim (#nim) |
02:24:47 | * | handlex joined #nim |
02:27:20 | * | chemist69 quit (Ping timeout: 240 seconds) |
02:34:43 | * | yglukhov joined #nim |
02:37:23 | * | handlex quit (Quit: handlex) |
02:39:04 | * | yglukhov quit (Ping timeout: 258 seconds) |
02:41:21 | * | chemist69 joined #nim |
02:43:25 | * | sz0 joined #nim |
02:52:38 | * | ARCADIVS joined #nim |
02:56:29 | TheManiac | Is it possible to nest calls to iterators? e.g. mySeq.iterator1().iterator2()? |
02:56:59 | TheManiac | Seems like the call to iterator2 means that nim doesn't think that iterator1 is being called in an iterator context |
02:59:51 | TheManiac | def-pri-pub: aren't concepts nim's answer to interfaces? |
03:07:25 | TheManiac | Not that I've ever really tried to use them, but if you have defined the concet of a Duck, why do you need an interface for one? (Or have I totally misunderstood what concepts do?) |
03:12:36 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
03:28:30 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
03:31:42 | * | Ven joined #nim |
04:01:23 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
04:07:12 | * | Ven joined #nim |
04:10:02 | * | Ven quit (Client Quit) |
04:15:30 | * | Ven joined #nim |
04:16:32 | Araq | def-pri-pub: you need to ensure that an object type can implement multiple interfaces at the same time |
04:16:47 | Araq | haven't checked if the proposals support that |
04:20:21 | FromGitter | <zacharycarter> Running into another problem with opengl - https://gist.github.com/zacharycarter/edb5d5067c6d6bd308d2d4948e2e533d ⏎ https://github.com/zacharycarter/derelict/blob/master/src/derelict.nim#L14 |
04:23:39 | * | Ven quit (Read error: Connection reset by peer) |
04:23:45 | * | Ven_ joined #nim |
04:25:29 | Araq | what's the problem? |
04:26:02 | FromGitter | <zacharycarter> First link has a sigsev in it |
04:27:26 | FromGitter | <zacharycarter> https://gist.github.com/zacharycarter/edb5d5067c6d6bd308d2d4948e2e533d#file-error-log-L33 |
04:28:29 | Araq | call loadExtensions? :-) |
04:29:16 | * | bjz joined #nim |
04:31:17 | FromGitter | <zacharycarter> okay I get it now thank you @Araq |
04:31:30 | FromGitter | <zacharycarter> first I was calling loadExtensions without loading any |
04:31:39 | FromGitter | <zacharycarter> now I'm loading them without calling loadExtensions first as the docu says |
04:32:17 | Araq | this loadExtensions business is a PITA and needs to get better |
04:32:57 | FromGitter | <zacharycarter> well to further confuse things I'm looking at older examples where they don't have that issue I reported this morning |
04:33:23 | FromGitter | <zacharycarter> so they call loadExtensions without loading any first, which is what caused my confusion just now |
04:36:20 | FromGitter | <philip-wernersbach> *Yawn* game jam is a tour-de-force sometimes |
04:36:55 | * | yglukhov joined #nim |
04:37:37 | FromGitter | <philip-wernersbach> @Araq What caused this commit: https://github.com/nim-lang/Nim/commit/9753782f96bcd9b35a4c45d6cb20de2a85c33e55 |
04:38:12 | FromGitter | <philip-wernersbach> I'm hoping it may fix memory consumption I've seen in https://github.com/philip-wernersbach/influx-mysql |
04:38:44 | Araq | well try it? |
04:38:56 | Araq | it's the reason we need to release 0.16.2 soon |
04:39:09 | Araq | was introduced in 0.16.0 |
04:40:56 | Araq | but: the fix in 0.16.0 also dealt with memory fragmentation problems, so yeah, hopefully that fixes your memory consumption problems |
04:41:06 | * | yglukhov quit (Ping timeout: 240 seconds) |
04:41:40 | FromGitter | <philip-wernersbach> Oh okay never mind. I've had large memory consumption since I started programming it, three Nim versions ago |
04:42:38 | FromGitter | <philip-wernersbach> I'll try 0.16.2 with it once it comes out, always good to see progress. Not sure how much of the memory consumption is due to Nim though, and how much is due to the memory intensive nature of the problem |
04:44:03 | Araq | 0.16.2 has a "heap dump" feature that can tell you |
04:44:42 | * | brson quit (Read error: Connection reset by peer) |
04:45:15 | kulelu88 | what is the problem you are addressing? |
04:47:49 | FromGitter | <philip-wernersbach> @Araq How can I use that? That would be so useful |
04:48:53 | Araq | compile with -d:nimTypeNames and at a strategic place call |
04:49:10 | Araq | dumpNumberOfInstances() |
04:49:21 | Araq | but it's new in devel |
04:50:08 | * | brson joined #nim |
04:50:41 | FromGitter | <philip-wernersbach> @kuleulu88 It's not a bug or issue, but an annoyance. Putting a large amount of data through influx-mysql causes a large amount of data to be allocated (obviously), that never gets unallocated. |
04:51:41 | FromGitter | <philip-wernersbach> As an aside, I have a hard time believing that 64MB of data can use up to 512MB after parsing and transforming into data structures. Rather, I think it's fragmentation |
04:52:36 | FromGitter | <philip-wernersbach> @Araq Thanks for the tip, I'll definitely take advantage of that |
04:55:40 | * | ARCADIVS quit (Ping timeout: 245 seconds) |
04:56:55 | kulelu88 | sounds like you need manual memory allocation, which Nim offers |
04:57:44 | FromGitter | <philip-wernersbach> @Araq Oh also, what is the status of coroutines, the stack gc, and gc2? All three have been in the standard library for a while |
04:58:36 | * | kulelu88 quit (Quit: Leaving) |
04:59:07 | FromGitter | <philip-wernersbach> kulelu88 You're probably right, but I'd rather not |
05:06:27 | * | ARCADIVS joined #nim |
05:06:53 | Araq | coroutines: looked into it, won't be ready anytime soon |
05:07:28 | * | m_rk joined #nim |
05:07:39 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
05:08:55 | Araq | gc2: likely to be abandoned. instead of an incremental M&S GC for cycles, somebody needs to take an intensive look at how Swift avoids cycles |
05:10:29 | Araq | stack "gc": still very promising and a good match for Nim's write tracking and escape analysis. |
06:10:05 | * | Ven joined #nim |
06:13:43 | * | def-pri-pub quit (Quit: leaving) |
06:16:53 | * | m_rk quit (Ping timeout: 240 seconds) |
06:32:11 | * | chemist69 quit (Ping timeout: 264 seconds) |
06:32:53 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
06:38:31 | * | yglukhov joined #nim |
06:42:59 | * | yglukhov quit (Ping timeout: 264 seconds) |
06:53:04 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
06:59:10 | * | chemist69 joined #nim |
07:02:29 | * | bjz joined #nim |
07:08:12 | Araq | „On Termix (and likely other non-rooted device environments) many parts of the root filesystem are read-only. |
07:08:12 | Araq | This causes Nimble (and likely lots of other Nim stuff) to fail trying to write to /tmp.“ |
07:08:42 | FromGitter | <Varriount> @Araq I thought coroutines were already implemented? |
07:10:01 | Araq | @varriount tests fail for me and the fact that a single external assembler is able to compile the assembler doesn't help |
07:10:35 | Araq | what's the point of a readonly /tmp filesystem? |
07:12:13 | FromGitter | <Varriount> Araq: Beats me. Seems like something a computer-illiterate auditor might demand in the name of security. |
07:12:36 | FromGitter | <Varriount> Unless only root is allowed to write to /temp? |
07:13:06 | * | Ven joined #nim |
07:13:27 | FromGitter | <Varriount> @Araq On the topic of Swift, the documentation basically states that resolving strong reference counts is the responsibility of the programmer. |
07:15:14 | Araq | varriount: yes I'm aware but I think they have some trick involving closures |
07:16:05 | FromGitter | <Varriount> Oh, you mean to prevent cycles for closures? |
07:16:57 | FromGitter | <Varriount> Does a reference cycle always occur with a closure in Nim? |
07:19:47 | * | sz0 quit (Quit: Connection closed for inactivity) |
07:20:03 | Araq | not always, but very often |
07:23:56 | FromGitter | <Varriount> Araq: What's the most common cause? |
07:24:18 | Araq | you capture too much |
07:24:37 | Araq | instead of capturing only x.foo, you capture the full 'x' |
07:24:40 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:24:54 | Araq | x containing the closure |
07:24:59 | Araq | tata, cycle. |
07:25:33 | FromGitter | <Varriount> Araq: Do closures in Nim capture everything in the parent scope (internally)? |
07:25:59 | Araq | the compiler computes what is captured |
07:26:06 | Araq | so no. |
07:26:23 | FromGitter | <Varriount> The only thing I can find in the swift documentation on cycles in closures is that an explicit capture list must be used to prevent them |
07:27:56 | Araq | we can statically compute the backrefs and internally make them ptr instead of ref |
07:28:12 | Araq | well, we can in many cases. |
07:28:31 | Araq | but the type graphs are incomplete in general. |
07:29:39 | FromGitter | <Varriount> Araq: Well, it seems that in the case of Swift, the language requires the programmer to resolve cycles. |
07:33:13 | FromGitter | <Varriount> Araq: Like too many things in programming, it seems there is no silver bullet. |
07:36:33 | FromGitter | <Varriount> Araq: Does the current mark & sweep collector have the ability to output the cycles it detects? |
07:37:39 | * | Ven joined #nim |
07:37:53 | Araq | no, it doesn't detect cycles |
07:37:58 | Araq | it marks and sweeps |
07:38:22 | FromGitter | <Varriount> Hm. |
07:38:39 | FromGitter | <Varriount> Could it be modified to do so? |
07:38:42 | Araq | but your idea is great. detect cycles at runtime and make the programmer add annotations for production |
07:38:53 | FromGitter | <Varriount> I'm wondering if something like profile-guided optimization might be used for the reference cycle problem too |
07:39:18 | FromGitter | <Varriount> If nothing else, to minimize the performance impact |
07:44:07 | FromGitter | <Varriount> @Araq I don't know how developers might react to debugging output in their executables though, even if they were compiled in debug mode. |
07:45:08 | Araq | it's 2017. we don't have to output profiling information to stdout |
07:45:30 | Araq | (or would that be stderr? who knows...) |
07:50:00 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
08:10:09 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:14:46 | * | bjz joined #nim |
08:24:26 | * | rokups joined #nim |
08:33:13 | * | brson quit (Ping timeout: 248 seconds) |
08:37:44 | * | brson joined #nim |
08:40:05 | * | yglukhov joined #nim |
08:44:06 | * | yglukhov quit (Ping timeout: 240 seconds) |
08:48:51 | Araq | Traceback (most recent call last) |
08:48:51 | Araq | toy.nim(95) toy |
08:48:51 | Araq | toy.nim(92) main |
08:48:53 | Araq | ui.nim(27) pollingMainLoop |
08:48:55 | Araq | toy.nim(92) :anonymous |
08:48:57 | Araq | asyncdispatch.nim(1072) poll |
08:48:59 | Araq | Error: unhandled exception: No handles or timers registered in dispatcher. [ValueError] |
08:49:05 | Araq | we had this discussion before, I think. |
08:49:18 | Araq | this behaviour is wrong. |
08:49:25 | * | byte512 joined #nim |
08:50:10 | Araq | the fact that I call 'poll' with a timeout pretty much suggests that eventually there could be registered events in the poll loop |
08:59:47 | gangstacat | certainly a noob question but is it possible to iterate over a range in a set in order to give the values on buttons and pass the value on a procedure using ui module? |
08:59:49 | gangstacat | https://gist.github.com/gangsterakato/df30123c84f9ceb38365f32d71d1f487 |
09:05:55 | FromGitter | <Varriount> gangstacat: Does it have to be a set? |
09:06:35 | gangstacat | Varriount, no |
09:08:32 | FromGitter | <Varriount> gangstacat: I'm on my phone at the moment. What happens if you just do `for letter in 'A'..'I':` ? |
09:08:47 | FromGitter | <Varriount> (Spacing exactly like that) |
09:08:48 | gangstacat | Varriount, same thing, always the last element |
09:11:45 | FromGitter | <Varriount> Wait, what? |
09:13:13 | * | yglukhov joined #nim |
09:13:33 | FromGitter | <Varriount> Try turning that inline closure into a proper nested closure, and see what happens |
09:23:31 | * | yglukhov quit (Remote host closed the connection) |
09:26:54 | * | yglukhov joined #nim |
09:27:18 | cheatfate | Araq, behavior is not wrong, it warns you that you are doing wrong... |
09:30:44 | * | nsf joined #nim |
09:31:06 | * | yglukhov quit (Ping timeout: 240 seconds) |
09:36:49 | Araq | gangstacat: that's just how Nim's closures work, you need a wrapper closure to produce a new context for the for loop variable |
09:37:09 | Araq | same issue in JS really, nothing to do with events |
09:43:06 | Araq | cheatfate: what's wrong with this |
09:43:29 | Araq | while true: |
09:43:29 | Araq | poll(timeout) |
09:43:30 | Araq | discard rawui.mainStep(timeout.cint) |
09:44:37 | * | sz0 joined #nim |
09:51:02 | dom96 | Araq: http://nim-lang.org/docs/asyncdispatch.html#hasPendingOperations, |
09:51:51 | FromGitter | <Varriount> gangstacat: If it makes you feel better, it happens in Python too. |
09:52:23 | gangstacat | ah.. I don't know if that makes me feel better honestly :'D |
09:52:42 | FromGitter | <Varriount> Also, I would have been puzzled about it too. |
09:53:26 | FromGitter | <Varriount> Although, it helped that I recalled a similar user problem in the past. And @Araq saying something about closure creation. |
09:53:59 | FromGitter | <Varriount> gangstacat: It also helps if you know the internals of closures. |
09:54:15 | gangstacat | can you show me an example or..? |
09:54:25 | FromGitter | <Varriount> An example of...? |
09:55:37 | gangstacat | nothing, I will try to resolve this, thanks both of you |
09:55:53 | FromGitter | <Varriount> @Araq can correct me if I'm wrong, but when a closure is created, all variables from the outer scopes that are 'captured' (referenced) by the closure are lifted into an implicit object. |
09:56:30 | FromGitter | <Varriount> This transforms all assignments in the outer scopes into assignments that mutate that object. |
09:57:58 | FromGitter | <Varriount> And since only (normally) one of the implicit object is created, redefinitions of the closure in a loop will still use the same instance of the implicit object. |
09:58:38 | FromGitter | <Varriount> I don't like the behavior, but it's probably tough to change, and/or inefficient for the majority of other cases. |
09:59:13 | FromGitter | <Varriount> (as evidenced by the fact that this behavior is exhibited by two other languages, both of which are much more dynamic in nature than Nim). |
10:01:11 | FromGitter | <Varriount> @Araq Would it be possible/a good idea for the compiler to warn about such behavior (that is, redefining a closure in a loop)? |
10:03:49 | FromGitter | <Varriount> gangstacat: What you need to do is create a separate procedure that creates and returns the update closure, then call that in a loop |
10:04:45 | Araq | dom96: ah ok |
10:05:15 | Araq | varriount: the behaviour *changed* from the behaviour everybody wants to the current behaviour |
10:05:37 | Araq | we could warn about captures of for loop variables though |
10:10:53 | dom96 | it changed but for a good reason: the old behaviour was inconsistent with JS which made things complex |
10:11:50 | Araq | it also was a pita to maintain. closure iterators capturing closures capturing scopes, not proc environments ... |
10:12:09 | Araq | it's a combinatorial explosion of cases |
10:17:57 | * | Parashurama joined #nim |
10:18:12 | Parashurama | hello everyone |
10:19:23 | Araq | hi Parashurama |
10:19:48 | Parashurama | Araq: so I'm trying to find a way |
10:20:26 | Parashurama | Araq: to make the opengl package have better compatibility with different opengl versions. |
10:22:10 | Parashurama | Araq: right now If I add GL_DOUBLE support to my program, it will raise an error if i run on a computer with a less recent driver since support unsupported functions are not eliminated. |
10:23:00 | Parashurama | perhaps a compile time flag that allow nimloadProc to not raise an error it function not found. |
10:23:22 | Parashurama | or even a way to queck if extensionnameARB is supported. |
10:23:56 | Parashurama | *check |
10:37:43 | * | vlad1777d joined #nim |
10:42:57 | * | Vladar joined #nim |
10:48:45 | * | arnetheduck quit (Ping timeout: 256 seconds) |
11:05:33 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
11:10:37 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
11:10:58 | * | Kingsquee joined #nim |
11:18:28 | Araq | Parashurama: only what you use it loaded, so I am not sure I understand your problem |
11:18:30 | Araq | but bbl |
11:25:37 | * | ftsf joined #nim |
11:28:05 | Parashurama | Araq: exactly: I f i compile my program on Computer1 (OGL 4) then distribute to other Computer2 (OGL3) with C/C++ I can use runtime fallback to OGL3 path, but since nimloadProc check at runtime if OGL4 functions is present it fails on computer2 |
11:29:21 | * | bjz joined #nim |
11:32:12 | * | brson quit (Read error: Connection reset by peer) |
11:32:29 | * | brson joined #nim |
11:44:03 | * | couven92 joined #nim |
11:59:47 | * | sz0 quit (Quit: Connection closed for inactivity) |
12:03:03 | * | Snircle joined #nim |
12:24:38 | * | Trioxin joined #nim |
12:39:05 | * | ARCADIVS quit (Quit: ARCADIVS) |
12:44:38 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
12:51:54 | * | chemist69 quit (Ping timeout: 252 seconds) |
12:54:36 | * | chemist69 joined #nim |
13:01:45 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:12:43 | * | nsf quit (Quit: WeeChat 1.7) |
13:16:22 | * | zevlg quit (Read error: Connection reset by peer) |
13:17:45 | * | abruanese quit (Ping timeout: 245 seconds) |
13:22:42 | * | Parashurama left #nim (#nim) |
13:24:57 | * | abruanese joined #nim |
13:29:33 | * | brson quit (Ping timeout: 276 seconds) |
13:39:31 | * | Trustable joined #nim |
13:48:05 | niv | dom96: is it possible that bin=[] support in nimble is kinda broken in what gets shipped with 0.16? |
13:48:35 | dom96 | niv: I don't think so, what's broken with it? |
13:49:01 | * | PMunch joined #nim |
13:49:25 | niv | dom96: https://gist.github.com/niv/ea0fbf758cee8c6d6c5a4e954fc63394 |
13:49:38 | niv | this is with a empty ~/.nimble/ |
13:50:06 | * | Trioxin quit (Ping timeout: 240 seconds) |
13:50:19 | niv | i tried the same with a nimble compiled from HEAD and there it worked (even though it still emitted that weird warning) |
13:50:57 | dom96 | hrm, yeah, I think that was fixed in HEAD |
13:51:05 | niv | okay, just checking |
13:51:11 | niv | whats the warning about? doesnt make any sense to me |
13:53:18 | dom96 | I suppose I should just get rid of that warning, it's not really anything to be worried about. |
13:53:43 | dom96 | When Nimble installs your package it copies everything in src/ |
13:53:52 | dom96 | to ~/.nimble/pkgs/pkgblah-ver |
13:53:59 | dom96 | then it copies the binaries |
13:54:14 | dom96 | but your src/ dir already contains the binaries so they were copied already |
13:54:29 | dom96 | so nimble copies them twice |
13:54:36 | niv | alright |
13:55:03 | niv | though that shouldnt really happen with my config regardless. im only telling it to explicitly copy the files i listed |
13:55:46 | dom96 | hrm |
13:55:49 | dom96 | good point |
13:55:54 | dom96 | Please report it |
13:56:10 | niv | https://github.com/nim-lang/nimble/blob/master/src/nimble.nim#L458 |
13:56:16 | niv | i think the check might actually be accidentally negated |
13:56:41 | niv | i just did :p |
13:57:10 | dom96 | hah, I think you're right |
13:57:13 | dom96 | oopsie |
13:59:17 | niv | do you really want me to open an issue on gh about this? |
14:00:04 | dom96 | yeah |
14:00:56 | niv | will do |
14:02:28 | Araq | Error: unhandled exception: Received length doesn't match expected length. Wanted 31805674 got 11950269 |
14:03:37 | dom96 | Araq: ouch, a bug in httpclient? |
14:03:59 | Araq | seems so but this thing is hardly usable as it is anyway |
14:04:53 | dom96 | why? |
14:05:44 | Araq | let contents = await client.getContent("http://nim-lang.org/download/" & pkg & ".zip") |
14:05:44 | Araq | let z = "dist" / pkg & ".zip" |
14:05:44 | Araq | writeFile(z, contents) |
14:06:10 | Araq | but 'writeFile' is not async and even it were |
14:06:22 | Araq | I want an async 'downloadFile' operation |
14:06:51 | Araq | there is no need to have a 80MB string buffer containing the zip just to store it on disc |
14:07:37 | dom96 | yes, for that we need async streams |
14:07:37 | euantor | +1 Araq |
14:08:09 | euantor | I actually have a very similar use case for a system I implemented at work, which downloads a bunch of files and zips them up for installing to servers automatically |
14:08:44 | Araq | no we don't need async streams for that, the API doesn't expose a streaming interface, it would take a 'destfile: string' |
14:10:08 | dom96 | okay, feel free to implement it that way then |
14:10:09 | euantor | Ideally it would use `sendfile` on linux |
14:10:26 | euantor | Not sure if Windows has a similar function |
14:10:31 | Araq | but there is a different problem |
14:10:45 | Araq | right now the event loop doesn't seem to work properly |
14:11:10 | Araq | I need to move the mouse to trigger "continue with the download" events ... what a piece of crap |
14:12:09 | dom96 | you mean the libui event loop isn't working? |
14:12:53 | dom96 | Are you using this? https://github.com/nim-lang/ui/blob/master/ui/rawui.nim#L23 |
14:13:39 | Araq | yes |
14:13:56 | dom96 | with what `wait` argument? |
14:14:45 | Araq | 10 |
14:14:52 | Araq | changed it to 0, now it works |
14:15:00 | Araq | apparently it's in seconds then? |
14:15:26 | dom96 | Perhaps a bit too premature for "what a piece of crap" |
14:15:43 | Araq | oh I meant my program |
14:15:50 | Araq | not necessarily the used libraries |
14:15:54 | dom96 | I see |
14:16:11 | Araq | but hmm, now it works and I have a nice progress bar |
14:16:45 | dom96 | Funny how I knew exactly where you went wrong ;) |
14:18:09 | Araq | yes, you are a genius. now. how do I cancel a httpclient download? |
14:19:23 | dom96 | hah |
14:19:47 | dom96 | You can't right now I'm afraid |
14:19:56 | dom96 | No support for cancelling futures yet |
14:21:40 | Araq | I can crash the program, I guess |
14:22:21 | dom96 | if you're cancelling the download then you essentially want to exit out of the program anyway right? |
14:23:16 | Araq | right |
14:24:29 | Araq | ugh, even the sync downloadFile uses full file buffering. that's not acceptable. |
14:29:35 | * | nsf joined #nim |
14:42:21 | federico3 | Varriount: getchip.com |
14:44:15 | * | handlex joined #nim |
14:44:51 | niv | alternative to chip, http://www.nanopi.org/ |
14:45:18 | federico3 | smaller but more expensive |
14:45:40 | niv | kind of but not really. i got the neo for like 8 quid |
14:45:57 | niv | but its not exactly a *great* board, its allwinner after all |
14:46:42 | federico3 | CHIP + shipping were around 10e each and they have onboard flash and wifi |
14:46:56 | niv | oh, cool stuff. |
14:47:11 | federico3 | oh, the nanopi has an 8GB MMC actually |
14:47:26 | niv | im kind of disenchanted with all these arm boards. they arent really useful unless you go for a raspberry, otherwise you are stuck with a very old, crappy kernel and ubuntu core |
15:06:49 | * | hendi joined #nim |
15:07:10 | * | hendi quit (Client Quit) |
15:10:55 | Araq | euantor: https://msdn.microsoft.com/en-us/library/ms775123(v=vs.85).aspx |
15:12:02 | cheatfate | Araq, `sendfile` is a nice feature and urldownloadtofile != sendfile in any case, because sendfile is sending from one fd to another fd, while urldownloadfile is just for downloading file from net |
15:13:39 | euantor | That would do it Araq |
15:13:54 | Araq | cheatfate: can shellExecute unzip a .zip file? |
15:14:06 | cheatfate | And because `sendfile` is syscall its very fast, but some times it causes problems because of custom kernel defaults |
15:15:01 | cheatfate | Araq, you need to look decompressor here https://msdn.microsoft.com/en-us/library/windows/desktop/hh437556(v=vs.85).aspx |
15:16:05 | * | xet7 quit (Ping timeout: 245 seconds) |
15:17:09 | Araq | "Compressapi.h on Windows 8 and Windows Server 2012" |
15:17:29 | Araq | I bet shellExecute does work |
15:17:55 | * | yglukhov joined #nim |
15:28:47 | * | hendi joined #nim |
15:30:05 | * | hendi quit (Client Quit) |
15:32:11 | * | chemist69 quit (Ping timeout: 264 seconds) |
15:32:54 | * | yglukhov quit (Remote host closed the connection) |
15:33:00 | Araq | asyncfutures.nim(125) fail |
15:33:00 | Araq | asyncfutures.nim(220) :anonymous |
15:33:00 | Araq | Error: unhandled exception: Operation timed out |
15:33:45 | Araq | this happens after the download is complete afaict |
15:34:21 | * | chemist69 joined #nim |
15:34:42 | PMunch | I'm poking around with wxWidgets again |
15:34:53 | PMunch | And I see it uses "cnew" what's that? |
15:35:48 | * | yglukhov joined #nim |
15:38:01 | * | handlex quit (Quit: handlex) |
15:38:03 | Araq | c++'s new |
15:38:15 | PMunch | Ah, okay |
15:42:50 | Araq | does the 3way merge work? |
15:43:14 | * | GustavoLapasta joined #nim |
15:47:01 | * | PMunch quit (Ping timeout: 240 seconds) |
15:49:20 | GustavoLapasta | In c, if I want to calculate the offset of a field in an object I'd write something like |
15:49:28 | GustavoLapasta | (size_t) & ((MyObject *) 0) -> myField) |
15:49:39 | GustavoLapasta | How would I do it in Nim? |
15:50:00 | * | handlex joined #nim |
15:52:52 | Araq | the same way |
15:54:36 | * | handlex quit (Quit: handlex) |
15:59:35 | * | Trustable quit (Remote host closed the connection) |
16:08:30 | * | irrequietus joined #nim |
16:10:09 | GustavoLapasta | I'm sorry, but my Nim knowledge isn't strong enough yet. How would I do that "the same way"? |
16:10:31 | GustavoLapasta | I've been trying playing with addr(), but with poor results |
16:13:06 | * | pie_ joined #nim |
16:19:12 | yglukhov | cast[csize](addr(cast[ptr MyObject](0).myField)) |
16:19:19 | yglukhov | GustavoLapasta |
16:20:42 | Calinou | hey GustavoLapasta :P |
16:21:34 | * | handlex joined #nim |
16:36:01 | FromGitter | <philip-wernersbach> @Araq Why is gc2 going to be abandoned? No time? |
16:36:06 | GustavoLapasta | hey Calinou :) |
16:36:21 | GustavoLapasta | thanks yglukhov |
16:36:47 | Araq | well it crashes and I'm not sure the approach has enough merits |
16:38:40 | FromGitter | <philip-wernersbach> Ah okay |
16:39:24 | * | hendi joined #nim |
16:40:08 | FromGitter | <philip-wernersbach> On an unrelated topic, everyone keeps asking about coroutines. I'm not sure I get how coroutines are better than the async we have now |
16:42:18 | * | handlex quit (Quit: handlex) |
16:46:49 | Araq | they are not better but would be easier to work with. |
16:54:29 | * | Parashurama joined #nim |
16:57:44 | Parashurama | Araq: pingback to our earlier conversation. To make this simple. I wish to make a single application that select either GL3 or GL4 (if available) at runtime. I currently can't since in case GL4 is not supported, nimloadProc will raise an error if func address is not found. |
16:58:34 | Araq | outside the box thinking: produce 2 exes and a dispatch.exe |
16:58:39 | Araq | :P |
16:58:57 | Araq | or patch the codegen to support a fallback for nimloadproc |
16:59:17 | Araq | but even I don't remember how nimLoadProc works |
16:59:58 | Parashurama | If you find this acceptable I can try to make this works with a compile time flag. |
17:00:29 | Parashurama | but, dispatch.exe can also be a possibility. |
17:01:04 | Parashurama | *compile time flag that will allow missing proc address |
17:02:49 | Parashurama | The logic is in fact not that complicated. like GLFW, and GLEW it looks at runtime for opengl proc address in opengl.dll/so/dynlib only if the proc is used in program (always remove dead code) |
17:04:10 | Parashurama | Araq: Also what do you think about the current endians.nim module depanding on bitops.nim for compiler intrinsics |
17:07:16 | cheatfate | Parashurama, for such problems its much easier to adopt opengl module... |
17:07:58 | Parashurama | cheatfate: I'm not sure what you mean by 'adopt' |
17:08:09 | Parashurama | do you mean fork? |
17:08:30 | cheatfate | as for me its much better to know you have problems when you starting application, then get problems when somebody press some button which uses procedure from missing dll... |
17:09:54 | Parashurama | I understand what you mean but when using C/C++ I can guard GL4 func at runtime by defining a variable at startup if opengl4 is supported |
17:10:41 | cheatfate | now i dont understand |
17:10:54 | Parashurama | Okay: |
17:11:04 | Parashurama | Proc render(): |
17:11:09 | cheatfate | the only problem i see is that nimgl wrapper is works for some version of opengl and don't supports other |
17:11:24 | Parashurama | if GL4supported: # runtime var |
17:11:34 | Parashurama | # gl functions stuffs |
17:11:36 | Parashurama | else |
17:11:42 | Parashurama | #gL3 stuff |
17:11:54 | cheatfate | https://github.com/nim-lang/Nim/blob/devel/lib/upcoming/asyncdispatch.nim#L296 |
17:12:01 | cheatfate | Parashurama, please check how i do it |
17:12:24 | cheatfate | I'm declaring variables which can be used as procedures... |
17:12:28 | cheatfate | i think it can help |
17:12:48 | Parashurama | you mean funtion pointer |
17:12:55 | Parashurama | *function pointer |
17:13:02 | cheatfate | yep you can do it for opengl wrapper in same way |
17:13:20 | cheatfate | and you can define your runtime variable |
17:14:12 | cheatfate | winlean.nim has this https://github.com/nim-lang/Nim/blob/devel/lib/windows/winlean.nim#L854 (i think its more close to what you need) |
17:14:19 | Parashurama | maybe it can work, but the thing is: the current doesn't even allow for testing if GL4 is supported. it just raise an error if proc address is not found |
17:14:41 | Parashurama | or any other version, really. |
17:15:12 | cheatfate | Parashurama, PRs are welcome :) (C) Araq |
17:15:43 | Parashurama | Yeah, I will try to see what I can do. |
17:16:03 | Parashurama | btw: cheatfate what kind of compiler/platform do you use. |
17:16:12 | cheatfate | windows |
17:16:34 | cheatfate | 10x64 also i have linux/freebsd/openbsd/netbsd/macosx/solaris as VMs |
17:16:46 | Parashurama | excellent, I kind of need some testers for my PR on bitops module. |
17:17:33 | Parashurama | I only have access to gcc/clang on x64 linux. add ICC is a PITA to download/install. |
17:17:40 | Parashurama | *and |
17:18:37 | cheatfate | Parashurama, i think install VM is not a problem too, if you want i can share my macosx vmware image, because it much harder to obtain, then any other images |
17:20:00 | Parashurama | Problem is my current setup doesn't really work with WMs. (only 2Go RAM) |
17:20:36 | Parashurama | but I have used VirtualBox in the past quite a lot for running windows apps on linux. |
17:21:36 | Parashurama | I can barely get by with an old Xp WM at the moment. |
17:22:43 | * | hendi quit (Quit: hendi) |
17:24:18 | cheatfate | Parashurama, you can also use https://www.appveyor.com for windows tests |
17:27:45 | Parashurama | I did not know that. thanks. I will see what it's about. |
17:27:51 | niv | style guide question: is depending on module prefixes for conflict resolution acceptable/recommended, or should i name procs differently? (a.open(): A vs b.open(): B) |
17:29:01 | * | yglukhov quit (Remote host closed the connection) |
17:30:03 | Parashurama | niv: good question. having 10 'open' proc in the current scope can sometimes be confusing when debugging why your proc does something unexpected. |
17:32:52 | niv | im leaning toward using the module name for scoping, instead of messing up my naming scheme |
17:33:46 | Parashurama | something like 'from module import nil' can be useful for this usecase |
17:34:04 | niv | or just "import module as xx; xx.open()" |
17:34:27 | niv | what does import nil do? |
17:35:10 | Parashurama | actually I'm not sure if 'import module as xx' pollute the current namespace with module definitions |
17:35:20 | Parashurama | *goes check documentation |
17:36:24 | GustavoLapasta | yglukhov>, Araq: that example for evaluating the offset of a field in an object fails in some cases: https://paste.kde.org/po171u8aq |
17:36:48 | GustavoLapasta | is that because Nim aligns fields in memory? |
17:39:59 | Parashurama | cheatfate: appearently this syntax pulls definitionto current scope and also allow to adress module proc as xx.func |
17:42:08 | cheatfate | GustavoLapasta, its not nim, its how c compiler align fields inside of structures, please use buggy {.packed.} pragma |
17:42:23 | cheatfate | bbl |
17:43:21 | Parashurama | GustavoLapasta: here is a template that works for me |
17:43:27 | Parashurama | template offsetof*(typ, field): expr = (var dummy: typ; cast[int](addr(dummy.field)) - cast[int](addr(dummy))) |
17:43:55 | Parashurama | sorry more recent version |
17:43:57 | Parashurama | template offsetof*(typ, field): untyped = (var dummy: typ; cast[int](addr(dummy.field)) - cast[int](addr(dummy))) |
17:46:52 | GustavoLapasta | thanks Parashurama. It gives the same result anyway. |
17:49:19 | * | Matthias247 joined #nim |
17:52:05 | * | rokups quit (Quit: Connection closed for inactivity) |
18:04:46 | GustavoLapasta | which on second thought is actually the right result. The example made should return "2" only on 16 bit machines :P |
18:06:40 | Parashurama | yeah, on most platforms struct fields usually aligned on words for best performance. unless a packed decltype/attribute is used |
18:06:55 | Parashurama | * on word size |
18:21:59 | cheatfate | For 32bit platforms alignment is 32bit, for 64bit platforms alignment is 64bit |
18:25:12 | * | GustavoLapasta quit (Ping timeout: 252 seconds) |
18:26:11 | * | GustavoLapasta joined #nim |
18:27:17 | federico3 | nimble install c2nim generated an empty file .nimble/pkgs/c2nim-0.9.12/c2nim |
18:33:40 | dom96 | federico3: bug in the bundled nimble, get HEAD |
18:35:22 | federico3 | dom96: doing nimble build in the c2nim pkg dir helped |
18:46:06 | * | GustavoLapasta quit (Ping timeout: 252 seconds) |
18:47:05 | * | GustavoLapasta joined #nim |
18:58:23 | * | zetashift joined #nim |
19:01:29 | Araq | sorry to be blunt but if you don't even know about alignments you shouldn't use offsetof |
19:03:50 | * | yglukhov joined #nim |
19:04:54 | GustavoLapasta | That's fair. In the c code I was looking at, the offset of the field was used like this: |
19:05:02 | GustavoLapasta | if (host -> receivedDataLength < (size_t) & ((ENetProtocolHeader *) 0) -> sentTime) |
19:06:54 | GustavoLapasta | It looked a little strange to me, I didn't really bother about the alignments. |
19:07:27 | GustavoLapasta | https://github.com/lsalzman/enet/blob/master/protocol.c#L988 |
19:21:10 | FromGitter | <zacharycarter> my game engine is coming along... https://github.com/zacharycarter/derelict |
19:21:48 | FromGitter | <zacharycarter> really enjoying nim :D |
19:24:25 | * | chemist69 quit (Ping timeout: 245 seconds) |
19:26:19 | dom96 | zacharycarter: nice! |
19:26:48 | dom96 | I love roguelikes and love sci-fi even more :D |
19:27:08 | * | chemist69 joined #nim |
19:27:14 | * | yglukhov quit (Remote host closed the connection) |
19:27:24 | dom96 | One small suggestion: convention for method/proc names is to start with a lowercase letter |
19:32:55 | * | GustavoLapasta quit (Quit: Leaving) |
19:33:29 | * | m_rk joined #nim |
19:35:34 | * | yglukhov joined #nim |
19:36:21 | * | yglukhov quit (Remote host closed the connection) |
19:36:34 | * | yglukhov joined #nim |
19:46:05 | FromGitter | <zacharycarter> gotcha - thank you @dom96 |
19:47:09 | * | kulelu88 joined #nim |
19:48:24 | * | kulelu88 quit (Remote host closed the connection) |
19:49:57 | * | bjz_ joined #nim |
20:00:45 | FromGitter | <Varriount> > <Araq> sorry to be blunt |
20:01:00 | * | Parashurama left #nim (#nim) |
20:01:08 | FromGitter | <Varriount> Oh my, Araq, are you actually learning to be tactful? :3 |
20:01:42 | Araq | I'm always tactful. It's just that people do not understand my politeness. |
20:11:32 | Araq | cheatfate: shellExecute opens the zip in an explorer window -.- |
20:15:16 | cheatfate | Araq, :) |
20:20:46 | * | Trustable joined #nim |
20:21:29 | cheatfate | it looks unzipping is much harder then i thought |
20:22:12 | cheatfate | Araq, try to change directory to inside of zip file |
20:22:50 | Araq | why would that make a difference? |
20:23:02 | Araq | it would unzip into TEMP, perhaps, yay |
20:24:38 | * | libman joined #nim |
20:25:38 | cheatfate | starting from windows xp it has compressed zipped folders |
20:25:56 | Araq | but no API to do that |
20:29:50 | Araq | but it's fine, I will ship 7z.exe with it |
20:30:14 | Araq | it's already a messy broken peice of junk |
20:32:05 | * | bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:37:16 | * | m_rk quit (Quit: Textual IRC Client: www.textualapp.com) |
20:39:55 | cheatfate | i think its better to ship zlib.dll then |
20:42:04 | * | bjz joined #nim |
20:42:06 | Araq | no, 7zG x mingw4.8.1.zip works like a charm |
20:42:11 | Araq | with UI and progress bar and stuff |
20:45:38 | Araq | plus we can provide 7z's which are much smaller than zips |
20:46:00 | cheatfate | 20% is not so much |
20:46:07 | cheatfate | also its not a standard |
20:46:19 | cheatfate | i have found a way but we need to interact with COM |
20:46:20 | dom96 | Can't you statically link zlib? |
20:46:23 | Araq | it should be a standard, it's good |
20:47:16 | cheatfate | it should be, but not standard |
20:47:50 | Araq | dom96: 7zG will cause fewer problems than our httpclient based download feature... |
20:48:18 | Araq | which often works and occasionally hangs and crashes |
20:48:22 | dom96 | what's 7zG? |
20:48:37 | * | libman2 joined #nim |
20:48:38 | * | libman quit (Remote host closed the connection) |
20:48:55 | cheatfate | Araq, everything we need to createObject("Shell.Application") |
20:49:11 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:49:11 | Araq | cheatfate: recently a library for COM arrived |
20:49:19 | cheatfate | yep we can try to use it |
20:50:49 | cheatfate | is somebody have a link? |
20:51:03 | Araq | dom96: 7z UI tool that can unpack zip files |
20:53:25 | dom96 | go for it |
20:53:36 | dom96 | I will work on a full featured installer at some point anyway |
20:54:44 | Araq | you will hate it. |
20:55:05 | Araq | everything is hard and messy, esp if you care about older Windows versions |
20:55:33 | Araq | even a start menu entry requires fighting with COM |
20:55:42 | dom96 | If it was easy NSIS/Inno setup wouldn't be the only solutions |
20:55:48 | cheatfate | Agree with Araq, making installer is a tough task, making full featured is harder |
20:57:21 | * | byte512 quit (Ping timeout: 240 seconds) |
21:01:28 | dom96 | My thought is that it could be a killer app for Nim. |
21:01:46 | * | yglukhov quit (Remote host closed the connection) |
21:03:27 | niv | is there a way to map() over a range? |
21:03:36 | niv | without using experimental list comprehensions that is |
21:04:00 | cheatfate | windows already has installer api inside, still not very usable but most people uses it to create .msi |
21:06:00 | cheatfate | web framework will be killing app, or electron/libCEF replacement without browser inside will be killer app |
21:06:41 | dom96 | there is plenty of web frameworks out there already |
21:06:41 | * | yglukhov joined #nim |
21:07:14 | cheatfate | yep and best of them based on interpreted languages, so at least we have one benefit - speed |
21:07:25 | cheatfate | and memory consumption |
21:07:33 | dom96 | the web framework space is highly saturated |
21:07:55 | dom96 | we would need lots of luck for it |
21:08:18 | niv | web developers are a very hard target to pitch to. things like performance and memory consumption don't really count for them |
21:08:20 | dom96 | Have you seen the web framework benchmarks? |
21:08:27 | dom96 | There is a LOT of them |
21:08:40 | niv | hardware is so cheap it doesnt matter if the box can handle 1000/s or 10000/s |
21:08:41 | dom96 | Written in everything from Rust to C and GO |
21:08:53 | * | yglukhov quit (Remote host closed the connection) |
21:09:09 | * | yglukhov joined #nim |
21:10:07 | cheatfate | niv, your words was true like 5 years ago, now all companies looking for methods/algorithms to lower memory consumption and servers count, because incoming data becomes too big |
21:10:26 | cheatfate | and data grows exponentially |
21:10:48 | cheatfate | so buying new hardware is not a proper way |
21:11:21 | niv | i dont think "all companies" is necessarily true. most of the people i talk to that want to do web stuff are looking for rapid iteration frameworks like node or rails. very few actually use go outside of big companies |
21:12:02 | * | bjz joined #nim |
21:12:45 | cheatfate | niv, just take screenshot of your opinion, we will talk 2-3 years after this moment about this theme. |
21:13:49 | dom96 | The big companies have enough resources to write their own web frameworks which scale well |
21:14:14 | niv | i'm not going to stand on my opinion in 2-3 years; just saying how things present themselves to me when talking to customers |
21:14:23 | cheatfate | big companies depends on people, and people some times making wrong decisions, like greenlets... |
21:16:31 | federico3 | cheatfate: what's wrong with greenlets? |
21:17:14 | cheatfate | federico3, its a dead end.. |
21:17:54 | Calinou | hi |
21:18:06 | Calinou | I see a discussion about web frameworks, just as I'm doing Django stuff for learning Python and Django :p |
21:18:25 | Calinou | dom96: btw, my internship ends tomorrow, I'll do a final presentation |
21:18:36 | Araq | shouldn't you work on our website instead? |
21:18:51 | Calinou | Araq: back-end vs front-end :p |
21:19:19 | Araq | 1. backend means Nim. |
21:19:19 | * | libman2 quit (Remote host closed the connection) |
21:19:26 | * | libman joined #nim |
21:19:27 | Araq | 2. frontend is not finished. |
21:19:46 | Calinou | actually with dom96, I debated if we create a Nim back-end for the new site, or if we just use Jekyll |
21:20:33 | Araq | I will eventually throw out any non-Nim-technologies |
21:21:02 | Araq | Jekyll doesn't support Nim highlighting, I bet |
21:21:22 | * | bjz quit (Ping timeout: 240 seconds) |
21:24:38 | Calinou | highlighting is done using Highlight.js (Rouge lacks Nim highlighting), so client-side |
21:25:19 | Araq | meh, better than nothing but there is no need to do it at runtime with JS |
21:25:24 | Calinou | it's better to do it server-side if possible, but since Rouge or Pygments doesn't have Nim highlighting that I know :P |
21:25:45 | Araq | Pygments has iirc but it's outdated |
21:26:42 | dom96 | I'm fairly sure that Jekyll supports pygments |
21:26:57 | dom96 | Performing syntax highlighting on the client side is a bad idea |
21:28:11 | cheatfate | omg, maybe we can use PHP/Node/Perl/Python/Crystal/Go/Rust to make Nim's website? |
21:28:41 | cheatfate | so you will get jokes on HN about Nim's site which based not on Nim? |
21:28:59 | Araq | how about we get a new website instead? |
21:29:08 | Araq | and worry later about how to spread fake news? |
21:30:24 | dom96 | yeah, because Rust gets tons of jokes because they use Discourse |
21:30:25 | dom96 | Right? |
21:31:00 | dom96 | Eating our own dogfood is well and good. But we don't even have the resources to maintain the forum. |
21:31:02 | cheatfate | be patriots use Nim to build back-end :) |
21:31:28 | dom96 | which I will likely end up having to work on to use the new website design |
21:31:36 | Araq | dom96: depends on your definition of "maintain" |
21:31:42 | Araq | last release was recent |
21:33:02 | dom96 | sure. |
21:33:18 | dom96 | But how many people are actually using Nim because they are impressed that Nim's forum is itself written in Nim? |
21:33:28 | dom96 | or that we have an "IDE" written in Nim? |
21:33:52 | dom96 | I used to think this mattered but it really doesn't |
21:34:25 | cheatfate | when forum and site got `professional` look this becomes matter, but we need a decent designer |
21:34:30 | Araq | sure but I like it this way because I'm a control freak |
21:34:57 | Araq | besides, I had experience with existing forum software |
21:35:33 | Araq | and it took spammers a long time to catch up |
21:35:46 | Araq | note that the old PHP based forum was plagued by spam too |
21:37:17 | Calinou | Discourse seems fairly spam-resistent, but it's just me |
21:37:22 | Calinou | or maybe all Discourse forums have tons of staff |
21:38:21 | cheatfate | what the problem to integrate google's recapture? |
21:38:40 | cheatfate | what the problem to integrate proof of work on post? |
21:40:09 | cheatfate | maybe there only one problem... nobody have time to work on it, or nobody wants to spare time on it |
21:40:35 | Araq | cheatfate: new users are moderrated now, problem solved |
21:41:02 | cheatfate | Araq, `spam` is not a problem for me :) |
21:41:10 | Araq | and again, we suspected the spammers were human beings, you can recapture all you want |
21:42:34 | cheatfate | Even people could not calculate many sha256 hashes :) |
21:44:53 | dom96 | Sadly, back when NimForum came into being Discourse wasn't a thing |
21:46:32 | Araq | when I compiled nimforum I found a serious codegen regression |
21:47:07 | Araq | eating our own dogfood is the only thing that makes Nim usable |
21:49:06 | Araq | I'm tired of these discussions really. sure, lets use Discourse and docbook and sphinx and let's write the compiler in Ocaml while we're at it |
21:50:06 | * | libman2 joined #nim |
21:50:06 | * | libman quit (Remote host closed the connection) |
21:50:09 | dom96 | I don't want us to move to Discourse |
21:50:31 | dom96 | But refusing to use tools which already exist and work now is madness |
21:57:01 | Araq | sure. but usually there is some disagreement about what "exist and work" means |
21:58:33 | * | zetashift quit (Ping timeout: 248 seconds) |
21:58:37 | * | libman2 quit (Remote host closed the connection) |
21:58:46 | * | yglukhov quit (Remote host closed the connection) |
21:58:51 | * | libman joined #nim |
21:59:22 | * | yglukhov joined #nim |
21:59:36 | * | libman2 joined #nim |
21:59:55 | * | libman2 quit (Remote host closed the connection) |
22:00:18 | vlad1777d | hello to all =) Why is "discard" statement mandatory ? |
22:00:50 | Araq | because it improves code quality. |
22:00:52 | * | libman quit (Remote host closed the connection) |
22:01:15 | vlad1777d | do you mean readability ? |
22:01:21 | * | PMunch joined #nim |
22:01:25 | Araq | no, code quality. |
22:01:29 | Araq | fewer bugs. |
22:01:35 | vlad1777d | aha, thanks |
22:01:43 | PMunch | Sorry Araq, I had to run earlier |
22:02:02 | PMunch | I haven't had time to play much with the three-way merge. But it looks promising |
22:02:41 | niv | speaking of code quality, is there a hacky way to break through visibility into a module and access hidden procs (for fuzz testing)? |
22:02:52 | * | irrequietus quit () |
22:03:05 | Araq | niv: include instead of import |
22:03:25 | niv | uuhhhh. good point. |
22:03:41 | * | yglukhov quit (Ping timeout: 255 seconds) |
22:13:29 | * | zetashift joined #nim |
22:28:39 | zetashift | will there be a roadmap of 2017 for Nim? |
22:29:33 | dom96 | yes, we'll hopefully write one up soon. |
22:29:36 | Araq | zetashift: I started with updating the todo.txt |
22:30:45 | * | kulelu88 joined #nim |
22:35:29 | PMunch | Hmm, when creating a proc that takes an object. How can I default that object to nil? |
22:35:43 | PMunch | It just says it just expects the type and not nil.. |
22:37:44 | Araq | objects cannot be nil, use a ref object |
22:37:54 | Araq | or some other default value |
22:38:06 | PMunch | Ah, makes sense |
22:38:07 | PMunch | Thanks |
22:40:05 | * | Trustable quit (Remote host closed the connection) |
22:52:31 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:54:03 | zetashift | woop woop! |
22:55:29 | PMunch | Hmm, what's the syntax for defining a macro that looks like those in Emerald? |
22:56:02 | PMunch | e.g: tagname(attribute="Hi"):<indented lines with more> |
22:56:46 | Araq | macro tagname(x, y: untyped) |
22:56:46 | * | Vladar quit (Quit: Leaving) |
22:57:57 | PMunch | Hmm |
22:58:02 | PMunch | Error: type mismatch: got (title: string, void) |
22:58:48 | PMunch | http://pastebin.com/kBnpnUuX |
22:58:53 | PMunch | That's what I did |
23:12:52 | PMunch | Do you know what I did wrong Araq? |
23:13:57 | Araq | macro frame(title, y: untyped): untyped = |
23:13:58 | Araq | echo "test" |
23:14:00 | Araq | result = title |
23:14:02 | Araq | frame(title="Hello"): |
23:14:03 | Araq | discard |
23:14:37 | PMunch | Ah, but I want to support different attributes |
23:14:38 | Araq | for named args to be weak you need varargs[untyped] iirc |
23:14:50 | PMunch | Okay |
23:15:15 | Araq | yeah varargs is it |
23:15:17 | PMunch | So I can type it out as varargs[untyped] and then traverse it? |
23:15:27 | Araq | yes but watch out |
23:15:33 | Araq | the last entry is the passed body |
23:15:35 | PMunch | But can I get the name that was used? |
23:15:40 | Araq | yes |
23:16:48 | PMunch | How? The varargs documentation is a bit sparse.. |
23:18:07 | FromGitter | <Araq> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=58853daed43728124e8f2c2c] |
23:18:26 | Araq | hmm gitter is just superior |
23:18:42 | PMunch | Ah, gotcha |
23:19:05 | PMunch | I'm actually writing a script ATM that will take my current selection, pipe it through ix and put the link in my clipboard :P |
23:21:10 | Araq | bash script? |
23:21:23 | PMunch | Yup |
23:22:00 | Araq | lol. you'll never find all the bugs resulting from weird quoting rules |
23:23:21 | Araq | it's not just that this Unix style of development is quite antique. It never worked in the first place. It was just as broken in the 70ies when it was new. |
23:28:34 | PMunch | http://ix.io/1QMi |
23:28:37 | PMunch | Seems to work fine |
23:30:38 | Araq | that's what everybody thought and then they discoverd Shellshock :P |
23:30:45 | * | def-pri-pub joined #nim |
23:30:45 | * | ftsf_ joined #nim |
23:32:22 | PMunch | Oh yeah, it definitely has it's quirks :P |
23:32:25 | PMunch | Don't get me wrong |
23:32:37 | PMunch | Been tearing my head out from time to time when writing bash scripts |
23:33:00 | Araq | I write Nim programs or NimScript instead |
23:33:12 | Araq | shorter and type checked |
23:33:34 | PMunch | There are just so many nice little utilities that are easy to call from bash |
23:33:46 | PMunch | Like xclip for example which I use in this case |
23:34:48 | PMunch | Most of my bash scripts are just stringing together commands with a couple of conditionals and binding the resulting script to a keyboard shortcut |
23:35:41 | enthus1ast | has one talked thrift or to hypertable from nim? |
23:39:43 | enthus1ast | im looking for a "longer term data store" hyptertable looks very kuhl |
23:41:08 | Araq | enthus1ast: no but it looked easy to wrap back in the days |
23:41:49 | enthus1ast | i thought it would good nim training for me to port one of the basic protocols |
23:42:25 | enthus1ast | but then i discovered (from a forum post) that they have something like a code generator |
23:43:01 | enthus1ast | but thats a little to much for me i guess |
23:45:50 | enthus1ast | it is wraped already? |
23:45:56 | Araq | I doubt it |
23:46:17 | * | brson joined #nim |
23:49:51 | Araq | "Hypertable, Inc. is Closing its Doors" ouch |
23:51:36 | enthus1ast | ohhh |
23:52:18 | enthus1ast | then mongo or postgres .... |
23:54:07 | enthus1ast | or sleeping |
23:55:41 | Araq | it's still an open source project and not dead |
23:56:04 | Araq | and we have mongo and postgres wrappers, so go for Hypertable |