00:01:08 | * | nsf quit (Quit: WeeChat 1.7) |
00:01:51 | * | yglukhov joined #nim |
00:02:39 | PMunch | Hmm, another question about my macro. The idea is that each node will return an object. And the previous level will add all objects as children. |
00:03:17 | PMunch | So frame (title="Hello"):\n text: "Hi there"\n button: "ButtonText" |
00:03:30 | PMunch | Would create a frame with a title, then add a text and a button element to it |
00:03:49 | PMunch | text and button are not containers so they only take strings |
00:05:49 | enthus1ast | nimx? |
00:06:12 | * | yglukhov quit (Ping timeout: 252 seconds) |
00:06:28 | PMunch | Nah, trying to create some nice little macros for wxWidgets |
00:06:43 | Araq | PMunch: sounds easy to do, but I need to sleep now. good night |
00:06:52 | PMunch | Okay, night |
00:06:58 | PMunch | I'll see what I can find :P |
00:07:15 | cheatfate | Araq, nimongo is not a wrapper, because it not using any external libraries, asyncpg is wrapper but i'm thinking to move away from libpq to get more performance |
00:08:09 | Araq | ok, I should have said "we have mongo and postgres support" |
00:08:21 | Araq | not necessarily C wrappers |
00:11:26 | enthus1ast | unhappy with the wrapper cheatfate? |
00:24:12 | * | couven92 quit (Quit: Client disconnecting) |
01:05:16 | * | chemist69 quit (Ping timeout: 258 seconds) |
01:05:39 | * | chemist69 joined #nim |
01:10:05 | * | PMunch quit (Quit: leaving) |
01:28:11 | * | MyMind quit (Ping timeout: 240 seconds) |
01:49:14 | * | MyMind joined #nim |
01:56:41 | * | Snircle_ joined #nim |
01:58:54 | * | Snircle quit (Ping timeout: 255 seconds) |
02:03:14 | * | Trioxin joined #nim |
02:03:51 | * | yglukhov joined #nim |
02:08:22 | * | yglukhov quit (Ping timeout: 240 seconds) |
02:21:06 | * | abruanese quit (Ping timeout: 276 seconds) |
02:21:25 | * | vlad1777d quit (Quit: Leaving) |
02:26:02 | * | chemist69 quit (Ping timeout: 255 seconds) |
02:28:18 | * | abruanese joined #nim |
02:39:43 | * | chemist69 joined #nim |
03:01:22 | * | zetashift quit (Ping timeout: 240 seconds) |
03:07:53 | FromGitter | <endragor> @dom96 Do you think it's OK that asyncdispatch/asyncnet/net raise OSError and not IOError? Logically, IOError should actually be a subtype of OSError. OSError would mean "some syscall returned an error", while IOError - "IO-related syscall returned an error". The current distinguishment between IOError/OSError is unclear |
03:17:47 | * | pie_ quit (Ping timeout: 264 seconds) |
03:28:00 | * | brson quit (Ping timeout: 255 seconds) |
03:42:51 | * | abruanese quit (Ping timeout: 255 seconds) |
04:00:58 | * | abruanese joined #nim |
04:05:21 | * | abruanese quit (Ping timeout: 255 seconds) |
04:05:27 | * | yglukhov joined #nim |
04:09:50 | * | yglukhov quit (Ping timeout: 245 seconds) |
04:25:56 | * | def-pri-pub quit (Quit: leaving) |
05:20:17 | Xe | how do you have nim output a C variable? |
05:21:38 | FromGitter | <Varriount> Xe: For what purpose? |
05:21:51 | * | djellemah quit (Ping timeout: 240 seconds) |
05:22:31 | Xe | I have a terrible idea involving writing weechat plugins in nim, and weechat expects certian C symbols (that are cstrings) in the .so file |
05:22:41 | FromGitter | <Varriount> @endragor Looks like sound logic to me. |
05:23:07 | FromGitter | <Varriount> Xe: There's the emit pragma |
05:23:44 | FromGitter | <Varriount> Or yippy could generate a separate C file at compilation time and link/include it. |
05:23:48 | FromGitter | <Varriount> *You |
05:24:00 | Xe | what side do pragmas go on in variable declerations? |
05:26:09 | FromGitter | <Varriount> This isn't a variable pragma, it's a statement one |
05:26:53 | FromGitter | <Varriount> It just hangs out in the middle of your code, like a clown in a mime party. :3 |
05:27:57 | Xe | template WEECHAT_PLUGIN_NAME*(name: untyped): void = |
05:27:59 | Xe | var weechat_plugin_name*: ptr char = name |
05:28:02 | FromGitter | <Varriount> Xe: http://nim-lang.org/docs/manual.html#implementation-specific-pragmas-emit-pragma |
05:28:08 | Xe | where do i put {.emit.} here? |
05:28:38 | FromGitter | <Varriount> Xe: Can you give me an appropriate link to the weechat docs? |
05:30:25 | * | kulelu88 quit (Quit: Leaving) |
05:32:03 | Xe | https://weechat.org/files/doc/devel/weechat_plugin_api.en.html |
05:32:36 | FromGitter | <Varriount> ? |
05:34:05 | FromGitter | <Varriount> Have you wrapped the include file? It says there's a macro that you need to call |
05:34:24 | FromGitter | <Varriount> I mean, C2Nim should handle things correctly |
05:35:13 | Xe | i c2nim'd it, but it took a lot of editing |
05:35:20 | Xe | the macro definitions i gave up on for now |
05:36:03 | FromGitter | <Varriount> Can you gist the macros then? |
05:36:54 | FromGitter | <Varriount> Also, I could try my hand at the file |
05:37:55 | Xe | https://github.com/weechat/weechat/blob/c017af8e0a0d4d0da6c28d0b82e77af51d8428fa/src/plugins/weechat-plugin.h |
05:39:48 | FromGitter | <Varriount> Goodness gracious that's horrid. |
05:40:43 | Xe | yeah |
05:40:51 | Xe | i'm considering giving up on this idea for now |
05:41:06 | FromGitter | <Varriount> Wait, let me try. |
05:41:28 | FromGitter | <Varriount> It's not quite as bad as the Windows header files. |
05:41:59 | FromGitter | <Varriount> I just wish I had a working Nim install on this laptop |
05:44:13 | * | brson joined #nim |
05:44:37 | FromGitter | <Varriount> Ok, first off, you're probably going to have to include this header file, along with whatever wrapper is generated. |
05:49:39 | FromGitter | <Varriount> Xe: Do you have a possibly working file? |
05:49:49 | Xe | no, i've given up on it for now |
05:50:14 | Xe | weechat is the kind of C program where its plugins pass around C pointers as strings |
05:51:30 | FromGitter | <Varriount> Nim can do that. |
05:52:13 | Xe | yes, but i'm saying that weechat just has such objectively bad code that it's not worth my time to deal with it, it might be better for me to putt energy into replacing it. |
05:53:54 | FromGitter | <Varriount> Xe: https://glot.io/snippets/emfwvbldwe |
05:54:05 | FromGitter | <Varriount> If you're interested, that *should* work, I think. |
05:54:37 | FromGitter | <Varriount> A proper API would use a function to get the name, not a variable. |
05:55:14 | FromGitter | <Varriount> `char* plugin_name(){ ... }` |
05:55:35 | Xe | weechat has very few "proper" design choices |
05:55:39 | FromGitter | <Varriount> Or actually. |
05:57:34 | FromGitter | <Varriount> `int plugin_name(char* buffer, int buffer_length){ ... }` if I have my C correct. |
05:58:03 | FromGitter | <Varriount> You might be able to turn that character pointer into a proper array type, I don't know |
06:02:36 | * | Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com) |
06:07:15 | * | yglukhov joined #nim |
06:07:31 | FromGitter | <Varriount> Xe: If you want a semi-easy way, just create a bare-bones C plugin for WeeChat that calls into the Nim code. |
06:08:34 | Xe | that would involve writing C though, i don't want to write C |
06:11:55 | * | yglukhov quit (Ping timeout: 258 seconds) |
06:19:59 | FromGitter | <Varriount> Xe: If you want, as soon as I have Nim setup on this laptop, I can try a quick wrap |
06:28:59 | * | nsf joined #nim |
06:35:04 | * | bjz joined #nim |
06:38:45 | * | djellemah joined #nim |
06:42:48 | * | bjz quit (Max SendQ exceeded) |
06:44:04 | * | bjz joined #nim |
06:54:41 | * | bjz quit (Ping timeout: 255 seconds) |
06:59:37 | * | Kingsquee joined #nim |
07:08:11 | * | bjz joined #nim |
07:12:30 | * | ftsf_ quit (Remote host closed the connection) |
07:29:51 | * | unlaudable joined #nim |
07:30:08 | * | yglukhov joined #nim |
07:34:11 | * | yglukhov quit (Ping timeout: 240 seconds) |
07:45:49 | * | filcuc joined #nim |
07:57:54 | * | couven92 joined #nim |
08:14:46 | FromGitter | <jacobdufault> Is there a way to check if two objects have the same type without knowing said type beforehand? I wrote a quick proof of concept, ie: ⏎ ⏎ ```var a: Derived = Derived() ⏎ echo repr(a.getRuntimeType())``` ⏎ ⏎ it will fail because the `m_type` field is on the `sup` member of `derived_asdfasdfa`. So making this work in general seems a bit tricky. Also tied very closely to compiler implementation details. |
08:14:46 | FromGitter | ... [https://gitter.im/nim-lang/Nim?at=5885bb7511e7a7f61dd164eb] |
08:17:11 | * | Andris_zbx joined #nim |
08:17:31 | * | rokups joined #nim |
08:23:12 | Araq | a is b and b is a |
08:23:48 | Araq | a of b and b of a |
08:24:32 | flyx | a = "fair", b = "foul" |
08:24:46 | FromGitter | <jacobdufault> Those give compiler errors, they expect an explicit type |
08:25:03 | Araq | oh come on |
08:25:06 | Araq | a is type(b) |
08:25:40 | * | lenstr quit (Ping timeout: 245 seconds) |
08:27:05 | FromGitter | <jacobdufault> type(...) computes declaration type, right? so it ignores the actual runtime type ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5885be57d43728124e91575d] |
08:29:52 | FromGitter | <jacobdufault> sorry, above example should actually be ⏎ ⏎ ``` echo "a == b? " & $(a is type(b) and b is type(a))``` ⏎ ⏎ which still has the same problem, because type(a) is fetching declaration type, not runtime type [https://gitter.im/nim-lang/Nim?at=5885beffd43728124e915b9d] |
08:31:46 | Araq | so use 'of' instead of 'is' |
08:32:58 | * | rusua joined #nim |
08:33:54 | FromGitter | <jacobdufault> same problem ⏎ ⏎ `echo "a == b? " & $(a of type(b) and b of type(a)) # ==> true` |
08:34:16 | FromGitter | <jacobdufault> Compiler even gives a warning saying 'of type (b)' is always true :P |
08:36:26 | * | Vladar joined #nim |
08:37:07 | Araq | how is a warning "the same problem"? |
08:39:46 | FromGitter | <Varriount> @jacobdufault You'll want the typetraits module |
08:39:50 | FromGitter | <jacobdufault> the warning is not a problem, it's just calling out that type(b) is fetching the declaration type of b, not the runtime type of b |
08:40:15 | FromGitter | <Varriount> Sorry, I mean typeinfo: http://nim-lang.org/docs/typeinfo.html |
08:41:22 | flyx | typeinfo has a `setObjectRuntimeType`, but apparently no getter |
08:41:27 | FromGitter | <jacobdufault> @Varriount I haven't been able to find anything to do this in typeinfo |
08:41:46 | FromGitter | <jacobdufault> @flyx: yep |
08:42:40 | flyx | jacobdufault: well you could of course define methods on the types, given that the set of types it needs to work on is known |
08:43:28 | * | stisa joined #nim |
08:43:35 | flyx | method isSameType(a: MyType, b: RootObj) = b is MyType |
08:43:55 | flyx | but you'd need an implementation for each tye |
08:43:58 | flyx | *type |
08:44:00 | FromGitter | <jacobdufault> @flyx: yea, I wanted to avoid that though since the information is available in the `m_type` struct param |
08:44:29 | FromGitter | <jacobdufault> implementation complexity is also different. one is just a compare, the other is a bunch of branches |
08:45:01 | FromGitter | <jacobdufault> runtime complexity* |
08:47:41 | Araq | b of type(a) and a of type(b) |
08:48:24 | FromGitter | <jacobdufault> araq: This doesn't work because type(a) and type(b) both resolve to Parent |
08:48:24 | FromGitter | <Varriount> Araq: Isn't that compile time though? |
08:49:24 | Araq | 'is' is compiletime, 'of' is runtime |
08:49:39 | Araq | but jacobdufault is right ... hmmm |
08:49:39 | FromGitter | <Varriount> @mpcjanssen If you look in the typeinfo code, you'll see the rawType template |
08:50:23 | FromGitter | <Varriount> If that was made public... |
08:50:32 | Araq | just cast your way around then. if cast[ptr pointer](addr obj)[] == cast[ptr pointer](add objB)[] |
08:51:41 | FromGitter | <Varriount> @jacobdufault Why do you need this, by the way? |
08:53:01 | FromGitter | <moigagoo> I've been writing some simple examples to showcase Nim's async story to my colleagues but found myself stuck with the very basic code, which I'm sure used to work. Please take a look and tell me where I am wrong: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ So here's a plain async downloader. It doesn't compile, the error is `'cb' is not GC-safe as it accesses 'nameIterVar' which is a global using GC'ed memory ... |
08:53:01 | FromGitter | ... [https://gitter.im/nim-lang/Nim?at=5885c46b11e7a7f61dd190bc] |
08:53:45 | * | arnetheduck joined #nim |
08:54:06 | FromGitter | <jacobdufault> @Varriount ⏎ ⏎ ```proc setup(defaults: seq[Init], overrides: seq[Init])``` ⏎ ⏎ The function goes through every value in `defaults` and runs some logic on it. It uses a value in `overrides` instead of the one in `defaults` if there is an override present. An override is defined as any object having the same type as the default value. [https://gitter.im/nim-lang/Nim?at=5885c4ace836bf70107cdad2] |
08:54:28 | FromGitter | <jacobdufault> @araq: I'm not following how casting helps in this situation. |
08:54:36 | * | brson quit (Ping timeout: 240 seconds) |
08:55:02 | FromGitter | <jacobdufault> @araq: Casting the values to pointers doesn't tell me the runtime type |
08:55:10 | FromGitter | <moigagoo> Here a twist I just discovered. When compiled without `--threads:on`, it's not an error but a warning, and the code compiles. With `--threads:on`, compilation fails. |
08:56:20 | FromGitter | <Varriount> @jacobdufault This looks like something a method (not a procedure) would handle... |
08:56:49 | FromGitter | <Varriount> @jacobdufault Will a hacky solution work? |
08:56:53 | FromGitter | <Araq> @moigagoo sounds like expected behaviour |
08:57:20 | FromGitter | <Araq> not sure if httpclient is threadsafe |
08:57:52 | FromGitter | <jacobdufault> @Varriount Yea, I can hack it by emulating runtime type information (putting an `id` field in `Init`), but it would be nice to use actual RTTI generated by the compiler |
08:58:25 | FromGitter | <moigagoo> @Araq So, I can't use httpclient and multiple threads in the same program? For example, download files asynchronously and then, say, calculating hashes in multiple threads? |
09:00:20 | FromGitter | <endragor> @moigagoo the problem is that it uses `defaultSslContext` variable which is global. just pass the context manually to `newAsyncHttpClient` as a workaround (and file an issue on GitHub if it's not there) |
09:04:06 | * | bjz_ joined #nim |
09:04:38 | * | irrequietus joined #nim |
09:06:41 | * | bjz quit (Ping timeout: 256 seconds) |
09:08:32 | FromGitter | <andreaferretti> @Araq I saw your new plans in todo.txt |
09:08:40 | FromGitter | <andreaferretti> It is nice to see that pattern matching is coming |
09:08:54 | FromGitter | <Varriount> @jacobdufault https://glot.io/snippets/emfwvbldwe |
09:09:02 | FromGitter | <andreaferretti> I don't konw if you had seen https://github.com/andreaferretti/patty |
09:09:05 | FromGitter | <moigagoo> @endragor Thanks! It's filed already https://github.com/nim-lang/Nim/issues/4998. ⏎ ⏎ Could you please guide me how to pass the context manually? Unfortunately, I couldn't find much info in the docs (http://nim-lang.org/docs/net.html#SslContext). |
09:09:22 | FromGitter | <Varriount> @jacobdufault I am not responsible if that snippet causes any major disasters and/or extinctions |
09:09:23 | FromGitter | <andreaferretti> I tried to emulate pattern matching - as well as algeraic data types - using macros |
09:09:53 | FromGitter | <andreaferretti> It could be better, but I never managed to work on nested patterns and so on |
09:10:38 | FromGitter | <Varriount> @jacobdufault Also, even if it works on the C/C++ backend, I can't say it will work on the JS backend |
09:10:42 | FromGitter | <andreaferretti> I don't know if it could make sense to port something like this into the stdlib |
09:10:43 | FromGitter | <endragor> @moigagoo newAsyncHttpClient(sslContext = nil) |
09:10:51 | FromGitter | <andreaferretti> so that the base language does not need to change |
09:11:02 | FromGitter | <andreaferretti> (of course, and improved version) |
09:11:07 | FromGitter | <jacobdufault> @Varriount Did you send the right link? |
09:11:33 | FromGitter | <Varriount> @jacobdufault The proper solution would be to expose the rawType attribute in the Any object. (file an issue) |
09:11:40 | FromGitter | <Araq> @andreaferretti I'm aware of your package, never used it though. some primitive way of PM needs to be builtin for safety reasons though |
09:11:42 | FromGitter | <andreaferretti> on the other hand baking pattern matching into the language would make it more type-safe |
09:12:02 | FromGitter | <andreaferretti> yes, I agree |
09:12:20 | FromGitter | <Varriount> @jacobdufault Blah, sorry: https://glot.io/snippets/emg2c6mp9r |
09:12:22 | FromGitter | <jacobdufault> @Varriount I'm not sure that would work either. Constructing an any calls getTypeInfo which runs at compile time |
09:12:40 | FromGitter | <andreaferretti> also, I think it would allow to use the same name for fields in different type branches |
09:12:42 | FromGitter | <moigagoo> @endragor Was not expecting that :-D Thanks! |
09:13:10 | FromGitter | <andreaferretti> because the compiler would be able to figure it out based on the pattern |
09:13:41 | FromGitter | <andreaferretti> I would be happy when patty becomes deprecated :-) |
09:13:48 | FromGitter | <Varriount> @jacobdufault Huh? Are you sure? |
09:14:45 | FromGitter | <andreaferretti> @Araq also, please, make the pattern matching an expression |
09:14:47 | FromGitter | <Varriount> getTypeInfo retrieves the pointer to the type information structure attached to the object/reference |
09:15:01 | FromGitter | <andreaferretti> right now in patty it only works well as a statement |
09:15:28 | FromGitter | <andreaferretti> which is inconvenient when one wants to assign the result of PM to a variable |
09:15:36 | FromGitter | <jacobdufault> @Varriount Try it with this snippet ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5885c9b7074f7be7630674f4] |
09:15:42 | FromGitter | <jacobdufault> It prints "true" for me |
09:16:22 | FromGitter | <Varriount> @jacobdufault Where's the rest of the code? |
09:16:56 | FromGitter | <jacobdufault> ```type ⏎ Parent = ref object {.inheritable.} ⏎ Derived = ref object of Parent ⏎ ⏎ ...``` ⏎ ⏎ I'll create a full paste, give me a sec [https://gitter.im/nim-lang/Nim?at=5885ca07074f7be763067697] |
09:17:01 | FromGitter | <Araq> @andreaferretti hmm? it's just that 'case' will get pattern matching features, 'case' is available as an expression |
09:17:43 | FromGitter | <andreaferretti> ok, then I think the problem only arises because patty uses a macro |
09:18:10 | FromGitter | <andreaferretti> I need to wrap the whole thing in a blcok |
09:18:12 | FromGitter | <andreaferretti> block |
09:18:20 | FromGitter | <andreaferretti> even though it expands to a case statement |
09:19:15 | FromGitter | <Varriount> @jacobdufault https://glot.io/snippets/emg2izax2z |
09:20:11 | FromGitter | <jacobdufault> @Varriount That's using type inference ⏎ https://glot.io/snippets/emg2k0rugw |
09:20:32 | FromGitter | <jacobdufault> The type inference gives y a decl type of 'Child' which makes it work |
09:20:41 | FromGitter | <Varriount> Ah, I see. |
09:21:07 | FromGitter | <vegansk> @Araq, @andreaferretti, hi! It will be superb if pattern matching will be added to the language or at least to the stdlib :-) |
09:21:15 | FromGitter | <Varriount> @jacobdufault Thats... unexpected. |
09:21:37 | * | yglukhov joined #nim |
09:22:21 | FromGitter | <jacobdufault> @Varriount If you look at the definition of `toAny` it is using `getTypeInfo`, which is compile-time only :/ |
09:23:30 | FromGitter | <vegansk> What do you think about something like scala extractors for PM? (http://docs.scala-lang.org/tutorials/tour/extractor-objects) |
09:25:41 | * | yglukhov quit (Ping timeout: 240 seconds) |
09:25:58 | FromGitter | <Varriount> @jacobdufault See PM |
09:26:46 | FromGitter | <andreaferretti> @vegansk the problem is that they add some overhead at runtime |
09:27:14 | * | chemist69 quit (Ping timeout: 255 seconds) |
09:27:18 | FromGitter | <andreaferretti> the approach of patty (and I assume what the builtin version will do) |
09:27:32 | FromGitter | <andreaferretti> just translates it into what you would write manually |
09:27:35 | FromGitter | <andreaferretti> at compile time |
09:28:26 | FromGitter | <Araq> btw ref object {.inheritable.} is already wrong and everything on top of this will make it worse |
09:28:47 | FromGitter | <Araq> use 'ref object of RootRef' and let the language do its job |
09:32:04 | * | chemist69 joined #nim |
09:35:21 | cheatfate | enthus1ast, libpq is pretty old and uses poll/select to satisfy asynchronous behavior, also for libpq i have invented workaround for windows (which is hacky), so its better to replace libpq with pure nim code |
09:36:00 | FromGitter | <Araq> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5885ce7fcbcb281770a51073] |
09:36:40 | FromGitter | <Varriount> @jacobdufault ^ |
09:36:43 | * | yglukhov joined #nim |
09:39:33 | FromGitter | <jacobdufault> araq: That's still broken. You're using type inference so that the compile time x and y have different types |
09:39:48 | FromGitter | <jacobdufault> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5885cf63d43728124e91c19c] |
09:40:15 | FromGitter | <jacobdufault> @Araq ^ |
09:41:13 | FromGitter | <Varriount> Don't forget to make them references |
09:44:40 | FromGitter | <jacobdufault> Nice catch, I got this to work with: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5885d087c0de6f017fdceadd] |
09:49:59 | FromGitter | <jacobdufault> Thanks @Varriount, @Araq, is this something you'd be willing to accept in a PR? |
09:50:21 | Araq | why is it needed? |
09:50:36 | Araq | if you want precise types, don't use inheritance |
09:52:56 | FromGitter | <jacobdufault> I treat object type as identity in some code |
09:58:18 | Araq | what does that even mean. |
10:00:44 | FromGitter | <jacobdufault> I have an example earlier up. The runtime type is used to identify an element and match it against other elements in a seq |
10:01:28 | FromGitter | <jacobdufault> I also think for a PR it be better to expose the type itself instead of just a compare function, more flexible that way |
10:09:08 | Araq | proc setup is not a use case, it's a big mystery |
10:09:13 | * | byte512 joined #nim |
10:09:41 | Araq | why are object types treated as values? what if I have 2 fields of the same type and want to override only one? |
10:10:32 | Araq | why not use a macro to create a much faster and flexible 'setup' operation? |
10:10:54 | * | bjz joined #nim |
10:11:11 | * | bjz_ quit (Ping timeout: 255 seconds) |
10:14:34 | FromGitter | <jacobdufault> The values given to the setup proc are only available at runtime, ie, parsed from a file the end user can modify, so a macro doesn't work |
10:19:13 | FromGitter | <Varriount> @jacobdufault You mean like a marshalling/serialization setup? |
10:19:13 | * | stisa quit (Read error: Connection reset by peer) |
10:19:56 | FromGitter | <Varriount> @Araq By the way, why is get |
10:21:07 | FromGitter | <jacobdufault> @Varriount Maybe, haven't implemented it yet. but that is before the data gets to the setup proc. |
10:21:31 | FromGitter | <Varriount> Why does getTypeInfo not see past variable types (such as references)? |
10:24:07 | FromGitter | <Varriount> If I assign a child type to a variable marked as holding parent type, getTypeInfo gets the parent type information |
10:25:25 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
10:26:06 | Araq | proc toAny*[T](x: var T): Any {.inline.} = |
10:26:06 | Araq | newAny(addr(x), cast[PNimType](getTypeInfo(x))) |
10:26:17 | Araq | that's why. it doesn't special case 'object of' |
10:29:23 | * | PMunch joined #nim |
10:30:08 | * | jinshil joined #nim |
10:31:05 | * | Arrrr joined #nim |
10:33:17 | * | bjz joined #nim |
10:33:26 | * | stisa joined #nim |
10:35:21 | FromGitter | <Varriount> Seems like a flaw to me, but oh well, probably a good reason for it. |
10:35:40 | yglukhov | Araq: what is newAny? is it real? |
10:36:07 | * | rusua quit (Quit: Connection closed for inactivity) |
10:36:16 | Araq | varriount could be a bug, could be for good reasons. I don't remember |
10:36:17 | FromGitter | <Varriount> It's a private procedure in typeinfo |
10:36:40 | Araq | yglukhov: it's real, private and old |
10:36:58 | yglukhov | it sounds a lot like my variants |
10:44:05 | * | libman joined #nim |
10:46:56 | FromGitter | <Varriount> @Araq Well, I know the current design is the reason why the marshal module can't serialize structures that have types different than that of their variables |
10:47:15 | * | pie_ joined #nim |
11:03:42 | * | stisa quit (Read error: Connection reset by peer) |
11:13:54 | Araq | yeah so fix it :-) |
11:16:09 | libman | msgpack4nim has been my favorite Nim marshal method so far. |
11:16:26 | Arrrr | link? |
11:16:53 | libman | https://github.com/jangko/msgpack4nim |
11:16:59 | Arrrr | thank you |
11:22:04 | * | stisa joined #nim |
11:25:46 | * | jinshil quit (Quit: client terminated!) |
11:32:15 | * | yglukhov quit (Remote host closed the connection) |
11:32:51 | * | yglukhov joined #nim |
11:33:06 | * | vlad1777d joined #nim |
11:37:13 | * | yglukhov quit (Ping timeout: 248 seconds) |
11:42:47 | * | yglukhov joined #nim |
11:45:32 | * | yglukhov quit (Remote host closed the connection) |
11:46:06 | * | yglukhov joined #nim |
11:50:38 | * | libman quit (Ping timeout: 255 seconds) |
11:50:45 | * | yglukhov quit (Ping timeout: 258 seconds) |
12:02:23 | * | yglukhov joined #nim |
12:02:32 | * | Snircle joined #nim |
12:13:29 | * | bbl joined #nim |
12:13:29 | * | stisa quit (Read error: Connection reset by peer) |
12:16:21 | * | stisa joined #nim |
12:18:09 | * | fredrik92 joined #nim |
12:20:12 | * | couven92 quit (Disconnected by services) |
12:20:18 | * | fredrik92 is now known as couven92 |
12:20:37 | * | fredrik92 joined #nim |
12:28:32 | FromGitter | <timeyyy> There is a libc msgpack being developed for neovim that is designed to be reusable https://github.com/tarruda/libmpack/blob/master/README.md |
12:39:01 | * | stisa quit (Read error: Connection reset by peer) |
12:43:56 | * | stisa joined #nim |
12:45:48 | * | Arrrr quit (Quit: WeeChat 1.5) |
12:47:16 | * | couven92 quit (Quit: Disconnecting) |
12:50:56 | * | Trioxin quit (Ping timeout: 255 seconds) |
12:57:58 | * | yglukhov quit (Remote host closed the connection) |
12:58:32 | * | yglukhov joined #nim |
13:08:40 | * | stisa quit (Read error: Connection reset by peer) |
13:11:33 | * | yglukhov quit (Remote host closed the connection) |
13:12:09 | * | yglukhov joined #nim |
13:13:40 | * | fredrik92 is now known as couven92 |
13:15:36 | * | yglukhov quit (Remote host closed the connection) |
13:15:49 | * | yglukhov joined #nim |
13:16:01 | * | stisa joined #nim |
13:16:58 | * | rupil joined #nim |
13:20:43 | * | fulcrum joined #nim |
13:21:44 | * | unlaudable quit (Ping timeout: 260 seconds) |
13:22:08 | * | yglukhov quit (Remote host closed the connection) |
13:22:27 | * | yglukhov joined #nim |
13:40:35 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:42:05 | * | rokups quit (Quit: Connection closed for inactivity) |
14:08:33 | * | zetashift joined #nim |
14:25:00 | * | yglukhov quit (Remote host closed the connection) |
14:25:35 | * | yglukhov joined #nim |
14:27:51 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
14:29:51 | * | yglukhov quit (Ping timeout: 245 seconds) |
14:40:09 | * | yglukhov joined #nim |
14:40:11 | * | fredrik92 joined #nim |
14:40:11 | * | fredrik92 quit (Client Quit) |
14:40:12 | * | couven92 quit (Quit: Client disconnecting) |
14:42:08 | * | askatasuna quit (Quit: ZNC 1.6.3 - http://znc.in) |
14:48:58 | * | stisa quit (Read error: Connection reset by peer) |
14:55:32 | * | stisa joined #nim |
14:56:19 | * | askatasuna joined #nim |
14:58:41 | * | zetashift quit (Ping timeout: 240 seconds) |
14:59:42 | * | devted joined #nim |
15:02:47 | * | devted quit (Read error: Connection reset by peer) |
15:04:35 | * | stisa quit (Read error: Connection reset by peer) |
15:09:53 | * | adeohluwa joined #nim |
15:14:18 | * | sz0 joined #nim |
15:21:22 | * | WildMage999 joined #nim |
15:27:48 | * | stisa joined #nim |
15:29:47 | * | stisa quit (Read error: Connection reset by peer) |
15:31:04 | * | zetashift joined #nim |
15:37:41 | * | adeohluwa_ joined #nim |
15:37:41 | * | adeohluwa quit (Ping timeout: 240 seconds) |
15:40:32 | * | stisa joined #nim |
15:43:47 | * | adeohluwa_ quit (Read error: Connection reset by peer) |
15:48:00 | * | couven92 joined #nim |
15:50:45 | * | adeohluwa joined #nim |
15:52:02 | * | stisa quit (Read error: Connection reset by peer) |
15:56:15 | FromGitter | <Varriount> Lib |
15:57:57 | FromGitter | <Varriount> Is there a de facto standard protocol for typed, reference-holding data? |
15:59:37 | * | krux02 joined #nim |
15:59:59 | * | adeohluwa_ joined #nim |
16:01:21 | * | adeohluwa quit (Ping timeout: 240 seconds) |
16:05:45 | * | nsf quit (Quit: WeeChat 1.7) |
16:10:34 | * | stisa joined #nim |
16:15:03 | * | pregressive joined #nim |
16:19:57 | * | adeohluwa_ quit (Remote host closed the connection) |
16:22:08 | flyx | Varriount: something like XML or YAML? |
16:22:09 | * | Jesin quit (Quit: Leaving) |
16:22:25 | * | fulcrum quit (Ping timeout: 255 seconds) |
16:23:10 | FromGitter | <Varriount> Those are ok, but not very space efficient |
16:25:52 | flyx | if you are looking for a binary format, I don't think there's a de facto standard |
16:26:32 | flyx | when efficiency is a concern, protocols tailored to the use-case tend to be better |
16:27:48 | * | devted joined #nim |
16:31:58 | FromGitter | <andreaferretti> well, there are protobuf, thrift, avro... |
16:35:17 | * | Trustable joined #nim |
16:36:07 | * | handlex joined #nim |
16:36:48 | federico3 | ...msgpack |
16:39:06 | FromGitter | <andreaferretti> well, msgpack is schemaless |
16:39:24 | FromGitter | <andreaferretti> varriount asked for typed data |
16:39:58 | federico3 | just typed or self-describing? |
16:41:05 | * | yglukhov quit (Remote host closed the connection) |
16:41:12 | * | hendi joined #nim |
16:41:19 | federico3 | partially related: https://xomachine.github.io/NESM/ |
16:41:38 | * | yglukhov joined #nim |
16:41:41 | * | arnetheduck quit (Ping timeout: 258 seconds) |
16:41:49 | * | yglukhov quit (Remote host closed the connection) |
16:42:03 | * | yglukhov joined #nim |
16:44:01 | * | hendi quit (Client Quit) |
16:44:57 | * | handlex quit (Ping timeout: 276 seconds) |
16:51:24 | * | yglukhov quit (Remote host closed the connection) |
16:51:31 | * | hendi joined #nim |
16:51:56 | * | yglukhov joined #nim |
16:59:36 | * | yglukhov quit (Ping timeout: 240 seconds) |
17:02:41 | * | filcuc quit (Ping timeout: 240 seconds) |
17:07:04 | * | Salewski joined #nim |
17:07:29 | * | NimBot joined #nim |
17:08:35 | enthus1ast | BSON |
17:09:04 | Salewski | Araq, is this statement (from the book ) true: "Sequences are stored on the heap and as such are garbage collected." |
17:09:49 | Salewski | Personally I have the feeling that sequences are objects, and only the real data is stored on the heap. |
17:11:25 | Salewski | var s: seq[int]; echo s.len # gives 0 |
17:13:27 | * | stisa quit (Read error: Connection reset by peer) |
17:14:35 | * | hendi quit (Quit: hendi) |
17:15:54 | Salewski | So a seq is basically a value type, not a ref type. But the buffer for the elements is a ref type, and nil be default. |
17:16:57 | cheatfate | Salewski, you can always check C code to be sure :) |
17:18:19 | * | stisa joined #nim |
17:18:41 | * | stisa left #nim (#nim) |
17:21:16 | Salewski | Yes, I think it's too late for fixes in the book. Maybe add some errata. |
17:21:34 | * | benwbooth quit (Quit: Textual IRC Client: www.textualapp.com) |
17:21:54 | flyx | Salewski: seqs are definitely on the heap |
17:22:19 | flyx | Salewski: you can be lucky that s.len in your code returns 0 |
17:22:44 | * | Andris_zbx quit (Remote host closed the connection) |
17:22:59 | flyx | probably it's implemented as if isNil(s): return 0 |
17:23:23 | flyx | just do `echo isNil(s)`, it will print true |
17:24:25 | Salewski | Interesting idea. |
17:27:34 | Salewski | Yes indeed, echo s.isNil gives true. |
17:28:28 | dom96 | A seq is definitely stored on the heap |
17:28:53 | flyx | the seq type just has value semantics, i.e. seqs are copied on assignment |
17:29:26 | Salewski | Dom: Yes, your book is correct! |
17:32:48 | Salewski | I was confused by: var s: seq[int]; echo s.len # gives 0 |
17:33:05 | Salewski | Sometimes Nim is too smart for me. Bye... |
17:36:49 | * | Salewski left #nim (#nim) |
17:37:06 | FromGitter | <PabClsn_twitter> Hi guys :) |
17:37:14 | dom96 | yeah, it's magical |
17:37:27 | dom96 | I didn't like this when it was implemented |
17:37:31 | dom96 | Still not sure I like it |
17:39:58 | dom96 | hi PabClsn_twitter |
17:40:08 | FromGitter | <PabClsn_twitter> just a little question I'm pretty new to nim I'm trying to make the Sastantua with nim and I'm facing a little problem. I need a array and the size of the array has to be movable so I used a sequence var tabEtoiles: seq[int] but when I acces it in my for loop I have a "trying to access nil ? " error please help me https://gist.github.com/anonymous/864bda147f794d60096ff65fd2b7e98c |
17:41:19 | * | askatasuna quit (Quit: ZNC 1.6.3 - http://znc.in) |
17:41:41 | * | Jesin joined #nim |
17:45:09 | Vladar | dom96: do you mean /libtcod_nim/libtcod_nim/private ? |
17:45:11 | * | kunev quit (Ping timeout: 240 seconds) |
17:45:24 | dom96 | yes |
17:45:36 | dom96 | /libtcod_nim/private |
17:45:41 | dom96 | where the root is the git repo root |
17:46:02 | * | kunev joined #nim |
17:47:06 | Vladar | seems strange, but ok |
17:48:05 | cheatfate | PabClsn_twitter, you need to initialize your `tabEtoiles`, like `tabEtoiles = newSeq[int]()`... |
17:48:21 | * | devted quit (Ping timeout: 240 seconds) |
17:49:37 | FromGitter | <PabClsn_twitter> ah ok i’ll try thx |
17:50:51 | FromGitter | <PabClsn_twitter> when you need to acces it you have to use the « @« right ? |
17:51:14 | * | Jesin quit (Quit: Leaving) |
17:51:23 | FromGitter | <PabClsn_twitter> beacuse when i remove it build but when i let the « @« it don’t build .. |
17:53:49 | FromGitter | <andreaferretti> no, @ is a function that takes an array and return a sequence |
17:54:24 | FromGitter | <andreaferretti> the problem you have is that you initialize an empty sequence |
17:54:32 | FromGitter | <andreaferretti> and then try to fill the i-th slot |
17:54:47 | FromGitter | <andreaferretti> you can either make the sequence large enough |
17:54:57 | FromGitter | <andreaferretti> with `newSeqint (maxLignes)` |
17:55:16 | FromGitter | <andreaferretti> or use `tabEtoiles.add(increment)` |
17:55:26 | FromGitter | <andreaferretti> which will resize the sequence when needed |
17:55:36 | FromGitter | <PabClsn_twitter> ah ok :) |
17:55:45 | FromGitter | <PabClsn_twitter> ok i try thanks |
18:07:17 | * | brson joined #nim |
18:11:59 | * | yglukhov joined #nim |
18:15:36 | * | devted joined #nim |
18:16:11 | * | yglukhov quit (Ping timeout: 240 seconds) |
18:23:12 | * | Matthias247 joined #nim |
18:26:15 | * | hendi joined #nim |
18:30:41 | * | zetashift quit (Ping timeout: 240 seconds) |
18:32:24 | * | kulelu88 joined #nim |
18:37:33 | * | hendi quit (Quit: hendi) |
18:39:24 | * | yglukhov joined #nim |
18:46:38 | * | yglukhov quit (Remote host closed the connection) |
18:47:11 | * | yglukhov joined #nim |
18:47:26 | FromGitter | <PabClsn_twitter> hey guys do you know if there is a way to acces the last index of an array ?? |
18:47:41 | Vladar | arr[^1] |
18:47:48 | * | yglukhov quit (Remote host closed the connection) |
18:47:52 | FromGitter | <PabClsn_twitter> Thanks :) |
18:47:56 | Vladar | np |
18:48:01 | * | yglukhov joined #nim |
18:49:54 | FromGitter | <PabClsn_twitter> last question do you know if there is a way to print x times a space for example ? |
18:50:33 | FromGitter | <PabClsn_twitter> because i need ton print x spaces before printing a « * » x times then a « \ » one time |
18:51:19 | Araq | strutils.repeat |
18:52:06 | FromGitter | <PabClsn_twitter> ok thanks a lot guys ! |
18:53:13 | * | Trustable quit (Remote host closed the connection) |
18:53:25 | yglukhov | Araq: i tried to find the commit that caused https://github.com/nim-lang/Nim/issues/5271, but is more than 2 months old, so that i can't even bootstrap nim that old. |
19:00:39 | Araq | just fix the bug |
19:00:55 | * | rupil quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
19:01:40 | Araq | I don't believe in git bisect and working backwards. the bug is in the current codegen. |
19:02:14 | Araq | so fix it. |
19:04:32 | FromGitter | <zacharycarter> is there an equivalent call to *func* in nim? I found instantiatonInfo for filename / line number but no way to retrieve function names yet |
19:05:06 | FromGitter | <zacharycarter> macro I should say |
19:07:26 | yglukhov | Araq: ok, mind merging my pr in? |
19:09:47 | * | sz0 quit (Quit: Connection closed for inactivity) |
19:10:03 | yglukhov | thanks! |
19:16:28 | * | hendi joined #nim |
19:19:21 | * | Trioxin joined #nim |
19:38:36 | * | Jesin joined #nim |
19:43:40 | * | couven92 quit (Quit: Client disconnecting) |
19:45:41 | * | Trioxin quit (Ping timeout: 240 seconds) |
19:50:13 | * | byte512 quit (Ping timeout: 260 seconds) |
19:50:22 | cheatfate | is it possible to create type with macro? |
19:50:55 | flyx | cheatfate: sure |
19:51:30 | flyx | https://nim-by-example.github.io/oop_macro/ does it, for example |
19:53:44 | FromGitter | <Varriount> @PabClsn_twitter arrayOrSeq[len(arrayOrSeq)] |
19:53:55 | cheatfate | flyx, thank you |
20:01:46 | * | bjz joined #nim |
20:02:09 | * | lenstr joined #nim |
20:08:00 | * | bbl quit (Quit: WeeChat 1.0) |
20:11:13 | kulelu88 | does nim have HTTP2 support? If no, will it be easy to port this lib to nim: https://www.nghttp2.org ? |
20:12:50 | federico3 | kulelu88: I wonder if it's worth supporting HTTP/2 vs SPDY vs QUIC |
20:13:11 | kulelu88 | well I'm not asking for anyone to port it or anything, just wondering what support is offered |
20:13:54 | federico3 | afaik HTTP2 is not natively supported. Porting a C client is probably relatively simple |
20:17:05 | * | hendi quit (Quit: hendi) |
20:18:18 | * | couven92 joined #nim |
20:18:33 | * | bbl joined #nim |
20:22:26 | * | bbl quit (Client Quit) |
20:25:43 | FromGitter | <Varriount> Though having native library support would be nice too |
20:27:50 | * | couven92 quit (Quit: Client disconnecting) |
20:28:55 | * | dddddd joined #nim |
20:30:47 | * | brson quit (Quit: leaving) |
20:43:44 | FromGitter | <PabClsn_twitter> guys what wrong here i dont understand … ```proc repeatT (n: T; i: Natural): seq[T] ⏎ ⏎ for i in 0..maxLignes-1: ⏎ repeat(" ", (tabEtoiles[^1 - 1] - tabEtoiles[i]) div 2)``` [https://gitter.im/nim-lang/Nim?at=58866affe836bf701080f52d] |
20:43:54 | FromGitter | <PabClsn_twitter> Error: value of type 'string' has to be discarded |
20:44:54 | FromGitter | <PabClsn_twitter> https://gist.github.com/pablocolson/3651ee44ec7969c73c9de5b0d3527def |
20:45:33 | Vladar | proc repeat returns string and it goes nowhere |
20:46:21 | FromGitter | <PabClsn_twitter> so i should do an echo if i want to display the space to repeat ? |
20:46:33 | Vladar | if you want just print the result, change it to echo repeat(... |
20:47:03 | FromGitter | <PabClsn_twitter> i try to do it but i have this now Error: implementation of 'satstentua.repeat(n: T, i: Natural)' expected |
20:47:49 | Vladar | well you, didn't implement your proc repeat[T](n: T; i: Natural): seq[T] |
20:48:05 | FromGitter | <PabClsn_twitter> ok now i’m lost ahah |
20:48:31 | Vladar | http://nim-lang.org/docs/tut1.html#procedures |
20:48:49 | Vladar | basically, you should write a procedure's body |
20:49:46 | FromGitter | <PabClsn_twitter> ok so in proc repeat I write echo .... |
20:50:03 | FromGitter | <PabClsn_twitter> and implement it in the for loop? |
20:51:05 | Vladar | Is the code you pasted is supposed to be the procedure itself? |
20:52:48 | FromGitter | <PabClsn_twitter> honestly Some one gave me a link sooner and I just read the website of the repeat proc and how to use it I'm sur I'm doing something wrong |
20:53:40 | Vladar | It should be easier for me if you tell me what you trying to achieve |
20:54:27 | FromGitter | <PabClsn_twitter> i want to print X times an Space character depending of a variable |
20:54:57 | FromGitter | <PabClsn_twitter> the X is the variable |
20:55:41 | FromGitter | <PabClsn_twitter> now i have this following the tutorial |
20:55:42 | FromGitter | <PabClsn_twitter> https://gist.github.com/pablocolson/97724bc4d9853050b7d431da9a0d000e |
20:56:40 | FromGitter | <PabClsn_twitter> sorry for ask so many question but i’m quit noob :/ |
20:58:04 | Vladar | i don't know what your tabEtoiles contains, but [^1 - 1] seems wrong to me |
20:58:29 | FromGitter | <PabClsn_twitter> wait |
20:59:06 | FromGitter | <PabClsn_twitter> http://a.fsdn.com/con/app/proj/sastantua/screenshots/Screen%20Shot%202013-07-29%20at%201.36.31%20AM.png |
20:59:17 | FromGitter | <PabClsn_twitter> i’m tring to do this |
20:59:46 | FromGitter | <PabClsn_twitter> I have to print X spaces and the are determined by the height of the pyramid |
21:00:02 | FromGitter | <PabClsn_twitter> so i made a co to count every stars and store them into a tab |
21:00:30 | FromGitter | <PabClsn_twitter> so i re use the last Index of my tab to print the space |
21:01:11 | FromGitter | <PabClsn_twitter> and all the code is here https://gist.github.com/pablocolson/1b85b8ade5586db7f0b6d2d8df5af02e |
21:01:42 | * | brson joined #nim |
21:03:58 | * | couven92 joined #nim |
21:05:36 | Vladar | how about https://gist.github.com/pablocolson/1b85b8ade5586db7f0b6d2d8df5af02e#gistcomment-1978702 ? |
21:06:54 | FromGitter | <PabClsn_twitter> i try because the number of stars to print are stored in the tab |
21:06:58 | FromGitter | <PabClsn_twitter> tabEtoiles |
21:07:28 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:07:41 | Vladar | it easily computed from the line number, as you see |
21:08:00 | Vladar | repeat("*", n * 2 + 1) |
21:09:04 | FromGitter | <PabClsn_twitter> your a fucking genius |
21:09:19 | FromGitter | <PabClsn_twitter> you made it in 4 line |
21:09:27 | FromGitter | <PabClsn_twitter> i’m so fucked |
21:12:31 | Vladar | once I did something similar in forth, for fun https://gist.github.com/Vladar4/838cc28a358f3ba0002f0496d92dd2cb |
21:12:56 | FromGitter | <PabClsn_twitter> Ahah ;)$ |
21:13:39 | FromGitter | <PabClsn_twitter> i just need to adapt you code because there is the different floor and the space need to be precisise |
21:14:11 | FromGitter | <PabClsn_twitter> but to access the last index of your array you use anArray[^1] right ? |
21:14:11 | Vladar | well, you've got the general idea |
21:14:45 | Vladar | yes, the arr[^n] is basically equal to arr[arr.len-n] |
21:15:18 | FromGitter | <PabClsn_twitter> ah ok the length of the array minus the current index |
21:15:21 | FromGitter | <PabClsn_twitter> ok nice |
21:16:33 | * | couven92 quit (Ping timeout: 260 seconds) |
21:16:38 | * | yglukhov quit (Remote host closed the connection) |
21:17:19 | FromGitter | <PabClsn_twitter> he really dont want to take my epeat(" ", (tabEtoiles[^1] - tabEtoiles[n])/2) |
21:18:06 | FromGitter | <PabClsn_twitter> oh i know it was dic instead of / |
21:19:22 | FromGitter | <PabClsn_twitter> with what software do you use Nim sublime text nano Vim emacs ? |
21:19:28 | * | zetashift joined #nim |
21:21:17 | * | bjz joined #nim |
21:22:17 | Vladar | vim |
21:23:15 | * | yglukhov joined #nim |
21:24:13 | FromGitter | <PabClsn_twitter> GUI ? |
21:24:55 | Vladar | you mean gvim? yes, mostly |
21:25:37 | FromGitter | <PabClsn_twitter> here it is |
21:25:42 | FromGitter | <PabClsn_twitter> https://gist.github.com/pablocolson/27bf5812c79bed94d2218cbb3f5b0a69 |
21:26:02 | FromGitter | <PabClsn_twitter> beacause i’m using sublime on mac but i have to compile in a term |
21:26:08 | FromGitter | <PabClsn_twitter> thansk a lot |
21:26:12 | Vladar | congrats |
21:26:32 | FromGitter | <PabClsn_twitter> this language is cool as fuck |
21:26:34 | FromGitter | <PabClsn_twitter> thanks a lot men :) |
21:26:45 | Vladar | it is cool, indeed |
21:27:00 | * | nsf joined #nim |
21:27:03 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:29:35 | FromGitter | <PabClsn_twitter> i was trying swift but for now Oriented Object is complicated to fully understand Nim seems good for leanring |
21:46:26 | * | bjz joined #nim |
21:50:44 | * | bjz quit (Client Quit) |
21:55:46 | * | vasher_ joined #nim |
21:59:02 | devted | PabClsn_twitter, checkout the NimLime plugin for Sublime Text; you can shift-command-b to pick |
21:59:26 | devted | 'run' or 'compile', and command-b will compile/run based off your last action. |
22:00:15 | devted | It works fine in OS X. Just update /etc/paths so it points to nim's bin folder, and then create an applescript launcher to properly start Sublime Text. |
22:00:43 | devted | by default Sublime Text doesn't pickup paths that you put in /etc/paths...but you can properly start Sublime Text run running this: |
22:00:44 | devted | open -a "/Applications/Sublime Text.app" |
22:10:55 | * | zion_ joined #nim |
22:12:43 | FromGitter | <PabClsn_twitter> I try installing NimLim |
22:12:55 | FromGitter | <PabClsn_twitter> but i’m getting Errno 13 Permissions denied |
22:13:08 | FromGitter | <PabClsn_twitter> i update my PATH but still not working |
22:14:53 | FromGitter | <PabClsn_twitter> ah your open -a "/Applications/Sublime Text.app » is working |
22:15:39 | FromGitter | <PabClsn_twitter> Thanks a lot men ;) |
22:15:56 | FromGitter | <PabClsn_twitter> do you know if i can by default lauch the app with this a option ? |
22:18:44 | federico3 | a way to swap endianness for an uint64? |
22:19:27 | FromGitter | <PabClsn_twitter> i didn’t understand but i find a tuto on how to lauch app with otpion by default :) |
22:20:34 | * | nsf quit (Quit: WeeChat 1.7) |
22:21:18 | zion_ | @fedrico3 have you looked at http://nim-lang.org/docs/endians.html ? |
22:21:46 | federico3 | yep zion_ |
22:22:22 | federico3 | http://forum.nim-lang.org/t/2626/2 it's more tricky than that |
22:34:26 | * | Vladar quit (Quit: Leaving) |
22:44:39 | zion_ | @fredrico3 does the following code do the trick: https://paste.scratchbook.ch/view/989be763 |
22:51:59 | * | krux02 quit (Quit: Leaving) |
22:58:16 | * | vlad1777d quit (Quit: Leaving) |
22:58:33 | zion_ | I just tested it and it looks like it works properly. |
23:01:47 | * | PMunch_ joined #nim |
23:04:18 | * | couven92 joined #nim |
23:06:16 | federico3 | swapping 1 leads to 2 ** 56 |
23:10:51 | federico3 | yep. Ideally I was hoping for a simpler way |
23:11:24 | zion_ | What do you mean simpler? |
23:14:05 | federico3 | there's an __builtin_bswap64 for int64 in intrin.h (and besides, I wonder if it maps to a single cpu instruction) |
23:15:23 | federico3 | or doing two 32-bits byte swap? http://x86.renejeschke.de/html/file_module_x86_id_21.html |
23:15:50 | zion_ | Perhaps this is what you want then: https://github.com/nim-lang/Nim/blob/master/lib/pure/endians.nim#L41 |
23:20:12 | federico3 | yep.. oddly it's not exported directly, only using pointers and casts |
23:20:37 | federico3 | thanks zion_ |
23:24:47 | * | WildMage999 quit (Remote host closed the connection) |
23:26:28 | * | yglukhov quit () |
23:29:03 | * | Trioxin joined #nim |
23:31:42 | * | ftsf_ joined #nim |
23:33:49 | * | zetashift left #nim ("Leaving") |
23:39:31 | * | yglukhov joined #nim |
23:39:33 | * | pregressive quit (Remote host closed the connection) |
23:40:07 | * | pregressive joined #nim |
23:40:48 | * | yglukhov quit (Remote host closed the connection) |
23:41:19 | * | pregressive quit (Read error: Connection reset by peer) |
23:41:42 | * | pregressive joined #nim |
23:42:27 | * | pregressive quit (Remote host closed the connection) |
23:43:00 | * | pregressive joined #nim |
23:47:36 | * | pregressive quit (Ping timeout: 240 seconds) |
23:50:34 | * | couven92 quit (Quit: Client disconnecting) |
23:53:23 | * | devted quit (Quit: Sleeping.) |
23:57:17 | * | manjaroi3 joined #nim |