00:01:26 | PMunch | What's the "proper" thing to raise when you hit an unknown node kind in a macro? |
00:03:52 | * | vitalyx quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:09:53 | * | PMunch quit (Quit: leaving) |
00:13:05 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
00:14:58 | * | vlad1777d quit (Quit: Leaving) |
00:31:21 | * | devted joined #nim |
00:38:49 | * | yglukhov joined #nim |
00:39:13 | FromGitter | <Varriount> PMunch: Raise an error? |
00:44:18 | * | yglukhov quit (Ping timeout: 248 seconds) |
00:44:47 | * | brson joined #nim |
00:53:43 | * | zachcarter is now known as carterza |
00:57:04 | carterza | awesome, I got my sprite batch working now |
00:57:31 | carterza | I should have this little engine ready for 7drl in March |
00:59:23 | ftsf_ | \o/ |
00:59:32 | ftsf_ | 7drl? |
01:00:21 | carterza | http://7drl.org/ |
01:01:48 | ftsf_ | awesome |
01:02:15 | ftsf_ | planning on doing Ludum Dare 38 in April |
01:02:24 | carterza | oh man I should do that as well |
01:02:30 | carterza | never done an LD before |
01:02:47 | ftsf_ | it's really fun (if you can come up with an idea and know your base code well enough) |
01:02:57 | carterza | yeah |
01:03:01 | ftsf_ | first 2 times i tried i sucked, 3rd time i finished and came 4th =) |
01:03:09 | carterza | I’ve written a bunch of engines and a few games but only done a few jams |
01:03:10 | carterza | nice |
01:03:26 | ftsf_ | awesome, yeah definitely do LD |
01:03:31 | carterza | this is the first time I’ve done modern opengl |
01:03:35 | carterza | I must say it’s a bitch |
01:03:57 | ftsf_ | haha yeah, it's a lot of work to get anything out the pipeline |
01:04:11 | ftsf_ | compared to ye old opengl glBegin/End |
01:05:43 | carterza | agreed |
01:29:42 | carterza | 2 sprites - http://imgur.com/a/PUvQG |
01:30:23 | * | def-pri-pub quit (Ping timeout: 256 seconds) |
01:31:52 | * | devted quit (Quit: Sleeping.) |
01:32:21 | * | def-pri-pub joined #nim |
01:32:21 | * | def-pri-pub quit (Changing host) |
01:32:21 | * | def-pri-pub joined #nim |
01:32:27 | carterza | https://gist.github.com/zacharycarter/54785ca34be3053be4e54cdd673f72ef - is the game code, I don’t think using the library at this point is too bad |
01:34:31 | * | devted joined #nim |
01:39:53 | FromGitter | <zetashift> a scifi roguelike game and engine |
01:40:08 | FromGitter | <zetashift> nooooiiiceeeeee |
01:40:35 | carterza | ah I need to delete that repo :) |
01:40:37 | carterza | and put up this new one |
01:40:39 | carterza | I’ll do that now |
01:42:36 | * | def-pri-pub quit (Ping timeout: 240 seconds) |
01:43:39 | carterza | https://github.com/zacharycarter/derelict - there we go |
01:43:43 | * | def-pri-pub joined #nim |
01:43:43 | * | def-pri-pub quit (Changing host) |
01:43:43 | * | def-pri-pub joined #nim |
01:50:28 | carterza | is there a cleaner way to do - https://github.com/zacharycarter/derelict/blob/master/src/derelictpkg/spritebatch.nim?l=99#L94 ? |
02:03:21 | * | arnetheduck joined #nim |
02:11:33 | FromGitter | <Varriount> carteza: not really |
02:13:48 | * | couven92 quit (Quit: Client disconnecting) |
02:18:21 | carterza | Varriount: okay thanks |
02:18:28 | carterza | btw I got my spritebatch working :) |
02:18:31 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
02:20:15 | FromGitter | <Varriount> carteza: Something to keep in mind for performance reasons - sequences and strings are like objects, they copy their contents on assignment. |
02:20:29 | FromGitter | <Varriount> Well, not a deepcopy, but a new string/sequence is created. |
02:20:48 | carterza | ah okay thanks |
02:26:08 | carterza | Varriount: what’s the performant way to do what I’m trying to do without allocating another sequence on the heap? |
02:32:05 | FromGitter | <Varriount> What are you trying to do? |
02:32:49 | FromGitter | <Varriount> I mean, I can see what that code you posted is doing, however I need some context |
02:33:16 | carterza | sure |
02:33:33 | carterza | if you look at src/derelict.nim that’s the game driver code |
02:34:01 | carterza | so if you can imagine in the render call - a bunch of calls to derelict.batch.draw taking place |
02:34:54 | carterza | I’m guessing it’s to just not allocate the sequences every time the method is called |
02:34:59 | carterza | and instead reuse some? |
02:35:25 | FromGitter | <Varriount> That's one technique. |
02:36:07 | FromGitter | <Varriount> carteza: In general, there are two ways to optimize or change the behavior of string/sequence assignment. |
02:36:33 | FromGitter | <Varriount> The first is to simply replace the sequence with a reference to a sequence. |
02:36:54 | carterza | okay |
02:37:14 | FromGitter | <Varriount> You can still extend/shrink the sequence and modify it, however there's always the (small to none) performance penalty of the double-indirection. |
02:37:33 | FromGitter | <Varriount> There's also marking the sequence/string as shallow, using the `shallow` procedure. |
02:38:05 | FromGitter | <Varriount> This prevents copying of the sequence, however you shouldn't (can't) modify the sequence afterwards. |
02:38:23 | carterza | gotcha, thank you for the explanation |
02:38:56 | FromGitter | <Varriount> carterza: https://forum.nim-lang.org/t/2665#16487 |
02:39:39 | FromGitter | <Varriount> My "shouldn't", I mean that if you modify the sequence (like via appending to it) you will get very, very strange behavior. |
02:40:02 | carterza | gotcha |
02:40:21 | FromGitter | <Varriount> I *think* modifying existing elements is ok, however I defer to @Araq on that. |
02:41:38 | FromGitter | <Varriount> Personally, I would find a way to bind those arrays to some sort of object. If you're going to have the same elements being rendered every frame, there's no need to reallocate memory for them each time. |
02:42:00 | * | yglukhov joined #nim |
02:42:56 | FromGitter | <Varriount> Some sort of 'RenderObject' that contains the texture and its vertices |
02:42:58 | carterza | that makes sense, I’ll do that next thank you :) |
02:43:34 | FromGitter | <Varriount> That being said, if this is a prototype, you shouldn't worry too much. Memory allocation is quite fast. |
02:43:41 | carterza | yeah that’s what I tried to make the vbo and ibo |
02:44:07 | carterza | but allocating new arrays every frame is a bad idea when they don’t change you’re right |
02:44:46 | carterza | I think the render object would be a mesh object |
02:45:33 | FromGitter | <Varriount> carteza: Even if they change, you can just modify the sequence. |
02:45:44 | carterza | ah true |
02:46:35 | FromGitter | <Varriount> carteza: Keep in mind that if you're giving opengl pointers to sequence data, that data will only remain valid for as long as the sequence's length isn't changed/deallocated. |
02:47:09 | * | yglukhov quit (Ping timeout: 240 seconds) |
02:49:48 | carterza | yeah I still have a lot of code to write to handle that :/ |
02:57:21 | FromGitter | <Varriount> carterza: There are functions for manually incrementing an object's refcount, as well as ways to allocate a variable-length array at runtime. |
02:57:39 | FromGitter | <Varriount> Although that last one is more of a process. |
02:58:11 | * | carterza quit (Quit: carterza) |
03:00:14 | * | chemist69 quit (Ping timeout: 255 seconds) |
03:01:37 | * | zachcarter joined #nim |
03:08:32 | FromGitter | <martinium> is a seq the same as a vector? |
03:11:29 | * | kulelu88 quit (Quit: Leaving) |
03:13:41 | FromGitter | <Varriount> @martinium In what way? |
03:13:43 | * | chemist69 joined #nim |
03:14:30 | FromGitter | <martinium> I haven't used them at all yet |
03:15:10 | FromGitter | <martinium> but I read they are dynamically expandable storage |
03:15:14 | FromGitter | <martinium> sounds like an array |
03:15:22 | FromGitter | <martinium> array/vector |
03:15:33 | FromGitter | <Varriount> An array's length can't change. A sequences can. |
03:15:46 | FromGitter | <martinium> array is C-style |
03:15:53 | FromGitter | <martinium> seq is like a vector in C++ |
03:17:01 | FromGitter | <Varriount> Yes. |
03:17:41 | FromGitter | <Varriount> A sequence is implemented as an array which is reallocated when it needs to grow. |
03:17:47 | FromGitter | <martinium> yep |
03:17:51 | FromGitter | <martinium> dynamically sized |
03:17:55 | FromGitter | <martinium> cool |
03:18:06 | FromGitter | <martinium> I wonder if it as fast as vectors are in C++ |
03:18:17 | ftsf_ | it also has some extra data i believe, so don |
03:18:18 | FromGitter | <martinium> std::vector is famous for that |
03:18:34 | ftsf_ | don't use it the same as a dynamically sized array |
03:19:16 | FromGitter | <martinium> gotcha |
03:19:37 | FromGitter | <Varriount> ftsf_: It is a dynamically sized array |
03:19:53 | FromGitter | <Varriount> Where people go wrong is when trying to treat it as a C array. |
03:20:18 | FromGitter | <martinium> for C array just use array |
03:20:22 | FromGitter | <Varriount> If you want to get a pointer to the internal array of elements, you have to do `addr mySequence[0]`, not `addr mySequence` |
03:20:44 | ftsf_ | yeah |
03:21:19 | FromGitter | <martinium> @Varriount do you know how to program in C? |
03:24:05 | FromGitter | <Varriount> In C? A little. |
03:24:14 | FromGitter | <Varriount> I'm far more adept at reading it than writing it. |
03:32:43 | FromGitter | <martinium> I only read a little |
03:33:04 | FromGitter | <martinium> so fast |
03:50:31 | * | ftsf_ quit (Ping timeout: 255 seconds) |
03:55:58 | * | brson quit (Quit: leaving) |
04:03:08 | * | ftsf_ joined #nim |
04:06:38 | * | def-pri-pub quit (Quit: leaving) |
04:40:01 | * | ftsf_ quit (Ping timeout: 255 seconds) |
04:48:50 | * | ibk joined #nim |
04:52:21 | * | ftsf_ joined #nim |
05:01:49 | * | chemist69 quit (Ping timeout: 240 seconds) |
05:04:18 | * | chemist69 joined #nim |
05:08:18 | * | smt quit (Read error: Connection reset by peer) |
05:39:30 | FromGitter | <barcharcraz> it works! |
05:39:31 | FromGitter | <barcharcraz> https://gist.github.com/barcharcraz/7b4429c9033daeac09b3b42405617c15 |
05:40:00 | FromGitter | <barcharcraz> all the correct types are gathered from the query |
05:40:35 | FromGitter | <barcharcraz> so you'd only write that once |
05:40:37 | FromGitter | <barcharcraz> the ql_convert is just to convert from internal db types to their associated nim type |
05:40:40 | FromGitter | <barcharcraz> same with nimqlgen() |
05:41:40 | FromGitter | <barcharcraz> works with tuple unpacking too! |
05:45:42 | * | yglukhov joined #nim |
05:49:53 | * | yglukhov quit (Ping timeout: 245 seconds) |
05:50:55 | * | sz0 joined #nim |
05:56:26 | * | devted quit (Quit: Sleeping.) |
06:12:23 | * | kunev quit (Ping timeout: 264 seconds) |
06:12:59 | * | FromGitter quit (Ping timeout: 264 seconds) |
06:12:59 | * | lenstr quit (Ping timeout: 264 seconds) |
06:13:09 | * | FromGitter joined #nim |
06:13:35 | * | Sergio965_ quit (Ping timeout: 264 seconds) |
06:13:51 | * | LeNsTR joined #nim |
06:14:48 | FromGitter | <Varriount> @barcharcraz What does it do/meant for exactly? |
06:18:33 | * | Sergio965 joined #nim |
06:18:39 | * | kunev joined #nim |
06:32:33 | FromGitter | <barcharcraz> it's an sql library |
06:33:00 | FromGitter | <barcharcraz> the idea is to get types from the database (and user provided overrides) and then execute the query verbatim |
06:33:23 | FromGitter | <barcharcraz> so I guess it's an ORM |
06:33:33 | FromGitter | <barcharcraz> or a reverse orm...? |
06:35:04 | FromGitter | <barcharcraz> so like if you have one table per object then instead of like db.load<type>(id) you could just say var thing: type = db.query("select * from object where id=$(some expression)) |
06:35:28 | FromGitter | <barcharcraz> stuff like that |
06:36:40 | * | devted joined #nim |
06:41:12 | * | devted quit (Ping timeout: 276 seconds) |
06:50:01 | * | nsf joined #nim |
07:05:40 | FromGitter | <Varriount> Oh cool! |
07:06:34 | Araq | barcharcraz: this is really cool! as a somewhat realistic test can we use that in nimforum? :-) |
07:09:00 | FromGitter | <barcharcraz> it needs more work Araq |
07:09:12 | FromGitter | <barcharcraz> just got the proof of concept working today |
07:09:32 | Araq | do you read the schema information with staticExec? |
07:09:42 | FromGitter | <barcharcraz> and there's only an sqlite backend right now. Yes. Sortof |
07:10:31 | FromGitter | <barcharcraz> row_iter (well actually row) is a macro that calls staticExec("util gen <query>") |
07:11:00 | FromGitter | <barcharcraz> the nimqlgen() is essentially parseStmt(staticExec("util getall")) |
07:11:13 | FromGitter | <barcharcraz> there's a config file that points to a schema (a folder of sql files) |
07:12:53 | FromGitter | <barcharcraz> because the code generator uses the database's own code to parse the sql and infer things about types each backend will need to have a target database accessible |
07:13:28 | Araq | the forum uses sqlite :-) |
07:14:32 | FromGitter | <barcharcraz> I don't intend to limit things to sqlite, but like a postgresql backend would have the code generator creating a postgres database in some tmpfs |
07:14:54 | FromGitter | <barcharcraz> probably |
07:17:07 | FromGitter | <barcharcraz> the repo is https://github.com/barcharcraz/nimql |
07:17:27 | FromGitter | <barcharcraz> but it's at proof of concept stage only |
07:19:50 | Araq | "this is just to shut the compiler up" |
07:20:01 | Araq | --> use a mixin declaration |
07:20:02 | * | adeohluwa joined #nim |
07:20:18 | Araq | https://github.com/barcharcraz/nimql/blob/master/src/nimql/backend/sqlite/runtime.nim#L16 |
07:20:38 | Araq | mixin ql_row_hack |
07:21:07 | FromGitter | <barcharcraz> runtime.nim is actually not used :blush: |
07:21:54 | FromGitter | <barcharcraz> and I figured that out by the time I got to the test code |
07:22:33 | FromGitter | <barcharcraz> https://github.com/barcharcraz/nimql/blob/master/src/nimql/frontend/sqlite.nim |
07:22:47 | FromGitter | <barcharcraz> that's the code for the "library" part |
07:23:07 | * | ftsf_ quit (Remote host closed the connection) |
07:23:23 | Araq | ah sorry |
07:23:55 | FromGitter | <barcharcraz> cmdline.nim is the code generator |
07:24:18 | FromGitter | <barcharcraz> and .nimql/metadata.db is where all the fun info about your queries is stored |
07:24:42 | FromGitter | <barcharcraz> including a mapping between sql types and native nim types |
07:24:54 | FromGitter | <barcharcraz> an interesting idea would be to use that mapping in reverse for stored procedures |
07:25:44 | * | bjz joined #nim |
07:29:39 | Araq | you don't need a database to cache these results, use the last argument to staticExec instead :-) |
07:30:12 | Araq | then it works out of the box with --forceBuild |
07:30:41 | * | adeohluwa quit (Ping timeout: 255 seconds) |
07:31:43 | * | adeohluwa joined #nim |
07:33:38 | FromGitter | <barcharcraz> the cache is there anyway |
07:33:41 | FromGitter | <barcharcraz> it does other things |
07:34:19 | * | Kingsquee joined #nim |
07:35:10 | FromGitter | <barcharcraz> and the command line tool can create it as well |
07:37:29 | FromGitter | <barcharcraz> I want to have user defined type overrides that are specific to a table and column, the metadata db lets me do fun things like joining those overrides to sqlite's system table |
07:45:57 | Araq | can you give an example? |
07:51:11 | * | rokups joined #nim |
07:57:15 | * | yglukhov joined #nim |
07:59:41 | * | yglukhov_ joined #nim |
07:59:41 | * | yglukhov quit (Read error: Connection reset by peer) |
08:06:13 | FromGitter | <barcharcraz> select * from some_metadata_table natural join pragma_table_info("idk_something") |
08:07:35 | Araq | yes, that is a metadata join. unfortunately I still don't know what it is good for. :-) |
08:07:51 | FromGitter | <barcharcraz> yeah I'm not sure, not done the overrides yet |
08:08:21 | FromGitter | <barcharcraz> I like being able to easily see all the state and collected info in the database though |
08:18:26 | * | unlaudable joined #nim |
08:21:59 | * | adeohluwa quit (Ping timeout: 264 seconds) |
08:24:14 | * | unlaudable quit (Ping timeout: 255 seconds) |
08:29:39 | * | adeohluwa joined #nim |
08:36:48 | * | unlaudable joined #nim |
08:40:09 | * | unlaudable quit (Read error: Connection reset by peer) |
08:40:44 | * | bjz_ joined #nim |
08:42:12 | * | bjz quit (Ping timeout: 256 seconds) |
08:45:42 | * | Andris_zbx joined #nim |
08:51:59 | * | unlaudable joined #nim |
08:57:40 | * | unlaudable quit (Read error: Connection reset by peer) |
09:07:26 | * | PMunch joined #nim |
09:19:48 | * | sz0 quit (Quit: Connection closed for inactivity) |
09:21:08 | * | adeohluwa quit (Ping timeout: 245 seconds) |
09:22:05 | * | couven92 joined #nim |
09:22:16 | * | sz0 joined #nim |
09:22:30 | * | Parashurama joined #nim |
09:22:52 | Parashurama | Hey! |
09:23:39 | Parashurama | Araq & others: Would there be any interest in a cpuinfo module in stdlib? |
09:24:44 | Parashurama | the idea is to have a serie of const defining which processor extensions are supported. |
09:25:04 | Araq | we have cpuinfo.nim |
09:25:22 | Parashurama | generated during compiler installation, either with __cpuid or cat /proc/cpuinfo |
09:25:30 | Parashurama | we do? I will have a look |
09:25:53 | Araq | "This module implements procs to determine the number of CPUs / cores." |
09:26:14 | Araq | it's still small, so we could add your ideas here |
09:26:37 | Parashurama | Well that's convenient. |
09:27:04 | Araq | I also wanted to write a "gpuinfo" module once :-) |
09:28:35 | Parashurama | That would be useful for opengl, but probably tricky to do, with having no builtin way to query GPU capability. on linux tou need glxinfo, on windows/MAC OS ??? |
09:30:31 | Parashurama | I also would like to add SIMD/SSE/NEON support as a separate, that would make a huge module. |
09:30:44 | Parashurama | *separate module |
09:32:05 | Parashurama | But that will likely come later, as this will require quite a bit of work. |
09:34:35 | * | unlaudable joined #nim |
09:38:57 | Araq | it's part of opencl |
09:39:06 | * | unlaudable quit (Ping timeout: 240 seconds) |
09:39:22 | Parashurama | Well only if you have it installed :) |
09:48:00 | * | yglukhov_ quit (Remote host closed the connection) |
09:51:24 | * | unlaudable joined #nim |
09:51:38 | * | unlaudable quit (Read error: Connection reset by peer) |
09:55:38 | Araq | ah fuck, I broke Nimble |
10:03:06 | * | yglukhov joined #nim |
10:33:32 | * | bjz joined #nim |
10:34:49 | * | bjz_ quit (Ping timeout: 240 seconds) |
10:50:18 | FromGitter | <andreaferretti> there are some helpers for GPU info here https://github.com/unicredit/nimcl |
10:50:25 | FromGitter | <andreaferretti> not much, though |
10:50:34 | FromGitter | <andreaferretti> I did not have the time to work on this lately |
10:51:33 | * | yglukhov quit (Remote host closed the connection) |
10:56:34 | Araq | I am working on some massive codegen changes affecting name mangling and so would welcome help in testing |
10:57:06 | FromGitter | <andreaferretti> what kind of help? |
10:57:18 | Araq | test all your packages with it :P |
10:57:20 | FromGitter | <andreaferretti> I do not have time today but could do something tomorrow |
10:57:27 | FromGitter | <andreaferretti> ok, sure! |
10:57:28 | Araq | good because I'm not done yet |
11:00:06 | * | vitalyx joined #nim |
11:01:59 | Parashurama | give a shout when it is ready. I'm available for most of the day. |
11:03:05 | Araq | btw want to fix another compiler bug? :-) |
11:03:11 | Araq | got hundreds of these |
11:04:27 | Parashurama | Well, I'm working on something else at the moment, but give the reference and i will check it out later. |
11:05:11 | rokups | codegen changes? while at it please consider c++ virtual function overriding so that accidental roadblocks for future work do not pop up :p |
11:09:27 | Araq | rokups: not sure I can sneak in a patch for that :P |
11:09:29 | * | yglukhov joined #nim |
11:10:40 | rokups | not asking for patch, just for keeping future plans in mind ;) |
11:20:37 | * | confundus joined #nim |
11:26:51 | * | yglukhov quit (Remote host closed the connection) |
11:29:49 | * | sz0 quit (Quit: Connection closed for inactivity) |
11:40:25 | Araq | oh god |
11:40:33 | Araq | https://github.com/nim-lang/Nim/issues/5020 why have missed this? |
11:40:47 | Araq | somebody make a PR out of this. quickly. |
11:47:20 | rokups | person who implemented that please dliver your fingers right here for us to cut them off. |
11:48:39 | * | yglukhov joined #nim |
11:51:13 | rokups | people on reddit are not impressed by nim's stdlib. they have a point tbh.. |
11:52:54 | PMunch | Wasn't that one of the things that was mentioned for the summer project thingamajig? |
11:53:09 | Araq | yeah yeah I know. I even agree now. |
11:54:48 | * | vitalyx quit (Ping timeout: 259 seconds) |
12:03:56 | * | Snircle joined #nim |
12:08:50 | * | confundus quit (Quit: confundus) |
12:16:29 | * | stisa joined #nim |
12:17:40 | Araq | rokups: why don't you save FP registers? does that mean one cannot use FP with coroutines? |
12:25:57 | * | sz0 joined #nim |
12:35:30 | * | yglukhov quit (Remote host closed the connection) |
12:45:50 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
12:49:57 | * | confundus joined #nim |
12:52:13 | * | Vladar joined #nim |
12:58:09 | FromGitter | <dom96> rokups: link? |
13:00:45 | * | hendi joined #nim |
13:02:02 | rokups | Araq: because setjmp/longjmp code in musl libc did not save them. i think it should be mostly ok as long as related floating point operations do not have suspend() somewhere in the middle. i should test that though. |
13:02:28 | rokups | dom96: it was a while ago idk, not gonna search :p |
13:02:44 | Araq | for windows xmm0-xmm5 must be preserved according to https://msdn.microsoft.com/en-us/library/9z1stfyw.aspx |
13:02:44 | Araq | https://github.com/JuliaLang/julia/blob/master/src/support/_setjmp.win64.S |
13:02:51 | Araq | is what Julia uses |
13:03:26 | Araq | might not be required for Posix targets though |
13:03:39 | Araq | and so musl lacks it |
13:06:37 | * | zevlg joined #nim |
13:06:41 | rokups | Araq: cool, ill copy those, license is compatible. however problem is broken alignment pragma. movaps needs target to be aligned properly and there is no way to force it currently. thats why using jumps from setjmp.h crashes on mingw64. |
13:07:48 | Araq | so use .codegenDecl as a workaround |
13:08:30 | Araq | or insert dummy fields to get the alignment ah but's 16byte aligned |
13:08:41 | Araq | and there is no 16byte wide type, pita |
13:10:19 | rokups | i tried inserting dummy stuff, didnt work. something somehow causes data to be 8-byte aligned on x64. well probably it is a proper alignment in most cases. its just that this fpu stuff needs 16 byte alignment |
13:11:04 | * | Gilga quit (Ping timeout: 258 seconds) |
13:11:32 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:12:20 | Araq | 16b alignment requirements shouldn't exist in a world of cache misses |
13:12:20 | * | yglukhov joined #nim |
13:13:56 | * | bjz joined #nim |
13:15:02 | rokups | tried reasoning with cpu, its convinced otherwise ^_^ |
13:19:14 | zevlg | nim complains about formfeed(0xc0) character in code, should not it treat it silently like something newline-alike ? |
13:19:35 | zevlg | error msg is: Error: invalid token: ^L (\12) |
13:19:58 | zevlg | s/0xc0/0x0c |
13:22:07 | Araq | zevlg: no, get rid of fromfeeds |
13:22:52 | Araq | I have only seen those in GNU sources showing up as ugly square boxes, no thanks |
13:25:14 | zevlg | on problem, but what is the idiomatic construction for page breaks in nim? maybe some specially crafted commentary string, or one should decide for his own? |
13:27:44 | FromGitter | <andreaferretti> page breaks? |
13:28:07 | * | zachcarter quit (Quit: zachcarter) |
13:28:20 | Araq | what's a page break? should the compiler also beep when it encounters the ascii bell? |
13:28:21 | zevlg | andreaferretti: some sign to logically split parts of the code |
13:28:38 | zevlg | compiler normally just ignores them |
13:28:55 | zevlg | but they are pretty handy for code navigation |
13:30:37 | Araq | how so? it's entirely editor specific and most editors don't handle them at all. |
13:31:21 | Araq | Nim source code is not composed of pages. Nothing is. The usenet got superseeded by the internet. |
13:33:38 | zevlg | 'pages' is historical word, pages in code are actually "sections". Normally code is organized as one section -- one file, but sometimes sections are too small to split them into files. That is exactly where "section split" character is handy |
13:33:53 | zevlg | no one is forced to use them |
13:35:45 | FromGitter | <andreaferretti> this is the first time I hear about putting page breaks in code |
13:37:39 | FromGitter | <Varriount> zevlg: Why not just use a comment that's a line entirely composed of "+" or "#" or another symbol? |
13:37:44 | Araq | zevlg: use instead #\ßf |
13:37:59 | Araq | well the "page break" after the '#' comment sign |
13:38:09 | Araq | I cannot type a page break on this machine. |
13:38:54 | Araq | maybe I copy one from a floppy :P |
13:39:04 | zevlg | great! # ^L does the job :) |
13:39:35 | zevlg | andreaferretti: bsd/linux/etc code is full of them |
13:39:57 | Araq | yeah I can imagine :-) |
13:40:23 | zevlg | handy to print code in sections :) |
13:40:27 | zevlg | on printer |
13:40:35 | Araq | it's also full of C code with pre-ansi function declarations |
13:43:15 | zevlg | heh, "# ^L" is not treated as page-break by editor/printer .. ok, i'll try to accustomize to nim-style page breaks |
13:43:37 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:43:41 | * | yglukhov quit (Remote host closed the connection) |
13:44:16 | * | yglukhov joined #nim |
13:48:33 | * | yglukhov quit (Ping timeout: 252 seconds) |
13:48:53 | FromGitter | <andreaferretti> it is also the *second* time I hear about printing code :-P |
13:49:03 | FromGitter | <andreaferretti> (oddly enough, not the first one) |
13:49:18 | PMunch | Why would you print code? |
13:49:36 | PMunch | Other than to get around old US weapon export laws :P |
13:49:46 | FromGitter | <andreaferretti> :-D |
13:51:41 | zevlg | PMunch: to read it while traveling by train :) |
13:51:44 | * | vlad1777d joined #nim |
13:52:12 | PMunch | Hmm, I guess.. Still would prefer a lap-top or kindle though. |
13:53:27 | zevlg | I'm trying not to use digital devices too much, old school paper is better |
13:58:09 | * | stisa quit (Ping timeout: 240 seconds) |
13:59:23 | * | stisa joined #nim |
14:02:06 | Araq | paper? what? |
14:02:27 | Araq | I stopped printing code after I had more than 1000 lines of code or something |
14:02:41 | * | confundus quit (Quit: confundus) |
14:03:01 | Araq | in fact, I noticed after 30 pages it's just not viable. |
14:08:09 | * | stisa quit (Ping timeout: 240 seconds) |
14:09:03 | * | yglukhov joined #nim |
14:09:10 | * | stisa joined #nim |
14:13:13 | * | zachcarter joined #nim |
14:15:07 | * | stisa2 joined #nim |
14:18:09 | * | stisa quit (Ping timeout: 240 seconds) |
14:25:41 | FromGitter | <martinium> old school paper is awesome but not the best for programming |
14:26:52 | FromGitter | <martinium> there was a study that those of us who grew up with paper based media/books/newspapers etc retain information better when reading from paper formats. Supposedly the newer generations learn just as well with digital media formats since they’ve grown up with it so to speak. |
14:27:16 | * | vitalyx joined #nim |
14:38:17 | * | nsf quit (Quit: WeeChat 1.7) |
14:43:35 | PMunch | Hmm, what's the best way to have a buffer of the 20 last values of a variable |
14:44:02 | PMunch | I have a webserver set up with nim and a services that pushes data to it. I want to show the last 20 pushed values |
14:44:21 | Vladar | sequence, I guess? |
14:44:30 | Araq | a queue? |
14:45:03 | Araq | when you have more than 20 entries pop and discard that |
14:45:22 | PMunch | Ah, perfect :) |
14:45:24 | Araq | queue still doesn't have to move memory all the time because it's awesome |
14:45:50 | PMunch | Well, I will probably just initialize the queue with 20 elements and always add and pop |
14:46:06 | Araq | or that, yes. |
14:55:41 | * | zachcarter quit (Quit: zachcarter) |
14:59:48 | * | sz0 quit (Quit: Connection closed for inactivity) |
15:11:28 | * | handlex joined #nim |
15:13:24 | * | arnetheduck quit (Ping timeout: 276 seconds) |
15:22:23 | * | stisa2 quit (Ping timeout: 245 seconds) |
15:22:36 | * | stisa joined #nim |
15:32:18 | * | fredrik92 joined #nim |
15:34:12 | * | handlex quit (Quit: handlex) |
15:35:48 | * | couven92 quit (Ping timeout: 252 seconds) |
15:41:27 | rokups | Araq: does codegenDecl work on object fields? it wont let me use it there |
15:41:58 | * | Andris_zbx quit (Read error: Connection reset by peer) |
15:46:21 | * | yglukhov quit (Remote host closed the connection) |
15:47:27 | Araq | you need to use it for the variables that you declare of this type |
15:49:06 | rokups | since JmpBuf is a member of ref type its problematic. alignment gets lapped on to pointer of that ref. totally useless |
15:50:26 | Araq | oh if its a ref you can maybe change Nim's memory manager |
15:50:35 | Araq | MemAlign = 8 |
15:50:42 | Araq | in mmdisp or something |
15:50:50 | rokups | will try |
15:51:55 | * | handlex joined #nim |
15:55:37 | * | pregressive joined #nim |
15:58:44 | * | pregressive quit (Read error: Connection reset by peer) |
15:58:56 | * | pregressive joined #nim |
15:58:59 | rokups | does not help |
15:59:24 | Araq | it helps when also add manual 'align' fields in the object |
15:59:40 | * | fredrik92 is now known as couven92 |
15:59:42 | Araq | so that the jmp_buf offset is actually aligned at 16 bytes |
16:00:47 | * | PMunch quit (Quit: leaving) |
16:02:02 | * | handlex quit (Quit: handlex) |
16:02:23 | rokups | tried adding 64bit int before that struct. it gets pushed down by 16 bytes. no idea why |
16:03:09 | rokups | tried with MemAlign=8 and MemAlign=16 - same thing |
16:05:07 | rokups | there surely must be a magic command to build modified nimcache right? |
16:06:02 | * | yglukhov joined #nim |
16:06:27 | Araq | --forceBuild |
16:07:57 | rokups | Araq: no i mean manually modifying generated source in nimcache and building that (as proof of concept for a fix) |
16:08:27 | couven92 | Hmm... I get an out of memory exception when trying to koch boot nim on my RaspberryPi 3 |
16:09:40 | rokups | looks like cross compiling section is exactly what i need |
16:10:51 | couven92 | But I have successfully managed to compile nim from csource... Is that good enough? |
16:11:42 | rokups | couven92: csources contain older version probably |
16:11:47 | rokups | no idea how old |
16:19:37 | * | nsf joined #nim |
16:20:58 | Araq | nim -v tells you how old |
16:23:39 | * | Trustable joined #nim |
16:24:18 | * | smt joined #nim |
16:39:04 | * | krux02 joined #nim |
16:40:45 | Parashurama | dom96: can you take a look at: https://github.com/nim-lang/zip/pull/17. |
16:42:01 | Parashurama | I don't know if we should raise an error if the input is invalid. |
16:42:44 | krux02 | Araq: feature request, would it be possible to provide hash and `==` for both NimSym and NimNode? I don't know about the internals of NimSym, but I doubt it would be much of work |
16:43:12 | krux02 | or better said would you accept a pull request, when I would provide hash functions for the types in the macros module? |
16:43:34 | FromGitter | <andreaferretti> I did not know about the zip library |
16:43:45 | FromGitter | <andreaferretti> can it be used to decompress .gz files? |
16:44:14 | Parashurama | not as the moment, but there is a zip file module |
16:44:46 | Parashurama | It should be *relatively* easy to add if you need it. |
16:48:41 | Parashurama | I already took a look some weeks ago. python stdlib has a good example of implemenation of gzip files module. |
16:50:22 | Parashurama | btw The SSL certificat for https://nimpkgdir.firelet.net/ (Nim package directory) is invalid apparently. |
16:51:41 | euantor | https://nimble.directory/ |
16:52:21 | Araq | krux02: meh von mir aus. |
16:52:23 | euantor | I think the https://nimpkgdir.firelet.net/ site is the same site |
16:52:31 | federico3 | https://nimpkgdir.firelet.net/ is the dev/demo version |
16:52:44 | Parashurama | Okay, thanks. |
16:52:45 | Araq | aber mach mal ein besseres random.nim, gibt hier immer nur issues und niemand tut was |
16:52:50 | euantor | Thought so :) |
16:54:42 | Parashurama | andreaferretti: If you really need a gzip module I could try to make an initial implementation this weekend. |
16:57:08 | FromGitter | <andreaferretti> it would be a nice to have, but nothing I really immediately :-) |
16:57:12 | FromGitter | <andreaferretti> I had seen this |
16:57:14 | FromGitter | <andreaferretti> https://github.com/nim-lang/zip/blob/master/tests/zlibtests.nim#L17 |
16:57:16 | dom96 | Parashurama: I think we should |
16:57:27 | FromGitter | <andreaferretti> and I had assumed there was already some support |
16:57:33 | dom96 | Silently ignoring errors is almost always bad. |
16:57:47 | krux02 | also random.nim wäre gar nicht mal so schwer, ich habe schon eine initiale version hier liegen |
16:58:05 | krux02 | das mit dem hash ist schon schwerer |
16:58:15 | dom96 | Also, why the German? |
16:59:36 | Parashurama | dom96: Okay, then I will update the PR |
17:01:01 | Parashurama | andreaferretti: The code shows basic gzipped data stream with GZIP header/footer not a gzipped file with full GZIP header struct. |
17:05:55 | * | handlex joined #nim |
17:07:22 | * | handlex quit (Client Quit) |
17:08:28 | * | brson joined #nim |
17:09:44 | FromGitter | <andreaferretti> ok, I see |
17:10:01 | FromGitter | <andreaferretti> got to go, bye |
17:25:19 | * | yglukhov quit (Remote host closed the connection) |
17:30:21 | * | ibk quit (Quit: Connection closed for inactivity) |
17:43:28 | FromGitter | <Varriount> krux02: Yay, my German class is actually useful |
17:44:12 | krux02 | dom96: see us using german made someone happy :P |
17:45:49 | FromGitter | <Varriount> krux02: Considering I have three me German classes to take, I need all the practice I can get |
17:47:00 | * | pregressive quit (Read error: Connection reset by peer) |
17:47:10 | krux02 | I don't I don't get credit for taking German classes. Instead all classes in my university are in English |
17:47:12 | * | pregressive joined #nim |
17:51:50 | * | handlex joined #nim |
17:52:12 | * | handlex quit (Client Quit) |
17:57:37 | * | Sentreen quit (Read error: Connection reset by peer) |
17:58:24 | * | Sentreen joined #nim |
18:01:33 | * | couven92 quit (Ping timeout: 252 seconds) |
18:01:40 | FromGitter | <Varriount> krux02: My university requires we take a 202-level foreign language course. |
18:01:41 | * | couven92 joined #nim |
18:02:01 | FromGitter | <Varriount> Which of course requires 201, 102, and 101 courses as prerequisites. |
18:06:36 | * | stisa quit (Ping timeout: 240 seconds) |
18:06:53 | * | nsf quit (Quit: WeeChat 1.7) |
18:07:21 | * | stisa joined #nim |
18:20:10 | * | yglukhov joined #nim |
18:23:57 | krux02 | Araq: hashes for nim symbols is easy (hashes.hashIgnoreStyle($sym)) but hash maps don't work on the vm |
18:24:03 | krux02 | I just tested it |
18:24:08 | krux02 | it doesn't compile |
18:25:55 | Araq | I told you how to debug the VM :-) |
18:31:38 | dom96 | Araq: Do we want overloading based on return value in the future? https://github.com/nim-lang/Nim/issues/1070 |
18:33:55 | Araq | no. |
18:34:58 | dom96 | shall we close it then? |
18:35:20 | Araq | we don't have to close every feature request but FRs like |
18:35:32 | Araq | "I just read about AOP, here are links, Nim should do that" |
18:36:00 | Araq | are not helpful. |
18:37:12 | Araq | and in general the number of issues needs to go down. today I found a gem hidden in 800+ issues |
18:37:47 | Araq | also I think I might not accept "documentation" bug reports anymore. |
18:37:58 | Araq | the website has an edit button, you don't like it, edit it. |
18:39:07 | * | kulelu88 joined #nim |
18:57:57 | dom96 | just tag them appropriately |
19:03:12 | * | yglukhov quit (Remote host closed the connection) |
19:03:14 | Araq | you might as well "Just fix them" |
19:03:28 | Araq | *as well say |
19:03:37 | Araq | or "Just do something" |
19:04:23 | Araq | if I fix 5 bugs each day (and I don't), it takes 160 days to fix them. |
19:05:11 | federico3 | unfortunately github cannot display instructions to people opening an issue |
19:05:37 | * | yglukhov joined #nim |
19:08:08 | demi- | documentation bugs should be fixable by anyone -- unless it is a case of ambiguous behavior where neither the docs nor the code is clear about what is the correct thing to do |
19:10:02 | subsetpark | So my understanding is that in C, openArrays are represented as a pointer to the array + an int representing its length, is that correct? |
19:10:04 | * | yglukhov quit (Ping timeout: 256 seconds) |
19:10:27 | Parashurama | yep: both passed as separate arguments |
19:10:31 | Araq | tagging the untagged issues is half a day of work. |
19:10:36 | Araq | any volunteers? |
19:10:45 | subsetpark | Parashurama: how would you pass in a seq, then? |
19:10:59 | Araq | subsetpark: you let the compiler handle it |
19:11:12 | Araq | it knows how to pass a seq to an openarray |
19:11:16 | Parashurama | Araq: Well some are easy to tag, other not so much. |
19:11:30 | Araq | so ask me when you don't know. |
19:11:33 | subsetpark | Araq: I am calling a compiled dynlib from Python, using the Python ctypes FFI |
19:11:50 | subsetpark | so I need to translate the Nim argument types into c types |
19:12:13 | Araq | well ok but then Python can pass the pointer, length combination somehow |
19:12:15 | Parashurama | Arq: I know that sometimes i would like to pass a custom type (ie seq/array like ) as openArray, I haven't found a way yet. |
19:12:31 | subsetpark | Araq, it definitely can :) I just need to know what the combination is |
19:12:40 | subsetpark | Is it a pointer to the first element of the seq, plus the length? |
19:12:54 | Araq | yes |
19:13:05 | Araq | but what 'seq'? |
19:13:14 | Araq | I thought it's called 'list' in Python. |
19:13:15 | dom96 | Araq: All I'm saying is: instead of closing the issue that you find to be a documentation issue, label it as "Documentation" |
19:13:22 | subsetpark | It is |
19:14:07 | Parashurama | But keep in mind that in python everything is an object so an int is something PyIntObject |
19:14:27 | Parashurama | and usually allocated on the heap |
19:14:36 | subsetpark | that's ok, ctypes takes care of that bit |
19:16:13 | Parashurama | Okay no problem then |
19:16:13 | Parashurama | look at cffi too for python it seems to have a bit less overhead |
19:16:14 | Parashurama | esspecially on PyPy |
19:16:42 | subsetpark | Yes, in the past I've taken a look at cffi - I don't think it's able to easily deal with the nim headers |
19:17:01 | subsetpark | Since nim-generated header files make reference to the nim runtime headers |
19:17:50 | Parashurama | As far i know they are quite able to parse full featured C headers with a few caveats. |
19:18:08 | * | hendi quit (Quit: Connection closed for inactivity) |
19:19:07 | Parashurama | I remember there were problems with bitfields, although that was about a year and a half ago. |
19:19:36 | Parashurama | Araq: I know that sometimes i would like to pass a custom type (ie seq/array like ) as openArray, I haven't found a way yet. do you have any suggestion? |
19:21:58 | Araq | no, there is no way except hacking it together with .emit :-( |
19:22:22 | Araq | even 'cast' is not aware of the unpacked tuple nature of openArrays |
19:23:18 | Parashurama | I think i tried something with exportc but don't remember if i could export a proc with openArray param |
19:24:37 | Parashurama | Also would there an interest in stdlib for context manager macro ie: |
19:24:48 | Parashurama | with objectA, objectB: |
19:24:53 | Parashurama | do stuff |
19:25:20 | * | vlad1777d quit (Quit: Leaving) |
19:25:48 | Parashurama | and with calling 'set_state' and 'unset_state' procs on each objects. |
19:26:47 | subsetpark | Parashurama: the last part of the openArray via C question is - if you're passing to a proc(a, b: openArray[Foo]) - are the arguments simply (*Foo, int, *Foo, int) ? |
19:27:46 | Parashurama | good question. you can yourself by looking at the generated C code in nimcache/your_test_file.c. |
19:27:51 | * | couven92 quit (Quit: Client disconnecting) |
19:27:52 | Parashurama | *check |
19:28:17 | Araq | Parashurama: you idea with 'exportc' should work |
19:28:39 | Araq | exportc the openarray version, importc it with pointer+length pair and call it :-) |
19:28:55 | subsetpark | It looks like the answer is 'yes' |
19:29:00 | Parashurama | Araq: That's what I was talking about. |
19:29:16 | * | yglukhov joined #nim |
19:29:22 | Araq | subsetpark: no, it's NI (Nim int) which is in nimbase.h and most of the time 'long' |
19:29:47 | Parashurama | Araq: about the `with` macro i talked above. what do you thing |
19:29:55 | Parashurama | *think |
19:30:20 | subsetpark | Araq: that part I know, I was just confirming that two open arrays simply expand to (pointer, NI, pointer, NI) |
19:30:32 | Araq | we had this in the language as 'using' statement |
19:30:52 | Araq | Parashurama: it was unworkable, IMO and replaced by the .this: self feature |
19:31:04 | Araq | subsetpark: sure. |
19:31:52 | Parashurama | Araq: I don't think that's what I'm talking about. It's something called in python a context manager. |
19:32:18 | Araq | oh, so not VB/Pascal's with, but Python's with, got it |
19:32:42 | Araq | that's just an ordinary template in Nim which uses try..finally |
19:33:03 | Araq | and this way we don't have to agree on an enter/exit naming convention :P |
19:33:28 | Araq | withLock x: ... withDir dir: ... withFile f: ... |
19:34:00 | Araq | Nim is much better than Python at this. IMO. |
19:35:11 | Parashurama | Nice, The worst part is that I already use WithFile in the past but completely forgot about it. |
19:35:17 | Parashurama | *used |
19:35:28 | Parashurama | thanks :) |
19:36:04 | Araq | and 'withDir' should be added to ospaths.nim |
19:36:10 | Araq | use it quite often |
19:36:18 | Parashurama | Nim is really a huge language. although that's not necessarily a bad thing. |
19:36:29 | Parashurama | An easy PR then |
19:36:39 | Parashurama | do you want to do it? |
19:36:46 | Parashurama | or should I? |
19:37:19 | Araq | could be problematic |
19:37:40 | Parashurama | Yeah I figured there could be some name conflits |
19:37:50 | Araq | could bite us when the code already defines 'withDir' on its own |
19:38:10 | * | couven92 joined #nim |
19:38:32 | Parashurama | And we don't have weak symbols (which may be good thing) :) |
19:39:06 | * | yglukhov quit (Remote host closed the connection) |
19:42:26 | * | yglukhov joined #nim |
19:44:02 | Araq | weak symbols? |
19:44:07 | Araq | we have 'mixin'. |
19:45:16 | Parashurama | I not sure exactly what mixin does, but in C, weak symbols can be replaced by variable/function with the same later in the file. |
19:45:51 | Parashurama | It's a gcc extension, but MSVC probably has similar pragma |
19:46:59 | Parashurama | It may not be compatible with symbol overloading. |
19:57:08 | Araq | oh yeah we don't have that |
19:58:00 | Parashurama | It could be useful, but maybe not enough. It could lead to some annoying bugs |
19:58:41 | demi- | Araq: using the FFI would it be possible to call mangled C symbol names? |
19:59:13 | Parashurama | use exportc pragma to, directly export cnames |
19:59:55 | demi- | Parashurama: was that at me? |
20:00:04 | Parashurama | yeah sorry |
20:00:31 | Parashurama | I'm doing a few things at once :) |
20:01:00 | demi- | that isn't what i'm asking, I want to call a C function based on the mangled C symbol name from nim -- wondering if that is possible with the FFI interface or i'd have to make a trampoline to do that |
20:01:37 | * | adeohluwa joined #nim |
20:01:48 | * | bjz joined #nim |
20:02:22 | Parashurama | If you are sure that the exportc prgama can't help you lookit up in the nim manual, then yeah |
20:02:29 | * | Arrrr1 joined #nim |
20:02:57 | demi- | i'm not exporting anything |
20:03:04 | Araq | you should |
20:03:07 | Parashurama | the cname is mangled not really easy to guess it is based on the filename, and something else I don't remember. |
20:03:15 | Araq | otherwise Nim is allowed to remove your proc |
20:03:24 | Parashurama | There is also that |
20:03:31 | Araq | Parashurama: recently it's based on the type signature |
20:03:41 | Araq | it's quite stable but don't rely on it please |
20:03:56 | Parashurama | following you work on sighashes i guess? |
20:04:02 | Parashurama | *your |
20:04:16 | Araq | demi-: exportc is not only about the generated C name, it also tells Nim to not optimize it away etc |
20:04:31 | Araq | Parashurama: yup |
20:04:58 | * | Arrrr1 quit (Changing host) |
20:04:58 | * | Arrrr1 joined #nim |
20:05:17 | Parashurama | Araq: Since then compile time are quite a bit faster. |
20:05:28 | * | Arrrr1 is now known as Arrrrr |
20:05:40 | * | Arrrrr is now known as Arrrr |
20:05:40 | Parashurama | or rather partial recompile time |
20:06:33 | * | nsf joined #nim |
20:07:05 | demi- | ah i see |
20:13:48 | subsetpark | ai ai! How do I interpret a seq when returned to C? |
20:14:45 | Parashurama | you mean returning from C? |
20:17:11 | * | couven92 quit (Read error: Connection reset by peer) |
20:17:20 | subsetpark | no, really I mean returning from Nim to Python... |
20:17:27 | * | couven92 joined #nim |
20:19:04 | Parashurama | The standard way would be returning a pointer to data and passing a ptr int param to return size. |
20:19:55 | Parashurama | the data being an allocated buffer with alloc or create or a sequence[0].addr |
20:20:21 | Parashurama | but keep in mind that if there no more reference to your seq, the Gc will destroy it. |
20:21:14 | Parashurama | You could store it in a global, or play with GC_ref, GC_unref, that entail storing the seq ptr somewhere |
20:21:40 | * | couven92 quit (Client Quit) |
20:21:42 | Parashurama | *but that means |
20:21:52 | * | yglukhov quit (Remote host closed the connection) |
20:22:12 | * | couven92 joined #nim |
20:24:25 | * | yglukhov joined #nim |
20:27:10 | * | yglukhov quit (Remote host closed the connection) |
20:28:09 | * | adeohluwa quit (Ping timeout: 240 seconds) |
20:28:27 | * | yglukhov joined #nim |
20:32:07 | * | rokups quit (Quit: Connection closed for inactivity) |
20:35:48 | * | corecode left #nim (#nim) |
20:42:25 | * | handlex joined #nim |
20:43:05 | * | handlex quit (Client Quit) |
20:43:21 | * | Matthias247 joined #nim |
20:49:13 | * | Matthias247 quit (Read error: Connection reset by peer) |
20:50:31 | * | Matthias247 joined #nim |
21:02:43 | * | yglukhov quit (Remote host closed the connection) |
21:03:04 | * | zachcarter joined #nim |
21:16:55 | * | yglukhov joined #nim |
21:19:52 | Araq | what should the file extension be for Nim's new "mapping" file? |
21:20:14 | Parashurama | .desc maybe? |
21:20:25 | Araq | it contains the (Nim identifier, line information, produced C name) information |
21:20:30 | Araq | for debuggers |
21:20:46 | Araq | "ndi" (Nim debug info) ? |
21:21:19 | Parashurama | .ndi is alright |
21:21:53 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:27:11 | * | Arrrr quit (Quit: Leaving.) |
21:37:50 | krux02 | Araq: I got the cause, why Tables don't work on the VM |
21:39:46 | krux02 | took me several hours to find that out. |
21:39:58 | krux02 | it least it felt that way |
21:41:48 | * | yglukhov quit (Remote host closed the connection) |
21:42:10 | dom96 | looks like nothing else uses it as well which is an added bonus http://filext.com/file-extension/ndi |
21:43:25 | subsetpark | If I have a proc that accepts a sequence of objects, and I want to create a sequence of references to those objects, should I just: create a new seq, iterate through the objects, for each one { 1. declare a new var x: ref Foo; 2. new(x); 3. x[] = myObj } ? |
21:44:30 | * | yglukhov joined #nim |
21:44:44 | Parashurama | That seems like a sensible solution. |
21:45:30 | subsetpark | phew, ok |
21:45:35 | Parashurama | you could also use mitems iterator on seq[ref Foo] and do for x in sequence.mitems: |
21:45:48 | Parashurama | x[] = new() |
21:46:02 | Parashurama | sorry new(x) |
21:47:02 | subsetpark | oh, interesting, i haven't used mitems before |
21:54:33 | * | yglukhov quit (Remote host closed the connection) |
21:56:27 | dom96 | subsetpark: are those objects custom types? |
21:57:00 | dom96 | if so then you should just declare them as 'ref' in the first place. |
21:57:37 | subsetpark | it's a bit simpler to receive them as values, because they're coming from the Python FFI |
21:58:04 | subsetpark | so i'll put them on the stack to get into Nim and then allocate once i've crossed the barrier |
21:58:55 | Araq | subsetpark: I'd leave them as values |
21:59:19 | Araq | faster and can be as convenient when you know more Nim. or not. :-) |
21:59:42 | subsetpark | really, faster to pass a bunch of objects up and down the stack? |
22:00:10 | subsetpark | i'd have thought it was faster to keep them in one place and just have to pass around pointers |
22:03:43 | * | krux02 quit (Quit: Leaving) |
22:03:59 | * | chemist69 quit (Ping timeout: 255 seconds) |
22:04:19 | * | Vladar quit (Quit: Leaving) |
22:05:03 | Araq | if you do it right, they are not passed by copy "up and down" the stack |
22:05:06 | * | pregressive quit () |
22:06:01 | subsetpark | say more... |
22:06:47 | * | vlad1777d joined #nim |
22:08:52 | Parashurama | Araq: I took a look at https://github.com/nim-lang/Nim/issues/5296 |
22:09:24 | Parashurama | It seems likely to be a setjmp/longjmp problem, variable not declared as volatile. |
22:09:47 | Araq | yes I know |
22:09:57 | Araq | patch sempass2 if you like to fix it |
22:10:05 | Parashurama | subsetpark: you can declare a type as .{byref.} |
22:10:23 | Parashurama | Araq: will see what i can do. |
22:10:27 | Araq | the compiler is aware of this problem, it's just that the detection fails for edge cases |
22:10:31 | subsetpark | ah how interesting |
22:10:34 | Araq | the logic exists. |
22:10:49 | Parashurama | Ok. that should make it easier. |
22:11:23 | Araq | btw that part of the C spec is pretty messed up. |
22:11:51 | Araq | if the C compiler does inline a function, does that mean it needs to detect setjmp and annotate the variables 'volatile' on its own? I think so. |
22:12:16 | Araq | so why require 'volatile' at all if the compiler needs this analysis pass anyway? makes no sense. |
22:12:53 | Parashurama | good question. That probably why there is only libpng which use setjmp/longjmp for error handling directly. |
22:13:53 | Araq | not too mention that 'volatile' here has a different meaning than "used for memory mapped IO" |
22:14:34 | Parashurama | ah, C and its use of the same keywords for completely different things |
22:14:57 | Parashurama | :P |
22:15:23 | Araq | yup, let's conflate different concepts and reuse keywords to pretend to be a "small" language. |
22:18:32 | * | chemist69 joined #nim |
22:21:35 | * | nsf quit (Quit: WeeChat 1.7) |
22:24:29 | * | Trustable quit (Remote host closed the connection) |
22:29:14 | * | corecode joined #nim |
22:30:20 | * | corecode left #nim ("ERC (IRC client for Emacs 25.1.1)") |
22:38:52 | * | Kingsquee joined #nim |
22:49:57 | Parashurama | Araq: I'm making some small progress on volatile issue. I figured out exactly where the volatile flag is not set. sempass2.nim line770 |
22:50:26 | Parashurama | If I force it to yes it seems to flag all let, var variable as volatile which is not really what we want. |
22:51:10 | Parashurama | The problem is I see no way to figure out at variable init if a variable is used later in try block. |
22:56:34 | Parashurama | I'm done for the night. bye |
22:56:36 | * | Parashurama left #nim (#nim) |
23:00:30 | subsetpark | hm, compiler error |
23:02:58 | Araq | hu? so close... |
23:03:28 | subsetpark | Can't reproduce it minimally. Fails on declaring a struct with cdoubles. |
23:03:42 | subsetpark | https://www.irccloud.com/pastebin/J6eIRnUI/ |
23:06:12 | * | PMunch joined #nim |
23:16:33 | Araq | subsetpark: without a bug report I cannot do anything. |
23:17:31 | Araq | could be this: https://github.com/nim-lang/Nim/issues/5277 |
23:20:02 | PMunch | What's the best way, when making a macro, to use identifiers. I don't really want the identifiers to be available to the user after the macro is run, or for them to interfere with anything, but I need them for the code that the macro should output. |
23:20:51 | PMunch | Plus I need identifiers that don't really have to mean anything, they're just for referencing back to them later. Is there a way to create a random identifier? |
23:22:12 | dom96 | use gensym |
23:25:29 | * | stisa quit (Ping timeout: 240 seconds) |
23:25:33 | subsetpark | hm, is there a builtin to generate a seq of the natural numbers between `x` and `y`? |
23:25:51 | * | stisa joined #nim |
23:25:54 | Araq | sequtils.toSeq(x..y) |
23:26:01 | subsetpark | word up! |
23:26:16 | Araq | but it's an indication you write Python in Nim |
23:28:23 | subsetpark | ha, very well |
23:29:08 | dom96 | Interesting. Rust now uses cargo for its build system. |
23:29:58 | dom96 | huh, except that they still have a Python script called `x.py`. What's up with that? |
23:35:42 | Araq | dom96: ah but Nimble shouldn't use Nimscript :P |
23:36:30 | dom96 | I guess we can now get rid of koch in favour of Nimble? :P |
23:52:42 | subsetpark | So in this Nim code (being called from Python), I'm getting a lot of `out of memory` failures. This feels like I must be doing something wrong with the GC, and I'm assuming it's that values being passed in over the FFI are being GCed from Nim. Am I totally off base? |
23:58:21 | * | def-pri-pub joined #nim |