00:00:31 | * | jdhorwitz joined #nim |
00:00:41 | FromGitter | <data-man> One of the best Delphi libraries for work with InterBase/Firebird https://github.com/madorin/fibplus |
00:01:05 | * | marenz__ quit (Ping timeout: 240 seconds) |
00:01:35 | * | jjido joined #nim |
00:02:45 | skrylar | data-man: i'll put a star on it |
00:04:47 | skrylar | I've only used ActiveRecord and i think a very baby version of NHibernate, so I'm not too familiar with database CRUD |
00:04:47 | * | jdhorwitz quit (Ping timeout: 248 seconds) |
00:06:20 | * | yglukhov joined #nim |
00:07:59 | FromGitter | <data-man> @skrylar: I also did it. |
00:10:27 | * | yglukhov quit (Ping timeout: 240 seconds) |
00:11:01 | skrylar | haven't quite gotten to prepared statements and getting data back out |
00:18:31 | * | gokr quit (Ping timeout: 240 seconds) |
00:35:58 | * | yuken joined #nim |
00:36:01 | yuken | Hm. |
00:36:14 | yuken | Should I run Nim in a Linux VM just for a fresh environment, or just run it in Windows? |
00:37:20 | zolk3ri | or install linux and run nim there |
00:37:29 | yuken | ew no ;) |
00:37:37 | zolk3ri | :p |
00:37:40 | zolk3ri | bsd? |
00:37:47 | yuken | Nah. Dislike Linux for desktop use. |
00:37:48 | * | jdhorwitz joined #nim |
00:46:38 | * | SenasOzys_ quit (Read error: Connection reset by peer) |
00:47:10 | * | SenasOzys_ joined #nim |
01:07:11 | * | Calinou quit (Ping timeout: 248 seconds) |
01:07:15 | * | jinshil joined #nim |
01:11:40 | * | Calinou joined #nim |
01:13:26 | * | yglukhov joined #nim |
01:18:28 | * | yglukhov quit (Ping timeout: 268 seconds) |
01:23:11 | skrylar | so there are two calls, and the difference is whether memory is freed up automatically or not. i collapsed these in to the same call on nim's side, with an "autofree: bool = true" |
01:23:22 | skrylar | I'm hoping this isn't considered a sin |
01:28:57 | * | SenasOzys_ quit (Ping timeout: 240 seconds) |
01:29:36 | * | vlad1777d_ quit (Ping timeout: 248 seconds) |
01:34:45 | FromGitter | <Varriount> skrylar: Why wouldn't you want the memory freed automatically |
01:38:19 | * | zolk3ri quit (Remote host closed the connection) |
01:40:04 | skrylar | Varriount: I don't know. Historical reasons? I have it set to use that method automatically. |
01:40:44 | * | kalkin--- joined #nim |
01:44:01 | * | kalkin-- quit (Ping timeout: 248 seconds) |
01:49:51 | skrylar | https://github.com/Skrylar/firebird tossed it on the githubs |
02:01:01 | FromGitter | <ntdef> Hi friends, quick question about the C FFI; I'm on a mac trying to link to the GNU Sci LIbrary. I'm getting an error when I try to wrap C code with a `const` in the function signature |
02:01:34 | FromGitter | <ntdef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a0a4e7e505b630c05dc83fc] |
02:01:43 | FromGitter | <ntdef> anyone know how I can make these types match |
02:02:41 | * | couven92 quit (Ping timeout: 248 seconds) |
02:07:29 | FromGitter | <Varriount> @ntdef Could you Allie is the wrapper code? |
02:07:44 | FromGitter | <Varriount> *show |
02:07:56 | FromGitter | <ntdef> `````` |
02:08:41 | FromGitter | <ntdef> @Varriount here you go^ |
02:09:07 | FromGitter | <Varriount> @ntdef First try making the calling convention the same - use the cdecl pragma |
02:09:35 | FromGitter | <Varriount> Or whatever calling convention the C function uses. |
02:09:40 | skrylar | ntdef nim doesn't have a const :< |
02:09:40 | FromGitter | <ntdef> What does cdecl do? I tried looking it up in the docs, but it's not documented |
02:09:58 | skrylar | cdecl is supposed to specify C calling conventions. |
02:10:07 | FromGitter | <ntdef> So can nim not call functions with const? |
02:10:17 | skrylar | As opposed to say, nimcall. Although nim's default is *often* also cdecl, it's not required to be |
02:10:34 | skrylar | you can, you just have to remove the 'const' declarations and pinky promise not to modify the values |
02:10:49 | skrylar | or rather, const going IN to a function says THAT FUNCTION won't modify it, so losing the declaration is fine |
02:11:08 | FromGitter | <ntdef> hmm. adding cdecl didn't change anything |
02:11:11 | skrylar | if you are binding callbacks and losing const, well. pray. |
02:11:44 | FromGitter | <Varriount> @ntdef https://nim-lang.org/docs/manual.html#types-procedural-type |
02:11:59 | FromGitter | <Varriount> What about importcpp? |
02:12:15 | FromGitter | <Varriount> skrylar: ^ |
02:12:50 | FromGitter | <ntdef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a0a5122df09362e67059890] |
02:13:04 | FromGitter | <ntdef> I thought the GSL was in C anyway |
02:13:50 | skrylar | varriount: what about it? |
02:15:05 | FromGitter | <ntdef> skrylar how do I sidestep the const argument then? |
02:15:15 | FromGitter | <ntdef> supposing I pinky promise |
02:16:36 | skrylar | you just leave it out of the nim declaration, and call it like normal |
02:16:52 | FromGitter | <ntdef> the compiler won't let me leave it out :( |
02:17:08 | FromGitter | <ntdef> gsl_vector_printf is a function from a library I didn't write |
02:18:28 | skrylar | that error sounds like what happens if you tried to bind the const and non-const version of the same function |
02:19:21 | FromGitter | <ntdef> I've only got one bindign |
02:20:26 | skrylar | i couldn't say more without seeing the module. |
02:21:24 | skrylar | it shouldn't say NIMCALL in C wrapper stuff though. you might want to make sure there is a header pragma to tell nim where to find the method |
02:21:42 | skrylar | i don't know what happens with importc and no header declaration |
02:22:00 | skrylar | i think if nim thinks there isn't one it will try to emit one, which can collide with the actual definition from C |
02:22:22 | skrylar | because importc tells it to use a specific nonmangled name, and the lack of a header pragma leaves it ignorant that its supposed to be there |
02:22:30 | * | yglukhov joined #nim |
02:25:33 | FromGitter | <ntdef> oh crap you're right I think it was the header pragma |
02:25:52 | FromGitter | <ntdef> I'm able to compile now, although I get a runtime erroer |
02:26:35 | * | yglukhov quit (Ping timeout: 240 seconds) |
02:30:46 | * | Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com) |
02:30:57 | * | BitPuffin|osx quit (Ping timeout: 240 seconds) |
02:31:03 | FromGitter | <ntdef> skyrlar, thanks for your help |
02:47:26 | skrylar | there seems to be a lot of weird stuff in here. no idea how important those are |
02:47:35 | skrylar | converting dates between date objects and sql |
02:48:02 | skrylar | their initial example files are using sprintf and concatting queries, but the engine seems to support placeholders just fine |
02:48:37 | skrylar | If I just had to field a guess, and was trying to make an actually user-friendly system, i'd probably just nimize some of the Clipper APIs |
02:49:22 | skrylar | they're not actually that far off from activerecord et all |
02:49:41 | * | jdhorwitz quit (Ping timeout: 240 seconds) |
02:52:15 | FromGitter | <Varriount> skrylar: Still making that Firebase module? |
02:57:01 | * | endragor joined #nim |
03:01:21 | * | jjido quit (Ping timeout: 248 seconds) |
03:01:48 | * | chemist69 quit (Ping timeout: 240 seconds) |
03:12:55 | * | jdhorwitz joined #nim |
03:15:36 | * | chemist69 joined #nim |
03:42:19 | skrylar | Varriount: yup. taking a while |
03:42:40 | skrylar | have to cross reference the headers with other docs and piece through examples to figure out how this works |
03:56:54 | * | mr_yogurt joined #nim |
03:58:24 | * | rauss joined #nim |
04:07:44 | * | yglukhov joined #nim |
04:12:17 | * | yglukhov quit (Ping timeout: 260 seconds) |
04:12:30 | * | dddddd quit (Remote host closed the connection) |
04:17:32 | * | jdhorwitz quit (Ping timeout: 260 seconds) |
04:50:35 | * | bkerin joined #nim |
04:51:47 | bkerin | I notice static:\n var foo = "testvar"\necho foo generates non-buildable C code, is this a known issue? |
04:52:48 | bkerin | I had hoped to use some data structures built up at compile time to do some corresponding run-time work but now I don't see how to pass them along... going through AST gen to do it seems crazed |
04:55:26 | skrylar | that looks like it should be legal, although just print something to the compiler's stdout |
04:56:07 | skrylar | you do need to go through the AST to do it safely, although depending on your needs it is possible to use a system such as `quote` to generate the AST for you |
04:56:21 | skrylar | (assuming quote works this week *prods dom96*) |
04:57:48 | * | yglukhov joined #nim |
05:02:23 | bkerin | hmm I just made forum post showing the non-building C problem |
05:02:25 | * | yglukhov quit (Ping timeout: 248 seconds) |
05:03:14 | bkerin | hmm |
05:09:32 | skrylar | Varriount: these examples make me cry. they are using constant numbers for error code ._. |
05:28:06 | bkerin | hmm I can sort of get what I want by introducing a const e.g. const tablesConst = tables but there's no way to bind the const to the end of compile time, except putting it at the end of the program :( |
05:28:10 | bkerin | as far as I can see |
05:29:25 | FromGitter | <Varriount> skrylar: You mean, just plain integers - not attached to consts or anything? |
05:29:50 | FromGitter | <Varriount> bkerin: Can't a const be modified by compile time code? |
05:31:40 | bkerin | o |
05:31:42 | bkerin | maybe |
05:32:58 | FromGitter | <Varriount> bkerin: Hm, nope |
05:33:49 | skrylar | Varriount: yes. raw sqlcodes |
05:34:02 | skrylar | "if [..] == -695" |
05:34:18 | FromGitter | <Varriount> skrylar: Oh gosh, you must be in such pain. |
05:34:38 | bkerin | it would be sort of confusing for const to have that odd different meaning in compile-time code anyway |
05:35:05 | skrylar | Varriount: well, getting data back out is strange. |
05:35:10 | FromGitter | <Varriount> bkerin: What are you aiming to do? |
05:35:38 | bkerin | well I made a dbbclass macro starting from the OOP macro in the nim by example |
05:35:57 | bkerin | it generates database-backed classes mostly automagically |
05:36:17 | bkerin | but now I need to make sure the backing tables are there at run time |
05:36:59 | bkerin | i have all the field lists for each class built up in a compile-time var and I want to transmit it to the run-time |
05:40:25 | skrylar | trying to show a file made me wonder how well ipfs works for file sharing. hrm |
05:41:39 | skrylar | Varriount: this is the part that also takes up quite a bit of time https://www.dropbox.com/s/8kud6sh3jgh9dv5/firebird3.pdf?dl=0 |
05:42:30 | FromGitter | <Varriount> skrylar: What are you using to generate/write that PDF? |
05:43:02 | bkerin | looks like there are some reports/pull requests fot this sort of stuff: #6041, #6050 |
05:43:31 | skrylar | Varriount: texinfo |
05:43:48 | FromGitter | <Varriount> bkerin: Have you looked at ormin? https://github.com/Araq/ormin |
05:45:36 | bkerin | hmm interesting... I had wondered about prepared statements and gave it up as too hard for now |
05:46:19 | skrylar | They actually aren't bad once you understand them |
05:46:35 | FromGitter | <Varriount> Also, apparently Nim has a parsesql module |
05:47:06 | skrylar | you just tell it you want to prepare something like 'INSERT INTO posts VALUES (spam=?)' and then you tell it that ?#1 is "birdseed!!" |
05:47:42 | skrylar | so theres no injection attacks possible |
05:47:53 | FromGitter | <Varriount> I wouldn't quite call it an ORM, to me it's something a bit lighter than that, but w/e |
05:48:11 | skrylar | i looked in to ormin very slightly |
05:48:44 | bkerin | skrylar: yah I've used them from perl, but they make ORM type stuff harder |
05:49:41 | bkerin | skrylar: and in my case I want to implement undo via the database using triggers which also makes prepared seem a bit harder |
05:49:55 | bkerin | I'm not seeing how araqs thing works yet |
05:50:03 | skrylar | theres no real obligation to keep prepared statements for long |
05:50:13 | skrylar | the exec_immediate routines create/prepare/drop them in one go |
05:50:22 | FromGitter | <Varriount> bkerin: That's because you haven't found the invisible documentation yet. :P |
05:50:38 | skrylar | well in skrycode.. the very visible documentation 8) |
05:50:51 | skrylar | except maybe rfc3339 is poorly documented |
05:50:54 | FromGitter | <Varriount> bkerin: So, you first create an SQL file with a bunch of "create table" statements. |
05:51:05 | bkerin | ah it goes from that |
05:51:12 | FromGitter | <Varriount> You use an "importModel" macro to "import" the table structures |
05:51:14 | bkerin | other way around I was suspecting that |
05:52:00 | FromGitter | <Varriount> Then you use the orm/queries module to create prepared statements. |
05:52:18 | skrylar | well it just depends on your code |
05:52:24 | skrylar | they don't use ORMs in huge database stuff afaik |
05:52:41 | skrylar | activerecord and stuff breaks down when you are dealing with more than just CRUD on a handful at a time |
05:52:56 | bkerin | mine is a little more class-friendly in that it builds up the tables for descendent types for you |
05:53:22 | bkerin | skrylar: I believe it |
05:53:39 | FromGitter | <Varriount> I'm used to more "object"-oriented ORMs, where you define the obejcts, and how they relate to the table |
05:53:40 | skrylar | there is a saying.. there is no middleware when you become giant |
05:53:48 | skrylar | every problem becomes a company specific problem |
05:54:15 | bkerin | you too can be a cog in the machine of a giant software company |
05:54:17 | bkerin | fun |
05:54:26 | skrylar | pff. i'm unhirable |
05:54:39 | bkerin | nice |
05:54:51 | skrylar | not that nice. poverty sucks |
05:55:10 | FromGitter | <Varriount> skrylar: What makes you unhirable? |
05:55:32 | bkerin | hmm, maybe move to alaska live in cabin like me? |
05:56:26 | FromGitter | <Varriount> bkerin: Do you end up having to fight bears for internet access. :P |
05:56:44 | bkerin | all the time |
05:57:08 | * | kier quit (Quit: No Ping reply in 180 seconds.) |
05:58:16 | bkerin | though I'm in seattle at the moment and if I could afford I'd live here in winter |
05:58:46 | FromGitter | <Varriount> I live on the east coast. Housing prices vary quite a bit depending on the area |
05:59:46 | bkerin | yeah I'm sure there's affordable stuff in states I just only end up visiting these crazy expensive places and never find other options |
06:00:25 | FromGitter | <Varriount> bkerin: You could always try hitting one of us up, if it's for a few days. |
06:01:46 | bkerin | hmm that would be really nice, and nim-oriented airBnB alternative ty :) |
06:02:31 | * | kier joined #nim |
06:03:43 | bkerin | I'm in fairbanks if you ever want try Alaska, could have nim conference |
06:04:06 | FromGitter | <Varriount> We could do what the Pypy team does, and host sprints |
06:05:56 | bkerin | mm nim is more exciting than python those people should also switch to nim sprints |
06:06:12 | * | endragor quit (Remote host closed the connection) |
06:07:34 | * | mr_yogurt quit (Ping timeout: 260 seconds) |
06:08:40 | bkerin | well bed time for me, night gents |
06:09:04 | * | bkerin quit (Quit: Confucius say: Man who Farts in Church sits in own pew.) |
06:17:46 | * | endragor joined #nim |
06:25:19 | * | yglukhov joined #nim |
06:29:27 | * | yglukhov quit (Ping timeout: 240 seconds) |
06:36:37 | skrylar | the yak shaving list is so long |
06:40:06 | * | nsf joined #nim |
07:02:24 | * | couven92 joined #nim |
07:18:16 | * | yglukhov joined #nim |
07:19:27 | * | rauss quit (Ping timeout: 240 seconds) |
07:22:55 | * | yglukhov quit (Ping timeout: 268 seconds) |
07:23:36 | * | SenasOzys_ joined #nim |
07:24:59 | skrylar | Varriount: you must use the proper datatype based on this enum, but the enum->datatype is only indirectly documented :D |
07:29:04 | * | kobi7 joined #nim |
07:29:16 | kobi7 | hi guys, do you get intellisense in vscode? |
07:29:37 | * | rauss joined #nim |
07:30:21 | kobi7 | it doesn't work here. is it just a wrong setup of paths or something, or simply not available yet? |
07:31:02 | skrylar | i don't personally use vscode |
07:31:35 | skrylar | trying to remember who here does |
07:32:03 | kobi7 | oh, do I need to run nimsuggest? |
07:33:12 | skrylar | nimsuggest needs to be installed, yes. |
07:33:25 | kobi7 | it's installed, but not sure it runs |
07:33:54 | kobi7 | I assume the vscode nim extension makes sure to run it -- but doesn't seem to work here. |
07:34:09 | skrylar | yglukhov uses it, don't know that he's awake |
07:35:56 | kobi7 | I actually just try to figure out the api of nimx, without delving into source codes. it's not easy to find free time here :-) |
07:36:37 | couven92 | kobi7, yes, the VS Code nim plugin has issues from time to time. We do not really know what is causing them |
07:37:13 | kobi7 | I reinstalled. let's see... |
07:37:52 | couven92 | In my experience, opening up `.vscode/settings.json` in your workspace folder and adding the `"nim.projects"` key helps |
07:39:00 | couven92 | though then you will not get IntelliSense for any random nim file you open, but rather IntelliSense for all files that are directly or indirectly included for your project |
07:45:39 | * | vlad1777d_ joined #nim |
07:53:41 | * | vlad1777d_ quit (Ping timeout: 240 seconds) |
07:56:23 | * | Arrrr joined #nim |
07:56:23 | * | Arrrr quit (Changing host) |
07:56:23 | * | Arrrr joined #nim |
08:00:11 | kobi7 | couven92: where does vscode store its global settings.json file? |
08:01:06 | * | gokr joined #nim |
08:01:07 | couven92 | in `%APPDATA%\Code\User\settings.json`, but that's not where you want to add nim project files to the `nim.projects` setting! |
08:01:51 | kobi7 | where would that be in linux? |
08:02:22 | couven92 | No idea, but why do you want to edit the gloabl settings????? |
08:02:28 | couven92 | DON'T do that! |
08:03:02 | kobi7 | it has some error, packages that added the same key. |
08:03:15 | couven92 | ??? |
08:03:35 | kobi7 | Duplicate object key |
08:04:24 | couven92 | What are you talking about, you have completely lost me now |
08:05:42 | kobi7 | I thought, perhaps the extension isn't working, due to some local failure - I saw this warning, when opening the Settings window. but it's on the left side - the un-editable, system settings. |
08:06:20 | couven92 | I still have no idea what you are talking about, start from the beginning please |
08:06:45 | kobi7 | nevermind. |
08:07:41 | kobi7 | tried to discover an api, through an ide. didn't work, so wanted to see if I can easily fix it. guess not. |
08:15:29 | * | PMunch joined #nim |
08:24:19 | * | claudiuinberlin joined #nim |
08:43:55 | hohlerde | I am getting this with latest devel on x86 and x64: .nimble\pkgs\oldwinapi-2.0.0\oldwinapi\windows.nim(22905, 10) Error: type mismatch: got (int) but expected 'int32' |
08:45:02 | Arrrr | you have to convert your int to int32, for example: int32(123), int32(myInt) |
08:45:18 | hohlerde | fixing it seems obvious, but I wonder if I am the only one getting it :-) |
08:46:10 | Arrrr | nim is very loudy with these things |
08:48:28 | hohlerde | yes, I am just a bit surprised that this is in windows.nim |
08:48:38 | * | jjido joined #nim |
08:50:47 | * | kobi7 quit (Quit: Leaving) |
08:51:31 | * | yglukhov joined #nim |
08:52:20 | * | yglukhov quit (Read error: Connection reset by peer) |
08:52:33 | * | yglukhov joined #nim |
08:53:21 | * | yglukhov quit (Remote host closed the connection) |
08:53:34 | * | yglukhov joined #nim |
08:59:10 | def- | hohlerde: it's gotten more strict recently. I see this error in quite a few of my code as well |
09:01:14 | * | xkapastel quit (Quit: Connection closed for inactivity) |
09:03:02 | * | miran joined #nim |
09:06:17 | hohlerde | I see |
09:07:07 | hohlerde | I am trying to port an old program to run with the latest compiler ... seems quite a bit of work |
09:07:44 | * | kier quit (Ping timeout: 248 seconds) |
09:08:33 | * | jinshil quit (Quit: Good-bye!) |
09:25:07 | FromGitter | <mratsim> Would love to get some sprints in Nim. Like a weekend per month we do as a community: bug squashing, documentation, small features, PR reviews whatever is needed but would be made more fun by not doing it alone. |
09:27:12 | * | kier joined #nim |
09:28:03 | FromGitter | <mratsim> I just stumbled upon this: :O https://nim-lang.org/docs/apis.html |
09:30:48 | * | jjido quit (Ping timeout: 240 seconds) |
09:34:21 | skrylar | i do find it boring that you have to constantly put '.int32' everywhere. |
09:35:02 | skrylar | i suppose its there so you don't make weird expectations like "i can always assign an int to a uint and it will work out!" well sure, it will work out until you try to assign a negative to that uint, then it won't work at all. |
09:35:29 | euantor | you can do `'i32` too |
09:35:43 | euantor | `let a = 5'i32` which is slightly shorter |
09:37:16 | skrylar | i've mostly been burying those details inside of calls. ex in the date module you just pass in an int, which is asserted at runtime in debug builds and cast to the right tyepe |
09:37:29 | skrylar | although i didn't know about range types when i wrote that, or i'd have done that instead |
09:50:58 | * | skrylar quit (Remote host closed the connection) |
09:51:54 | * | willcdot joined #nim |
09:53:03 | * | willc quit (Ping timeout: 248 seconds) |
09:56:32 | * | Vladar joined #nim |
09:57:13 | * | floppydh joined #nim |
10:03:19 | floppydh | I guess you cant ever modify an "index-variable" in a for stmt? - like "for x in 0..10: if x == 2: x+=2" |
10:04:12 | Araq | use a while loop instead, 'for' is for "structured" looping (no infinite loops) |
10:05:03 | floppydh | I'm trying to skip some elements in a 'for', but I guess it amounts to the same thing? |
10:06:34 | floppydh | would it be possible to get a reference to an iterator inside a for loop and advancing/discarding a value? :> |
10:08:56 | miran | floppydh: "I'm trying to skip some elements in a 'for'" - use `continue`? |
10:09:26 | floppydh | miran: don't want to reset the loop, so basically just discard iterator.pop() :> |
10:10:19 | floppydh | I mean all my issues could easily be solved with nims meta-programming features, just thinking out loud |
10:23:58 | * | ShalokShalom_ joined #nim |
10:26:21 | * | ShalokShalom quit (Ping timeout: 240 seconds) |
10:44:14 | floppydh | strutil's % doesnt format numbers right? - just does string interpolation |
10:45:59 | def- | floppydh: correct, you can use formatFloat() separately or use strfmt |
10:46:16 | floppydh | def-: strfmt is external dep? |
10:46:19 | def- | yes |
10:46:37 | floppydh | trying to formatint 2 -> 002 |
10:46:40 | floppydh | no such thing tho |
10:46:42 | def- | https://lyro.bitbucket.io/strfmt/ |
10:46:43 | floppydh | guess I'll get strfmt |
10:47:59 | def- | floppydh: or strutils.align($myNumber, 3, '0') |
10:48:07 | floppydh | def-: beautiful |
10:48:55 | floppydh | maybe it's just me but % formatting is misleading, seems to take from python? but pythons % does more |
10:49:15 | def- | with strfmt: echo interp"My number is ${myNumber:03}" |
10:49:16 | floppydh | not like really an issue, but led me astray a bit |
10:49:46 | def- | and I think I saw something strfmt like coming to Nim standard lib |
10:50:01 | floppydh | <3 |
10:51:16 | def- | https://github.com/nim-lang/Nim/pull/6507 |
10:51:31 | def- | But I found strfmt nice to use and powerful enough |
10:55:52 | * | sz0 joined #nim |
10:59:47 | FromGitter | <mratsim> Is there a wiki or a post with "wanted" modules for the stdlib? |
10:59:53 | floppydh | hmmm... I can't stop json module from escaping my strings or can I? |
11:01:35 | floppydh | I don't think escaping umlauts in json is mandatory for json? |
11:01:54 | floppydh | actually json requires to be utf8 by default? |
11:02:31 | floppydh | lets see if nimyaml offers a way to unset this |
11:06:46 | floppydh | ye, nimyaml by default doesn't escape umlauts |
11:07:05 | floppydh | does it make sense to open an issue proposing to add a way to disable umlaut-escaping from stdlib json outputs? |
11:07:32 | floppydh | IIRC python has such an option with ensure_ascii |
11:08:38 | FromGitter | <alehander42> @mratsim we had an idea for wiki / issue repo with "wanted" stuff for the ecosystem and stdlib several weeks ago somewhere in the chat |
11:09:24 | FromGitter | <mratsim> A bit like rust_rfcs repo? |
11:09:56 | FromGitter | <mratsim> Or in a nim-lang wiki? |
11:15:47 | Araq | floppydh: iirc that was changed in nim devel... |
11:16:51 | floppydh | Araq: oh thanks, just checked on GH and yeah it looks better |
11:16:58 | floppydh | time to update I guess |
11:19:07 | FromGitter | <data-man> @mratsim: What the users want https://nim-lang.org/blog/2017/10/01/community-survey-results-2017.html#what-critical-libraries-are-missing-in-the-nim-ecosystem |
11:22:09 | FromGitter | <alehander42> @mratsim rfcs-s / pep-s are changes specifical for the language, nim lang repo is good for that |
11:22:28 | FromGitter | <alehander42> more of something like https://github.com/crystal-community/crystal-libraries-needed/issues (just an example of the format) |
11:22:39 | FromGitter | <alehander42> araq seemed to prefer a wiki, so probably a wiki |
11:23:07 | Araq | I can create a repo for you |
11:23:11 | Araq | just a sec |
11:23:40 | FromGitter | <mratsim> Wiki is good to present an overview but a repo with issues is better for vote/discussion |
11:23:52 | FromGitter | <alehander42> exactly |
11:24:37 | dom96 | oh, are we making an rfcs and "libraries needed" repos? |
11:25:42 | Araq | https://github.com/nim-lang/needed-libraries |
11:25:42 | FromGitter | <alehander42> seems useful to me |
11:26:11 | dom96 | Nice :) |
11:26:12 | FromGitter | <alehander42> awesome! |
11:26:16 | Araq | I would probably misuse the issue tracker for nim-lang/packages but here you go |
11:26:44 | FromGitter | <mratsim> Rfcs works fine today no? Unless the current 1000+ issues are too much |
11:27:11 | dom96 | If we want an RFC repo then we should come up with a good RFC structure that all RFCs should follow |
11:28:00 | FromGitter | <alehander42> so probably the next step is to add the ideas from https://nim-lang.org/blog/2017/10/01/community-survey-results-2017.html#what-critical-libraries-are-missing-in-the-nim-ecosystem for now as issues |
11:28:39 | FromGitter | <alehander42> I can write a script to do that later |
11:36:57 | Araq | dom96: just copy Python's PEPs |
11:41:25 | Araq | mratsim: they are too much. |
11:41:42 | Araq | I mean ok, I don't look at them without filters but still |
11:49:19 | * | arnetheduck joined #nim |
12:02:58 | euantor | `This repository contains a list a needed libraries.` -> `This repository contains a list of needed libraries.` |
12:05:30 | floppydh | devel is supposed to work no? - so when a lib I'm using breaks on devel I'm free to demand things from the guy making it? |
12:06:10 | * | Snircle joined #nim |
12:06:32 | dom96 | hah, "demand" is a bit strong :) |
12:07:05 | dom96 | -> "This repository contains a list of libraries that are missing in Nim's package ecosystem" |
12:07:13 | dom96 | Also, anyone want to write a readme for that repo? |
12:09:20 | hohlerde | wow, 0.17.3 totally broke my driver. getting a lot of gcunsafe compiler errors, whereas with 0.15.x it worked |
12:10:37 | hohlerde | it seems my main problem is, I use a asynchttpserver on a thread (which is needed, as this is a windows service). |
12:13:09 | FromGitter | <mratsim> “I demand a trial by combat" |
12:14:14 | dom96 | if you're using global vars then they need to be thread local |
12:14:21 | * | dddddd joined #nim |
12:14:27 | dom96 | if not then you can mark your procs with {.gcsafe.} |
12:15:15 | hohlerde | as far as I can see all globals I use are marked with {.threadvar.} ... and it worked before |
12:17:17 | hohlerde | all my procedures, which work on data passed as arguments are marked as gcunsafe by the compiler |
12:18:23 | hohlerde | I am not blaming, I am just a bit surprised |
12:19:52 | dom96 | weird |
12:21:04 | hohlerde | is there a way to tell the compiler to print out information about what it thinks is unsafe? |
12:23:18 | Arrrr | 140 beings in this channel, it is breaking records. |
12:28:17 | Araq | record is at 146 iirc |
12:40:46 | * | pwntus joined #nim |
12:41:15 | * | pwntus quit (Changing host) |
12:41:15 | * | pwntus joined #nim |
12:59:14 | FromGitter | <alehander42> @dom96 I can try to write a README and prepare the initial issues based on the report later today |
12:59:54 | dom96 | alehander42: brilliant :) |
13:00:03 | dom96 | Record is in the IRC topic: git.io/gHZGCg |
13:00:04 | dom96 | 170 |
13:08:33 | * | arecaceae quit (Remote host closed the connection) |
13:08:53 | * | arecaceae joined #nim |
13:24:02 | * | nsf quit (Quit: WeeChat 1.9.1) |
13:30:27 | * | PMunch quit (Ping timeout: 240 seconds) |
13:31:42 | * | SenasOzys_ quit (Ping timeout: 260 seconds) |
13:39:43 | * | PMunch joined #nim |
13:40:12 | * | SenasOzys_ joined #nim |
13:41:34 | * | elrood joined #nim |
13:42:38 | FromGitter | <Varriount> dom96: What about those of us who are only in Gitter? |
13:53:29 | FromGitter | <mratsim> "Why Zig when D, Rust, C, C++ exist": https://www.reddit.com/r/programming/comments/7cumiy/why_use_zig_when_c_d_and_rust_exist/ |
13:58:45 | floppydh | https://github.com/nim-lang/Nim/commit/8cc268876a214d164899b0d0a0ccdcb98a861b1b did capturing in non-closure inner procs never work at all or does it work in some cases? |
13:58:56 | * | gokr quit (Ping timeout: 248 seconds) |
14:00:46 | Araq | mratsim: "because the existing languages are too 'complex' and so I'm reinventing things adding required features until the result is as complex but it took a decade to get there" |
14:04:09 | FromGitter | <mratsim> Well I'm also guilty of that with Arraymancer w.r.t. Numpy, Julia, Matlab, etc. I just say that the unofficial reason I'm doing Arraymancer is that it's fun :p. |
14:06:37 | flyx | did the {.inline.} semantics recently change to not allow captures? context: NimYAML breaks on devel https://github.com/flyx/NimYAML/issues/49 |
14:17:46 | floppydh | flyx: flyx https://github.com/nim-lang/Nim/commit/8cc268876a214d164899b0d0a0ccdcb98a861b1b |
14:19:38 | Araq | flyx: .inline is not .closure so can't capture anything. before that commit the compiler quietly changed the calling convention from inline to closure |
14:20:16 | Araq | mratsim: I thought the reason was to push Nim forward :-) |
14:27:37 | FromGitter | <alehander42> @dom96 I wrote some kind of initial README https://github.com/nim-lang/needed-libraries/pull/1 |
14:27:41 | FromGitter | <mratsim> That's one of the official reasons ;) |
14:29:23 | federico3 | alehander42 I recommend renaming the repo to include other ideas as well |
14:38:52 | FromGitter | <alehander42> can you suggest a better name ? |
14:39:10 | FromGitter | <alehander42> ecosystem-wishlist maybe ? |
14:40:08 | FromGitter | <alehander42> I think this name is good enough(people wouldn't hesitate to add a wish for better debugger just because it's "libraries") |
14:40:50 | federico3 | even just idea-bank |
14:41:08 | * | endragor quit (Remote host closed the connection) |
14:43:47 | * | endragor joined #nim |
14:44:13 | * | Jesin quit (Quit: Leaving) |
14:46:57 | flyx | thanks floppydh, Araq |
14:47:13 | floppydh | flyx: I thank you for fixing NimYAML :) |
14:47:59 | * | endragor quit (Ping timeout: 248 seconds) |
14:53:10 | * | sz0 quit (Quit: Connection closed for inactivity) |
14:55:59 | * | nsf joined #nim |
14:59:21 | FromGitter | <mratsim> Btw @flyx I saw your comments on Reddit, you're one of YAML core devs? |
14:59:40 | flyx | mratsim: currently I am. |
15:00:30 | * | Jesin joined #nim |
15:01:17 | FromGitter | <mratsim> Currently? Like it happened by accident because you were doing Nim bindings? |
15:01:44 | flyx | yeah, that's kind-of the story. |
15:03:42 | FromGitter | <mratsim> Fun :) |
15:03:42 | flyx | I have not co-authored of any of the released specs, but two of the authors do not have the intention to further work on it, and the third one asked me if I was interested in helping him advance the language since I was pretty active on #yaml while implementing NimYAML, so I joined |
15:09:26 | * | floppydh quit (Quit: WeeChat 1.9.1) |
15:10:04 | * | floppydh joined #nim |
15:10:10 | * | floppydh quit (Client Quit) |
15:10:32 | * | floppydh joined #nim |
15:10:43 | * | jdhorwitz joined #nim |
15:12:31 | * | willcdot quit (Ping timeout: 248 seconds) |
15:12:35 | * | floppydh quit (Client Quit) |
15:12:51 | * | floppydh joined #nim |
15:14:40 | FromGitter | <krux02> I have an Ast that is partially typechecked |
15:14:54 | FromGitter | <krux02> now I transformed it and generated a new AST |
15:15:13 | * | jdhorwitz quit (Ping timeout: 248 seconds) |
15:15:58 | FromGitter | <krux02> I passed this new ast to a macro with a ``typed`` argument, but for some reason, I cannot get the type of the nodes |
15:16:16 | FromGitter | <krux02> the ast does not have more type information than before |
15:16:35 | * | sz0 joined #nim |
15:20:42 | * | miran quit (Quit: Page closed) |
15:20:55 | Araq | krux02: I need a snippet to see for myself |
15:22:58 | * | PMunch quit (Quit: Leaving) |
15:28:07 | * | jdhorwitz joined #nim |
15:39:42 | * | rauss quit (Quit: WeeChat 1.9.1) |
15:39:59 | * | m0o joined #nim |
15:40:54 | * | rauss joined #nim |
15:41:21 | * | SenasOzys_ quit (Ping timeout: 248 seconds) |
15:42:28 | * | chemist69 quit (Ping timeout: 240 seconds) |
15:42:51 | * | chemist69 joined #nim |
15:47:30 | * | SenasOzys joined #nim |
15:52:03 | * | Jesin quit (Quit: Leaving) |
15:54:20 | * | jsgrant quit (Remote host closed the connection) |
15:55:22 | * | Jesin joined #nim |
15:56:43 | * | xet7bot joined #nim |
15:57:59 | * | xet7bot quit (Client Quit) |
16:05:12 | FromGitter | <krux02> Araq: I am starting now to write a compiler from Nim to glsl |
16:05:47 | FromGitter | <krux02> I write it in a macro |
16:05:53 | FromGitter | <krux02> I would like to map glm functions/type to glsl builtins |
16:06:03 | FromGitter | <krux02> but there are things that are a bit weird |
16:06:37 | FromGitter | <krux02> for example, from type to time, getTypeInst returns a Symbol "Vec4f" and sometimes it is a bracket expression Vec[4, float32] |
16:06:48 | FromGitter | <krux02> semantically it is the same |
16:07:08 | FromGitter | <krux02> Vec4f is just an alias for that, but in the ast I don.t get a normalized representation |
16:09:55 | FromGitter | <krux02> Araq: would you recommend to implement this instead of with macros as a branch in the compiler? |
16:12:41 | Araq | hmm not sure |
16:14:05 | flyx | wouldn't you lose almost all semantic checks the compiler makes when implementing it as macro? |
16:14:15 | FromGitter | <krux02> it is pretty much tied to the glm implementation |
16:15:14 | FromGitter | <krux02> Araq: I do some ast transformations, for example the macro expects only a single block of code in a do notation and the macro then spits that block of code into fragment- and vertex-shader |
16:16:17 | FromGitter | <krux02> I have a transformation to an ssa (single static assignment) list |
16:16:41 | FromGitter | <krux02> after this transformation I would like to update the typechecker, but for some reasons this fails |
16:16:44 | FromGitter | <krux02> I don't know why |
16:17:14 | * | endragor joined #nim |
16:17:50 | Araq | what do you mean "update the typechecker"? |
16:22:02 | * | endragor quit (Ping timeout: 260 seconds) |
16:22:23 | FromGitter | <krux02> Araq: I have a type ast. Then I transform this ast into SSA form (single static assignment). And this SSA form has now nodes of let expressions. |
16:23:01 | FromGitter | <krux02> eg: let a = bar(foo(b)) ~-> let tmp = foo(b); let a = bar(tmp) |
16:23:17 | FromGitter | <krux02> list statementlist I would like to typecheck again |
16:23:36 | FromGitter | <krux02> but for some reason it just goes through the typechecker without any modifications |
16:23:56 | FromGitter | <krux02> nodes don't have types |
16:25:14 | Araq | yeah well, partial type checking is a pita to support |
16:25:36 | FromGitter | <krux02> http://ix.io/CfZ |
16:26:02 | GitDisc | <treeform> I was very surprised when I saw this project https://github.com/yglukhov/nimsl doing a nim to GLSL translation in 500 lines of code. I never though some thing like this would be possible as a DSL, and here it is. |
16:26:21 | FromGitter | <krux02> treeform: I know that project |
16:26:29 | FromGitter | <krux02> I do something similar yet a bit different |
16:26:31 | GitDisc | <treeform> krux02, Do you have yours some place? |
16:26:39 | FromGitter | <krux02> yes of course |
16:26:39 | GitDisc | <treeform> What are the differences? |
16:26:46 | FromGitter | <krux02> but mine doesn't work yet |
16:27:04 | FromGitter | <krux02> the difference is, that I want to support more of OpenGL |
16:27:27 | GitDisc | <treeform> ok. Then my mind was blown that he had an emulator for GLSL as well, so that you can write tests etc... |
16:27:35 | GitDisc | <treeform> Will you also have an emulator? |
16:27:52 | FromGitter | <krux02> I want to support Framebuffers and arbitrary attributes and automatic sepration of FragmentShader/VertexShader |
16:28:07 | FromGitter | <krux02> the other project is more a proof of concept nothing you would really want to use in practice |
16:28:47 | GitDisc | <treeform> Well I like that it maps 1:1 to GLSL. |
16:28:54 | GitDisc | <treeform> But yes I have not used it in production yet. |
16:28:58 | FromGitter | <krux02> treeform: not an emulator, but the code that is used in the shader should be possible on the CPU as well |
16:29:02 | FromGitter | <krux02> meaning you should be able to share code on the CPU and the shader |
16:29:09 | FromGitter | <krux02> but that is technically not emulation |
16:29:19 | GitDisc | <treeform> yeah sorry, cross compiler |
16:29:34 | FromGitter | <krux02> when the glsl compiler has a bug it might happen thet the CPU code works but the GPU code just doesn't |
16:29:37 | GitDisc | <treeform> the repo calls it emulation but we know what we mean |
16:29:51 | FromGitter | <krux02> i wouldn't call it emulation |
16:29:54 | GitDisc | <treeform> Sure but that is a GLSL but, and we know how to deal with it. |
16:30:00 | FromGitter | <krux02> I just call it compilation |
16:30:24 | FromGitter | <krux02> I am thinking of compiling to SPIR-V instead of GLSL |
16:30:40 | GitDisc | <treeform> I like that you can unit test GLSL code and put print statments inside it. |
16:30:46 | FromGitter | <krux02> But I have little knowledge about SPIR-V so I don't start with that |
16:31:06 | GitDisc | <treeform> can you use SPIR-V in openGL or us vk? |
16:31:13 | GitDisc | <treeform> just* |
16:31:29 | FromGitter | <krux02> yes that is what I will support, but you won't be able to cross compile texture lookup statements |
16:31:47 | GitDisc | <treeform> why no texture lookup? |
16:31:56 | FromGitter | <krux02> yes you can just use SPIR-V in OpenGL |
16:32:02 | FromGitter | <krux02> no vulkan required |
16:32:10 | FromGitter | <krux02> it is opengl 4.6 I think |
16:32:17 | GitDisc | <treeform> will you support cross compiling dx and dy functions? |
16:32:22 | FromGitter | <krux02> and with ARB extensions also in older versions |
16:32:31 | FromGitter | <krux02> nope |
16:33:17 | FromGitter | <krux02> as I told you, there is no rasterization on the CPU side and I won't reimplement a software rasterizer just for debugging purpose |
16:33:20 | Araq | krux02: there are multiple ways to do something like that. a "Production quality" solution seems to be to write types and operations that support the "DSL" you want and then add a Nim backend that outputs GLSL |
16:33:45 | federico3 | is there a dashboard with the Travis CI build logs? |
16:35:18 | FromGitter | <krux02> Araq: the types and operations that are supported in the DSL are already implemented |
16:35:25 | FromGitter | <krux02> it is the glm package |
16:37:52 | * | m0o left #nim ("Leaving") |
16:39:00 | GitDisc | <treeform> Got my first packadge merge into the nimble list of packages https://treeform.github.io/chrono/ So I have that going for me. |
16:42:06 | * | miran joined #nim |
16:42:23 | * | hohlerde sent a long message: hohlerde_2017-11-14_16:42:22.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/gtkNdXovXuhaBcMVkiuxlGZn> |
16:44:43 | GitDisc | <treeform> fmAppend? |
16:44:47 | GitDisc | <treeform> you probalby wnat read? |
16:46:41 | Araq | krux02: ok, so would the compiler patch only be a backend? |
16:49:38 | FromGitter | <krux02> Araq: I found a solution for now, when I do tha SSA transformation I can just keep the type inforamtion in the let expression |
16:50:01 | Araq | ok |
16:50:12 | GitDisc | <treeform> So your GLSL will be a seperate compiler target, not just macros? |
16:50:19 | FromGitter | <krux02> and yes it would only be a backend |
16:50:38 | FromGitter | <krux02> but it is not a complete backend that is a new compilation target |
16:50:49 | FromGitter | <krux02> like "nim cpp file.nim" |
16:51:10 | GitDisc | <treeform> `nim glsl file.nim` |
16:51:12 | FromGitter | <krux02> the main backend would still be the C backend it would be only for the part that runs on the GPU |
16:51:25 | FromGitter | <krux02> treeform: exactly that is not what I am doing |
16:51:30 | GitDisc | <treeform> ok |
16:51:39 | GitDisc | <treeform> i am still interested to see what you will be doing |
16:51:47 | * | Trustable joined #nim |
16:52:15 | FromGitter | <krux02> well you can get an idea here: https://github.com/krux02/opengl-sandbox |
16:52:42 | FromGitter | <krux02> that is my project and up until now I used strings for thet part that runs on the GPU |
16:52:55 | FromGitter | <krux02> from now on I would like to replace the strings with pure nim code |
16:53:01 | FromGitter | <krux02> that eventually runs on the GPU |
16:53:08 | FromGitter | <krux02> so it is mixed CPU and GPU code |
16:53:27 | FromGitter | <krux02> and still there is full control of what runs on the CPU and what runs on the GPU |
16:55:14 | GitDisc | <treeform> yeah that would be cool. I was working on this project in nim: |
16:55:16 | GitDisc | <treeform> |
16:55:16 | GitDisc | <treeform> https://cdn.discordapp.com/attachments/371759389889003532/380037983782436867/unknown.png |
16:55:23 | GitDisc | <treeform> I was working on shaders for the planets. |
16:57:05 | GitDisc | <treeform> I need to switch to a nim shader based solution. |
16:58:12 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
16:58:24 | FromGitter | <krux02> what do you mean? |
16:59:16 | GitDisc | <treeform> it would be cool to use him instead of stupid strings |
16:59:22 | GitDisc | <treeform> with GLSL in them. |
16:59:36 | GitDisc | <treeform> got to go to work. |
16:59:45 | GitDisc | <treeform> slowly trying to use nim there as well. |
16:59:56 | FromGitter | <krux02> well I found out, that not strings are the problem, but that strings are not really embedded in the language |
17:00:30 | FromGitter | <krux02> you have to do a lot of stull to define the interface between GLSL and the Nim code (or c++ if you work in that language" |
17:01:10 | FromGitter | <krux02> I fixed the intraface problem |
17:10:46 | * | NimBot joined #nim |
17:11:01 | * | jdhorwitz quit (Ping timeout: 240 seconds) |
17:19:23 | hohlerde | treeform: I want to append to a file |
17:23:03 | * | gokr joined #nim |
17:23:10 | * | sz0 quit (Quit: Connection closed for inactivity) |
17:30:13 | hohlerde | treeform: almost the same happens in the logging module when you want to append to an already existing log file. found it on github: https://github.com/nim-lang/Nim/issues/6141 |
17:44:48 | * | ShalokShalom_ quit (Ping timeout: 240 seconds) |
17:48:16 | FromGitter | <krux02> hohlerde: well I suggest you open the file, append to it and then close it again. |
17:48:50 | * | gokr quit (Ping timeout: 268 seconds) |
17:51:29 | * | SenasOzys quit (Ping timeout: 248 seconds) |
17:56:17 | * | fredrik92 joined #nim |
17:56:25 | * | SenasOzys joined #nim |
18:05:18 | * | floppydh quit (Quit: WeeChat 1.9.1) |
18:06:49 | * | claudiuinberlin joined #nim |
18:15:06 | * | xkapastel joined #nim |
18:21:08 | * | yglukhov quit (Remote host closed the connection) |
18:30:32 | * | Jesin quit (Quit: Leaving) |
18:31:28 | * | nsf quit (Quit: WeeChat 1.9.1) |
18:31:46 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:34:10 | * | claudiuinberlin joined #nim |
18:54:24 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:56:39 | * | claudiuinberlin joined #nim |
18:57:17 | * | PMunch joined #nim |
18:59:59 | FromGitter | <Varriount> @dom96 https://forum.nim-lang.org/t/3332 |
19:00:20 | * | marenz__ joined #nim |
19:01:37 | dom96 | I guess Araq removed it :) |
19:01:39 | dom96 | I made him a spammer |
19:03:02 | FromGitter | <ntdef> hey how do I call `std::cout << someCppVar` from nim, or overload it to echo? |
19:03:45 | FromGitter | <ntdef> I'm importing a type from a library that prints to stdout, but it's not clear from the docs how to import the method |
19:04:35 | * | miran quit (Quit: Konversation terminated!) |
19:05:26 | dom96 | You could just {.emit: """std::cout << someCppVar""".} |
19:05:33 | dom96 | Not sure if there is a better way |
19:05:44 | FromGitter | <ntdef> is that the best/recommended way? |
19:06:30 | FromGitter | <Varriount> importcpp might have a way to do it |
19:07:25 | * | JappleAck joined #nim |
19:07:27 | FromGitter | <Varriount> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma |
19:08:40 | FromGitter | <Varriount> @ntdef Is there a way to call the '<<' operator like a regular function in C++? |
19:08:50 | FromGitter | <Varriount> (I can't remember) |
19:09:11 | FromGitter | <ntdef> no idea; I'm trying to wrap a cpp lib so I don't have to write cpp xD |
19:09:51 | FromGitter | <ntdef> `std::cout << someVar` is pretty common in cpp though... might want to add a pragma for it |
19:10:38 | hohlerde | mhm, I guess it was the wrong decision to use nim for production |
19:10:41 | FromGitter | <Varriount> @ntdef https://stackoverflow.com/questions/3398825/how-do-i-call-operator-directly |
19:11:14 | * | yglukhov joined #nim |
19:12:17 | FromGitter | <Varriount> @ntdef So you could try `importcpp: "#.operator<<(@)"` |
19:12:29 | FromGitter | <Varriount> Of course, then the first argument would need to be the stdout object |
19:12:37 | FromGitter | <ntdef> right |
19:12:38 | FromGitter | <ntdef> let me try it |
19:14:35 | FromGitter | <Varriount> hohlerde: C++ is not the easiest language to interface with. |
19:15:02 | FromGitter | <Varriount> I honestly don't know of many languages that even try to interface with C++. |
19:15:15 | FromGitter | <ntdef> yeah. I mean it's on the Nim homepage as an example |
19:15:17 | * | SenasOzys quit (Ping timeout: 255 seconds) |
19:15:45 | * | yglukhov quit (Ping timeout: 248 seconds) |
19:16:59 | FromGitter | <ntdef> I didn't think it would be *this* difficult |
19:17:29 | FromGitter | <Varriount> Well, what difficulties have you run into so far? |
19:17:41 | * | yglukhov joined #nim |
19:18:21 | FromGitter | <ntdef> there aren't very many examples about how to do things |
19:18:36 | FromGitter | <ntdef> about how to use the pragma specifically |
19:19:07 | FromGitter | <ntdef> in addition the c2nim install is straight up broken |
19:19:12 | hohlerde | varriount: it's not C++ ... I wrote an ATM driver in nim using libusb. it provided a REST interface and events via websocket and worked pretty well, compiled with nim 0.14.x and 0.15.x. now i wanted to fix some things and used the latest devel and it seems it is broken. i used basic OO a lot, asynchttpserver and threads, because the driver is also capable of running as a windows service (windows service callbacks etc.). |
19:19:13 | hohlerde | compiling works, but running results in a crash. |
19:20:12 | FromGitter | <ntdef> I tried installing c2nim on both my mac and a clean ubuntu env and I got errors both times |
19:20:20 | FromGitter | <ntdef> even when trying to compile from source |
19:22:40 | FromGitter | <Varriount> I don't know about Ubuntu, but on Mac I just install Nim + C2Nim using `brew install nim --HEAD` |
19:23:20 | FromGitter | <Varriount> On Windows I just download it, and dump it in C:/Nim/ |
19:23:40 | FromGitter | <Varriount> How did you install it on Ubuntu? |
19:24:38 | FromGitter | <Varriount> hohlerde: Sounds like a memory corruption issue. Do you get any traceback with a program compiled in debug mode? |
19:26:12 | * | SenasOzys joined #nim |
19:28:46 | hohlerde | varriount: no traceback, just a crash, probably because of freeing memory through libusb. using libusb's get version function returns some memory garbage. however, the point is it worked perfectly when compiled with an older nim version. I already wrote a smal test program with libusb and that works with the latest devel of nim. |
19:29:44 | FromGitter | <Varriount> hohlerde: It likely only worked with an earlier version of Nim due to how the underlying C++ code was generated. |
19:29:52 | * | yglukhov quit (Read error: Connection reset by peer) |
19:30:02 | hohlerde | I use the default C backend |
19:30:11 | FromGitter | <Varriount> Well, C code then. |
19:30:28 | * | yglukhov joined #nim |
19:32:16 | hohlerde | varriount: most probably yes. I think it is just too much work to find the culprit. rewriting from scratch might be easier. |
19:32:33 | hohlerde | I am just a bit disappointed |
19:32:44 | FromGitter | <Varriount> hohlerde: What should the developers have done then? |
19:34:13 | hohlerde | varriount: I am not blaming developers or the community. It was my fault. Nim is still evolving and I ignored that fact. |
19:35:15 | dom96 | How did you solve the gc safety issues? |
19:35:41 | hohlerde | I had to put {.gcsafe.} on a lot of procs and methods |
19:36:14 | dom96 | It's possible that your code was never gcsafe and that the newer compiler found the bug. |
19:36:26 | dom96 | Which you just told the compiler to ignore by adding {.gcsafe.} :) |
19:36:45 | FromGitter | <Varriount> We could take a look at it |
19:36:47 | hohlerde | yes, maybe |
19:36:51 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:36:56 | dom96 | Please don't give up on Nim :( |
19:37:27 | * | claudiuinberlin joined #nim |
19:38:56 | hohlerde | varriount: that's a nice offer, but I can't hand out the code due to company policies. it's a driver for ATMs you'l find all around the world |
19:41:54 | FromGitter | <Varriount> Ah, I understand |
19:42:28 | FromGitter | <Varriount> hohlerde: I myself work in a sensitive industry too. It can be quite maddening. |
19:43:14 | hohlerde | varriount: indeed :-) |
19:43:20 | FromGitter | <Varriount> We can't use X service or Y product or Z library because it doesn't have the certifications. |
19:43:30 | FromGitter | <Varriount> *right certifications |
19:49:05 | FromGitter | <Varriount> @ntdef Any luck? |
19:49:44 | dom96 | ATMs running web servers? Isn't that a bit unsafe? :) |
19:51:30 | FromGitter | <Varriount> dom96: Probably safer than ATMs running Windows XP |
19:51:45 | FromGitter | <Varriount> They have to connect to the backend anyway. |
19:53:59 | hohlerde | dom96: not all, but some |
19:55:00 | dom96 | hohlerde: if you're up for some investigation you could bisect the compiler to find the commit that breaks things, might be a bit painful though (0.15 is a while back) but it's doable and would help us out |
19:57:24 | FromGitter | <Varriount> hohlerde: How about you hook up your stuff to ffmpeg. We could all be watching movies while we withdraw money from our accounts. |
19:58:14 | * | TjYoco joined #nim |
19:58:50 | hohlerde | varriount: you already have that :-) have you never seen kind of advertising on the ATM screens ? |
19:59:44 | hohlerde | dom96: i can try, but not sure when I have the time for that |
20:00:39 | hohlerde | wait, some of my colleagues used an ATM for a demo |
20:01:17 | * | vlad1777d_ joined #nim |
20:01:36 | hohlerde | there it is: https://www.youtube.com/watch?v=GynWoDcjE-4 |
20:02:26 | * | Amun_Ra quit (Quit: WeeChat 1.6) |
20:02:33 | dom96 | omg, I've used the exact same ATM |
20:02:35 | hohlerde | it's a bit old, though |
20:03:15 | dom96 | Isn't that a tad illegal? :O |
20:03:22 | * | Amun_Ra joined #nim |
20:03:43 | * | JappleAck quit (Ping timeout: 248 seconds) |
20:03:47 | dom96 | I'm genuinely wondering |
20:04:09 | dom96 | oh, he even takes out lots of money at the end |
20:04:11 | dom96 | definitely illegal |
20:04:20 | FromGitter | <Varriount> I need to visit Europe again someday. Then I can meet up with Araq and all the other developers that live there. |
20:04:50 | FromGitter | <Varriount> That looks like it took place in Germany, or some place where German is a common language. |
20:04:55 | dom96 | There might be an opportunity for that |
20:04:58 | hohlerde | dom96: the demo is really running on the ATM, but in the lab. the video is edited. |
20:05:00 | dom96 | I applied to have a stand at FOSDEM |
20:05:10 | dom96 | hohlerde: ahh |
20:05:36 | hohlerde | varriount: yep, germany |
20:06:32 | dom96 | I've used the same ATMs in Switzerland |
20:06:47 | dom96 | Could have sworn the card was from UBS as well. |
20:07:07 | FromGitter | <Varriount> dom96: Nice to know the money from those monthly donations is being used for something. |
20:07:26 | FromGitter | <Varriount> I keep getting an image of it just laying around in a bank account somewhere. |
20:08:02 | dom96 | well, it is mostly laying around |
20:08:12 | dom96 | to be honest |
20:08:24 | dom96 | but if we do get a stand we'll use some of it for that |
20:08:59 | FromGitter | <Varriount> If nothing else, it should be invested. |
20:09:20 | FromGitter | <Varriount> At least it will get some interest that way |
20:10:16 | dom96 | That would require some significant effort and many decisions to be made |
20:10:16 | * | gokr joined #nim |
20:10:24 | dom96 | It's easier to pay people like zahary via bountysource |
20:12:32 | * | Trustable quit (Remote host closed the connection) |
20:16:32 | * | JappleAck joined #nim |
20:19:41 | hohlerde | dom96: I am initializing libusb on a thread and when calling echo repr(libusbGetVersion()) I get the following: https://privatebin.tarakis.de/?a1840bd59109a7ed#5OJ8mlpPOG9fjYS0nDivqCSGXTmBTap7sojKF++2HN0= |
20:20:15 | hohlerde | dom96: I can't explain where the garbage comes from |
20:20:41 | hohlerde | dom96: at the bottom you'll see the actual structure returned |
20:21:13 | dom96 | Do you get the same outcome with -d:release and without? |
20:23:21 | hohlerde | dom96: with -d:release I don't get the garbage |
20:24:44 | hohlerde | dom96: but still the program crashes, so it seems something is wrong with memory allocation |
20:25:25 | dom96 | that would suggest to me that your stack is getting corrupted |
20:26:01 | dom96 | another approach to finding the culprit is to strip your program in stages until the problem disappears |
20:26:07 | * | gokr quit (Ping timeout: 248 seconds) |
20:28:13 | hohlerde | dom96: yeah, already doing that, but it takes quite a long time |
20:34:14 | * | objection joined #nim |
20:36:25 | hohlerde | dom96: it runs with the 64bit version of libusb. with the 32bit version I get the garbage. program of course compiled with correct version of nim (64/32bit). one small step, but I am afraid the pain starts now. |
20:37:19 | * | JappleAck quit (Ping timeout: 248 seconds) |
20:41:53 | * | Jesin joined #nim |
20:42:56 | * | nsf joined #nim |
20:45:49 | * | objection quit (Quit: WeeChat 1.9.1) |
20:49:10 | * | Arrrr quit (Read error: Connection reset by peer) |
20:49:34 | * | JappleAck joined #nim |
21:04:22 | * | Vladar quit (Quit: Leaving) |
21:16:25 | * | fredrik92 quit (Quit: Client Disconnecting) |
21:20:00 | * | shodan45 quit (Remote host closed the connection) |
21:20:29 | * | shodan45 joined #nim |
21:20:30 | * | salewski joined #nim |
21:22:46 | salewski | Do we already have something like Ruby's splash operator, which generates single values from an array or tuple? |
21:22:50 | salewski | const Color = [0.2, 0,5, 0.0]; setCol(context, Color[0], Color[1], Color[2]) # ==> setCol(context, *Color) |
21:23:13 | dom96 | no |
21:23:32 | dom96 | I wanted to implement it via macros but it's not possible |
21:24:32 | salewski | OK, thanks. It is not too important, but would be nice. |
21:27:30 | * | salewski quit (Quit: WeeChat 1.9.1) |
21:29:38 | Araq | dom96: huh? impossible with macros? |
21:30:01 | dom96 | I asked you this, can't you remember? |
21:30:07 | dom96 | You can't do it with that syntax |
21:30:42 | Araq | why not? |
21:31:00 | Araq | it's possible now with getType, I think |
21:31:05 | * | r4vi quit (Ping timeout: 250 seconds) |
21:31:10 | Araq | and when you asked we didn't have getType |
21:31:23 | dom96 | ehh, I don't think that has anything to do with this. |
21:31:43 | dom96 | *Color -> Color[0], Color[1], Color[2] # What's the AST node here? |
21:31:49 | * | r4vi joined #nim |
21:34:27 | * | yglukhov quit (Remote host closed the connection) |
21:36:15 | Araq | ah yes, but so what |
21:36:19 | FromGitter | <mratsim> Splat* not splash, it's quite useful in Python as well |
21:36:36 | FromGitter | <mratsim> But varargs covers my use cases |
21:37:39 | Araq | expandArgs setCol(context), Color |
21:37:45 | Araq | is possible |
21:38:19 | dom96 | Yes, but that's lame |
21:38:49 | Araq | it's consistent with how Nim works, that's not lame at all |
21:39:21 | dom96 | The Python way is also consistent |
21:39:52 | Araq | in Python it's builtin magic |
21:40:32 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:40:37 | Araq | you can't implement it in Python yourself, you cannot even overload this 'star' iirc |
21:41:25 | FromGitter | <Varriount> What do you mean, overload? |
21:41:32 | Araq | it's as special as it can become in Python, it's not "consistent" with anything |
21:41:45 | Araq | def __unpackstar__() # does not exist |
21:42:02 | FromGitter | <Varriount> The star can be overridden by objects that implement the iterator methods |
21:42:13 | * | claudiuinberlin joined #nim |
21:43:10 | FromGitter | <Varriount> Araq: https://stackoverflow.com/questions/26293751/properly-implementing-python-star-operator-for-a-custom-class |
21:43:22 | Araq | :-) nice |
21:44:15 | * | JappleAck quit (Read error: Connection reset by peer) |
21:44:49 | Araq | never would have thought of overloading __getitem__ or __iter__ for that, but ok |
21:45:18 | FromGitter | <Varriount> Double star is a bit less obvious: https://stackoverflow.com/questions/33402220/custom-double-star-operator-for-a-class |
21:45:55 | Araq | but the unpacking itself still can't be done in the language for the same reason Nim can't do it ;-) |
21:48:45 | FromGitter | <Varriount> Araq: What do you mean by "in the language"? |
21:49:25 | FromGitter | <Varriount> As in, magically grab the requested data from the structure? |
21:49:29 | Araq | do the expansion in your head |
21:49:57 | Araq | f(*a) becomes f(a[0], a[1]) |
21:50:09 | Araq | but what does * itself do? produce a tuple? |
21:50:25 | Araq | then f(*a) becomes f((a[0], a[1])) |
21:50:29 | Araq | not what we want |
21:50:47 | Araq | it needs to produce an "inline argument list" |
21:51:03 | Araq | Nim has some super minor support for it named nkArgList |
21:51:16 | Araq | Python has no such thing. |
21:51:55 | Araq | (Nim's support doesn't suffice to make such a macro possible) |
21:52:40 | FromGitter | <Varriount> I don't follow. I thought it became f(a[0], a[1]) |
21:52:46 | dom96 | well meh |
21:52:52 | dom96 | let's just implement it in the language then |
21:53:16 | dom96 | it's a useful feature |
21:53:29 | FromGitter | <Varriount> Like, a compile-time 'expandArgs' macro? |
21:53:39 | dom96 | Also, if I got a penny for the amount of times I had to write the equivalent of: Person(name: name, age: age) I would be a millionaire |
21:53:42 | dom96 | We need syntax sugar for that |
21:54:56 | FromGitter | <Varriount> I think I would rather current efforts go towards 1.0, and/or improving the stdlib, not minor language enhancements |
21:55:27 | Araq | varriount: I don't know how else I could explain it. f(*a) is not "apply star to a and then pass it to f", it's a special case |
21:56:48 | * | dmi0 joined #nim |
21:59:38 | Araq | it looks at the surrounding 'f' in order to do its work. |
21:59:38 | Araq | that's not how anything else in Python's syntax works afaict |
21:59:38 | Araq | f(a + b) # can the '+' see the 'f'? no, it can't |
21:59:38 | FromGitter | <Varriount> Oh, I see what you're saying. It's not just another operator. |
21:59:38 | Araq | exactly. |
22:00:21 | FromGitter | <Varriount> Though, a term-rewriting macro could almost do it |
22:02:56 | Araq | dom96: we did some similar special casing for '^'. it was hard to implement and did bite us, the new implementation is without compiler support |
22:03:01 | * | Jesin quit (Quit: Leaving) |
22:03:29 | dom96 | oh well, I agree with Varriount, we should focus on more important things |
22:04:55 | * | JappleAck joined #nim |
22:05:01 | * | Jesin joined #nim |
22:08:31 | * | TjYoco quit (Quit: Leaving) |
22:11:22 | Araq | indeed. we need to decide what the lookup rules should be for non-overloadable names clashing with overloadable names |
22:11:41 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
22:12:08 | Araq | https://github.com/nim-lang/Nim/issues/6726 |
22:12:38 | Araq | currently I'm leaning towards "just look for a type in a generic T[] context" |
22:13:45 | Araq | but strictly speaking it should be "ambiguous symbol: did you mean system.string or gdk2.string?" |
22:13:59 | dom96 | is gdk2.string a type? |
22:14:28 | dom96 | I guess not |
22:15:08 | dom96 | can a `string` type even be defined? |
22:15:19 | Araq | sure |
22:15:39 | * | nsf quit (Quit: WeeChat 1.9.1) |
22:26:36 | * | yglukhov joined #nim |
22:31:02 | * | yglukhov quit (Ping timeout: 255 seconds) |
22:35:11 | * | dmi0 quit (Ping timeout: 240 seconds) |
22:45:13 | FromGitter | <Varriount> I prefer the ambiguity error |
22:46:16 | FromGitter | <Varriount> If it's ambiguous to the compiler, it is probably ambiguous to the reader |
22:51:48 | GitDisc | <treeform> I feel like because nim has method overloading the fun(*list) is less useful. |
22:53:07 | GitDisc | <treeform> dom96, thank you for adding my chrono package. |
22:58:17 | * | PMunch quit (Quit: leaving) |
22:58:42 | * | demian joined #nim |
22:58:55 | FromGitter | <Varriount> treeform: "include chrono/timestamps" should be "import chrono/timestamps" in the documentation? |
23:00:35 | FromGitter | <Varriount> Also, did you give any thought to making "minute", "hour", etc types so that one can do "calender + 1.minute"? |
23:02:48 | * | elrood quit (Quit: Leaving) |
23:03:33 | dom96 | treeform: np |
23:03:59 | dom96 | I think I'm leaning towards the ambiguity error as well ^^ |
23:08:00 | * | jdhorwitz joined #nim |
23:22:37 | * | jdhorwitz quit (Ping timeout: 260 seconds) |
23:34:57 | * | demian quit (Ping timeout: 248 seconds) |
23:42:22 | * | endragor joined #nim |
23:46:39 | * | endragor quit (Ping timeout: 248 seconds) |
23:53:57 | * | Chuang-Tzu joined #nim |