00:02:26 | * | GangstaCat joined #nim |
00:06:52 | kier | ephja: if you haven't found a solution already, @'#endif' ought to do the trick |
00:13:03 | * | yglukhov joined #nim |
00:13:39 | ephja | kier: yep, figured it out |
00:17:48 | * | yglukhov quit (Ping timeout: 276 seconds) |
00:22:03 | * | chemist69 quit (Ping timeout: 264 seconds) |
00:22:10 | * | Demon_Fox joined #nim |
00:30:10 | * | irrequietus quit () |
00:48:43 | * | chemist69 joined #nim |
00:56:29 | * | andrewo91 joined #nim |
00:59:54 | Demos | how likely is a dll built using nimrtl to work? |
01:02:46 | andrewo91 | Araq: can I just define my own memstr etc. implementation and string.h? do I need to use patchFile for that as well? |
01:07:35 | Demos | huh |
01:19:06 | * | chemist69 quit (Ping timeout: 250 seconds) |
01:25:07 | Demos | now can I use the GC in a situation where I have a callback that can get called from many different threads |
01:25:22 | Demos | I don't want to share memory between the threads, I just want to use strings and such in my functions |
01:26:20 | * | yglukhov joined #nim |
01:31:15 | * | yglukhov quit (Ping timeout: 276 seconds) |
01:32:33 | Demos | huh triggering a full collection before returning from my callback function seems to do the trick |
01:32:41 | Demos | not ideal though *shrug* |
01:33:05 | * | chemist69 joined #nim |
02:10:58 | * | shodan45 quit (Quit: Konversation terminated!) |
02:18:21 | * | andrewo91 quit (Remote host closed the connection) |
02:21:18 | * | GangstaCat quit (Quit: Leaving) |
02:25:17 | * | brechtm quit (Read error: Connection reset by peer) |
02:25:22 | * | brechtm_ joined #nim |
02:40:04 | * | Sergio965 quit (Max SendQ exceeded) |
02:40:18 | * | Sergio965 joined #nim |
02:44:02 | * | brechtm_ quit (Read error: Connection reset by peer) |
02:44:07 | * | brechtm joined #nim |
02:46:51 | * | brson quit (Quit: leaving) |
03:09:48 | * | brechtm quit (Read error: Connection reset by peer) |
03:10:15 | * | brechtm joined #nim |
03:13:38 | ftsf | can I import the nim compiler and use it in my nim app to compile nim code and then load it as a shared object and run it? |
03:28:15 | * | yglukhov joined #nim |
03:33:27 | * | yglukhov quit (Ping timeout: 276 seconds) |
03:41:43 | * | brechtm quit (Read error: Connection reset by peer) |
03:41:49 | * | brechtm_ joined #nim |
03:55:12 | * | kssreeram joined #nim |
04:43:22 | mcc | I'm trying to create importc's for importing stuff into Nim, and the original symbols on the other side begin with a _ (like, _default). This is not allowed in Nim. What is the most sensible way to transliterate this into Nim? |
04:45:04 | * | brechtm joined #nim |
04:45:29 | * | brechtm_ quit (Read error: Connection reset by peer) |
04:45:41 | * | fastrom joined #nim |
04:56:00 | * | kssreeram quit (Read error: Connection reset by peer) |
05:11:02 | reactormonk | mcc, importc takes a string parameter, use it. proc someName {.importc: "_someName".} |
05:26:13 | * | kssreeram joined #nim |
05:30:28 | * | yglukhov joined #nim |
05:30:39 | * | endragor joined #nim |
05:31:59 | * | endragor quit (Remote host closed the connection) |
05:32:29 | * | endragor joined #nim |
05:35:00 | * | yglukhov quit (Ping timeout: 276 seconds) |
05:37:01 | * | endragor quit (Ping timeout: 252 seconds) |
05:37:33 | * | brechtm quit (Read error: Connection reset by peer) |
05:37:53 | * | brechtm joined #nim |
05:58:15 | * | nsf quit (Quit: WeeChat 1.5) |
06:21:23 | * | kssreeram quit (Read error: Connection reset by peer) |
06:46:54 | * | kssreeram joined #nim |
06:58:32 | * | Demos quit (Read error: Connection reset by peer) |
07:03:01 | * | Varriount joined #nim |
07:05:20 | * | Varriount_ quit (Ping timeout: 258 seconds) |
07:16:07 | Araq | mcc: leave out the _ ? |
07:26:57 | * | mcc quit (Quit: Connection closed for inactivity) |
07:28:42 | * | kssreeram quit (Read error: Connection reset by peer) |
07:28:46 | * | Matthias247 joined #nim |
07:31:59 | * | yglukhov joined #nim |
07:36:37 | * | yglukhov quit (Ping timeout: 260 seconds) |
07:46:49 | * | yglukhov joined #nim |
08:46:26 | * | irrequietus joined #nim |
08:50:16 | * | joebo quit (Ping timeout: 272 seconds) |
08:56:51 | * | joebo joined #nim |
09:17:27 | * | ephja quit () |
09:25:40 | * | endragor joined #nim |
09:31:16 | * | yglukhov quit (Remote host closed the connection) |
09:43:07 | * | yglukhov joined #nim |
09:46:50 | * | endragor_ joined #nim |
09:47:08 | * | endragor_ quit (Remote host closed the connection) |
09:47:38 | * | endragor_ joined #nim |
09:47:51 | * | yglukhov quit (Ping timeout: 276 seconds) |
09:52:13 | * | endragor_ quit (Ping timeout: 252 seconds) |
10:07:16 | * | Demon_Fox quit (Quit: Leaving) |
10:07:39 | * | yglukhov joined #nim |
10:10:06 | * | fredrik92 joined #nim |
10:12:33 | * | yglukhov quit (Ping timeout: 276 seconds) |
10:33:52 | * | elrood joined #nim |
10:38:23 | * | nsf joined #nim |
10:58:54 | * | Ven joined #nim |
11:21:06 | * | yglukhov joined #nim |
11:26:00 | * | yglukhov quit (Ping timeout: 276 seconds) |
11:44:36 | * | Jaggernaught joined #nim |
11:47:12 | * | titan3 joined #nim |
11:47:38 | * | Jaggernaught quit (Read error: Connection reset by peer) |
11:52:41 | * | yglukhov joined #nim |
11:52:49 | * | titan3 quit (Quit: Page closed) |
12:01:00 | * | cheatfate joined #nim |
12:07:48 | * | titan3 joined #nim |
12:14:52 | * | andrewo91 joined #nim |
12:15:44 | * | andrewo91 quit (Remote host closed the connection) |
12:20:47 | * | andrewo91 joined #nim |
12:21:20 | * | andrewo91 quit (Client Quit) |
12:22:03 | * | brechtm quit (Read error: Connection reset by peer) |
12:22:04 | * | brechtm_ joined #nim |
12:25:34 | * | nsf quit (Quit: WeeChat 1.5) |
12:46:04 | * | brechtm_ quit (Read error: Connection reset by peer) |
12:46:19 | * | brechtm joined #nim |
12:46:35 | * | Matthias247 quit (Read error: Connection reset by peer) |
13:35:52 | * | titan3 quit (Quit: Page closed) |
13:51:36 | minus | what's the nim equivalent for this C: float vertices[] = {1,2,3,4,…};? |
13:52:57 | * | pafmaf joined #nim |
13:53:16 | cheatfate | vertices = [1'f, 2'f, 3'f, 4'f] |
13:53:30 | cheatfate | or vertices = [1.0, 2.0, 3.0, 4.0] |
13:54:02 | minus | what's the difference between @[] and []? |
13:54:14 | minus | meh, doesn't like the [ being on its own line |
13:54:46 | cheatfate | minus, http://nim-lang.org/docs/manual.html#types-array-and-sequence-types |
13:55:56 | minus | i see |
13:56:11 | minus | any chance of multi-lining an array intialization? |
13:59:03 | Araq | what are you even talking about |
13:59:06 | Araq | const |
13:59:06 | Araq | foo = [ |
13:59:06 | Araq | [1, 2], |
13:59:08 | Araq | [5, 6], |
13:59:10 | Araq | [7, 8] |
13:59:12 | Araq | ] |
13:59:14 | Araq | works perfectly fine |
14:00:39 | minus | https://sr.ht/ZvA-.txt |
14:01:11 | minus | nim is nope'ing me hard |
14:04:17 | minus | oh damn, the comments |
14:04:42 | minus | that was stupid |
14:12:27 | * | brechtm quit (Read error: Connection reset by peer) |
14:12:38 | * | brechtm joined #nim |
14:12:55 | minus | how do i get a pointer to the array's data? |
14:15:06 | minus | ah, addr didn't work because it was a const |
14:24:12 | minus | this is madness: attribs_in_color.glVertexAttribPointer(3, cGL_FLOAT, false, GLsizei(6*sizeof(float)), cast[pointer](3*sizeof(float))) |
14:29:38 | * | ephja joined #nim |
14:31:30 | EastByte | minus: `cast[pointer](3*sizeof(float))` this looks scary |
14:31:59 | minus | it's the offset in the data, the API wants it as void* |
14:32:44 | EastByte | ah I see |
14:32:59 | minus | another funny thing in the opengl api is glGetAttribLocation and glVertexAttribPointer. former returns a GLint, latter needs that value as GLuint |
14:33:27 | EastByte | I would probably write wrapper procs to make it nicer |
14:33:34 | minus | i have now entered the most annoying phase when dealing with opengl: it runs, but i see nothing |
14:33:35 | ephja | http://nim-lang.org/docs/manual.html#types-pre-defined-floating-point-types |
14:33:56 | ephja | float is basically float64 (or C's double) now |
14:34:18 | minus | oh |
14:34:56 | EastByte | I guess cfloat should be used? |
14:35:31 | minus | GLfloat |
14:35:53 | ephja | if you want. "cfloat = float32" |
14:36:41 | minus | yeah, GLfloat is float32 as well, and makes more sense here |
14:36:47 | * | endragor quit (Quit: endragor) |
14:37:45 | Araq | OpenGL predates strict static typing, unfortunately. |
14:41:07 | Araq | on the other hand, it wasn't designed by a Unix neckbeard, so you get glGetAttribLocation() rather than f=fopen("/dev/opengl"); write(f, "gtttrblctn") |
14:42:29 | * | nsf joined #nim |
14:42:51 | ephja | never gets old :p |
14:43:44 | ephja | does c2nim not process opaque pointers? |
14:44:23 | Araq | it does. |
14:48:09 | * | Salewski joined #nim |
14:49:05 | minus | how do i best get my array typed as GLfloat? ·var·vertices:·array[24,·GLfloat]·= [ -0.5, ...] complains about a type mismatch |
14:49:28 | Araq | minus: convert the first array entry to GLfloat |
14:49:33 | Araq | the others are then inferred |
14:49:46 | ephja | Araq: you're right. these weren't pointers though, but plain structs |
14:50:13 | minus | doesn't look very elegant but it works |
14:50:29 | ephja | and then it's referenced as Foo* |
14:50:44 | minus | thanks |
14:51:37 | Salewski | I still wonder if "file.isNil" is the same as "file != nil" ? Was not able to find explanation, sorry. |
14:52:08 | ephja | Salewski: did you ever have this problem? are all opaque structures defined as "typedef Foo* Foo" rather than "typedef Foo Foo"? |
14:52:18 | ephja | but this too can be automated with pegs |
14:53:30 | ephja | these are the ugliest parts: content.rep(r"'when not defined(_WIN32) and'" & r"@'when defined(DLL) and defined(_GLFW_BUILD_DLL):'") |
14:54:21 | Salewski | ephja: Can not really remember, there were so many problems... Most fixed by scripts I wrote two years ago. |
14:54:52 | minus | not surprising that nothing shows if the view matrix' top half is all NaNs |
14:55:52 | ephja | it's always fun to debug these issues |
14:56:22 | * | kssreeram joined #nim |
14:56:37 | ephja | the spec is kind of half-assed when it comes to specifying types, but I guess vulkan will be a little more pleasant to use |
14:57:42 | Salewski | ephja: are you still working on gstreamer? I looked at the API yesterday, seems to be large unfortunately. And not close related to gtk/glib, so code structure may be different, with new problems. |
15:03:03 | ephja | yes probably. no I'm not working on it atm |
15:04:20 | Salewski | isNil: ## Fast check whether `x` is nil. This is sometimes more efficient than ## ``== nil``. |
15:04:44 | Salewski | Sorry, had not found that explanation some months ago... |
15:05:09 | ephja | only for closures, right? but I prefer to use it in any case |
15:05:51 | Salewski | And do we write "if not file.isNil" or is there somethink like "file.isNotNil" ? |
15:06:02 | minus | yay it renders |
15:07:18 | Salewski | I would still like the unless from Ruby, "unless file.isNil" |
15:07:35 | ephja | minus: great |
15:10:33 | minus | last thing that got me was arr.len instead of arr.sizeof; an abstraction would really help there |
15:11:31 | ephja | a proc calculating len * sizeof? |
15:12:13 | Araq | Salewski: isNil is the same as == nil except for seqs where == causes a generic instantion |
15:12:59 | ephja | I dunno what I heard about closures then |
15:13:07 | minus | nah, my vertices array; i used glBufferData with the len of the vertices array instead of the size in bytes, so i ended up getting only ¼th of the data buffered |
15:16:09 | Salewski | Araq: Thanks. And we write "if not file.isNil:" ? |
15:17:36 | Araq | yeah, pretty much |
15:17:56 | Salewski | OK. |
15:20:25 | Salewski | Bye... |
15:20:28 | * | Salewski quit () |
15:22:15 | minus | if anyone wants to take a look https://git.mnus.de/minus/nim-sdl2-opengl3/blob/master/main.nim [cc def-] |
15:24:36 | * | Gonzih quit (Quit: WeeChat 1.5) |
15:24:38 | ephja | "typedef struct GLFWcursor* GLFWcursor" -> "illegal recursion", "typedef struct GLFWcursor* GLFWcursor2;" -> "undeclared identifier: 'GLFWcursor'" |
15:24:41 | ephja | difficult problem to solve? |
15:24:55 | * | Gonzih joined #nim |
15:26:04 | * | Gonzih quit (Client Quit) |
15:26:43 | Araq | type IpromiseToLearnNimSomeday = ptr object # done. |
15:27:15 | * | Gonzih joined #nim |
15:30:18 | ephja | well I'm using c2nim but PEG it is for these symbols |
15:40:21 | * | kssreeram quit (Read error: Connection reset by peer) |
15:48:17 | def- | minus: opengl3, cool |
15:57:32 | * | aziz joined #nim |
15:57:59 | * | kssreeram joined #nim |
15:58:37 | ephja | bleeding edge :p |
16:04:51 | * | brechtm quit (Read error: Connection reset by peer) |
16:04:57 | * | brechtm_ joined #nim |
16:23:31 | * | kssreeram quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
16:23:43 | * | kssreeram joined #nim |
16:25:58 | * | Ven quit (Read error: Connection reset by peer) |
16:28:19 | * | kssreeram quit (Read error: Connection reset by peer) |
16:30:23 | * | Ven joined #nim |
16:39:39 | * | nsf quit (Quit: WeeChat 1.5) |
16:40:50 | * | Ven quit (Read error: Connection reset by peer) |
16:45:07 | * | kssreeram joined #nim |
16:50:46 | * | Ven joined #nim |
16:55:06 | * | brechtm_ quit (Read error: Connection reset by peer) |
16:55:12 | * | brechtm joined #nim |
16:56:09 | * | Ven quit (Read error: Connection reset by peer) |
17:03:34 | * | yglukhov quit (Remote host closed the connection) |
17:10:18 | * | Ven joined #nim |
17:11:22 | * | Ven quit (Read error: Connection reset by peer) |
17:13:18 | * | fredrik92 quit (Read error: Connection reset by peer) |
17:13:24 | * | _stowa joined #nim |
17:13:24 | * | Matthias247 joined #nim |
17:15:24 | * | yglukhov joined #nim |
17:19:39 | * | brechtm quit (Read error: Connection reset by peer) |
17:20:15 | * | yglukhov quit (Ping timeout: 276 seconds) |
17:20:40 | * | _stowa quit (K-Lined) |
17:20:52 | * | brechtm joined #nim |
17:24:20 | * | kunev quit (Quit: е те!) |
17:28:30 | * | kunev joined #nim |
17:28:30 | * | kssreeram quit (Read error: Connection reset by peer) |
17:30:03 | * | Ven joined #nim |
17:32:21 | * | yglukhov joined #nim |
17:32:25 | * | xet7 quit (Quit: Leaving) |
17:33:03 | * | xet7 joined #nim |
17:36:19 | * | aziz quit (Remote host closed the connection) |
17:37:05 | * | kssreeram joined #nim |
17:42:07 | * | nsf joined #nim |
17:51:33 | * | yglukhov quit (Remote host closed the connection) |
18:02:52 | * | mcc joined #nim |
18:03:26 | * | yglukhov joined #nim |
18:05:16 | * | euantor joined #nim |
18:07:53 | * | euantor quit (Read error: Connection reset by peer) |
18:08:12 | * | euantor joined #nim |
18:08:21 | * | yglukhov quit (Ping timeout: 276 seconds) |
18:13:18 | * | euantor quit (Ping timeout: 272 seconds) |
18:15:00 | * | desophos quit (Read error: Connection reset by peer) |
18:15:39 | mcc | When writing bindings from Nim to another language, how are constructors typically handled? |
18:15:59 | mcc | I think I can create an equivalent of "new Class()" using importcpp. But what would be the most sensible thing to name it? |
18:16:15 | * | kssreeram quit (Read error: Connection reset by peer) |
18:16:44 | mcc | the convention i've seen so far in nim code is that when creating a "constructor function" for SomeClass, it's typically named "someClass". but that's not really safe for a binding script (i'm writing one from js->nim) since i can't guarantee types will have uppercase names. |
18:16:54 | mcc | should i just name it newSomeClass? |
18:17:17 | * | Trustable joined #nim |
18:26:43 | * | Ven quit (Read error: Connection reset by peer) |
18:29:59 | * | Ven joined #nim |
18:39:17 | * | yglukhov joined #nim |
18:41:58 | * | yglukhov quit (Remote host closed the connection) |
18:44:33 | * | yglukhov joined #nim |
18:47:05 | * | freezerburnv joined #nim |
18:54:25 | * | Trustable quit (*.net *.split) |
18:54:27 | * | michael_campbell quit (*.net *.split) |
18:54:28 | * | Lea2 quit (*.net *.split) |
18:54:28 | * | rektide quit (*.net *.split) |
18:54:29 | * | SirCmpwn quit (*.net *.split) |
18:56:16 | Araq | mcc: newSomeClass is it |
18:56:25 | Araq | or for value types: initSomeClass |
18:57:08 | mcc | thx |
18:58:32 | * | M-max quit (Ping timeout: 260 seconds) |
18:58:50 | * | M-max joined #nim |
19:05:45 | * | yglukhov quit (Remote host closed the connection) |
19:13:26 | * | SirCmpwn joined #nim |
19:13:31 | * | yglukhov joined #nim |
19:13:33 | * | rektide joined #nim |
19:13:34 | * | Learath2 joined #nim |
19:13:36 | * | Trustable joined #nim |
19:15:44 | * | brechtm quit (Read error: Connection reset by peer) |
19:15:49 | * | brechtm_ joined #nim |
19:29:03 | * | freezerburnv quit (Ping timeout: 240 seconds) |
19:30:28 | * | yglukhov quit (Remote host closed the connection) |
19:36:22 | * | yglukhov joined #nim |
19:36:41 | * | GangstaCat joined #nim |
19:37:13 | * | yglukhov quit (Remote host closed the connection) |
19:49:05 | * | yglukhov joined #nim |
19:54:18 | * | yglukhov quit (Ping timeout: 276 seconds) |
20:13:38 | * | yglukhov joined #nim |
20:18:21 | * | yglukhov quit (Ping timeout: 276 seconds) |
20:24:48 | * | Trustable quit (Remote host closed the connection) |
20:28:10 | * | Ven quit (Read error: Connection reset by peer) |
20:28:26 | * | desophos joined #nim |
20:29:11 | * | Ven joined #nim |
20:36:11 | * | Demon_Fox joined #nim |
20:39:45 | * | kssreeram joined #nim |
20:48:14 | * | kssreeram quit (Quit: Textual IRC Client: www.textualapp.com) |
20:49:08 | * | kssreeram joined #nim |
20:49:45 | * | yglukhov joined #nim |
20:51:14 | * | kssreeram quit (Client Quit) |
20:54:45 | * | yglukhov quit (Ping timeout: 276 seconds) |
21:14:05 | * | yglukhov joined #nim |
21:15:19 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:18:48 | * | yglukhov quit (Ping timeout: 276 seconds) |
21:25:41 | mcc | My TypeScript -> Nim binding script now works with variables, functions, classes and objects https://pbs.twimg.com/media/CnmMNN5WAAA4J9Q.jpg |
21:26:10 | mcc | Can't do constructors, enums or the standard library yet |
21:29:03 | * | Matthias247 quit (Read error: Connection reset by peer) |
21:31:34 | * | kssreeram joined #nim |
21:33:41 | * | kssreera_ joined #nim |
21:36:36 | * | kssreeram quit (Ping timeout: 272 seconds) |
21:38:22 | * | yglukhov joined #nim |
21:40:41 | * | freezerburnv joined #nim |
21:41:51 | Araq | mcc: nice! :-) |
21:41:58 | Araq | how do you parse typescript? pegs? |
21:42:24 | mcc | no, typescript exposes a compiler API, i just pull in typescript from npm and use it as a module |
21:42:40 | Araq | smart |
21:42:50 | mcc | it's a little awkward because the typescript compiler API is technically intended for syntax highlighters in editors |
21:43:30 | * | yglukhov quit (Ping timeout: 276 seconds) |
21:44:16 | mcc | they actually have something called "tsserver" which is a process that runs standalone and you can query it over a socket... it's more limited than the node_modules version but if it were more complete it would be in principle possible to query it from nim |
21:52:32 | * | kssreera_ quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
21:56:25 | * | irrequietus quit () |
21:59:17 | * | kssreeram joined #nim |
22:00:33 | * | freezerburnv quit (Ping timeout: 240 seconds) |
22:14:30 | * | yglukhov joined #nim |
22:18:33 | * | kssreeram quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
22:19:15 | * | yglukhov quit (Ping timeout: 276 seconds) |
22:35:31 | * | elrood quit (Quit: Leaving) |
22:38:53 | * | yglukhov joined #nim |
22:43:57 | * | yglukhov quit (Ping timeout: 276 seconds) |
22:50:21 | * | pafmaf quit (Quit: Leaving) |
23:14:52 | * | yglukhov joined #nim |
23:19:42 | * | yglukhov quit (Ping timeout: 276 seconds) |
23:39:21 | * | yglukhov joined #nim |
23:44:24 | * | yglukhov quit (Ping timeout: 276 seconds) |
23:46:34 | * | GangstaCat quit (Quit: Leaving) |
23:55:24 | * | brechtm_ quit (Read error: Connection reset by peer) |
23:56:34 | * | brechtm joined #nim |