00:17:15 | * | zachcarter joined #nim |
00:21:51 | * | couven92 joined #nim |
00:38:42 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
00:56:51 | * | arnetheduck joined #nim |
01:10:49 | * | krux02 joined #nim |
01:11:57 | krux02 | hello does someone know how to concatenate two identifiers into one within a template? |
01:12:18 | krux02 | I think I remember that it is somehow possible, but I can't remember how to do it. |
01:24:39 | def-pri-pub | You might have to mess with macros to do that |
01:39:30 | * | Ven joined #nim |
02:04:05 | * | couven92 quit (Quit: Client Disconnecting) |
02:14:06 | * | Ven quit (Ping timeout: 240 seconds) |
02:16:05 | * | Ven joined #nim |
02:24:53 | * | inotsu joined #nim |
02:25:13 | * | cheatfate_ joined #nim |
02:25:28 | * | cheatfate quit (Read error: Connection reset by peer) |
02:25:36 | * | inotsu quit (Client Quit) |
02:26:47 | * | chemist69 quit (Ping timeout: 264 seconds) |
02:27:58 | * | Ven quit (Ping timeout: 240 seconds) |
02:31:04 | * | bjz joined #nim |
02:31:25 | * | Ven joined #nim |
02:40:26 | * | chemist69 joined #nim |
02:40:38 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
02:44:55 | * | bjz joined #nim |
02:55:20 | def-pri-pub | Question: the float type is a 64 bit type. correct? |
02:56:15 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
02:57:53 | * | Nobabs27 joined #nim |
03:11:44 | * | def-pri-pub quit (Read error: Connection reset by peer) |
03:13:18 | * | def-pri-pub joined #nim |
03:32:21 | * | zachcarter quit (Quit: zachcarter) |
03:37:18 | * | yglukhov joined #nim |
03:41:44 | * | yglukhov quit (Ping timeout: 258 seconds) |
03:46:42 | Lord_Nightmare | def-pri-pub: not sure. in c, float is 32 bit, double is 64 bit and long double is 80 bit for compilers/systems which handle it |
03:47:20 | Lord_Nightmare | some processors and compilers support a quadruple or quad of 128 bits but it isn't standard afaik |
03:50:45 | Lord_Nightmare | in nim, i'm not sure. |
03:55:08 | * | rauss joined #nim |
04:02:08 | * | Nobabs27 quit (Quit: Leaving) |
05:05:23 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
05:05:51 | * | zachcarter joined #nim |
05:07:23 | * | zachcarter quit (Read error: Connection reset by peer) |
05:08:08 | * | zachcarter joined #nim |
05:08:11 | * | bjz joined #nim |
05:24:59 | krux02 | float is 64 bit at least of 64 bit systems. I think it is 32 bit on 32 bit systems. Just use float32 and float64 when you want a specific size. |
05:25:15 | * | krux02 quit (Remote host closed the connection) |
05:27:39 | cheatfate_ | def-pri-pub, float = float64 for Nim, afaik |
05:28:14 | cheatfate_ | def-pri-pub, but krux02 is right, better use float32/float64 :) |
05:35:48 | * | vlad1777d joined #nim |
05:38:36 | * | BitPuffin|osx quit (Ping timeout: 268 seconds) |
05:40:25 | * | zachcarter quit (Quit: zachcarter) |
05:57:55 | * | Serenitor joined #nim |
06:02:44 | * | cheatfate_ is now known as cheatfate |
06:03:20 | Serenitor | would someone be able to tell me if this is broken or if i am just stupid? http://up.r00t.li/20170305_vivaldi_sl3U.png |
06:04:32 | cheatfate | Serenitor, you've got problems while trying to register on forum? |
06:04:55 | Serenitor | yea that screenshot is from https://forum.nim-lang.org |
06:05:28 | cheatfate | try one more time with different captcha |
06:06:56 | Serenitor | heh, I always get the 8+91 even after clearing cache |
06:07:18 | Serenitor | in any browser |
06:09:16 | cheatfate | hmm, could you please fill an issue here https://github.com/nim-lang/nimforum/issues? |
06:09:53 | cheatfate | it looks like a bug |
06:10:07 | cheatfate | but currently there no admins online to help you |
06:10:57 | * | libman quit (Quit: Connection closed for inactivity) |
06:13:24 | Serenitor | kk, thanks cheatfate |
06:13:24 | * | def-pri-pub quit (Read error: Connection reset by peer) |
06:19:27 | Serenitor | alright cheatfate, I just now tried again and it worked. guess it was only temporary. thanks again |
06:25:22 | cheatfate | Serenitor, welcome aboard :) |
06:36:09 | * | yglukhov joined #nim |
06:38:55 | * | jabb quit (Read error: Connection reset by peer) |
06:40:33 | * | yglukhov quit (Ping timeout: 260 seconds) |
06:43:15 | * | jabb joined #nim |
07:04:20 | * | nsf joined #nim |
07:55:54 | FromGitter | <Varriount> demi- : You can't get a safe reference to an *existing* object, as there's no guarantee that the object's data is on the heap. |
07:56:12 | FromGitter | <Varriount> What you can do is copy the object's data to a reference. |
07:57:34 | FromGitter | <Varriount> `var objectRef: ref ObjectType;new(objectRef);objectRef[] = objectValue` |
07:58:02 | FromGitter | <Varriount> Those empty square brackets may not be needed. |
08:02:07 | * | eizua quit (Quit: Leaving) |
08:10:36 | * | shashlick quit (Ping timeout: 240 seconds) |
08:11:53 | * | shashlick joined #nim |
08:27:46 | * | rauss quit (Quit: WeeChat 1.7) |
08:58:08 | * | yglukhov joined #nim |
08:58:21 | * | yglukhov quit (Remote host closed the connection) |
09:03:30 | * | couven92 joined #nim |
09:04:54 | * | gibs0n joined #nim |
09:05:01 | * | gibs0n left #nim (#nim) |
09:27:44 | * | gk_1wm_su joined #nim |
09:29:14 | * | gk_1wm_su quit (K-Lined) |
09:30:30 | * | gokr joined #nim |
10:03:29 | * | byte512 joined #nim |
10:08:43 | * | sdw_ is now known as sdw |
10:08:44 | * | sdw quit (Changing host) |
10:08:44 | * | sdw joined #nim |
10:09:11 | * | tankfeeder joined #nim |
10:12:54 | * | Ven joined #nim |
10:29:28 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:30:49 | * | Serenitor quit (Ping timeout: 240 seconds) |
10:56:26 | * | gokr quit (Ping timeout: 258 seconds) |
11:11:28 | * | vendethiel quit (Ping timeout: 240 seconds) |
11:15:13 | * | Ven joined #nim |
11:31:08 | * | elrood joined #nim |
11:31:54 | * | Arrrr joined #nim |
11:31:54 | * | Arrrr quit (Changing host) |
11:31:54 | * | Arrrr joined #nim |
11:35:03 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:51:46 | * | yglukhov joined #nim |
11:57:58 | * | yglukhov quit (Ping timeout: 240 seconds) |
12:02:00 | * | bjz_ joined #nim |
12:02:34 | * | bjz quit (Ping timeout: 240 seconds) |
12:11:44 | * | gokr joined #nim |
12:37:32 | * | bjz_ quit (Ping timeout: 246 seconds) |
12:37:47 | * | bjz joined #nim |
12:59:13 | * | Trioxin quit (Ping timeout: 256 seconds) |
13:02:08 | * | zachcarter joined #nim |
13:04:28 | * | Arrrr quit (Ping timeout: 240 seconds) |
13:06:51 | * | Arrrr joined #nim |
13:17:14 | * | BitPuffin|osx joined #nim |
13:21:51 | * | Jesin quit (Ping timeout: 260 seconds) |
13:36:58 | * | sdw left #nim (#nim) |
13:40:10 | * | Ven joined #nim |
13:55:53 | * | yglukhov joined #nim |
13:59:58 | * | yglukhov quit (Ping timeout: 240 seconds) |
14:01:35 | * | Ven quit (Ping timeout: 264 seconds) |
14:03:46 | * | Jesin joined #nim |
14:06:40 | * | Ven joined #nim |
14:08:53 | * | arnetheduck quit (Ping timeout: 246 seconds) |
14:11:55 | * | yglukhov joined #nim |
14:22:15 | * | dddddd_ joined #nim |
14:24:30 | demi- | thanks varriount, so there is no concept of a weak reference to an existing object to prevent having to do copies when performing assignment? |
14:31:29 | demi- | Araq: are you around? I had some questions about using objective-C blocks with the FFI, and if you had any pointers for that |
14:31:42 | * | Matthias247 joined #nim |
14:38:43 | Araq | demi-: hey |
14:38:50 | demi- | hi |
14:40:17 | * | yglukhov quit (Remote host closed the connection) |
14:40:29 | demi- | I was wondering if you every looked at how bridging of blocks (libclosure) would work in nim. I was trying it last night and ran into some typing issues where the methods that would take a block wouldn't accept a function |
14:45:18 | * | yglukhov joined #nim |
14:49:03 | * | yglukhov quit (Remote host closed the connection) |
15:04:23 | Araq | demi-: can you give some snippet to look at? |
15:18:46 | demi- | sure, give me a minute to put one together for you |
15:38:31 | * | kulelu88 joined #nim |
15:39:10 | demi- | Araq: here is the error I get: https://gist.github.com/samdmarshall/bc6f1ad9e4cb7061d06c273178dfdca8 and here is the respective code: https://github.com/samdmarshall/snippets/tree/master/nim-blocks |
15:41:55 | Araq | proc (value: cdouble): int is not compatible to proc (value: cdouble): cdouble |
15:46:49 | * | tankfeeder quit (Quit: Leaving) |
15:51:29 | * | BitPuffin|osx quit (Ping timeout: 256 seconds) |
15:54:12 | demi- | Araq: sorry, my bad, this is the one i was encountering last night: https://gist.github.com/samdmarshall/ef1684e3825fdce1e38f0e0e50eef1d1 and i've updated the code respectively: https://github.com/samdmarshall/snippets/tree/master/nim-blocks |
15:54:58 | * | BitPuffin|osx joined #nim |
15:56:24 | Araq | I don't know what 'int (^)(double)' is |
15:57:01 | Araq | you need to use .emit to create Objective C syntax for the "block" that then calls the nim proc |
15:57:45 | demi- | https://en.wikipedia.org/wiki/Blocks_%28C_language_extension%29 |
15:59:07 | demi- | that is what i ended up doing, but it seems extremely crude especially when a lot of APIs use these as parameters to method calls -- in implementation they are quite (including implementation details) to anonymous function callbacks |
15:59:41 | FromGitter | <Varriount> demi-: The way Nim constructs closures and how Objective C constructs blocks is very similar |
16:00:01 | demi- | I am looking for interop with them varriount |
16:03:26 | Araq | demi-: that wiki article doesn't tell me the layout Objective C uses |
16:04:03 | demi- | the docs in the root here should do it? https://opensource.apple.com/source/libclosure/libclosure-67/ |
16:05:08 | * | Trustable joined #nim |
16:07:48 | * | nsf quit (Quit: WeeChat 1.7) |
16:10:48 | FromGitter | <Varriount> Specifically, this file looks good:https://opensource.apple.com/source/libclosure/libclosure-67/Block_private.h.auto.html |
16:12:49 | FromGitter | <Varriount> As well as https://opensource.apple.com/source/libclosure/libclosure-67/BlockImplementation.txt.auto.html |
16:17:51 | Araq | demi-: ok, well that's some complex runtime representation |
16:18:21 | Araq | and not compatible with Nim's closures (which only consist of 2 memory words) |
16:24:26 | * | BitPuffin|osx quit (Ping timeout: 260 seconds) |
16:25:02 | * | BitPuffin|osx joined #nim |
16:31:29 | * | rauss joined #nim |
16:37:32 | demi- | Araq: hmmm, ok; how far off is the compile-time FFI then? I think I can making a bridge pretty easily for this through some codegen through an `emit` |
16:37:49 | * | djellemah quit (Ping timeout: 268 seconds) |
16:38:09 | * | djellemah joined #nim |
16:39:02 | demi- | sorry, the context for this is the `static` keyword |
16:39:19 | * | SunDwarf is now known as assign |
16:39:21 | * | assign is now known as declare |
16:40:24 | * | declare is now known as abc |
16:40:31 | * | abc is now known as await |
16:40:51 | * | vlad1777d quit (Quit: Leaving) |
16:51:33 | * | BitPuffin|osx quit (Ping timeout: 256 seconds) |
17:00:11 | * | nsf joined #nim |
17:00:12 | * | Vladar joined #nim |
17:02:59 | * | BitPuffin|osx joined #nim |
17:03:58 | Araq | use staticExec instead of the compile-time FFI |
17:06:04 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:10:00 | * | zachcarter quit (Quit: zachcarter) |
17:10:10 | demi- | sorry, i mean this: https://nim-lang.org/docs/manual.html#statements-and-expressions-static-statement-expression it says that later versions of nim will support this, how far off is that? |
17:11:06 | * | hjsagg quit (Ping timeout: 240 seconds) |
17:12:40 | * | elrood quit (Remote host closed the connection) |
17:13:31 | * | deavmi__ joined #nim |
17:13:37 | * | deavmi__ quit (Client Quit) |
17:14:10 | * | deavmi__ joined #nim |
17:14:37 | * | deavmi__ quit (Client Quit) |
17:24:40 | * | Sembei joined #nim |
17:39:11 | ehmry[m] | what do you folks think is better ``newClient(host, port); connect()`` or ``newClient(); connect(host, port)`` |
17:40:53 | dom96 | The latter. But the former can also work, depending on what the client connects to. |
17:44:03 | ehmry[m] | yea, in the case of multisync its better to have more code in connect() than new() |
17:46:22 | Araq | demi-: that's not planned anymore. :-) |
17:46:33 | Araq | need to update the manual |
18:24:56 | * | rauss quit (Quit: WeeChat 1.7) |
18:25:56 | * | rauss joined #nim |
18:28:51 | * | hjsagg joined #nim |
18:54:36 | * | couven92 quit (Ping timeout: 240 seconds) |
19:06:16 | * | krux02 joined #nim |
19:13:33 | * | vlad1777d joined #nim |
19:14:52 | * | BlaXpirit quit (Quit: Bye) |
19:14:52 | * | FromGitter quit (Remote host closed the connection) |
19:20:51 | * | couven92 joined #nim |
19:22:52 | * | couven92 quit (Read error: Connection reset by peer) |
19:24:22 | * | couven92 joined #nim |
19:29:24 | * | rauss quit (Quit: WeeChat 1.7) |
19:30:37 | * | rauss joined #nim |
19:36:03 | * | Ven joined #nim |
19:37:57 | * | FromGitter joined #nim |
19:38:03 | * | BlaXpirit joined #nim |
19:38:15 | * | nsf quit (Quit: WeeChat 1.7) |
20:02:28 | demi- | Araq: :( |
20:03:08 | Araq | demi-: staticExec works fine for this |
20:03:27 | demi- | can you explain what you mean by that? i'm not sure if i completely follow |
20:06:09 | Araq | you write a Nim or Objective-C program that outputs what you're interested in and read that output via staticExec |
20:12:19 | demi- | would i be able to use a macro to emit objective-c code based on the compile-time nim types it gets passed? |
20:14:02 | * | Arrrr quit (Quit: Leaving.) |
20:14:30 | * | BlaXpirit_ joined #nim |
20:15:53 | stisa | demi- I think a proc with {.compiletime.} and a ``when passedtype is type`` block should work |
20:16:54 | * | FromGitter quit (Remote host closed the connection) |
20:17:16 | * | FromGitter joined #nim |
20:26:56 | * | BlaXpirit_ quit (Quit: Bye) |
20:27:12 | * | BlaXpirit_ joined #nim |
20:38:16 | Araq | demi-: yes |
20:46:00 | * | zachcarter joined #nim |
20:58:11 | * | nsf joined #nim |
21:06:52 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:07:22 | demi- | how would i generate a nim-type at compile time? i don't think i fully understand how to use the emit pragma plus the macros module to do this |
21:07:46 | Araq | macros.getType() and others |
21:08:40 | Araq | you don't generate the type, you only generate an AST resembling a type and let Nim construct a type out of this, types are hard |
21:09:16 | Araq | but it sounds more like you need to analyse an already existing type, macros.getType can do that |
21:09:54 | demi- | so i'm emitting some objc code that constructs the block variable for me, and i think i'm close to getting this working but I need to get the type over into nim now so i can import the correct type alias to nim to do the work for me |
21:11:41 | demi- | so i think all i need here is to tell nim "there is this variable with associated type, alias to that; like C's `extern` |
21:13:12 | Araq | I can't follow :-) |
21:13:26 | * | dexterk quit (Ping timeout: 246 seconds) |
21:13:26 | * | dexterk_ joined #nim |
21:15:30 | demi- | sorry, so i have a template that emits objc code that declares a block, and makes it call a nim procedure. when that gets emitted, i create a static block variable with a specific name; i want to import that specific variable back into my nim code so i can reference the block pointer and pass it to the my FFI'd objective-c code. |
21:16:38 | demi- | i'm trying to work out how i would declare a const with that specific name automatically |
21:21:14 | Araq | why do you have to declare the block? |
21:21:55 | * | Nobabs27 joined #nim |
21:23:21 | demi- | so i can reference it in the nim code, otherwise i might as well just write it all in objc |
21:26:55 | * | bjz joined #nim |
21:39:06 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:44:13 | * | Trustable quit (Remote host closed the connection) |
21:55:27 | Araq | yeah sure, but you can pass the name to the template until you feel comfortable with macros and gensym() |
21:56:00 | Araq | or maybe |
21:56:36 | Araq | var blck: type(placeholder) |
21:57:47 | Araq | {.emit: [type(returntype), " ", blck, "^{", nimProc, "}"].} |
21:57:53 | Araq | blck |
21:58:05 | Araq | well, you get the idea |
22:06:06 | * | byte512 quit (Ping timeout: 240 seconds) |
22:16:14 | demi- | yeah, i'm trying to play with the macros module on its own right now to get a better feel for this -- it is very unlike anything i've had access to in a programming language before, so this is pretty interesting. |
22:18:29 | * | Ven quit (Ping timeout: 240 seconds) |
22:19:44 | * | Ven joined #nim |
22:24:23 | * | nsf quit (Quit: WeeChat 1.7) |
22:32:20 | * | couven92 quit (Quit: Client Disconnecting) |
22:33:33 | * | Ven quit (Ping timeout: 240 seconds) |
22:37:02 | * | PMunch joined #nim |
22:39:25 | * | Ven joined #nim |
22:58:46 | * | shashlick quit (Ping timeout: 260 seconds) |
22:59:37 | * | shashlick joined #nim |
23:15:41 | * | kulelu88 quit (Ping timeout: 260 seconds) |
23:20:51 | SusWombat | Vladar, Hey im currently using your sdl bindings and im looking at your examples (thanks for that). Is there a specific reason to use logCritical over echo or a different loggin module? |
23:21:53 | Vladar | SusWombat, no specific reason, it's just there in sdl2 so I used it |
23:22:04 | SusWombat | Ok thank you :) |
23:22:07 | Vladar | np |
23:26:47 | krux02 | Vladar: I am still using the SDL from the official repository, but I see a few things that are just better in your repository. |
23:26:59 | * | ludocode joined #nim |
23:27:30 | * | kulelu88 joined #nim |
23:27:49 | Vladar | krux02: events or something else? |
23:28:04 | krux02 | not only |
23:28:50 | krux02 | I just made a pull request recently to the "official" sdl2 bindings, because they had untyped macros for things that were only used with cint arguments |
23:29:25 | krux02 | and yes of course events are a lot better |
23:30:22 | krux02 | even though I think the best way would be to port events to object: case kind of ...: structure |
23:31:03 | Vladar | I believe it is c2nim which converts c-defines to templates with untyped arguments. |
23:31:22 | krux02 | that breaks code that uses cast like the in sdl2 example on nim-lang/sdl2 |
23:31:34 | krux02 | Vladar: that is totally correct |
23:31:45 | krux02 | it better than nothing, but it can be improved |
23:34:03 | Vladar | The variant object might be incompatible with the sdl2 event structure, I guess |
23:46:37 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:51:17 | krux02 | Vladar: actually I tested it once, it works |
23:51:34 | krux02 | there is just one thing you need to do when you want to implement it |
23:51:52 | krux02 | every SDL event starts with the enum value |
23:52:02 | krux02 | you have to take that enum out of the event type |
23:53:43 | krux02 | so you can't just use the sdl2 event types |